"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[49005],{819061(e,t,s){s.d(t,{A:()=>r});var n=s(602086),i=s(716155);const r=(0,s(302405).w)(e=>(0,n.createElement)("svg",(0,i.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,n.createElement)("path",{d:"M4 3.5a.5.5 0 0 0-1 0v13a.5.5 0 0 0 1 0v-13Z",fill:"currentColor",className:e.baseclassname}),(0,n.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m11.708 15.5 4.793-4.794.354-.353a.5.5 0 0 0 0-.707l-5.138-5.138-.009-.008a.5.5 0 0 0-.707.707l.009.008 4.284 4.284H6.5a.501.501 0 0 0-.002 1.003l2.013.008h6.77L11 14.793a.5.5 0 0 0 .707.707Z",fill:"currentColor",className:e.baseclassname}),(0,n.createElement)("path",{d:"M4.5 3.75a.75.75 0 1 0-1.5 0v12.5a.75.75 0 0 0 1.5 0V3.75Zm7.03.778a.751.751 0 0 0-.53 1.28l3.411 3.413H6.75a.75.75 0 1 0 0 1.5h7.718L11 14.188a.75.75 0 0 0 1.06 1.06l4.72-4.719a.75.75 0 0 0 0-1.061l-4.72-4.72a.745.745 0 0 0-.53-.22Z",fill:"currentColor",className:e.fillclassname})))},933823(e,t,s){s.d(t,{A:()=>A});var n=s(602086),i=s(620955),r=s(949050),o=s(422432),a=s(310749),l=s(713035);const c=(0,a.c)(o.A),d=n.forwardRef((e,t)=>{const{className:s,motif:i,...r}=e,{motif:o}=(0,l.A)(i);return n.createElement("div",{ref:t,slot:"header","data-uic-component":"Disclosure.StaticHeader",className:c.concat(s)("header",`header-${o}`),...r})});d.displayName="DisclosureStaticHeader";var u=s(293147),m=s(798282);const A=n.forwardRef((e,t)=>{const{label:s,caption:o,symbol:a,tooltipProps:l,children:c,size:A,isDisabled:p,hasDivider:h=!0,hasPaddedContent:x=!0,..._}=e;return n.createElement(i.A,{ref:t,isDisabled:p,isExpanded:!0,"data-uic-component":"Disclosure_Static",..._},n.createElement(n.Fragment,null,n.createElement(d,null,n.createElement(u.A,{label:s,caption:o,symbol:a,tooltipProps:l,isDisabled:p,size:A,width:"auto"})),c&&n.createElement(r.A,{hasPaddedContent:x,hasDivider:h},c),h&&n.createElement(m.A,null)))});A.displayName="Disclosure_Static"},179951(e,t,s){s.d(t,{A:()=>r});var n=s(602086),i=s(3249);const r=({children:e})=>{const[t,s]=n.useState(null),r=null!==t,o=n.useCallback(e=>{s(e)},[]),a=n.useCallback(e=>{s(e)},[]),l=n.useCallback(()=>{s(null)},[]),c=n.useMemo(()=>({isMaximized:r,maximizedId:t,maximize:a,minimize:l}),[r,t,a,l]),d="function"==typeof e?e({isMaximized:r,maximizedId:t,maximize:a,minimize:l}):e;return n.createElement(i.zX.Provider,{value:c},n.createElement(i.YC.Provider,{value:o},d))}},431712(e,t,s){s.r(t),s.d(t,{default:()=>Ko});var n=s(274934),i=s(247816),r=s(244081),o=s(213920),a=s(222361),l=s(401004),c=s(724081),d=s(309130),u=s(429622),m=s(645648),A=s(100978),p=s(104997),h=s(838701),x=s(539453),_=s(101267),E=s(598990),g=s(548794),C=s(350762),O=s(553732),f=s(794535),N=s(747030),S=s(789803),T=s(795206),I=s(239627),M=s(652236),v=s(602086),b=s(977872),j=s(279740),D=s(749888),P=s(720770),k=s(968021),y=s(95546),w=s(754924),R=s(160286),L=s(869744),$=s(20049),F=s(10695);const U=(e,t,s)=>{const n=[];return e.forEach(e=>{const{deviceMac:i,portIdx:r,unitId:o}=(0,y.q9)(e),a=s.get(i);if(!a?.stacking_group_id)return;if(!(0,L.WW)(a.stacking_group_id,s))return;const{runtimeMembersByUnitId:l}=(0,L.Sq)(a.stacking_group_id,s),c=[...l.values()],d=o||c.find(e=>e.mac===i)?.unit_id;if(!d)return;const u=t.find(e=>e._id===a.stacking_group_id),m=(u?.lag_groups||[]).find(e=>(e.unit_lags||[]).some(e=>e.unit_index===d&&e.ports.includes(r)));m&&(m.unit_lags||[]).forEach(e=>{const t=c.find(t=>t.unit_id===e.unit_index);t&&e.ports.forEach(s=>{n.push(o?(0,y.FS)(i,s,e.unit_index):(0,y.FS)(t.mac,s))})})}),n};var V=s(107178),G=s(505817),H=s(179102),z=s(711950),W=s(134028),B=s(916471),K=s(263705),Y=s(590979),Z=s(303853),q=s(291508),X=s(589650),Q=s(972090),J=s(205521),ee=s(470070),te=s(127927),se=s(207399),ne=s(588769),ie=s(449339),re=s(20768);const oe=(0,i.A)(A.A,(0,q.A)("isVisible"))`
  background-color: ${({theme:{themeName:e}})=>G.Ay[`desktop-color-neutral-01-${e}`]};
  gap: ${d.kc};
  padding: 6px ${d.kc};
  display: ${({isVisible:e})=>e?"flex":"none"};
`,ae=(0,i.A)(A.A,(0,q.A)("elementWidth"))`
  position: absolute;
  border-radius: ${d.YC};
  width: fit-content;
  max-width: ${325}px;
  top: 0;
  max-height: ${320}px;
  overflow-y: auto;
  background-color: ${({theme:{themeName:e}})=>G.Ay[`desktop-color-neutral-01-${e}`]};
  box-shadow: ${({theme:{themeName:e}})=>G.Ay[`desktop-shadow-low-${e}`]};
  z-index: 1;

  /* 
  Horizontal placement of this element is done through "right" property.
  1. Move element to middle of the page.
  2. Subtract half of the element width to center it.
  3. SPACE_16 is an extra constant to align with the page tabs.
  4. There is a constant relevant to scrollbar width - we dont want the element to jump left and right when scrollbar appears. This compentates the element& scrollbar widths movements.
  */
  right: ${({elementWidth:e,isOverflowing:t})=>`calc(50% + ${d.Ln} - ${e/2}px - ${t?16:0}px)`};
  @media ${ne.A.VIEWPORT_M_DOWN} {
    right: 0;
  }

  opacity: ${({elementWidth:e})=>e>0?1:0};
`,le=(0,i.A)(A.A)`
  flex-direction: column;
  width: 100%;
`,ce=()=>(0,n.jsx)(z.A,{variant:"fill",size:"original",color:G.Ay[`desktop-color-red-06-${(0,K.u)().themeName}`]}),de=()=>(0,n.jsx)(z.A,{variant:"fill",size:"original",color:G.Ay[`desktop-color-orange-06-${(0,K.u)().themeName}`]}),ue=({issue:e,onClick:t})=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(se.g[e.anomaly]===te.Q.CRITICAL?ce:de,{}),(0,n.jsxs)(H.A,{size:"medium",color:"text-2",style:{cursor:t?"pointer":"default"},onClick:t?()=>t(e.port_idx):void 0,...Y.A.addDataTestId(Y.A.TestId.SIDE_PANEL_TRIGGER),children:[(0,n.jsx)(ee.sA,{id:"COMMON_PORT_NUMBER",values:{portNumber:e.port_idx}}),": ",(0,n.jsx)(ee.sA,{id:Q.l3[e.anomaly]})]})]}),me=({deviceIssues:e,isExpanded:t,setIsExpanded:s,onPortClick:i})=>{const r=e.some(e=>se.g[e.anomaly]===te.Q.CRITICAL);return(0,n.jsxs)(le,{children:[(0,n.jsxs)(oe,{cursor:"pointer",onClick:()=>{s(!t)},isVisible:!0,children:[(0,n.jsx)(r?ce:de,{}),(0,n.jsx)(H.A,{size:"medium",color:"text-2",children:(0,n.jsx)(ee.sA,{id:"DEVICE_PORT_STATE_ISSUES_TITLE"})}),(0,n.jsx)(t?W.A:B.A,{size:"original"})]}),t?e.map(e=>(0,n.jsx)(oe,{isVisible:t,children:(0,n.jsx)(ue,{issue:e,onClick:i})},e.port_idx+e.anomaly)):null]})},Ae=()=>{const e=(0,b.wA)(),t=(0,b.d4)($.I_),s=(0,b.d4)($.tI),i=(0,v.useRef)(null),{width:r}=(0,Z.Ay)(i.current),[o,a]=(0,v.useState)(!1),l=t=>{if(!s)return;const n=(0,y.FS)(s,t);e((0,F.Ao)([n])),e((0,J.XP)({type:ie.H.PORTS,id:re.D,tab:X.BC.INSIGHTS,onClose:()=>e((0,F.Ao)([])),preventReopen:!0}))};return t.length?(0,n.jsx)(ae,{elementWidth:r,ref:i,isOverflowing:o&&t.length+1>10,children:1===t.length?(0,n.jsx)(oe,{isVisible:!0,children:(0,n.jsx)(ue,{issue:t[0],onClick:l})}):(0,n.jsx)(me,{deviceIssues:t,isExpanded:o,setIsExpanded:a,onPortClick:l})}):null},pe=()=>{const e=(0,V.A)(a.g1.PORT_MANAGEMENT);return(0,n.jsx)(A.A,{alignItems:"start",minHeight:30,marginTop:2,marginBottom:2,position:"relative",paddingLeft:e?0:d.kc,children:(0,n.jsx)(Ae,{})})};var he=s(548941),xe=s(775250),_e=s(347625);const Ee=(0,v.createContext)(null),ge=({children:e})=>{const[t,s]=(0,v.useState)(1),[i,r]=(0,v.useState)(0),o=(0,v.useRef)(1),a=(0,v.useRef)(0),l=(0,v.useMemo)(()=>({sharedScale:t,sharedOffset:i,setSharedScale:s,setSharedOffset:r,cachedScaleRef:o,cachedOffsetRef:a}),[t,i]);return(0,n.jsx)(Ee.Provider,{value:l,children:e})},Ce=()=>{const e=(0,v.useContext)(Ee);if(!e)throw new Error("useDiagramScaleContext must be used within DiagramScaleProvider");return e};var Oe=s(576024),fe=s(528015),Ne=s(340820),Se=s(225889),Te=s(598987),Ie=s(24490),Me=s(670830),ve=s(831433),be=s(114530),je=s(306212),De=s(565527),Pe=s(774385),ke=s(641671);const ye=(0,i.A)(A.A,(0,q.A)("hide"))`
  align-items: center;
  justify-content: center;
  width: ${Q.Dq}px;
  height: ${Q.Dq}px;
  border-radius: ${d.YC};
  padding: ${d.YC};
  background: ${({theme:{themeName:e}})=>G.Ay[`desktop-color-neutral-01-${e}`]};
  cursor: pointer;
  position: relative;
  ${(0,be.g)(Q.Dq)}
`,we=(0,i.A)(je.A)`
  width: ${d.YC};
  height: ${d.YC};
  position: absolute;
  top: ${d.YC};
  left: ${d.YC};
`,Re=({connectedDevice:e,connectedClient:t,hide:s,wanProviderAsn:i,wanProviderName:r,onClick:o,isActive:a})=>{const{themeName:l}=(0,K.u)();return e||t||r?(0,n.jsxs)(ye,{hide:s,onClick:o,...Y.A.addDataTestId(Y.A.TestId.SIDE_PANEL_TRIGGER),children:[a?null:(0,n.jsx)(we,{color:l===De.S.DARK?G.Ay[`desktop-color-neutral-04-${l}`]:G.Ay[`desktop-color-neutral-08-${l}`]}),(0,n.jsx)(A.A,{opacity:a?void 0:Pe.q,children:(0,n.jsx)(ke.A,{size:32,connectedClient:t,connectedDevice:e,wanProviderAsn:i,wanProviderName:r})})]}):null};var Le=s(748027),$e=s(419284),Fe=s(684209),Ue=s(536273),Ve=s(223104),Ge=s(940229);const He=(0,Fe.xn)(10),ze=(0,i.A)(A.A,(0,q.A)("color","isDisabled","isLocating","disableSelectionEvents"))`
  align-items: center;
  color: ${({theme:{themeName:e},color:t})=>G.Ay[`desktop-color-${t}-${e}`]};
  justify-content: center;
  position: relative;
  pointer-events: auto;
  border-radius: ${G.Ay["desktop-radius-base"]};
  cursor: ${({disableSelectionEvents:e})=>e?"default":"pointer"};
  ${({isDisabled:e})=>e?"\n    pointer-events: none;\n    opacity: 0.4;\n  ":""}
  ${({isLocating:e})=>e?Le.AH`
          animation: ${He} 1s cubic-bezier(0.5, 1, 0, 1) infinite alternate;
        `:""}
`,We=(0,i.A)("div",(0,q.A)("stacked"))`
  position: relative;
  width: ${Q.Dq}px;
  height: ${Q.Dq}px;
`,Be={0:{top:0,left:0,topSelected:0,leftSelected:0,topHovered:0,leftHovered:0,height:Q.Dq,width:Q.Dq,heightSelected:Q.Dq,widthSelected:Q.Dq,heightHovered:Q.Dq,widthHovered:Q.Dq},1:{top:-1.75,left:3,topSelected:-6,leftSelected:3.22,topHovered:-2.75,leftHovered:4,height:37,width:37,heightSelected:40,widthSelected:41,heightHovered:37,widthHovered:37},2:{top:-3.75,left:8,topSelected:-9,leftSelected:7.22,topHovered:-5.75,leftHovered:10,height:36,width:34,heightSelected:40,widthSelected:40,heightHovered:36,widthHovered:34}},Ke=(0,i.A)("div",(0,q.A)("background","border","order","isSelected","isHovered","isStacked"))`
  position: absolute;
  transform: translate(
    ${({order:e,isSelected:t,isHovered:s})=>Be[e][t?"leftSelected":s?"leftHovered":"left"]}px,
    ${({order:e,isSelected:t,isHovered:s})=>Be[e][t?"topSelected":s?"topHovered":"top"]}px
  );

  width: ${({order:e,isSelected:t,isHovered:s})=>Be[e][t?"widthSelected":s?"widthHovered":"width"]}px;
  height: ${({order:e,isSelected:t,isHovered:s})=>Be[e][t?"heightSelected":s?"heightHovered":"height"]}px;

  border: ${({order:e})=>0!==e?"none":"1px solid"} ${({border:e})=>e};
  border-radius: ${d.YC};
  background: ${({background:e})=>e};
  z-index: ${({order:e})=>3-e};
  transition:
    all 0.2s ease-out,
    outline 0s,
    outline-offset 0s;

  filter: ${({isHovered:e,order:t})=>e&&0===t?"brightness(0.9)":"none"};
  ${({isSelected:e,order:t,theme:{themeName:s}})=>e&&0===t?`\n      outline: 2px solid ${G.Ay[`desktop-color-ublue-06-${s}`]}; \n      outline-offset: 1px;\n      `:""}
`,Ye=(0,i.A)("div")`
  position: absolute;
  right: 2px;
  top: 2px;
  width: 24px;
  height: 24px;
  pointer-events: none;
  z-index: ${4};
`,Ze=(0,i.A)(H.A)`
  position: absolute;
  text-align: left;
  bottom: 0px;
  left: 4px;
  pointer-events: none;
  z-index: 4;
`,qe=(0,i.A)("div")`
  position: absolute;
  width: ${2*Q.Dq+16}px;
  height: ${Q.Dq+8}px;
  top: -${d.YC};
  left: -${d.YC};
  z-index: -1;
  background: ${({theme:{themeName:e}})=>G.Ay[`desktop-color-ublue-01-${e}`]};
  border-radius: ${d.kc};
  border: 1px solid
    ${({theme:{themeName:e}})=>G.Ay[`desktop-color-ublue-04-${e}`]};
`,Xe=(0,v.memo)(({port:e,isFirstPortInMcLagLinks:t,isFirstPortInStackingLink:s,isFirstPortWan:i,isFirstPortManagement:r,isFirstRow:o})=>{const a=(0,b.wA)(),l=(0,b.d4)($.x$),c=(0,b.d4)($.UH),d=(0,b.d4)($.O2),u=(0,b.d4)($.pN),m=(0,b.d4)($.XS),[A,p]=(0,v.useState)(!1),h=(0,b.d4)($.QR),x=m,_=(0,b.d4)((0,v.useMemo)(()=>(0,$.JX)(e.port_idx||0,e.device.mac),[e.port_idx,e.device.mac])),{background:E,border:g,text:C,stackBackground:O=E,stackBackgroundDark:f=E}=(0,v.useMemo)(()=>(0,Fe.PI)(e),[e]),N=Boolean(e.isInTargetDevice||e.isInMcLink),S=m?Boolean(e.port_idx&&u.includes(e.port_idx)):d.has(e.id),T=!(0,be.s)({port:e,selectedPorts:c,isPortSelected:S,isStatsOpen:h,isEditingAggregation:m,aggregationPickedPorts:u,firstPort:{isWan:i,isManagement:r,isMcLag:t,isInStackingLink:s},thisPort:{isMcLag:N,isInStackingLink:Boolean(e.isInStackingLink)}}),I=(0,v.useCallback)(t=>{t.stopPropagation(),x||T||!e.port_idx||a((0,F.Ao)(t.metaKey||t.ctrlKey?(0,Ge.QP)(e.id,c):(0,Ge.Um)(e.id)))},[a,x,T,e.id,e.port_idx,c]),M=Boolean(e.aggregationGroup||e.lag_idx),j=A||Boolean(e.lag_idx)&&e.lag_idx===l,D=(0,v.useCallback)(()=>{x||(e.lag_idx&&a((0,F.L$)(e.lag_idx)),p(!0))},[a,x,e.lag_idx]),P=(0,v.useCallback)(()=>{x||(a((0,F.L$)(null)),p(!1))},[a,x]),k=(0,K.u)(),{card1Background:w,card2Background:R}=(0,v.useMemo)(()=>{const e=(0,$e.YR)((0,$e.wQ)((0,Ge.oX)(E,k.themeName)),(0,$e.wQ)((0,Ge.oX)("dark"===k.themeName?f:O,k.themeName)),50),t=(0,$e.YR)((0,$e.wQ)((0,Ge.oX)(E,k.themeName)),(0,$e.wQ)((0,Ge.oX)("dark"===k.themeName?f:O,k.themeName)),100);return{card1Background:(0,$e.qi)(e),card2Background:(0,$e.qi)(t)}},[E,O,f,k.themeName]);return(0,n.jsx)(Ue.A,{port:e,position:o?"top":"bottom",children:(0,n.jsxs)(ze,{onClick:I,color:C,isDisabled:T,isLocating:_,disableSelectionEvents:x,onMouseEnter:D,onMouseLeave:P,children:[(0,n.jsxs)(We,{stacked:M,children:[(0,n.jsx)(Ke,{order:0,background:(0,Ge.oX)(E,k.themeName),border:(0,Ge.oX)(g,k.themeName),isSelected:S,isHovered:j}),M?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ke,{order:1,background:w,border:(0,Ge.oX)(g,k.themeName),isSelected:S,isHovered:j}),(0,n.jsx)(Ke,{order:2,background:R,border:(0,Ge.oX)(g,k.themeName),isSelected:S,isHovered:j})]}):null]}),(0,n.jsx)(Ye,{children:(0,n.jsx)(Ve.A,{icon:e.icon})}),(0,n.jsx)(Ze,{size:"small",color:"inherit",children:(0,Oe.LS)(e,e.device?.model)}),(0,y.s_)(e.port_idx,e.device?.model)?(0,n.jsx)(qe,{}):null]})})}),Qe=(0,i.A)(A.A,(0,q.A)("hide"))`
  ${(0,be.g)(20)};
`,Je=({poe_enable:e,poe_power:t,hide:s})=>{const i=(0,Oe.lG)({poe_enable:e,poe_power:t});return i?(0,n.jsx)(Qe,{hide:s,children:(0,n.jsx)(H.A,{color:"text-3",size:"xsmall",children:i})}):null},et=(0,i.A)(xe.A)`
  text-align: center;
  cursor: pointer;
  max-width: ${Q.Dq}px;
`,tt=(0,i.A)(A.A,(0,q.A)("hide","isActive"))`
  ${(0,be.g)(20)};
  cursor: pointer;
  max-width: ${Q.Dq}px;
  opacity: ${({isActive:e})=>e?1:Pe.q};
`,st=({onClick:e,hide:t,label:s,isActive:i})=>(0,n.jsx)(tt,{hide:t,onClick:e,isActive:i,...Y.A.addDataTestId(Y.A.TestId.SIDE_PANEL_TRIGGER),children:(0,n.jsx)(et,{isTruncated:!0,size:"xsmall",weight:"bold",color:"text-2",children:s})}),nt=(0,i.A)(A.A,(0,q.A)("isFirstRow","disableGap"))`
  flex-direction: ${({isFirstRow:e})=>e?"column-reverse":"column"};
  justify-content: flex-start;
  align-items: center;
  gap: ${({disableGap:e})=>e?0:d.YC};
  position: relative;
  max-width: ${Q.Dq}px;
`,it=(0,i.A)(A.A,(0,q.A)("hide","isActive"))`
  width: 1px;
  height: ${8}px;
  opacity: ${({isActive:e})=>e?1:0};
  background: ${({theme:{themeName:e}})=>G.Ay[`desktop-color-neutral-04-${e}`]};
  ${(0,be.g)(8)}
`,rt=(0,i.A)("div",(0,q.A)("isPoeCapable"))`
  height: ${({isPoeCapable:e})=>{const t=12+Q.Dq+4+14;return e?t+4+14:t}}px;
`,ot=(0,v.memo)(({isFirstRow:e,port:t,hideOptionalElements:s,topConnectionMac:i,setTopConnectionMac:r,topConnectionMacWithPoe:o,setTopConnectionMacWithPoe:a,isFirstSelectedPortWan:l,isFirstSelectedPortManagement:c,isFirstSelectedPortInMcLag:d,isFirstSelectedPortInStackingLink:u})=>{const m=(0,b.wA)(),{wanConfiguration:p,wanProviderAsn:h,wanProviderName:x,lastConnectionClient:_,lastConnectionDevice:E,lastConnectionIsp:g,lastConnectionMac:C,isSomethingConnected:O,wasSomethingConnected:f}=(0,Te.A)(t),N=x?{name:x,asn:h}:g?{name:g.isp_name,asn:g.isp_asn}:void 0,S=(0,v.useMemo)(()=>C?(0,Me.r)(C):()=>{},[C]),T=(0,b.d4)(S),M=(0,b.d4)($.Hz),j=(0,v.useMemo)(()=>p?ie.H.ISP:E?ie.H.DEVICE:T?ie.H.UNIFI_DEVICE_CLIENT:_?ie.H.CLIENT:void 0,[E,_,T,p]),D=(0,v.useCallback)(e=>{e.stopPropagation();const t=p?.configuration?.wan_networkgroup||C;t&&(_&&j===ie.H.CLIENT&&m((0,I.W6)(t,!0)),m((0,J.XP)({type:j,id:t})))},[m,_,C,j,p?.configuration?.wan_networkgroup]),P=N?.name||(0,_e.Q)(E)||(0,ve.tn)(_),k=O?void 0:_?.last_seen||E?.last_seen||g?.last_seen,y=!e,w=k?"text-3":"text-2",R=Boolean((0,Oe.lG)({poe_enable:t.poe_enable,poe_power:t.poe_power})),L=Boolean(t.port_poe);return(0,v.useEffect)(()=>{e&&(O||f||M)&&(i!==t.device.mac&&r(t.device.mac),o!==t.device.mac&&(R||M&&L)&&a(t.device.mac))},[t.device.mac,i,r,o,a,O,f,e,R,M,L]),(0,n.jsxs)(nt,{isFirstRow:e,disableGap:s,children:[(0,n.jsx)(A.A,{children:(0,n.jsx)(Xe,{port:t,isFirstPortInMcLagLinks:d,isFirstPortInStackingLink:u,isFirstPortWan:l,isFirstPortManagement:c,isFirstRow:e})}),O||f?(0,n.jsx)(Ie.A,{label:P,lastSeen:k,isUpsideDown:y,isTooltipAllowed:Boolean(P),children:(0,n.jsxs)(nt,{isFirstRow:e,disableGap:s,children:[(0,n.jsx)(it,{hide:s,isActive:O}),(0,n.jsx)(Re,{connectedDevice:E,connectedClient:_,wanProviderAsn:N?.asn,wanProviderName:N?.name,hide:s,onClick:D,isActive:O}),(0,n.jsx)(st,{label:P,onClick:D,hide:s,textColor:w,isActive:O}),(0,n.jsx)(Je,{poe_enable:t.poe_enable,poe_power:t.poe_power,hide:s})]})}):M&&!s?(0,n.jsx)(rt,{isPoeCapable:L}):null]})}),at=(0,i.A)(A.A)`
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: ${d.kc};
`,lt=(0,i.A)(A.A)`
  gap: ${d.kc};
`,ct=(0,i.A)("div")`
  width: ${38}px;
`,dt=(0,i.A)(A.A,(0,q.A)("scale"))`
  transform: scale(${({scale:e})=>e});
  justify-content: center;
  align-self: center;
`,ut=(0,i.A)(A.A)`
  flex-direction: column;
  gap: ${d.kc};
`,mt=(0,i.A)(A.A)`
  min-height: 32px;
`,At=(0,i.A)(A.A)`
  gap: ${d.YC};
  align-items: center;
`;var pt=s(239875),ht=s(254585),xt=s(570801);const _t=({children:e,scale:t,spaceOffset:s})=>(0,n.jsx)("div",{style:{marginRight:s,transitionDuration:"0.2s",alignItems:"center"},children:(0,n.jsx)(A.A,{gap:d.kc,flexDirection:"column",overflow:"visible",children:(0,n.jsx)(dt,{scale:t,children:e})})}),Et=({children:e,cachedScaleRef:t,cachedOffsetRef:s,onScaleOffsetChange:i})=>{const{spaceOffset:r,containerRef:o,contentRef:a,scale:l}=((e,t)=>{const s=(0,v.useRef)(null),n=(0,v.useRef)(null),i=Boolean(s.current)&&Boolean(n.current),{width:r=0}=(0,pt.A)({ref:n}),{width:o=0}=(0,pt.A)({ref:s}),[a,l]=(0,v.useState)(t.current),c=(0,v.useRef)(0),d=(0,v.useRef)(0),u=r>0&&o>0?Math.min((r-16)/o,1):e.current,m=(0,b.d4)($.UH),A=(0,b.d4)(ht.WS),p=Boolean(m.length)||A,h=(0,b.d4)($.QR),x=(0,b.d4)($.kq),_=(0,b.d4)(xt.P),E=(0,b.d4)(ht.S5),g=416+(_&&E.length>1&&A?40:0);return(0,v.useEffect)(()=>{r>0&&o>0&&(e.current=u)},[u,r,o,e]),(0,v.useEffect)(()=>{if(!i)return;if(!p||h)return c.current=0,l(0),d.current=0,void(t.current=0);const e=e=>{c.current=e,t.current=e,l(e)};requestAnimationFrame(()=>{const t=s.current?.getBoundingClientRect(),i=n.current?.getBoundingClientRect();if(!t||!i)return;const r=c.current,o=d.current,a=g-o;if(o>0&&0!==a)return e(Math.max(0,r+a)),void(d.current=g);const l=window.innerWidth-t.right+r,u=window.innerWidth-i.right,m=g-l;if(m>0){const t=Math.min(m,l-u);e(m-t+2*t)}else e(0);d.current=g})},[p,h,i,x,g,t]),{spaceOffset:a,scale:u,containerRef:n,contentRef:s}})(t,s);return(0,v.useEffect)(()=>{i?.(l,r)},[l,r,i]),(0,n.jsx)("div",{ref:o,style:{marginRight:r,transitionDuration:"0.2s",alignItems:"center"},children:(0,n.jsx)(A.A,{gap:d.kc,flexDirection:"column",overflow:"visible",children:(0,n.jsx)(dt,{scale:l,ref:a,children:e})})})},gt=(0,i.A)(A.A)`
  flex-direction: column;
  justify-content: start;
  gap: ${d.kc};
`,Ct=(0,i.A)(A.A)`
  gap: ${d.kc};
`,Ot=(0,i.A)("div")`
  width: ${Q.Dq}px;
`,ft=(0,i.A)(A.A,(0,q.A)("isDiagramTopRowExpanded","hasPoeLabel"))`
  align-items: start;
  position: relative;
  min-width: ${d.xO};
  padding-top: ${({isDiagramTopRowExpanded:e,hasPoeLabel:t})=>(e?100:40)+(t?24:0)}px;
`,Nt=(0,i.A)(xe.A)`
  transform: rotate(-90deg) translate(-50%, 0);
  transform-origin: left center;
  position: absolute;
  left: 0;
  width: max-content;
  && {
    max-width: 95px;
  }
`,St=(0,v.memo)(({deviceMac:e,isFirst:t,showDeviceName:s})=>{const i=(0,b.d4)(w.Kh).get(e),{sharedScale:r,sharedOffset:o,setSharedScale:a,setSharedOffset:l,cachedScaleRef:c,cachedOffsetRef:d}=Ce(),u=(0,b.d4)($.OF),m=(0,v.useMemo)(()=>u.filter(t=>t.device.mac===e),[u,e]),p=(0,b.d4)($.WJ),h=(0,b.d4)($.pZ),x=(0,b.d4)($.IP),_=(0,b.d4)($.uq),E=(0,b.d4)($.Qz),[g,C]=(0,v.useState)(""),[O,f]=(0,v.useState)(""),N=(0,v.useMemo)(()=>{if(!i?.model)return!1;const{diagram:e}=(0,Ne.j)(i.model);return!!e},[i?.model]),S=(0,v.useMemo)(()=>{if(!i?.model)return(0,P.A)();const{diagram:e}=(0,Ne.j)(i.model);if(!e)return(0,P.A)();const t=e.length?(0,Oe.sT)(e,i):(0,Oe.oJ)(i);return t?(0,fe.o)(t,m).map(({key:e,cells:t})=>(0,n.jsx)(Ct,{children:t.map(({key:e,port:t,rowIndex:s})=>t?(0,n.jsx)(ot,{port:t,isFirstRow:0===s,hideOptionalElements:!p,setTopConnectionMac:C,topConnectionMac:g,setTopConnectionMacWithPoe:f,topConnectionMacWithPoe:O,isFirstSelectedPortWan:h,isFirstSelectedPortManagement:x,isFirstSelectedPortInMcLag:_,isFirstSelectedPortInStackingLink:E},e):(0,n.jsx)(Ot,{},e))},e)):(0,P.A)()},[m,i,p,g,O,h,x,_,E]),T=(0,v.useCallback)((e,t)=>{r!==e&&a(e),o!==t&&l(t)},[r,o,a,l]);if(!N)return(0,n.jsx)(Se.A,{});if(0===m.length)return null;if(!S||0===S.length)return null;const I=(0,_e.Q)({name:i?.name,model:i?.model,mac:i?.mac});return t?(0,n.jsx)(Et,{cachedScaleRef:c,cachedOffsetRef:d,onScaleOffsetChange:T,children:(0,n.jsxs)(A.A,{children:[s?(0,n.jsx)(ft,{isDiagramTopRowExpanded:g===e&&p,hasPoeLabel:O===e&&p,children:(0,n.jsx)(he.A,{portal:!0,description:I,position:"top",noWrap:!0,children:(0,n.jsx)(Nt,{size:"small",color:"text-3",isTruncated:!0,children:I})})}):null,(0,n.jsx)(gt,{children:S})]})}):(0,n.jsx)(_t,{scale:r,spaceOffset:o,children:(0,n.jsxs)(A.A,{children:[s?(0,n.jsx)(ft,{isDiagramTopRowExpanded:g===e&&p,hasPoeLabel:O===e&&p,children:(0,n.jsx)(he.A,{portal:!0,description:I,position:"top",noWrap:!0,children:(0,n.jsx)(Nt,{size:"small",color:"text-3",isTruncated:!0,children:I})})}):null,(0,n.jsx)(gt,{children:S})]})})});var Tt=s(440020),It=s(455425),Mt=s(222102),vt=s(15989),bt=s(401042),jt=s(547617);const Dt=e=>(0,Mt.Mz)((e=>(0,vt.uh)((0,jt.R)(e)))(e),bt.kh);var Pt,kt=s(34087),yt=s(827360),wt=s(68736);!function(e){e.ANOMALY="ANOMALY",e.DEVICE_CONNECTED="DEVICE_CONNECTED",e.DEVICE_DISCONNECTED="DEVICE_DISCONNECTED",e.CLIENT_CONNECTED="CLIENT_CONNECTED",e.CLIENT_DISCONNECTED="CLIENT_DISCONNECTED",e.INTERNET_CONNECTED="INTERNET_CONNECTED",e.INTERNET_DISCONNECTED="INTERNET_DISCONNECTED",e.NETWORK_OFFLINE="NETWORK_OFFLINE",e.NETWORK_UPDATED="NETWORK_UPDATED",e.DEVICE_OFFLINE="DEVICE_OFFLINE",e.POWER_CYCLE_TRIGGERED="POWER_CYCLE_TRIGGERED"}(Pt||(Pt={}));var Rt=s(291700);const Lt={[te.Q.CRITICAL]:yt.n.ERROR,[te.Q.DEGRADED]:yt.n.WARNING,[te.Q.NONE]:yt.n.INFO},$t={[te.t.NETWORK_LOOP_DETECTED_BY_STP]:yt.B.LOOP,[te.t.NETWORK_LOOP_DETECTED_BY_KEEPALIVE]:yt.B.LOOP},Ft=e=>e.external_id?`${e.type}-${e.external_id}`:`${e.type}-${e.timestamp}-${e.end_timestamp??e.timestamp}`,Ut=(e,t)=>{const s={};return null!=e.anomaly_type&&(s.anomalyType=e.anomaly_type),null!=e.name&&(s.name=e.name),null!=e.port_idx&&(s.portIdx=e.port_idx),null!=e.unit_id&&(s.unitId=e.unit_id),t&&e.deviceMac&&t[e.deviceMac]&&(s.deviceName=t[e.deviceMac]),s},Vt={[Pt.DEVICE_CONNECTED]:{type:yt.B.DEVICE_CONNECTED,priority:Rt.$O[yt.B.DEVICE_CONNECTED]},[Pt.DEVICE_DISCONNECTED]:{type:yt.B.DEVICE_DISCONNECTED,priority:Rt.$O[yt.B.DEVICE_DISCONNECTED]},[Pt.CLIENT_CONNECTED]:{type:yt.B.CLIENT_CONNECTED,priority:Rt.$O[yt.B.CLIENT_CONNECTED]},[Pt.CLIENT_DISCONNECTED]:{type:yt.B.CLIENT_DISCONNECTED,priority:Rt.$O[yt.B.CLIENT_DISCONNECTED]},[Pt.INTERNET_CONNECTED]:{type:yt.B.INTERNET_CONNECTED,priority:Rt.$O[yt.B.INTERNET_CONNECTED]},[Pt.INTERNET_DISCONNECTED]:{type:yt.B.INTERNET_DISCONNECTED,priority:Rt.$O[yt.B.INTERNET_DISCONNECTED]},[Pt.POWER_CYCLE_TRIGGERED]:{type:yt.B.POWER_CYCLE,priority:Rt.$O[yt.B.POWER_CYCLE]}},Gt=e=>e.external_id||`${e.timestamp}-${e.type}-${e.port_idx??""}-${e.unit_id??""}`;var Ht=s(653547),zt=s(348185),Wt=s(79777),Bt=s(648552),Kt=s(166941);const Yt=[],Zt=[],qt=[],Xt=[],Qt=()=>{const e=(0,b.wA)(),t=(0,b.d4)($._h),s=(e=>{const t=(0,b.d4)(Wt.a),s=(0,v.useMemo)(()=>t[Bt.Uz],[t]),[n,i]=(0,v.useState)(Yt),r=(0,v.useMemo)(()=>JSON.stringify(e),[e]),o=(0,v.useCallback)((e,t)=>{const s=Array.isArray(e)?e:[e];0!==s.length&&i(e=>{const t=new Map;for(const s of e)t.set(Gt(s),s);for(const e of s)t.set(Gt(e),e);return Array.from(t.values())})},[]);return(0,v.useEffect)(()=>{const e=JSON.parse(r);if(s&&0!==e.length){for(const t of e)s.send((0,Kt.f)(zt.E.PORTS_TIMELINE,!0,{device_mac:t}));return()=>{for(const t of e)s.send((0,Kt.f)(zt.E.PORTS_TIMELINE,!1,{device_mac:t}))}}},[s,r]),(0,v.useEffect)(()=>{const e=(0,Ht.K6)(zt._.PORTS_TIMELINE_EVENT,o);return()=>(0,Ht.$N)(e)},[o]),(0,v.useEffect)(()=>{i(Yt)},[r]),n})(t),n=(0,v.useRef)(0);(0,v.useEffect)(()=>{if(s.length>0&&s.length!==n.current){n.current=s.length;const i=Date.now();for(const s of t)e((0,kt.N)(s,i-It.jU,i))}},[e,t,s.length]);const i=(0,b.d4)($.Kw),r=(0,v.useMemo)(()=>{if(0===t.length)return()=>Xt;if(1===t.length){const e=Dt(t[0]);return t=>e(t)}const e=t.map(e=>Dt(e));return(0,Mt.Mz)(e,(...e)=>{const s=[];for(let n=0;n<e.length;n+=1){const i=t[n],r=e[n];for(let e=0;e<r.length;e+=1)s.push({...r[e],deviceMac:i})}return s})},[t]),o=(0,b.d4)(r),{trackEvents:a,iconEvents:l}=(0,v.useMemo)(()=>{const e=((e,t)=>{if(0===t.length)return e;const s=new Map;for(const t of e)s.set(Gt(t),t);for(const e of t)s.has(Gt(e))||s.set(Gt(e),e);return Array.from(s.values())})(o,s);return 0===e.length?{trackEvents:Zt,iconEvents:qt}:((e,t)=>{const s=[],n=[],i=t?new Set:void 0;return e.forEach((e,r)=>{const o=`${e.type}-${e.timestamp}-${r}`,a=Vt[e.type];if(a){const{trackEvent:i,iconEvent:r}=(0,wt.h1)(o,a.type,a.priority,e.timestamp,Ut(e,t));return s.push(i),void n.push(r)}switch(e.type){case Pt.ANOMALY:{const i=(e=>{if(!e)return yt.n.WARNING;const t=se.g[e];return t?Lt[t]:yt.n.WARNING})(e.anomaly_type),r=(l=e.anomaly_type)&&$t[l]||yt.B.WARNING,a=Rt.Zn[r],{trackEvent:c,iconEvent:d}=(0,wt.q9)(o,r,i,e.timestamp,e.end_timestamp,Ut(e,t),{openEnded:a});s.push(c),n.push(d);break}case Pt.NETWORK_OFFLINE:case Pt.DEVICE_OFFLINE:{if(e.type===Pt.NETWORK_OFFLINE&&i){const t=Ft(e);if(i.has(t))break;i.add(t)}const r=e.type===Pt.NETWORK_OFFLINE?yt.B.NETWORK_OFFLINE:yt.B.DEVICE_OFFLINE,{trackEvent:a,iconEvent:l}=(0,wt.q9)(o,r,yt.n.NEUTRAL,e.timestamp,e.end_timestamp,Ut(e,t),{openEnded:!e.end_timestamp,pattern:"hatch"});s.push(a),n.push(l);break}case Pt.NETWORK_UPDATED:{if(i){const t=Ft(e);if(i.has(t))break;i.add(t)}const{trackEvent:r,iconEvent:a}=(0,wt.q9)(o,yt.B.NETWORK_UPDATED,yt.n.INFO,e.timestamp,e.end_timestamp,Ut(e,t));s.push(r),n.push(a);break}}var l}),{trackEvents:s,iconEvents:n}})(e,i)},[o,s,i]);return{trackEvents:a,iconEvents:l}},Jt=It.vl/2,es=(0,v.memo)(()=>{const e=(0,b.wA)(),t=(0,b.d4)($.XI),s=(0,b.d4)($.Hm),i=(0,b.d4)($.aX),{trackEvents:r,iconEvents:o}=Qt(),a=i?Date.now()-i:void 0,l=(0,v.useRef)(0),c=(0,v.useRef)(void 0);(0,v.useEffect)(()=>()=>clearTimeout(c.current),[]);const d=(0,v.useCallback)(t=>{const s=Date.now(),n=s-l.current;clearTimeout(c.current),n>=Jt?(e((0,F.DH)(t)),l.current=s):c.current=setTimeout(()=>{e((0,F.DH)(t)),l.current=Date.now()},Jt-n)},[e]),u=(0,v.useCallback)(t=>{e((0,F.j$)(t))},[e]);return(0,n.jsx)(Tt.A,{selectedTimestamp:t,onTimestampSelect:d,isLive:s,onLiveChange:u,events:r,iconEvents:o,maxPastMs:a})});var ts=s(251905),ss=s(212635),ns=s(286988);var is=s(177173);var rs=s(271656),os=s(873247),as=s(197571),ls=s(727337),cs=s(782194),ds=s(304151),us=s(645951),ms=s(423564),As=s(883717),ps=s(170427),hs=s(16845),xs=s(821711),_s=s(669439),Es=s(461731),gs=s(874866),Cs=s(167933),Os=s(68105);const fs=(0,i.A)(xe.A)`
  max-width: 120px;
`,Ns=({portNumber:e})=>{const t=(0,b.d4)($.aq),s=(0,b.d4)(os.wD),i=(0,b.d4)(gs.D),r=(0,b.d4)(R.D5),{portData:o,originalPortName:a}=(0,ls.E)(t,e,s),l=(0,b.d4)(as.wf),c=(0,b.d4)(Cs.pB),u=(0,b.d4)(Es.G),m=(0,b.d4)(Os.qS),p=(0,Ge.vT)(o,t,i,r,l,c,u,m),{wanProviderName:h,lastConnectionClient:x,lastConnectionDevice:_,isSomethingConnected:E}=(0,Te.A)(p),g=h??(_?(0,_e.Q)(_):(0,ve.tn)(x));return(0,n.jsxs)(A.A,{flexDirection:"column",gap:d.YC,width:"100%",children:[(0,n.jsx)(A.A,{gap:d.kc,alignItems:"center",width:"100%",children:(0,n.jsxs)(xe.A,{color:"inherit",weight:"bold",size:"inherit",isTruncated:!0,children:[e,a?` | ${a}`:""]})}),E?(0,n.jsxs)(A.A,{justifyContent:"space-between",gap:d.fS,alignItems:"center",children:[(0,n.jsx)(xe.A,{color:"inherit",size:"small",style:{whiteSpace:"nowrap"},children:(0,n.jsx)(ee.sA,{id:"COMMON_CONNECTED_TO"})}),(0,n.jsxs)(A.A,{alignItems:"center",gap:d.YC,minWidth:0,children:[(0,n.jsx)(ke.A,{size:20,connectedClient:x,connectedDevice:_,wanProviderName:h}),(0,n.jsx)(fs,{color:"inherit",size:"small",isTruncated:!0,children:g})]})]}):null]})};var Ss=s(45523);const Ts=(0,i.A)(A.A,(0,q.A)("background","border"))`
  justify-content: center;
  width: ${38}px;
  height: ${38}px;
  border-radius: ${d.YC};
  border: 1px solid ${({border:e})=>e};
  background: ${({background:e})=>e};
  align-items: center;
`,Is=(0,v.memo)(({isTagged:e,isWanPort:t,isNative:s,portNumber:i,networkId:r,rowIndex:o,isDisabled:a})=>{const{themeName:l}=(0,K.u)(),{background:c,border:d,text:u}=(0,v.useMemo)(()=>{let n;switch(!0){case t:n=hs.vL.WAN;break;case a:n=hs.vL.DISABLED;break;case s:n=hs.vL.UNTAGGED_NATIVE;break;case e:n=hs.vL.TAGGED;break;default:n=hs.vL.BLOCKED}const{background:i,border:r,text:o}=Ss.k[n];return{background:i,border:r,text:o}},[t,a,s,e]);return(0,n.jsx)(_s.A,{description:(0,n.jsx)(Ns,{portNumber:i}),placement:0===o?"top":"bottom",delay:0,closeDelay:0,children:(0,n.jsx)(Ts,{background:(0,Ge.oX)(c,l),border:(0,Ge.oX)(d,l),color:(0,Ge.oX)(u,l),children:t?(0,n.jsx)(xs.A,{size:"original",color:(0,Ge.oX)(u,l)}):null})},`${i}-${r}`)}),Ms=(0,i.A)(A.A)`
  & > *:not(:last-child) {
    border-bottom: ${({theme:{themeName:e}})=>G.Ay[`desktop-border-divider-${e}`]};
  }
`,vs=(0,i.A)(A.A)`
  &:not(:last-child) {
    padding-bottom: ${d.kc};
  }
  &:not(:first-child) {
    padding-top: ${d.kc};
  }
`,bs=({network:e,rowLayouts:t,model:s,values:i,scale:r,spaceOffset:o})=>(0,n.jsx)(_t,{scale:r,spaceOffset:o,children:(0,n.jsx)(at,{children:(t||[]).map((t,r)=>(0,n.jsx)(lt,{children:t.map((t,o)=>{const a=`PortDiagramLayoutCell-${r+1}-${o+1}`;if(!t)return(0,n.jsx)(ct,{},a);const l=+(0,Oe.Cu)({port_idx:t.portNumber},s),c=i.taggedNetworks[l]?.[e._id];return c?(0,n.jsx)(Is,{isNative:c[hs.at.IS_NETWORK_NATIVE_ON_PORT],isWanPort:c[hs.at.IS_WAN_PORT],isTagged:c[hs.at.IS_TAGGED],isDisabled:c[hs.at.IS_DISABLED],portNumber:l,rowIndex:r,networkId:e._id},a):(0,n.jsx)(ct,{},a)})},`PortDiagramLayoutRow-${r+1}`))})}),js=({rowLayouts:e,model:t,values:s})=>{const{themeName:i}=(0,K.u)(),{formatMessage:r}=(0,ee.tz)(),{sharedScale:o,sharedOffset:a}=Ce(),l=(0,b.d4)(as.Tn).sort((e,t)=>(e.vlan??0)-(t.vlan??0)),[c,u]=(0,v.useState)(""),[m,p]=(0,v.useState)([]),h=(0,v.useMemo)(()=>l.map(e=>({id:e._id,vlan:e.vlan??0,name:e.name,subnet:(0,ms.mC)(e)??"",label:e.name})),[l]),x=(0,v.useMemo)(()=>h.filter(({id:e,name:t,subnet:s,vlan:n})=>(t?.toLowerCase().includes(c.toLowerCase())||s?.toLowerCase().includes(c.toLowerCase())||n?.toString().toLowerCase().includes(c.toLowerCase()))&&!m.some(t=>t.id===e)),[h,m,c]),_=(0,v.useCallback)(e=>{if(m.some(({id:t})=>t===e))return;const t=h.find(({id:t})=>t===e);t&&p(e=>e.concat([{id:t.id,label:t.label}]))},[h,m]),E=(0,v.useCallback)(e=>{p(t=>t.filter(({id:t})=>t!==e))},[]);return(0,n.jsxs)(A.A,{flexDirection:"column",maxWidth:"100%",width:"100%",children:[(0,n.jsx)(mt,{children:(0,n.jsxs)(A.A,{gap:d.kc,width:"100%",flexWrap:"wrap",alignItems:"center",children:[(0,n.jsxs)(At,{children:[(0,n.jsx)(H.A,{size:"medium",weight:"bold",color:"text-1",style:{whiteSpace:"nowrap"},children:(0,n.jsx)(ee.sA,{id:"PORTS_VLANS_SECTION_TITLE"})}),(0,n.jsx)(ds.A,{description:(0,n.jsx)(us.A,{messages:[["PORTS_VLANS_SECTION_TITLE_DESC_1"],["PORTS_VLANS_SECTION_TITLE_DESC_2"],["PORTS_VLANS_SECTION_TITLE_DESC_3"]]})})]}),(0,n.jsx)(ps.A,{description:(0,n.jsx)(ee.sA,{id:"COMMON_TAGGED"}),indicator:(0,n.jsx)(As.T,{color:(0,Ge.oX)(Ss.k.TAGGED.background,i)})}),(0,n.jsx)(ps.A,{description:(0,n.jsx)(ee.sA,{id:"COMMON_BLOCKED"}),indicator:(0,n.jsx)(As.T,{color:(0,Ge.oX)(Ss.k.BLOCKED.background,i)})}),(0,n.jsx)(ps.A,{description:(0,n.jsx)(ee.sA,{id:"COMMON_NATIVE"}),indicator:(0,n.jsx)(As.T,{color:(0,Ge.oX)(Ss.k.UNTAGGED_NATIVE.background,i)})}),(0,n.jsx)(A.A,{flexGrow:1}),(0,n.jsx)(cs.A,{selectOnEnter:!0,value:c,tags:m,searchResults:x,onClear:(e,t)=>{u("")},onReset:()=>{u(""),p([])},onChange:(e,t)=>{u(t)},onAddTag:_,onRemoveTag:E,placeholder:m.length?"":r({id:"PORTS_VLANS_SECTION_SEARCH"}),maxResultsHeight:300})]})}),(0,n.jsx)(ut,{children:(0,n.jsx)(Ms,{flexDirection:"column",children:l.filter(e=>!m.length||m.map(e=>e.id).includes(e._id)).map(i=>(0,n.jsxs)(vs,{flexDirection:"column",gap:d.YC,children:[(0,n.jsxs)(A.A,{justifyContent:"space-between",alignItems:"center",children:[(0,n.jsx)(H.A,{size:"medium",color:"text-2",children:(0,ms.gm)(i)}),(0,n.jsx)(H.A,{size:"medium",color:"text-3",children:(0,ms.mC)(i)})]}),(0,n.jsx)(bs,{network:i,rowLayouts:e,model:t,values:s,scale:o,spaceOffset:a})]},i._id))})})]})},Ds=(0,i.A)(A.A,(0,q.A)("background","border"))`
  position: relative;
  justify-content: center;
  width: ${38}px;
  height: ${38}px;
  border-radius: ${d.YC};
  border: 1px solid ${({border:e})=>e};
  background: ${({background:e})=>e};
  align-items: center;
`,Ps=(0,v.memo)(({nativeNetworkVlanId:e,isWanPort:t,portNumber:s,rowIndex:i})=>{const{themeName:r}=(0,K.u)(),{background:o,border:a,text:l}=t?Ss.k[hs.vL.WAN]:Ss.k[hs.vL.NATIVE];return(0,n.jsx)(_s.A,{description:(0,n.jsx)(Ns,{portNumber:s}),placement:0===i?"top":"bottom",delay:0,closeDelay:0,children:(0,n.jsx)(Ds,{background:(0,Ge.oX)(o,r),border:(0,Ge.oX)(a,r),children:t?(0,n.jsx)(xs.A,{size:"original",color:(0,Ge.oX)(l,r)}):(0,n.jsx)(H.A,{size:"small",color:"text-1",children:e})})},`${s}-${i}`)}),ks=({rowLayouts:e,model:t,values:s})=>{const{sharedScale:i,sharedOffset:r}=Ce();return(0,n.jsxs)(A.A,{flexDirection:"column",maxWidth:"100%",width:"100%",children:[(0,n.jsx)(mt,{children:(0,n.jsxs)(At,{children:[(0,n.jsx)(H.A,{size:"medium",weight:"bold",color:"text-1",style:{whiteSpace:"nowrap"},children:(0,n.jsx)(ee.sA,{id:"PORTS_VLANS_NATIVE_TITLE"})}),(0,n.jsx)(ds.A,{description:(0,n.jsx)(us.A,{messages:[["PORTS_VLANS_NATIVE_TITLE_DESC_1"],["PORTS_VLANS_NATIVE_TITLE_DESC_2"]]})})]})}),(0,n.jsx)(ut,{children:(0,n.jsx)(_t,{scale:i,spaceOffset:r,children:(0,n.jsx)(at,{children:(e||[]).map((e,i)=>(0,n.jsx)(lt,{children:e.map((e,r)=>{const o=`PortDiagramLayoutCell-${i+1}-${r+1}`;if(!e)return(0,n.jsx)(ct,{},o);const a=+(0,Oe.Cu)({port_idx:e.portNumber},t),l=s.nativeNetwork[a];return l?(0,n.jsx)(Ps,{isWanPort:l[hs.dv.IS_WAN_PORT],nativeNetworkVlanId:l[hs.dv.DISPLAYED_VLAN_ID],isDisabled:l[hs.dv.IS_DISABLED],portNumber:a,rowIndex:i},o):(0,n.jsx)(ct,{},o)})},`PortDiagramLayoutRow-${i+1}`))})})})]})},ys=(0,i.A)(A.A,(0,q.A)("isNarrow"))`
  flex-direction: column;
  gap: ${d.kc};
  padding-bottom: 3px;
  min-width: ${440}px;
  width: 100%;
  align-items: center;
  align-self: ${({isNarrow:e})=>e?"start":"center"};
`,ws=()=>{const[e,t]=(0,v.useState)(!1),s=(0,v.useRef)(null),i=(0,b.d4)($.w2),r=(0,b.d4)(w.ID),o=(0,b.d4)($.jv),a=(0,b.d4)($.Sg),l=(0,v.useMemo)(()=>i[0]?r.find(e=>e.mac===i[0])??(0,rs.A)():(0,rs.A)(),[i,r]),c=(0,v.useMemo)(()=>{if(!o||0===a.length)return l;const e=a.find(e=>e.mac===i[0]);return e?((e,t)=>({...t,port_table:e.ports,ethernet_overrides:e.ethernet_overrides,model:e.model,name:e.name,type:e.type,mac:e.mac}))(e,l):l},[o,a,l,i]),d=c?.model,u=d?(0,Ne.j)(d).diagram??[]:[],m=(0,b.d4)(os.wD),A=(0,b.d4)(as.Tn),p=(0,b.d4)(as.nT)?._id,h=(0,v.useMemo)(()=>(0,ls.Np)(c,m,A,p),[p,c,A,m]),x=u.length?(0,Oe.sT)(u,c):(0,Oe.oJ)(c);return(0,v.useEffect)(()=>{const e=s.current;if(!e)return;const n=new ResizeObserver(e=>{const[s]=e,{width:n}=s.contentRect;t(n<=440)});return n.observe(e),()=>{n.disconnect()}},[]),(0,n.jsx)(ys,{ref:s,isNarrow:e,flexDirection:"column",paddingBottom:3,minWidth:440,width:"100%",alignItems:"center",children:d?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ks,{rowLayouts:x,model:d,values:h}),(0,n.jsx)(js,{rowLayouts:x,model:d,values:h})]}):null})};var Rs=s(490820),Ls=s(884144),$s=s(409844),Fs=s(396489),Us=s.n(Fs),Vs=s(722837),Gs=s(567082),Hs=s(591917),zs=s(83570),Ws=s(579875),Bs=s(703842),Ks=s(588497),Ys=s(963945),Zs=s(367828),qs=s(897166),Xs=s(94411),Qs=s(54013),Js=s(230853),en=s(70582),tn=s(17211),sn=s(570866),nn=s(882355);const rn=["","k","M","G","T","P","E","Z","Y"],on=e=>e>=ne.A.XXL.TO?25:e>=ne.A.L.TO?13:e>=ne.A.M.TO?7:4,an={[nn.l.ONE_DAY]:{frequency:on,label:({index:e,value:t,selfUse24HourTime:s,selfHourCycle:n,documentWidth:i,siteTimezone:r,language:o,formatMessage:a})=>e!==on(i)-1?new Intl.DateTimeFormat(o,{hourCycle:n,hour:"numeric",timeZone:r,...s&&{minute:"numeric"}}).format(t).toUpperCase():a({id:"COMMON_NOW"})},[nn.l.ONE_WEEK]:{frequency:()=>7,label:({value:e,language:t})=>new Intl.DateTimeFormat(t,{weekday:"short"}).format(e)},[nn.l.ONE_MONTH]:{frequency:(e,t)=>Math.ceil(t/(e>=ne.A.XL.TO?1:e>=ne.A.M.TO?2:4)),label:({value:e,language:t})=>new Intl.DateTimeFormat(t,{month:"short",day:"numeric"}).format(e)},[nn.j]:{frequency:()=>10,label:({value:e,selfHourCycle:t,siteTimezone:s,language:n})=>new Intl.DateTimeFormat(n,{hourCycle:t,month:"short",day:"numeric",hour:"numeric",minute:"numeric",timeZone:s}).format(e).replace(sn.sO,e=>e.toUpperCase())}};class ln extends en.Un{constructor(e,t){super(e,"bytes","SI",t),this.unit=`${rn[this.power]}W`}toString(){return Number.isFinite(this.bytes)?((e,t)=>{const s=Math.abs(e);return s<10?`${e.toFixed(2)} ${t}`:s<100?`${e.toFixed(1)} ${t}`:`${e.toFixed(0)} ${t}`})(this.value,this.unit):""}}class cn extends en.Un{constructor(e,t){super(e,"bytes","SI",t),this.unit=`${rn[this.power]}Pkts`}}class dn extends en.Un{constructor(e,t){super(e,"bytes","SI",t),this.unit=`${rn[this.power]}Wh`}}const un=e=>(t,s)=>{const{source:n,usage:i}=e;switch(n){case Ks.I0.PACKETS:case Ks.I0.ERRORS:case Ks.I0.DROPPED:return new cn(t,s);case Ks.I0.POE:return new ln(t,s);case Ks.I0.USAGE:return i===Ks.AM.BPS?(0,en.cS)(t,"bitrate","SI",s):(0,en.cS)(t,void 0,void 0,s);default:return(0,en.cS)(t,void 0,void 0,s)}},mn=()=>{const e=(0,b.wA)(),{themeName:t}=(0,K.u)(),s=(0,b.d4)($.zD),n=(0,v.useMemo)(()=>(e=>[G.Ay[`desktop-color-navy-06-${e}`],G.Ay[`desktop-color-navy-04-${e}`],G.Ay[`desktop-color-aqua-04-${e}`],G.Ay[`desktop-color-green-04-${e}`],G.Ay[`desktop-color-green-06-${e}`],G.Ay[`desktop-color-green-08-${e}`],G.Ay[`desktop-color-lime-06-${e}`],G.Ay[`desktop-color-yellow-06-${e}`],G.Ay[`desktop-color-purple-06-${e}`],G.Ay[`desktop-color-yellow-09-${e}`],G.Ay[`desktop-color-lime-07-${e}`],G.Ay[`desktop-color-aqua-06-${e}`],G.Ay[`desktop-color-green-09-${e}`],G.Ay[`desktop-color-navy-05-${e}`],G.Ay[`desktop-color-green-05-${e}`],G.Ay[`desktop-color-lime-09-${e}`],G.Ay[`desktop-color-ublue-05-${e}`],G.Ay[`desktop-color-purple-04-${e}`],G.Ay[`desktop-color-yellow-07-${e}`],G.Ay[`desktop-color-ublue-04-${e}`],G.Ay[`desktop-color-ublue-06-${e}`],G.Ay[`desktop-color-lime-05-${e}`],G.Ay[`desktop-color-ublue-09-${e}`],G.Ay[`desktop-color-lime-04-${e}`],G.Ay[`desktop-color-navy-09-${e}`],G.Ay[`desktop-color-orange-07-${e}`],G.Ay[`desktop-color-green-10-${e}`],G.Ay[`desktop-color-yellow-04-${e}`],G.Ay[`desktop-color-ublue-08-${e}`],G.Ay[`desktop-color-purple-05-${e}`],G.Ay[`desktop-color-orange-09-${e}`],G.Ay[`desktop-color-lime-08-${e}`],G.Ay[`desktop-color-ublue-10-${e}`],G.Ay[`desktop-color-orange-06-${e}`],G.Ay[`desktop-color-aqua-09-${e}`],G.Ay[`desktop-color-yellow-05-${e}`],G.Ay[`desktop-color-orange-05-${e}`],G.Ay[`desktop-color-purple-07-${e}`],G.Ay[`desktop-color-navy-08-${e}`],G.Ay[`desktop-color-purple-08-${e}`],G.Ay[`desktop-color-aqua-08-${e}`],G.Ay[`desktop-color-orange-08-${e}`],G.Ay[`desktop-color-orange-10-${e}`],G.Ay[`desktop-color-green-07-${e}`],G.Ay[`desktop-color-navy-07-${e}`],G.Ay[`desktop-color-aqua-07-${e}`],G.Ay[`desktop-color-navy-10-${e}`],G.Ay[`desktop-color-orange-04-${e}`],G.Ay[`desktop-color-aqua-05-${e}`],G.Ay[`desktop-color-aqua-10-${e}`],G.Ay[`desktop-color-ublue-07-${e}`],G.Ay[`desktop-color-yellow-08-${e}`],G.Ay[`desktop-color-yellow-10-${e}`]])(t),[t]),i=(0,v.useCallback)(t=>{const i={...s};t.forEach(e=>{i[e]=(0,Ge.O)(e,t,i,n),Object.keys(i).forEach(t=>{i[t]===i[e]&&t!==e&&delete i[t]})}),e((0,F.Ao)(t)),e((0,F.hl)(i))},[s,e,n]);return(0,v.useMemo)(()=>({setSelectedPortsAndAssignColors:i}),[i])};var An=s(594005),pn=s(64222),hn=s(43210),xn=s(265799),_n=s(891108),En=s(48282),gn=s(407440),Cn=s(229674),On=s(398839),fn=s(56809),Nn=s(988135),Sn=s(820633);const Tn=({sfp_voltage:e})=>{const t=(0,b.d4)(Sn.zi),s=(0,fn.b)(e),i=(0,Nn.L)(s||0,t,3);return(0,n.jsx)(On.cp,{value:(0,n.jsx)(ee.sA,{id:s?"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_VOLTAGE":"COMMON_FALLBACK",values:{voltage:i}})})},In=["UBNT","Ubiquiti","UbiquitiNetworks"],Mn=({sfp_vendor:e})=>{const t=In.includes(s=e)?"Ubiquiti Inc.":s;var s;return(0,n.jsx)(On.cp,{value:t})},vn=({sfp_temperature:e})=>{const t=(0,b.d4)(Sn.zi),s=(0,fn.b)(e),i=(0,Nn.L)(s||0,t,3);return(0,n.jsx)(On.cp,{value:(0,n.jsx)(ee.sA,{id:s?"DEVICE_PROPERTY_OVERVIEW_TEMPERATURE_VALUE":"COMMON_FALLBACK",values:{temperature:i}})})},bn=({io_power:e})=>{const t=(0,b.d4)(Sn.zi),s=(0,fn.b)(e),i=(0,Nn.L)(s||0,t,3);return(0,n.jsx)(On.cp,{value:(0,n.jsx)(ee.sA,{id:s?"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_IO_POWER":"COMMON_FALLBACK",values:{power:i}})})},jn=({sfp_current:e})=>{const t=(0,b.d4)(Sn.zi),s=(0,fn.b)(e),i=(0,Nn.L)(s||0,t,3);return(0,n.jsx)(On.cp,{value:(0,n.jsx)(ee.sA,{id:s?"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_CURRENT":"COMMON_FALLBACK",values:{current:i}})})},Dn=['No SFP Inserted"',"Unknown"],Pn=e=>Dn.includes(e)?void 0:e,kn=({sfp_compliance:e})=>(0,n.jsx)(On.cp,{value:Pn(e)}),yn=e=>[{id:hn.d1.PORT,accessorFn:An.Fo,maxSize:e?void 0:xn.ve,...e?hn.sP[hn.d1.PORT]:{size:xn.ve},header:()=>(0,n.jsx)(ee.sA,{id:hn.Cz[hn.d1.PORT]}),cell:({row:{original:t}})=>(0,n.jsx)(gn.A,{port:t,isInteractive:!1,showDevice:e}),compare:Cn.o$},{id:hn.d1.NAME,accessorFn:An.Fo,...hn.sP[hn.d1.NAME],header:()=>(0,n.jsx)(ee.sA,{id:hn.Cz[hn.d1.NAME]}),cell:({row:{original:e}})=>(0,n.jsx)(On.cp,{value:e.name,color:e.color}),compare:(0,An.l0)(({name:e})=>e)},Cn.QW,{id:hn.d1.NATIVE_VLAN,accessorFn:An.Fo,...hn.sP[hn.d1.NATIVE_VLAN],header:()=>(0,n.jsx)(ee.sA,{id:hn.Cz[hn.d1.NATIVE_VLAN]}),cell:({row:{original:e}})=>(0,n.jsx)(En.A,{nativeNetworkConfIdSubstituted:e.nativeNetworkConfIdSubstituted}),compare:(0,An.l0)(({nativeNetworkConfIdSubstituted:e})=>e===pn.F?-1/0:e)},{id:hn.d1.SPEED,accessorFn:An.Fo,...hn.sP[hn.d1.SPEED],header:()=>(0,n.jsx)(ee.sA,{id:hn.Cz[hn.d1.SPEED]}),cell:({row:{original:e}})=>(0,n.jsx)(_n.A,{speed:e.speed,autoneg:e.autoneg,up:e.up}),compare:(0,An.l0)(({speed:e})=>e)},{id:hn.d1.VENDOR,accessorFn:An.Fo,...hn.sP[hn.d1.VENDOR],header:()=>(0,n.jsx)(ee.sA,{id:hn.Cz[hn.d1.VENDOR]}),cell:({row:{original:e}})=>(0,n.jsx)(Mn,{sfp_vendor:e.sfp_vendor||void 0}),compare:(0,An.l0)(({sfp_vendor:e})=>e)},{id:hn.d1.SERIAL,accessorFn:An.Fo,...hn.sP[hn.d1.SERIAL],header:()=>(0,n.jsx)(ee.sA,{id:hn.Cz[hn.d1.SERIAL]}),cell:({row:{original:e}})=>(0,n.jsx)(On.cp,{value:e.sfp_serial||void 0}),compare:(0,An.l0)(({sfp_serial:e})=>e)},{id:hn.d1.PART_NUMBER,accessorFn:An.Fo,...hn.sP[hn.d1.PART_NUMBER],header:()=>(0,n.jsx)(ee.sA,{id:hn.Cz[hn.d1.PART_NUMBER]}),cell:({row:{original:e}})=>(0,n.jsx)(On.cp,{value:e.sfp_part||void 0}),compare:(0,An.l0)(({sfp_part:e})=>e)},{id:hn.d1.COMPLIANCE,accessorFn:An.Fo,...hn.sP[hn.d1.COMPLIANCE],header:()=>(0,n.jsx)(ee.sA,{id:hn.Cz[hn.d1.COMPLIANCE]}),cell:({row:{original:e}})=>(0,n.jsx)(kn,{sfp_compliance:e.sfp_compliance||void 0}),compare:(0,An.l0)(({sfp_compliance:e})=>Pn(e||void 0))},{id:hn.d1.TEMPERATURE,accessorFn:An.Fo,...hn.sP[hn.d1.TEMPERATURE],header:()=>(0,n.jsx)(ee.sA,{id:hn.Cz[hn.d1.TEMPERATURE]}),cell:({row:{original:e}})=>(0,n.jsx)(vn,{sfp_temperature:e.sfp_temperature}),compare:(0,An.l0)(({sfp_temperature:e})=>e)},{id:hn.d1.OUTPUT_POWER,accessorFn:An.Fo,...hn.sP[hn.d1.OUTPUT_POWER],header:()=>(0,n.jsx)(ee.sA,{id:hn.Cz[hn.d1.OUTPUT_POWER]}),cell:({row:{original:e}})=>(0,n.jsx)(bn,{io_power:e.sfp_txpower}),compare:(0,An.l0)(({sfp_txpower:e})=>e)},{id:hn.d1.INPUT_POWER,accessorFn:An.Fo,...hn.sP[hn.d1.INPUT_POWER],header:()=>(0,n.jsx)(ee.sA,{id:hn.Cz[hn.d1.INPUT_POWER]}),cell:({row:{original:e}})=>(0,n.jsx)(bn,{io_power:e.sfp_rxpower}),compare:(0,An.l0)(({sfp_rxpower:e})=>e)},{id:hn.d1.VOLTAGE,accessorFn:An.Fo,...hn.sP[hn.d1.VOLTAGE],header:()=>(0,n.jsx)(ee.sA,{id:hn.Cz[hn.d1.VOLTAGE]}),cell:({row:{original:e}})=>(0,n.jsx)(Tn,{sfp_voltage:e.sfp_voltage}),compare:(0,An.l0)(({sfp_voltage:e})=>e)},{id:hn.d1.CURRENT,accessorFn:An.Fo,...hn.sP[hn.d1.CURRENT],header:()=>(0,n.jsx)(ee.sA,{id:hn.Cz[hn.d1.CURRENT]}),cell:({row:{original:e}})=>(0,n.jsx)(jn,{sfp_current:e.sfp_current}),compare:(0,An.l0)(({sfp_current:e})=>e)}];var wn=s(526744),Rn=s(250266),Ln=s(255045),$n=s(884313),Fn=s(434521);const Un=(0,i.A)("div")`
  position: absolute;
  top: -${d.xO};
  bottom: -${d.xO};
  left: calc(100% - 400px); /* The restart confirm dialog width */
  right: 0;
`,Vn=(0,i.A)("div")`
  z-index: 1;
`,Gn=(0,v.memo)(({port:e})=>{const{port_idx:t,unit_id:s,device:i}=e,{mac:r,name:o}=i,a=(0,b.wA)(),l=(0,b.d4)($.qq),{resetPortStatistics:c}=(0,$n.X)(),u=l.some(e=>e.includeDevices?.includes(r)),m=!e.states.includes(Ln.Vd.MANAGEMENT)&&(0,Ge.cd)(i.switch_caps?.feature_caps,i.deviceState),p=(0,Ge.ug)(e),h=(0,Ge.CQ)(e),[x,_]=(0,v.useState)(!1),E=(0,b.d4)((0,$.JX)(t,r)),[g,C]=(0,v.useState)(E),O=(0,v.useCallback)(()=>{a((0,T.Fx)({mac:r,name:o},t,s))},[a,r,o,t,s]),f=(0,v.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),C(!g),a((0,T.cj)({mac:r,name:i.name},[t],g,void 0,s))},[i.name,a,g,r,t,s]),N=(0,v.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),_(!0)},[]),S=(0,Fn.wk)(i.deviceState),I=(0,v.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),c(r,t,h,S,s)},[r,t,c,h,S,s]);return(0,v.useEffect)(()=>{C(E)},[E]),m||p||u?(0,n.jsxs)(A.A,{padding:d.YC,gap:d.kc,position:"relative",onMouseLeave:x?()=>_(!1):void 0,children:[p?(0,n.jsx)(Vn,{children:(0,n.jsx)(Rn.A,{title:"DEVICE_PORT_POWER_CYCLE_CONFIRMATION_TITLE",titleValues:{portId:t},buttonMessage:"COMMON_ACTION_PROCEED",handleClose:_,handleConfirm:O,isOpen:x,rootClose:!0,body:(0,n.jsx)(H.A,{size:"inherit",children:(0,n.jsx)(ee.sA,{id:"DEVICE_PORT_POWER_CYCLE_CONFIRMATION_BODY",values:{portId:t}})}),children:(0,n.jsx)(A.A,{alignItems:"center",children:(0,n.jsx)(wn.A,{variant:"inline",onClick:N,type:"button",size:"medium",children:(0,n.jsx)(ee.sA,{id:"COMMON_POWER_CYCLE"})})})})}):null,m?(0,n.jsx)(Vn,{children:(0,n.jsx)(wn.A,{variant:"inline",onClick:f,type:"button",size:"medium",children:(0,n.jsx)(ee.sA,{id:g?"DEVICE_ACTIONS_LOCATE_STOP":"DEVICE_ACTIONS_LOCATE"})})}):null,u?(0,n.jsx)(Vn,{children:(0,n.jsx)(wn.A,{variant:"inline",onClick:I,type:"button",size:"medium",children:(0,n.jsx)(ee.sA,{id:"COMMON_RESET_STATISTICS"})})}):null,x?(0,n.jsx)(Un,{}):null]}):null}),Hn=e=>({})=>(0,n.jsx)(Gn,{port:e});var zn;!function(e){e.CLASSIC="CLASSIC",e.SFP_ANALYZER="SFP_ANALYZER"}(zn||(zn={}));var Wn=s(227170),Bn=s(943126),Kn=s(427724);const Yn=()=>{const e=(0,b.wA)(),t=(0,b.d4)($.t),s=(0,b.d4)($.EW),n=(0,v.useCallback)(()=>{e((0,F.Ao)([]));const t=(0,Bn.A)(is.Fs);e((0,F.Ff)(t))},[e]),i=(0,v.useMemo)(()=>(0,Kn.Kn)(t),[t]),r=(0,v.useMemo)(()=>(0,ts.Ac)(s),[s]),o=(0,v.useMemo)(()=>i&&r,[i,r]);return(0,v.useMemo)(()=>({areFiltersInitial:o,resetPortsFilters:n}),[o,n])},Zn=({allPortsCount:e})=>{const{resetPortsFilters:t}=Yn(),s=(0,v.useMemo)(()=>(0,n.jsx)(Wn.A,e?{title:(0,n.jsx)(ee.sA,{id:"COMMON_NO_MATCH"}),description:(0,n.jsx)(ee.sA,{id:"PORTS_EMPTY_FILTER_NO_PORTS_DETAILS",values:{button:(0,n.jsx)(wn.A,{type:"button",variant:"inline",onClick:t,children:(0,n.jsx)(ee.sA,{id:"COMMON_RESET_THEM_BUTTON_TEXT"})})}})}:{title:(0,n.jsx)(ee.sA,{id:"PORTS_TABLE_EMPTY_HEADER"})}),[e,t]);return(0,n.jsx)(A.A,{width:"100%",flexDirection:"column",children:s})},qn=$s.AH`
  div:has(> * > * > .${Bs.k}) {
    overflow: visible;
  }
`,Xn=(0,i.A)(A.A)`
  height: 100%;
  min-height: 400px;
  width: 100%;
  overflow: hidden;
  flex-direction: column;
  flex-grow: 1;
`,Qn=$s.AH`
  overflow-x: scroll;
`,Jn={height:"unset",padding:"0",overflow:"unset"},ei=Js.W2[Qs.xz.TABLES][Vs.l.PORTS].columns,ti=(0,$.IS)([]),si=new Set(Rs.qq),ni=(e,t)=>{if(e===t)return!0;if(e.length!==t.length)return!1;for(let s=0;s<t.length;s+=1){const n=e[s],i=t[s];if(n!==i){if(n.id!==i.id)return!1;for(const e of Object.keys(i))if(!si.has(e)){if("last_connection"===e){const e=n.last_connection,t=i.last_connection;if(e?.mac!==t?.mac||e?.connected!==t?.connected)return!1;continue}if((null!=n[e]||null!=i[e])&&!Us()(n[e],i[e]))return!1}}}return!0},ii=(0,v.memo)(()=>{const e=(0,b.wA)(),t=(0,K.u)(),{formatMessage:s}=(0,ee.tz)(),i=(0,b.d4)($.ZN),r=(0,b.d4)($.vR),o=(0,b.d4)($.UH),a=(0,b.d4)($.O2),l=(0,b.d4)($.cW),c=(0,b.d4)($.yZ),u=(0,b.d4)($.hb),{initialColumns:m}=(0,Xs.A)(Vs.l.PORTS),A=(0,b.d4)($.TP),p=(0,b.d4)($.X5),h=(0,b.d4)($.zD),x=(0,b.d4)(qs.EL),_=(0,b.d4)($.XS),E=(0,b.d4)($.QR),g=(0,b.d4)(ti,ni),{setSelectedPortsAndAssignColors:C}=mn(),O=(0,Ys.D)()===Zs.o.SFP_ANALYZER,f=O?zn.SFP_ANALYZER:zn.CLASSIC,N=(0,b.d4)($.x4),S=(0,b.d4)(gs.D),T=(0,v.useMemo)(()=>{const e=S.find(e=>e.stacking&&e.peers.bottom===N||e.stacking&&e.peers.top===N);return e?.peers.top===N?e?.peers.bottom:e?.peers.top},[S,N]),[I,M]=(0,Hs.A)(f===zn.CLASSIC?Vs.l.PORTS:Vs.l.SFP_PORTS),[j,D]=(0,Gs.A)(O?Vs.l.SFP_PORTS:Vs.l.PORTS),P=(0,v.useMemo)(()=>{if(x)return null;const e=new Map;for(const t of g)e.set(t.id,Hn(t));return e},[g,x]),k=(0,v.useMemo)(()=>{if(E)return g.map(e=>({...e,color:p.mode===Ks.Mz.BY_PORT&&a.has(e.id)?h[e.id]:void 0,disabled:!1,_rowHoverContent:P?.get(e.id)}));const e=new Set(u.selectablePortsSingleSelection||[]);return g.map(t=>{const s=a.has(t.id),n=e.has(t.id),i=!(t.device.mac===N)&&!(t.device.mac===T)&&Boolean(N);return{...t,color:void 0,disabled:!s&&!n||i||_,_rowHoverContent:P?.get(t.id)}})},[E,g,p.mode,a,h,N,P,u.selectablePortsSingleSelection,T,_]),y=(0,v.useCallback)(t=>{E?C(t):e((0,F.Ao)(t))},[E,C,e]),w=(0,v.useCallback)(t=>{t.disabled||(E?C([t.id]):e((0,F.Ao)((0,Ge.Um)(t.id))))},[E,C,e]),R=(0,v.useMemo)(()=>{const e=ei.reduce((e,t)=>(e[t]=m.includes(t),e),{});return l||xn.lj.forEach(t=>{e[t]=!1}),c||xn.v0.forEach(t=>{e[t]=!1}),e},[l,c,m]),L=(0,v.useCallback)(t=>{e((0,F.DE)(t))},[e]),U=(0,v.useMemo)(()=>(0,Cn.oE)(t,s,A),[t,s,A]),V=(0,v.useMemo)(()=>yn(A),[A]),G=(0,v.useRef)(null),H=(0,v.useCallback)(({rowsPerPage:e,pageNumber:t})=>(0,n.jsx)(Ls.A,{ref:G,columns:f===zn.CLASSIC?U:V,columnVisibility:f===zn.CLASSIC?R:void 0,data:m?.length?k:[],initialColumnSize:I,onColumnSizingChange:M,multiSelectMode:!0,onChangeSelection:y,onRowClick:w,enableRowSelection:e=>!e.disabled,selection:o,isSelectAllVisible:E,rowStyle:d.gc,onSort:D,sorting:j,rowDisabledClassName:"",pageIndex:t,pageSize:e,className:`${zs.E} ${qn}`,withOverflow:!0,virtualizeColumn:!0,overscanColumn:1},f===zn.CLASSIC?`ports-${A}`:"sfp"),[f,A,U,V,R,m?.length,k,I,M,y,w,o,E,D,j]);return Boolean(g.length&&m?.length)?(0,n.jsx)(Ws.A,{itemCount:g.length,tableType:Vs.l.SFP_PORTS,onRenderTable:H,onPageChanged:L,rowOptions:xn.j8,pageNumber:r,wrapperFlexProps:Jn,paginationTableContainerClassName:Qn}):(0,n.jsxs)(Xn,{children:[(0,n.jsx)(Ls.A,{data:[],columns:U,columnVisibility:R,tableHeight:"auto",className:zs.E,multiSelectMode:!0,isSelectAllVisible:!1},`ports-empty-${A}`),(0,n.jsx)(Zn,{allPortsCount:i})]})});var ri=s(430328),oi=s(733360),ai=s(585565),li=s(415466),ci=s(358248),di=s(416233),ui=s(627056);const mi=(0,Mt.Mz)($._h,qs.vc,(e,t)=>e.includes(t)),Ai=(0,ri.WY)((e,t)=>e.lastFetchTime===t.lastFetchTime||null===t.lastFetchTime)((0,Mt.Mz)(ci.Od,$.Ky,$._h,(e,t,s)=>{const n={data:{attrs:di.$r,start:t.startDate.getTime(),end:t.endDate.getTime(),macs:s}};return(0,vt.JC)(ci.Pd,e,n)}),e=>e),pi=(0,ri.WY)((e,t)=>e.lastFetchTime===t.lastFetchTime||null===t.lastFetchTime)((0,Mt.Mz)(ci.yN,$.Ky,$._h,(e,t,s)=>{const n={data:{attrs:di.Tj,start:t.startDate.getTime(),end:t.endDate.getTime(),macs:s}};return(0,vt.JC)(ci.Zk,e,n)}),e=>e),hi=(0,Mt.Mz)(Ai,bt.kh),xi=(0,Mt.Mz)(pi,bt.kh),_i=/(\d+)-(.+)/,Ei=(0,Mt.Mz)(hi,xi,$.UH,mi,li.BG,$.QR,(e,t,s,n,i,r)=>{if(!s||0===s.length||!r)return[];const o=new Set(s),a=n?i.filter(e=>e.port_info?.port_idx).sort((e,t)=>e.id.localeCompare(t.id)):[],l=new Map;n&&t.length>0&&t.forEach((t,s)=>{if(!t)return;const n=e[s]?.oid;if(!n)return;const i={};a.forEach(({id:e,port_info:{port_idx:s}})=>{const r=(0,y.FS)(n,s);if(!o.has(r))return;const a=(0,ai.t)(e);ui.M6.forEach(e=>{const s=t[`${a}-${e}`];null!=s&&(i[e]=(i[e]||0)+s)})}),l.set(s,i)});const c=new Map,d=new Map;e.forEach((e,t)=>{const s=e.oid,n=e.time;d.has(n)||d.set(n,e.duration);let i=c.get(n);i||(i={timestamp:n,tx_bytes:0,rx_bytes:0,tx_rate:0,rx_rate:0,tx_packets:0,rx_packets:0,tx_broadcast:0,rx_broadcast:0,tx_multicast:0,rx_multicast:0,tx_dropped:0,rx_dropped:0,tx_errors:0,rx_errors:0,poe_power:0,poe_energy:0},c.set(n,i)),Object.keys(e).forEach(t=>{const n=t.match(_i);if(n){const[,r,a]=n,l=(0,y.FS)(s,+r);o.has(l)&&void 0!==i[a]&&(i[a]+=e[t])}});const r=l.get(t);r&&ui.M6.forEach(e=>{void 0!==r[e]&&(i[e]+=r[e])})});const u=[];return c.forEach((e,t)=>{const s=d.get(t)||0;u.push({...e,tx_rate:(0,tn.tI)(e.tx_bytes,s),rx_rate:(0,tn.tI)(e.rx_bytes,s),poe_energy:e.poe_power*s/It.$_})}),u.sort((e,t)=>e.timestamp-t.timestamp),u}),gi=(0,Mt.Mz)(Ei,e=>{const t=(e,t)=>e.reduce((e,s)=>(s[t]||0)+e,0);return{tx_bytes:t(e,"tx_bytes"),rx_bytes:t(e,"rx_bytes"),tx_rate:t(e,"tx_rate")/(e.length||1),rx_rate:t(e,"rx_rate")/(e.length||1),tx_packets:t(e,"tx_packets"),rx_packets:t(e,"rx_packets"),tx_broadcast:t(e,"tx_broadcast"),rx_broadcast:t(e,"rx_broadcast"),tx_multicast:t(e,"tx_multicast"),rx_multicast:t(e,"rx_multicast"),poe_power:t(e,"poe_power")/(e.length||1),poe_energy:t(e,"poe_energy"),tx_errors:t(e,"tx_errors"),rx_errors:t(e,"rx_errors"),tx_dropped:t(e,"tx_dropped"),rx_dropped:t(e,"rx_dropped")}}),Ci=(0,Mt.Mz)(hi,xi,$.UH,$.X5,mi,li.nB,$.QR,(e,t,s,n,i,r,o)=>{if(!s||0===s.length||!o)return[];const a=(e=>{const t=(e=>{let t="";return e.source===Ks.I0.USAGE&&(e.usage===Ks.AM.BPS&&(t="rate"),e.usage===Ks.AM.BYTES&&(t="bytes")),e.source===Ks.I0.PACKETS&&(e.packets===Ks.uO.ALL&&(t="packets"),e.packets===Ks.uO.BROADCAST&&(t="broadcast"),e.packets===Ks.uO.MULTICAST&&(t="multicast")),t})(e);return(s,n,i)=>{const r="number"==typeof n?`port_${n}`:`wan${n}`;if(e.source===Ks.I0.USAGE&&e.usage===Ks.AM.BPS){const t=s[`${r}-tx_bytes`]||0,n=s[`${r}-rx_bytes`]||0;if(!i)return 0;if(e.direction===Ks.O_.ALL)return(0,tn.tI)(t+n,i);if(e.direction===Ks.O_.UPLINK)return(0,tn.tI)(t,i);if(e.direction===Ks.O_.DOWNLINK)return(0,tn.tI)(n,i)}if(e.source===Ks.I0.POE)return s[`${r}-poe_power`]||0;if(e.source===Ks.I0.ERRORS){const t=s[`${r}-tx_errors`]||0,n=s[`${r}-rx_errors`]||0;if(e.direction===Ks.O_.ALL)return t+n;if(e.direction===Ks.O_.UPLINK)return t;if(e.direction===Ks.O_.DOWNLINK)return n}if(e.source===Ks.I0.DROPPED){const t=s[`${r}-tx_dropped`]||0,n=s[`${r}-rx_dropped`]||0;if(e.direction===Ks.O_.ALL)return t+n;if(e.direction===Ks.O_.UPLINK)return t;if(e.direction===Ks.O_.DOWNLINK)return n}const o=s[`${r}-tx_${t}`]||0,a=s[`${r}-rx_${t}`]||0;return e.direction===Ks.O_.ALL?o+a:e.direction===Ks.O_.UPLINK?o:e.direction===Ks.O_.DOWNLINK?a:0}})(n),l=new Map;e.forEach((e,n)=>{const{duration:o,oid:c}=e,d=e.time,u=t[n];let m=l.get(d);m||(m={timestamp:d,duration:o,portsData:{}},l.set(d,m));for(let t=0;t<s.length;t+=1){const n=s[t],{deviceMac:l,portIdx:d}=(0,y.q9)(n);if(l===c){const t=r[d];if(i&&u&&t){const e=(0,oi.si)(t.id);m.portsData[n]=a(u,e<2?"":e.toString(),o)}else m.portsData[n]=a(e,d,o)}}});const c=[];return l.forEach(({timestamp:e,duration:t,portsData:s})=>{c.push({timestamp:e,duration:t,...s})}),c.sort((e,t)=>e.timestamp-t.timestamp),c}),Oi=(0,Mt.Mz)(Ci,$.X5,(e,t)=>{const s=un(t),n=Object.keys(e[0]||{}).filter(e=>"timestamp"!==e&&"duration"!==e);let i=e.reduce((e,s)=>{const i=n.reduce((e,n)=>{let i=s[n];return t.source===Ks.I0.POE&&(i=i*s.duration/It.$_),e+i},0);return e+i},0);return t.source===Ks.I0.USAGE&&t.usage===Ks.AM.BPS&&(i/=e.length||1),t.source===Ks.I0.POE?{total:new dn(i)}:{total:s(i)}});var fi=s(731666),Ni=s(546657);const Si=(0,i.A)(H.A)`
  white-space: nowrap;
`,Ti=({summary:e})=>{const t=(0,K.u)();return(0,n.jsxs)(A.A,{gap:d.kc,alignItems:"center",justifyContent:"end",children:[e.rx?(0,n.jsxs)(Si,{size:"medium",style:{color:(0,$e.gB)(t)},children:[(0,n.jsx)(Ni.A,{}),e.rx.toString()]}):null,e.tx?(0,n.jsxs)(Si,{size:"medium",style:{color:(0,$e.mN)(t)},children:[(0,n.jsx)(fi.A,{}),e.tx.toString()]}):null,e.total?(0,n.jsx)(Si,{size:"medium",color:"text-1",children:e.total.toString()}):null]})};var Ii=s(684935);const Mi=[{id:Ks.AM.BPS,label:(0,n.jsx)(ee.sA,{id:"COMMON_BPS"})},{id:Ks.AM.BYTES,label:(0,n.jsx)(ee.sA,{id:"COMMON_BYTES"})}],vi=()=>{const e=(0,b.wA)(),{usage:t}=(0,b.d4)($.X5);return(0,n.jsx)(Ii.A,{className:wi,tabs:Mi,selectedTab:t,onSelectTab:({id:t})=>(t=>{e((0,F.H4)({usage:t}))})(t),variant:"filter"})},bi=()=>{const e=(0,b.wA)(),t=(0,b.d4)($.cW),{source:s}=(0,b.d4)($.X5);((e,t)=>{const s=(0,b.wA)();(0,v.useEffect)(()=>{e||t!==Ks.I0.POE||s((0,F.H4)({source:ui.ON}))},[e,s])})(t,s);const i=(0,v.useMemo)(()=>[{id:Ks.I0.PACKETS,label:(0,n.jsx)(ee.sA,{id:"COMMON_PACKETS"})},{id:Ks.I0.USAGE,label:(0,n.jsx)(ee.sA,{id:"COMMON_USAGE"})},{id:Ks.I0.POE,label:(0,n.jsx)(ee.sA,{id:"COMMON_DEVICE_POE_MODE_POE"}),disabled:!t},{id:Ks.I0.ERRORS,label:(0,n.jsx)(ee.sA,{id:"COMMON_ERRORS"})},{id:Ks.I0.DROPPED,label:(0,n.jsx)(ee.sA,{id:"COMMON_DROPPED"})}],[t]);return(0,n.jsx)(Ii.A,{className:wi,tabs:i,selectedTab:s,onSelectTab:({id:t})=>(t=>{e((0,F.H4)({source:t}))})(t),variant:"filter"})},ji=[{id:Ks.uO.ALL,label:(0,n.jsx)(ee.sA,{id:"COMMON_ALL"})},{id:Ks.uO.BROADCAST,label:(0,n.jsx)(ee.sA,{id:"COMMON_STATUS_BROADCAST"})},{id:Ks.uO.MULTICAST,label:(0,n.jsx)(ee.sA,{id:"COMMON_MULTICAST"})}],Di=()=>{const e=(0,b.wA)(),{packets:t}=(0,b.d4)($.X5);return(0,n.jsx)(Ii.A,{className:wi,tabs:ji,selectedTab:t,onSelectTab:({id:t})=>(t=>{e((0,F.H4)({packets:t}))})(t),variant:"filter"})},Pi=[{id:Ks.Mz.AVERAGE,label:(0,n.jsx)(ee.sA,{id:"COMMON_TOTAL"})},{id:Ks.Mz.BY_PORT,label:(0,n.jsx)(ee.sA,{id:"PORTS_BY_PORT"})}],ki=()=>{const e=(0,b.wA)(),{mode:t}=(0,b.d4)($.X5);return(0,n.jsx)(Ii.A,{className:wi,tabs:Pi,selectedTab:t,onSelectTab:({id:t})=>(t=>{e((0,F.H4)({mode:t}))})(t),variant:"filter"})},yi=()=>{const e=(0,b.wA)(),t=(0,b.d4)($.X5),{direction:s,source:i}=t,r=(0,v.useMemo)(()=>{const e=i===Ks.I0.ERRORS||i===Ks.I0.DROPPED;return[{id:Ks.O_.ALL,label:(0,n.jsx)(ee.sA,{id:"COMMON_ALL"})},{id:Ks.O_.DOWNLINK,label:(0,n.jsx)(ee.sA,{id:e?"COMMON_RECEIVE":"COMMON_DOWNLOAD"})},{id:Ks.O_.UPLINK,label:(0,n.jsx)(ee.sA,{id:e?"COMMON_TRANSMIT":"COMMON_UPLOAD"})}]},[i]);return(0,n.jsx)(Ii.A,{className:wi,tabs:r,selectedTab:s,onSelectTab:({id:t})=>(t=>{e((0,F.H4)({direction:t}))})(t),variant:"filter"})},wi=$s.AH`
  flex: unset;
  width: auto;
  flex-shrink: 0;
`,Ri=({summary:e})=>{const{source:t}=(0,b.d4)($.X5);return(0,n.jsxs)(A.A,{gap:d.kc,overflow:"auto",children:[(0,n.jsx)(ki,{}),(0,n.jsx)(bi,{}),t===Ks.I0.PACKETS?(0,n.jsx)(Di,{}):null,t===Ks.I0.USAGE?(0,n.jsx)(vi,{}):null,t!==Ks.I0.POE?(0,n.jsx)(yi,{}):null,(0,n.jsx)(A.A,{flexGrow:1}),(0,n.jsx)(Ti,{summary:e})]})};var Li=s(833881),$i=s(528116),Fi=s(927027),Ui=s(141651),Vi=s(761047),Gi=s(964978),Hi=s(122109);const zi={Bytes:(0,i.A)(H.A)`
    color: ${({theme:{themeName:e}})=>G.Ay[`desktop-color-aqua-06-${e}`]};
  `,Icon:void 0},Wi=(0,i.A)(A.A)`
  flex-direction: column;
  padding-bottom: ${d.kc};
  border-bottom: 1px solid
    ${({theme:{themeName:e}})=>G.Ay[`desktop-color-neutral-10-${e}`]};
`,Bi=(0,i.A)(A.A)`
  g {
    transition: unset;
  }
`,Ki=(0,i.A)("div",(0,q.A)("color"))`
  width: ${d.kc};
  height: ${d.kc};
  background: ${({color:e})=>e};
`,Yi=(0,i.A)(A.A,(0,q.A)("columnCount"))`
  display: grid;
  grid-template-columns: repeat(${({columnCount:e})=>e}, 1fr);
  column-gap: ${d.S2};
  width: 100%;
`,Zi=({portIdx:e,value:t,graphDataSeries:s,color:i})=>{const r=s.getFormattedValue(t);return(0,n.jsxs)(A.A,{justifyContent:"space-between",alignItems:"baseline",width:"100%",gap:d.YC,children:[(0,n.jsxs)(A.A,{gap:d.YC,alignItems:"center",children:[(0,n.jsx)(Ki,{color:i}),(0,n.jsx)(H.A,{size:"small",color:"text-2",children:(0,n.jsx)(ee.sA,{id:"COMMON_PORT_NUMBER",values:{portNumber:e}})})]}),(0,n.jsx)(H.A,{size:"small",children:r.toString()})]})},qi=({value:e,direction:t,source:s,graphDataSeries:i})=>{const r=(0,v.useMemo)(()=>((e,t)=>e===Ks.I0.POE?zi:t===Ks.O_.UPLINK?Gi.A:Hi.A)(s,t),[t,s]),o=(0,v.useMemo)(()=>((e,t)=>e===Ks.I0.POE?"COMMON_POWER":e===Ks.I0.ERRORS||e===Ks.I0.DROPPED?t===Ks.O_.UPLINK?"COMMON_TRANSMIT":"COMMON_RECEIVE":t===Ks.O_.UPLINK?"COMMON_UPLOAD":"COMMON_DOWNLOAD")(s,t),[t,s]),a=i.getFormattedValue(e);return(0,n.jsxs)(A.A,{justifyContent:"space-between",width:"100%",children:[(0,n.jsx)(H.A,{size:"small",color:"text-2",children:(0,n.jsx)(ee.sA,{id:o})}),(0,n.jsxs)(A.A,{children:[r.Icon?(0,n.jsx)(r.Icon,{}):null,(0,n.jsx)(r.Bytes,{size:"small",children:a.toString()})]})]})},Xi=({hidden:e,top:t,left:s,x:i,chartWidth:r,chartHeight:o,selfHourCycle:a,tooltipPropsCollection:l,showDateWithTime:c,language:u,graphDataSeries:m,settings:p,gradientColor:h,graphDataCollection:x,seriesIndex:_,duration:E})=>{const{mode:g}=p,{themeName:C}=(0,K.u)(),O=(0,b.d4)($.zD),f=(0,v.useMemo)(()=>(e=>{switch(e){case Ks.I0.POE:return(0,n.jsx)(ee.sA,{id:"COMMON_POWER"});case Ks.I0.PACKETS:return(0,n.jsx)(ee.sA,{id:"COMMON_PACKETS"});case Ks.I0.USAGE:return(0,n.jsx)(ee.sA,{id:"COMMON_USAGE"});case Ks.I0.ERRORS:return(0,n.jsx)(ee.sA,{id:"COMMON_ERRORS"});case Ks.I0.DROPPED:return(0,n.jsx)(ee.sA,{id:"COMMON_DROPPED"});default:return null}})(p.source),[p.source]),N=(0,v.useMemo)(()=>Object.values(x).find(e=>e.timestamp===i),[x,i]),S=(0,v.useMemo)(()=>{const e=s<Math.round(r/2);return{left:Math.round(s+(e?8:-8)),top:Math.round(t),position:e?"rightTop":"leftTop"}},[s,t,r]),T=(0,v.useMemo)(()=>((e,t,s,n,i)=>{const r=new Intl.DateTimeFormat(t,{day:"numeric",month:"short",year:"numeric",...s&&{hour:"numeric",minute:"numeric",hourCycle:n}}).format(e);return i?`${r} - ${new Intl.DateTimeFormat(t,s?{hour:"numeric",minute:"numeric",hourCycle:n}:{day:"numeric",month:"short",year:"numeric"}).format(i)}`:r})(i,u,c,a,i+Number(E||0)),[i,u,c,a,E]),I=(0,v.useMemo)(()=>N?g===Ks.Mz.BY_PORT?((e,t,s)=>(0,n.jsx)(Yi,{columnCount:Math.ceil(Object.values(e.data).length/18),children:Object.values(e.data).sort((e,t)=>(0,y.q9)(e.key).portIdx-(0,y.q9)(t.key).portIdx).map(i=>{const r=t[i.key],o=s[i.key],{portIdx:a}=(0,y.q9)(i.key);return(0,n.jsx)(Zi,{value:r,color:o,graphDataSeries:e,portIdx:a},i.key)})}))(m,N,O):((e,t,s)=>{const i=e.data.series1,r=e.data.series2,o=r&&t[r.key];return(0,n.jsxs)(A.A,{flexDirection:"column",gap:d.YC,children:[i?(0,n.jsx)(qi,{direction:Ks.O_.UPLINK,graphDataSeries:e,value:i&&t[i.key],source:s}):null,r?(0,n.jsx)(qi,{direction:Ks.O_.DOWNLINK,graphDataSeries:e,value:o,source:s}):null]})})(m,N,p.source):null,[N,m,g,p.source,O]),M=(0,v.useMemo)(()=>(0,n.jsx)(Bi,{position:"absolute",top:0,left:0,children:(0,n.jsx)("svg",{width:r,height:o,children:s&&t?(0,n.jsx)(Ui.A,{hasAnimation:!1,x:s,y:Math.round(t),color:h,innerRadius:4,outterRadius:8}):null})}),[o,r,h,s,t]),j=(0,v.useMemo)(()=>{const e=Math.min(t,l.min);return{top:e,height:Math.max(t,l.max)-e,left:s-1}},[t,l,s]);return 0===_?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Vi.A,{hidden:e,left:S.left,top:S.top,topMargin:4,width:"auto",tooltipProps:{maxWidth:"auto",position:S.position},description:(0,n.jsxs)(A.A,{flexDirection:"column",gap:d.kc,whiteSpace:"nowrap",children:[(0,n.jsxs)(Wi,{children:[(0,n.jsx)(H.A,{color:"text-1",weight:"bold",size:"medium",children:f}),(0,n.jsx)(H.A,{color:"text-3",size:"small",children:T})]}),(0,n.jsx)(A.A,{flexDirection:"column",children:I})]})}),(0,n.jsx)(A.A,{zIndex:1,width:1,borderLeft:`2px dashed ${G.Ay[`desktop-color-neutral-04-${C}`]}`,top:j.top,height:j.height,left:j.left,position:"absolute"}),M]}):M};var Qi=s(702381);const Ji=({graphDataCollection:e,graphDataKey:t,getCoordinates:s,mouseData:i,maxY:r,tooltipContainer:o,seriesIndex:a,renderTooltip:l})=>{const c=(0,K.u)(),{mode:d}=(0,b.d4)($.X5),u=(0,b.d4)($.zD),m=(e=>`${e}GradientId`)(t),A=d===Ks.Mz.AVERAGE?((e,t)=>e.includes("rx")||e.includes("poe_power")?(0,$e.gB)(t):(0,$e.mN)(t))(t,c):u[t]||(0,$e.mN)(c),p=(0,v.useMemo)(()=>e.map(({timestamp:e,...s})=>({x:e,y:s[t]})),[e,t]),h=(0,v.useCallback)(()=>(0,n.jsx)("defs",{children:(0,n.jsxs)("linearGradient",{id:m,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[(0,n.jsx)("stop",{offset:"0%",stopColor:A,stopOpacity:.5}),(0,n.jsx)("stop",{offset:"100%",stopColor:A,stopOpacity:.1})]})}),[m,A]),x=(0,v.useCallback)(e=>l?l(e,A,a):void 0,[l,A,a]);return(0,n.jsx)(Qi.A,{data:p,maxY:r,mouseData:i,getCoordinates:s,lineColor:A,variant:d===Ks.Mz.AVERAGE?"gradientArea":"line",interpolation:"linear",allowCustomDots:!0,tooltipPortal:o?o.current:void 0,customGradientId:m,renderCustomGradient:h,renderTooltip:x})},er=(0,i.A)(A.A,(0,q.A)("chartWidth","preset"))`
  #x-labels > g:last-child {
    ${({preset:e,chartWidth:t})=>!e&&`transform: translateX(${t-45}px) !important;`}
  }
`,tr=({graphDataCollection:e=[],graphDataSeries:t,graphContainerHeight:s})=>{const{formatMessage:i}=(0,ee.tz)(),{width:r}=(0,Z.Ay)(),o=(0,v.useRef)(null),a=(0,v.useRef)({min:0,max:0,left:0}),{ref:l,width:c=0}=(0,pt.A)(),{startDate:d,endDate:u,preset:m}=(0,b.d4)($.Ky),p=(0,b.d4)(xt.jc),h=(0,b.d4)(xt.BQ),x=(0,b.d4)(qs.hq),_=(0,b.d4)(Sn.zi),E=(0,b.d4)($.X5),g=(0,b.d4)($.UH),C=(0,v.useMemo)(()=>(0,$i.$V)(d,u,!0,!0),[u,d]),O=(0,v.useMemo)(()=>(0,di.Io)(d,u),[u,d]),f=(0,$i.Vi)(O,i),N=(0,v.useMemo)(()=>Math.floor(Math.abs(new Date(u).getTime()-new Date(d).getTime())/It.jU),[d,u]),S=s<400,T=(0,v.useMemo)(()=>{let s=1;const n=Object.values(t.data).map(e=>e.key);return e.forEach(e=>{Object.keys(e).forEach(t=>{"timestamp"!==t&&"number"==typeof e[t]&&n.includes(t)&&(s=Math.max(s,e[t]))})}),t.getFormattedValue(s)},[e,t]),I=(0,v.useMemo)(()=>!(E.source===Ks.I0.USAGE&&E.usage===Ks.AM.BPS)&&E.source!==Ks.I0.POE&&E.source!==Ks.I0.ERRORS&&E.source!==Ks.I0.DROPPED,[E.usage,E.source]),M=(0,v.useCallback)(({hidden:i,left:r=0,top:o=0,x:l=0,y:d},u,m)=>(a.current={min:a.current.left===r?Math.min(o,a.current.min):o,max:a.current.left===r?Math.max(o,a.current.max):o,left:r},(0,n.jsx)(Xi,{hidden:i,left:r,top:o,tooltipPropsCollection:a.current,x:l,y:d,duration:C.grain,chartHeight:s,chartWidth:c,selfHourCycle:h,settings:E,showDateWithTime:N<=7,language:_,graphDataSeries:t,gradientColor:u,graphDataCollection:e,seriesIndex:m})),[C.grain,s,c,h,E,N,_,t,e]),j=(0,v.useMemo)(()=>((e,t)=>{const s=Math.ceil((t-e)/36e5),n=s/24;return(s=>(0,Fi.v)([e,t],an[s].frequency(r,N)).map((e,t)=>({label:an[s].label({index:t,value:e,selfHourCycle:h,selfUse24HourTime:p,documentWidth:r,siteTimezone:x,language:_,formatMessage:i}),value:e})))(null===m||m===nn.l.ONE_DAY&&s<13||m===nn.l.ONE_WEEK&&n<5||m===nn.l.ONE_MONTH&&n<10?nn.j:m)})(e[0]?.timestamp||d.getTime(),e.length>1&&e.at(-1)?.timestamp||u.getTime()),[e,h,p,d,u,m,x,_,r,N,i]),D=(0,v.useMemo)(()=>{return e=T.bytes,(0,Fi.Y)(Math.ceil(e+1/(S?5:10)*e),S?6:11);var e},[T.bytes,S]),P=(0,v.useCallback)(({value:e},s)=>{if(s!==(S?5:10))return`${t.getFormattedValue(+e,T.power).value.toFixed(1)}`},[T.power,t,S]),k=(0,v.useCallback)((s,i,r)=>(0,n.jsx)(n.Fragment,{children:Object.keys(t.data).map((a,l)=>{const{key:c,label:d}=t.data[a];return(0,n.jsx)(Ji,{graphDataCollection:e,graphDataKey:c,graphDataLabel:d,getCoordinates:s,mouseData:i,maxY:r,tooltipContainer:o,renderTooltip:M,seriesIndex:l},c)})}),[t.data,e,M]);return(0,n.jsxs)(er,{width:"100%",position:"relative",preset:m,chartWidth:c,children:[(0,n.jsx)(A.A,{width:"100%",position:"relative",ref:l,children:(0,n.jsx)(Li.A,{xAxis:j,yAxis:D,width:c,yAxisTitle:I?`${T.unit} / ${f}`:T.unit,height:s,renderYLabel:P,children:g.length?k:void 0})}),(0,n.jsx)("div",{ref:o})]})},sr=({settings:e})=>{const t=(0,b.d4)($.UH),s=(0,b.d4)(Ci),i=(0,b.d4)(Oi),r=((e,t)=>{const s={getFormattedValue:un(t),data:{}};return e.forEach(e=>{s.data[e]={key:e,label:`COMMON_PORT ${e}`}}),s})(t,e);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ri,{summary:i}),(0,n.jsx)(tr,{graphDataCollection:s,graphDataSeries:r,graphContainerHeight:ui.F$})]})},nr=({settings:e})=>{const t=(0,b.d4)(gi),s=(0,b.d4)(Ei),i=((e,t)=>{const{DOWNLINK:s,UPLINK:n,ALL:i}=Ks.O_,r=un(t),o={getFormattedValue:r,data:{}},{rx_broadcast:a,rx_bytes:l,rx_multicast:c,rx_packets:d,rx_rate:u,tx_broadcast:m,tx_bytes:A,tx_multicast:p,tx_packets:h,tx_rate:x,tx_errors:_,rx_errors:E,tx_dropped:g,rx_dropped:C,poe_energy:O}=e;return t.source===Ks.I0.ERRORS&&(o.summary={tx:r(_),rx:r(E),total:r(_+E)},[n,i].includes(t.direction)&&(o.data.series1={key:"tx_errors",label:"COMMON_ERRORS"}),[s,i].includes(t.direction)&&(o.data.series2={key:"rx_errors",label:"COMMON_ERRORS"})),t.source===Ks.I0.DROPPED&&(o.summary={tx:r(g),rx:r(C),total:r(g+C)},[n,i].includes(t.direction)&&(o.data.series1={key:"tx_dropped",label:"COMMON_DROPPED"}),[s,i].includes(t.direction)&&(o.data.series2={key:"rx_dropped",label:"COMMON_DROPPED"})),t.source===Ks.I0.USAGE&&(t.usage===Ks.AM.BPS&&(o.summary={tx:r(x),rx:r(u),total:r((x+u)/2)},[n,i].includes(t.direction)&&(o.data.series1={key:"tx_rate",label:"COMMON_RATE"}),[s,i].includes(t.direction)&&(o.data.series2={key:"rx_rate",label:"COMMON_RATE"})),t.usage===Ks.AM.BYTES&&(o.summary={tx:r(A),rx:r(l),total:r(A+l)},[n,i].includes(t.direction)&&(o.data.series1={key:"tx_bytes",label:"COMMON_USAGE"}),[s,i].includes(t.direction)&&(o.data.series2={key:"rx_bytes",label:"COMMON_USAGE"}))),t.source===Ks.I0.PACKETS&&(t.packets===Ks.uO.ALL&&(o.summary={tx:r(h),rx:r(d),total:r(h+d)},[n,i].includes(t.direction)&&(o.data.series1={key:"tx_packets",label:"COMMON_PACKETS"}),[s,i].includes(t.direction)&&(o.data.series2={key:"rx_packets",label:"COMMON_PACKETS"})),t.packets===Ks.uO.BROADCAST&&(o.summary={tx:r(m),rx:r(a),total:r(m+a)},[n,i].includes(t.direction)&&(o.data.series1={key:"tx_broadcast",label:"COMMON_PACKETS"}),[s,i].includes(t.direction)&&(o.data.series2={key:"rx_broadcast",label:"COMMON_PACKETS"})),t.packets===Ks.uO.MULTICAST&&(o.summary={tx:r(p),rx:r(c),total:r(p+c)},[n,i].includes(t.direction)&&(o.data.series1={key:"tx_multicast",label:"COMMON_PACKETS"}),[s,i].includes(t.direction)&&(o.data.series2={key:"rx_multicast",label:"COMMON_PACKETS"}))),t.source===Ks.I0.POE&&(o.summary={total:new dn(O)},o.data.series1={key:"poe_power",label:"COMMON_POE_USAGE"}),o})(t,e);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ri,{summary:i.summary}),(0,n.jsx)(tr,{graphDataCollection:s,graphDataSeries:i,graphContainerHeight:ui.F$})]})},ir=(0,i.A)(A.A)`
  flex-direction: column;
  width: 100%;
  border-radius: ${d.YC};
`,rr=(0,v.memo)(()=>{const e=(0,b.wA)(),t=(0,b.d4)($._h),s=(0,b.d4)($.Ky),i=(0,b.d4)($.X5),r=(0,b.d4)(mi),[o,a]=(0,v.useState)([]),[l,c]=(0,v.useState)(null),[d,u]=(0,v.useState)(null),{startDate:m,endDate:A}=s,p=(0,v.useMemo)(()=>!(!t.length||(0,D.L)(o,t)&&m===l&&A===d),[o,t,m,l,A,d]);return(0,v.useEffect)(()=>{p&&(a(t),c(m),u(A),e((0,F.qV)({deviceMacs:t,dateRange:{startDate:m,endDate:A,preset:s.preset},isGatewaySelected:r})))},[p,e,m,A,t,r,s.preset]),(0,n.jsx)(ir,{children:(0,n.jsx)(i.mode===Ks.Mz.AVERAGE?nr:sr,{settings:i})})});var or=s(376527),ar=s(969288);const lr=()=>{const e=(0,b.wA)(),t=(0,b.d4)($.OA),{type:s,id:i}=(0,v.useMemo)(()=>(0,ts.Se)(t),[t]),r=s===ss.F7.MC_LAG,o=s===ss.F7.STACKING_GROUP,a=(0,v.useMemo)(()=>i?`${ar.Rm}/${i}`:ar.Rm,[i]),l=(0,v.useMemo)(()=>i?`${ar.vc}/${i}`:ar.vc,[i]),c=(0,b.d4)($.hb),u=(0,b.d4)($.UH),m=(0,b.d4)($.XS),p=(0,v.useCallback)(()=>{e((0,F.Ao)([]))},[e]),h=(0,v.useCallback)(()=>{e((0,F.Ao)([u,c.selectablePortsBulkSelection].flat()))},[e,c.selectablePortsBulkSelection,u]),x=!c.selectablePortsBulkSelection.length;return(0,n.jsxs)(A.A,{gap:d.kc,alignItems:"center",children:[r?(0,n.jsx)(or.A,{to:a,size:"small",children:(0,n.jsx)(ee.sA,{id:"PORTS_EDIT_MC_LAG"})}):null,o?(0,n.jsx)(or.A,{to:l,size:"small",children:(0,n.jsx)(ee.sA,{id:"PORTS_EDIT_STACKING"})}):null,u.length?(0,n.jsx)(wn.A,{size:"small",type:"button",variant:"inline",onClick:p,children:(0,n.jsx)(ee.sA,{id:"COMMON_ACTION_DESELECT_ALL"})}):null,x||m?null:(0,n.jsx)(wn.A,{size:"small",type:"button",variant:"inline",onClick:h,children:(0,n.jsx)(ee.sA,{id:"COMMON_ACTION_SELECT_ALL"})})]})},cr=(0,i.A)(A.A)`
  gap: ${d.Ln};
  height: 100%;
  overflow: hidden;
`,dr=(0,i.A)("div")`
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  height: 100%;
`,ur=(0,i.A)("div")`
  container-type: inline-size;
`,mr=(0,i.A)("div")`
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: ${d.YC};

  > :nth-child(2) {
    flex-wrap: nowrap;
  }

  @container (max-width: 950px) {
    grid-template-columns: 1fr;

    > :first-child {
      order: 1;
    }

    > :nth-child(2) {
      flex-wrap: wrap;
    }
  }
`,Ar=(0,v.memo)(()=>{const e=(0,b.d4)($.w2),t=(0,b.d4)($._h),s=(0,b.d4)($.tI),i=(0,b.d4)($.OA),r=(0,b.d4)($.Mi),o=(0,b.d4)($.QR),a=(0,b.d4)($.$X),l=(0,b.d4)($.kq),c=(0,b.d4)($.Hz);(()=>{const e=(0,b.wA)(),t=(0,b.d4)($.QR),s=(0,b.d4)($.Bt)||(0,P.A)(),n=(0,b.d4)($.Fk),i=(0,b.d4)(R.D5),r=(0,b.d4)(w.Kh),o=(0,v.useRef)(r);o.current=r;const a=(0,b.d4)($.UH),l=(0,k.A)(a);(0,v.useEffect)(()=>{const r=l||[];if(!(0,D.L)(a,r)&&!t){const t=a.filter(e=>!r.includes(e)),l=r.filter(e=>!a.includes(e)),c=new Set,d=new Set;t.forEach(e=>{const t=s.find(t=>t.id===e),{aggregationGroup:i,device:r}=t||{};if(i?.aggregate_members&&r){const e=i.lag_idx;if(n){const t=s.find(t=>{const s=t.aggregationGroup;return s?.aggregate_members&&s.lag_idx===e&&t.device.mac!==r.mac});t?.aggregationGroup?.aggregate_members&&c.add({...t.aggregationGroup,deviceMac:t.device.mac,unitId:t.unit_id})}c.add({...i,deviceMac:r.mac,unitId:t?.unit_id})}}),l.forEach(e=>{const t=s.find(t=>t.id===e),{aggregationGroup:i,device:r}=t||{};if(i?.aggregate_members&&r){const e=i.lag_idx;if(n){const t=s.find(t=>{const s=t.aggregationGroup;return s?.aggregate_members&&s.lag_idx===e&&t.device.mac!==r.mac});t?.aggregationGroup?.aggregate_members&&d.add({...t.aggregationGroup,deviceMac:t.device.mac,unitId:t.unit_id})}d.add({...i,deviceMac:r.mac,unitId:t?.unit_id})}});const u=Array.from(c).reduce((e,t)=>[...e,...t.aggregate_members.map(e=>(0,y.FS)(t.deviceMac,e,t.unitId))],[]),m=Array.from(d).reduce((e,t)=>[...e,...t.aggregate_members.map(e=>(0,y.FS)(t.deviceMac,e,t.unitId))],[]),A=U(t,i,o.current),p=U(l,i,o.current);let h=[...a].filter(e=>!m.includes(e)).filter(e=>!p.includes(e));h=new Array(...new Set([...h,...u,...A])),0===h.length&&1===a.length&&(h=[...a]),(0,D.L)(h,a)||e((0,F.Ao)(h))}},[a,l,e,t,n,s,i])})(),(0,j.A)(s||""),(()=>{const e=(0,b.wA)(),t=(0,b.d4)($.OA),s=(0,b.d4)($.Jm);(0,v.useEffect)(()=>{e((0,F.U)(t))},[e]),(0,v.useEffect)(()=>s?(e((0,F.gU)(!1)),()=>null):()=>{e((0,ns.p)(!1)),e((0,F.Ao)([]))},[e])})(),(()=>{const e=(0,b.wA)(),t=(0,b.d4)($.$X),s=(0,b.d4)($.wJ),n=(0,Ge.Ki)(s);(0,v.useEffect)(()=>{!n&&t&&e((0,F.JL)(!1))},[n,t,e])})(),((e,t)=>{const s=(0,b.wA)();(0,v.useEffect)(()=>{if(e.length>0&&t&&t!==is.Zt&&!e.find(e=>e.value===t)){const{deviceMacs:n}=(0,ts.Se)(t),i=e.find(e=>n.some(t=>e.includeDevices?.includes(t)));i?(s((0,F.U)(i.value)),s((0,F.gU)(!0))):s((0,F.U)(is.Zt))}},[e,t,s])})(r,i),(()=>{const e=(0,b.wA)(),t=(0,b.d4)(ht.WS),s=(0,b.d4)(ht.it),n=(0,b.d4)($.QR);(0,v.useEffect)(()=>{t&&s!==ie.H.PORTS&&!n&&e((0,F.Ao)([]))},[e,t,s,n])})();const u=(0,ts.Se)(i).type===ss.F7.STACKING_GROUP?t:e,m=u[0],p=(0,n.jsxs)(ge,{children:[m&&l?(0,n.jsxs)(A.A,{flexDirection:"column",children:[a?(0,n.jsx)(A.A,{minHeight:"34px"}):(0,n.jsx)(pe,{}),(0,n.jsxs)(A.A,{flexDirection:"column",gap:d.kc,children:[u.map((e,t)=>(0,n.jsx)(St,{deviceMac:e,isFirst:0===t,showDeviceName:u.length>1},e)),(0,n.jsx)(ur,{children:(0,n.jsxs)(mr,{children:[(0,n.jsx)("div",{children:a?null:(0,n.jsx)(lr,{})}),(0,n.jsx)(As.A,{isSingleLine:!0,deviceMac:m})]})})]})]}):null,o?(0,n.jsx)(rr,{}):null,a?(0,n.jsx)(ws,{}):null,a?null:(0,n.jsx)(Rs.uA,{children:(0,n.jsx)(ii,{})})]});return c&&e.length>0?(0,n.jsxs)(cr,{children:[(0,n.jsx)(es,{}),(0,n.jsx)(dr,{children:p})]}):p});var pr=s(798282),hr=s(692),xr=s(479086),_r=s(262356);const Er=()=>{const e=(0,b.wA)(),t=(0,b.d4)($.Mi),s=(0,b.d4)($.OA),n=(0,b.d4)($.N0),i=(0,b.d4)($.K6),r=(0,b.d4)((0,$.IS)([])),{setSelectedPortsAndAssignColors:o}=mn(),a=(0,v.useMemo)(()=>n?.[0],[n]),l=(0,v.useCallback)(()=>{e((0,F.JL)(!1)),e((0,F.IU)(!1)),e((0,F.E1)(!0)),e((0,F.Ao)([]))},[e]),c=(0,v.useCallback)(t=>{e((0,F.JL)(t)),t&&(1===i.length?e((0,F.is)([i[0]])):a&&e((0,F.is)([a.mac])))},[e,a,i]),d=(0,v.useCallback)(t=>{e((0,F.E1)(t))},[e]),u=(0,v.useCallback)(t=>{e((0,F.T6)(t)),t&&(e((0,F.Ao)([])),e((0,J.K5)()))},[e]),m=(0,v.useCallback)(l=>{const c=s===is.Zt,d=t[0];if(l&&c&&e((0,F.U)(d?.value)),e((0,F.IU)(l)),l){const e=c?n.find(e=>e.mac===d?.includeDevices?.[0]):1===i.length?n.find(e=>e.mac===i[0]):a;if(e){const t=r.filter(t=>void 0===e.unit_id?t.device.mac===e.mac:t.unit_id===e.unit_id).map(e=>e.id);o(t)}}l||e((0,F.Ao)([])),e((0,J.K5)())},[t,e,n,r,a,s,i,o]);return(0,v.useMemo)(()=>({handleReturnToPortsView:l,handleStatsChange:m,handleVlansChange:c,handleDeviceDiagramChange:d,handleTimeMachineChange:u}),[l,m,c,d,u])},gr=()=>{const{handleVlansChange:e}=Er(),t=(0,b.d4)($.$X),s=(0,v.useCallback)(t=>{e(t.target.checked)},[e]);return(0,n.jsx)(_r.A,{onChange:s,checked:t,full:!0,size:"small",children:(0,n.jsx)(H.A,{weight:"bold",size:"small",color:"text-1",children:(0,n.jsx)(ee.sA,{id:"PORTS_VLANS_DIAGRAM"})})})},Cr=()=>{const{handleTimeMachineChange:e}=Er(),t=(0,b.d4)($.Hz),s=(0,v.useCallback)(t=>{e(t.target.checked)},[e]);return(0,n.jsx)(_r.A,{onChange:s,checked:t,full:!0,size:"small",children:(0,n.jsx)(H.A,{weight:"bold",size:"small",color:"text-1",children:(0,n.jsx)(ee.sA,{id:"COMMON_TIME_MACHINE"})})})},Or=()=>{const{handleStatsChange:e}=Er(),t=(0,b.d4)($.QR),s=(0,v.useCallback)(t=>{e(t.target.checked)},[e]);return(0,n.jsx)(_r.A,{onChange:s,checked:t,full:!0,size:"small",children:(0,n.jsx)(H.A,{weight:"bold",size:"small",color:"text-1",children:(0,n.jsx)(ee.sA,{id:"COMMON_STATS"})})})},fr=()=>{const{handleDeviceDiagramChange:e}=Er(),t=(0,b.d4)($.kq),s=(0,v.useCallback)(t=>{e(t.target.checked)},[e]);return(0,n.jsx)(_r.A,{onChange:s,checked:t,full:!0,size:"small",children:(0,n.jsx)(H.A,{weight:"bold",size:"small",color:"text-1",children:(0,n.jsx)(ee.sA,{id:"PORTS_PORT_DIAGRAM"})})})},Nr=()=>{const e=(0,b.wA)(),t=(0,b.d4)($.WJ),s=(0,b.d4)($.OA),i=(0,v.useMemo)(()=>(0,ts.Se)(s).type===ss.F7.STACKING_GROUP,[s]),r=(0,v.useRef)(t);r.current=t,(0,v.useEffect)(()=>{i&&r.current&&e((0,F.sv)(!1))},[e,i]);const o=(0,v.useCallback)(t=>{e((0,F.sv)(t.target.checked))},[e]);return(0,n.jsx)(_r.A,{onChange:o,checked:t,full:!0,size:"small",children:(0,n.jsx)(H.A,{weight:"bold",size:"small",color:"text-1",children:(0,n.jsx)(ee.sA,{id:"PORTS_CONNECTED_DEVICES"})})})};var Sr=s(883571),Tr=s(14084),Ir=s(373616),Mr=s(501454),vr=s(444971),br=s(252445),jr=s(887101),Dr=s(716155);const Pr=(0,s(302405).w)(e=>(0,v.createElement)("svg",(0,Dr.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,v.createElement)("path",{d:"M13 8.25a.501.501 0 0 0-.332.126L10 10.75l-.02-.02-2.648-2.353a.5.5 0 1 0-.665.747l2.638 2.346a1.001 1.001 0 0 0 1.39 0l2.637-2.345A.5.5 0 0 0 13 8.25Z",fill:"currentColor",className:e.baseclassname}),(0,v.createElement)("path",{d:"M13 8a.743.743 0 0 0-.498.19L10 10.414 7.498 8.19a.75.75 0 0 0-.997 1.121l2.634 2.342c.234.224.54.347.865.347.325 0 .631-.123.865-.347l2.633-2.343A.75.75 0 0 0 13 8Z",fill:"currentColor",className:e.fillclassname}))),kr=$s.AH`
  display: none;
`,yr=(0,n.jsxs)(A.A,{alignItems:"center",children:[(0,n.jsx)(xe.A,{size:"medium",color:"inherit",children:(0,n.jsx)(ee.sA,{id:"COMMON_RESET_STATISTICS"})}),(0,n.jsx)(Pr,{})]}),wr=()=>{const{formatMessage:e}=(0,ee.tz)(),t=(0,b.d4)($.aq),{mac:s,port_table:i}=t||{},r=!!t&&(0,Fn.wk)((0,Fn.S9)(t)),[o,a]=(0,v.useState)([]),{resetMultiplePortStatistics:l}=(0,$n.X)(),c=(0,v.useCallback)(e=>{const t=e.map(e=>{const{portIdx:t,unitId:n}=(0,y.q9)(`${s}/${e}`),r=i?.find(e=>e.port_idx===t&&e.unit_id===n);return{port_idx:t,unit_id:n,value:(0,Ge.CQ)(r||{})}});l(s,t,r),a([])},[s,i,l,r]),d=(0,v.useMemo)(()=>(i||[]).map(e=>({label:e.name||"",value:(0,y.Z2)(e.port_idx,e.unit_id),id:(0,y.Z2)(e.port_idx,e.unit_id)})),[i]),u=(0,v.useCallback)(e=>{e&&a(d.map(({value:e})=>e))},[d]),m=(0,v.useCallback)((e,t)=>{a(e?[...o,t]:o.filter(e=>e!==t))},[o]),A=(0,v.useCallback)(e=>{a(e?d.map(({value:e})=>e):[])},[d]);return(0,n.jsx)(jr.A.Popover,{options:d,onSave:c,value:o,onOpenChange:u,searchPlaceholder:e({id:"COMMON_SEARCH"}),saveButtonText:e({id:"COMMON_ACTION_RESET"}),cancelButtonText:e({id:"COMMON_ACTION_CANCEL"}),onOptionCheck:m,onChangeSelectAll:A,saveButtonProps:{disabled:0===o.length},renderToggle:()=>(0,n.jsx)(jr.A.Trigger,{options:d,editSelectionsButtonStyle:{margin:0},editSelectionsButtonText:yr,chipContainerClassName:kr})})},Rr=({options:e})=>{const[t,s]=(0,v.useState)([]),i=(0,b.d4)(w.ID),r=(0,v.useRef)(i),{resetSwitchStatistics:o}=(0,$n.X)(),a=(0,v.useCallback)(t=>{const n=[];t.forEach(t=>{const s=e.find(e=>e.value===t);if(!s?.includeDevices)return;const{includeDevices:i}=s;i.forEach(e=>{const t=r.current?.find(t=>t.mac===e);if(!t)return;const{name:s}=t,i=(0,Fn.wk)((0,Fn.S9)(t));n.push(o(`${e}`,s,t.port_table||[],i))})}),Promise.all(n),s([])},[e,o]),{formatMessage:l}=(0,ee.tz)(),c=(0,v.useCallback)(t=>{t&&s(e.map(e=>e.value))},[e]),d=(0,v.useCallback)((e,n)=>{s(e?[...t,n]:t.filter(e=>e!==n))},[t]),u=(0,v.useCallback)(t=>{s(t?e.map(({value:e})=>e):[])},[e]);return(0,n.jsx)(jr.A.Popover,{options:e,onSave:a,onOpenChange:c,value:t,onOptionCheck:d,onChangeSelectAll:u,searchPlaceholder:l({id:"COMMON_SEARCH"}),saveButtonText:l({id:"COMMON_ACTION_RESET"}),cancelButtonText:l({id:"COMMON_ACTION_CANCEL"}),saveButtonProps:{disabled:0===t.length},renderToggle:()=>(0,n.jsx)(jr.A.Trigger,{options:e,value:t,onChange:a,editSelectionsButtonStyle:{margin:0},editSelectionsButtonText:yr,chipContainerClassName:kr})})},Lr=()=>(0,n.jsx)(jr.A.Trigger,{options:[],editSelectionsButtonStyle:{margin:0},editSelectionsButtonText:yr,chipContainerClassName:kr,buttonProps:{disabled:!0}}),$r=()=>{const e=(0,b.d4)($.tI),t=(0,b.d4)($.qq);if(e){const s=t.some(({includeDevices:t})=>t?.includes(e));return(0,n.jsx)(s?wr:Lr,{})}return 0===t.length?null:(0,n.jsx)(Rr,{options:t})},Fr=()=>{const e=(0,b.wA)(),{formatList:t}=(0,ee.tz)(),s=(0,b.d4)((0,$.IS)([])),i=(0,v.useMemo)(()=>{const e={};return s.forEach(t=>{const{mac:s}=t.device;e[s]||(e[s]=!0)}),Object.keys(e)},[s]),r=(0,b.d4)((0,w.nH)(i)),o=(0,v.useMemo)(()=>{const e=[];return r.forEach(({mac:t,name:n,locating_ports:i})=>{const r=s.filter(e=>e.device.mac===t&&i?.includes(e.port_idx)),o=new Map;r.forEach(e=>{const t=e.unit_id,s=o.get(t)||[];s.push(e.port_idx),o.set(t,s)}),o.forEach((s,i)=>{e.push({mac:t,name:n,locatingPorts:s,unit_id:i})})}),e.filter(({locatingPorts:e})=>e.length>0)},[r,s]),a=(0,v.useCallback)(()=>{const s=o.map(({mac:s,locatingPorts:n,name:i,unit_id:r})=>e((0,T.cj)({mac:s,name:i},n,!0,t(n),r)));Promise.all(s)},[e,t,o]);return o.length>0?(0,n.jsx)(wn.A,{type:"button",size:"medium",variant:"inline",onClick:a,children:(0,n.jsx)(ee.sA,{id:"DEVICE_ACTIONS_LOCATE_STOP"})}):null},Ur=()=>(0,n.jsxs)(A.A,{width:"100%",alignItems:"center",gap:d.kc,children:[(0,n.jsx)($r,{}),(0,n.jsx)(Fr,{})]});var Vr;!function(e){e.PORTS="ports"}(Vr||(Vr={}));const Gr=(0,v.memo)(()=>{const e=(0,b.wA)(),{areFiltersInitial:t,resetPortsFilters:s}=Yn(),i=(0,Ys.D)()===Zs.o.SFP_ANALYZER,r=(0,vr.A)({leftFilterPageId:a.g1.PORT_MANAGEMENT,leftFilterColumnsId:Vr.PORTS}),o=(0,v.useCallback)(()=>{e((0,br.GD)({leftFilterPageId:a.g1.PORT_MANAGEMENT,leftFilterColumnsId:Vr.PORTS}))},[e]);return(0,n.jsxs)(Ir.A,{children:[(0,n.jsx)(Ur,{}),(0,n.jsx)(Mr.A,{onClear:s,disabled:t}),i?null:(0,n.jsx)(Tr.A,{onPress:o,labelId:"COMMON_CUSTOMIZE_COLUMNS",disabled:r})]})});var Hr=s(498208),zr=s(436910),Wr=s(582588);const Br=[zr.E[nn.l.ONE_DAY],zr.E[nn.l.ONE_WEEK],zr.E[nn.l.ONE_MONTH]],Kr=()=>{const e=(0,b.wA)(),t=(0,b.d4)($.Ky),s=(0,v.useCallback)(t=>{e((0,F.m$)(t))},[e]),[i,r]=(0,v.useState)({startDate:t.startDate,endDate:t.endDate}),o=(0,v.useCallback)(({id:e})=>{const t=Br.find(t=>t.id===e);t?s({...t.getRange(new Date),preset:e}):i&&s({...i,preset:nn.j})},[i,s]),a=(0,v.useMemo)(()=>Br.map(({id:e,message:t,messageValues:s})=>({id:e,label:(0,n.jsx)(ee.sA,{id:t,values:s})})).concat({id:nn.j,label:(0,n.jsx)(Hr.A,{})}),[]),l=(0,v.useCallback)(e=>{r(e),s({...e,preset:nn.j})},[s]);return(0,n.jsx)(Wr.A,{presets:a,selectedPreset:t.preset,range:i,onSelectTab:o,onSelectCustomRange:l,showCalendar:t.preset===nn.j})};var Yr=s(530110);const Zr=(0,v.memo)(()=>{const e=(0,b.d4)($.cW),t=(0,b.d4)($.yZ),s=(0,v.useMemo)(()=>Object.values(xn.YH).filter(s=>!(!e&&xn.lj.includes(s)||!t&&xn.v0.includes(s))),[e,t]);return(0,n.jsx)(Yr.A,{leftFilterPageId:a.g1.PORT_MANAGEMENT,columns:s,columnLabels:xn.Fi,tableType:Vs.l.PORTS})});var qr=s(19751),Xr=s(115238),Qr=s(233288),Jr=s(894357),eo=s(795186);const to={[ss.y5.PARTICIPANT]:"COMMON_PARTICIPANT",[ss.y5.EDGE]:"COMMON_DEVICE_EDGE",[ss.y5.BLOCKED]:"COMMON_BLOCKED",[ss.y5.DISABLED]:"COMMON_DISABLED"},so={[ss.y5.PARTICIPANT]:1,[ss.y5.EDGE]:2,[ss.y5.BLOCKED]:3,[ss.y5.DISABLED]:4},no=(0,v.memo)(()=>{const e=(0,b.wA)(),{formatMessage:t,formatNumber:s}=(0,ee.tz)(),i=(0,b.d4)(e=>(0,Jr.e)(e).stp),r=(0,b.d4)($.Sh),o=(0,v.useMemo)(()=>Object.values(i),[i]),a=(0,v.useMemo)(()=>o.map(e=>e[eo.x.ID]),[o]),l=(0,v.useCallback)(t=>{e((0,F.I9)(Array.from(t||[])))},[e]),c=(0,v.useCallback)(t=>{e((0,F.I9)(Array.from(t||[])))},[e]),d=(0,v.useCallback)(()=>{e((0,F.I9)([]))},[e]),u=(0,v.useMemo)(()=>o.sort((e,t)=>so[e[eo.x.ID]]-so[t[eo.x.ID]]).map(e=>({id:e[eo.x.ID],type:"CHECKBOX",title:`${t({id:to[e[eo.x.ID]]})} (${s(e[eo.x.COUNT])})`,children:[]})),[o,t,s]),m=(0,v.useMemo)(()=>r.length===o.length?"all":new Set(r),[r,o.length]),A=(0,v.useMemo)(()=>new Set(o.filter(e=>!r.includes(e[eo.x.ID])&&!i[e[eo.x.ID]][eo.x.COUNT]).map(e=>e[eo.x.ID])),[o,i,r]);return(0,Xr.A)(r,a,F.I9),o.length?(0,n.jsx)(Qr.A,{label:(0,n.jsx)(ee.sA,{id:"COMMON_STP"}),isSingleColumn:!0,children:(0,n.jsx)(qr.A,{items:u,selectedKeys:m,disabledKeys:A,onSelectionChange:l,onSelectAll:c,onDeselectAll:d,shouldAlwaysUseSimplifiedPicker:!0})}):null}),io={[ss.fA.AVAILABLE]:"COMMON_NOT_CONNECTED",[ss.fA.IN_USE]:"COMMON_IN_USE",[ss.fA.CRITICAL]:"COMMON_CRITICAL",[ss.fA.WARNING]:"COMMON_WARNING"},ro={[ss.fA.IN_USE]:1,[ss.fA.AVAILABLE]:2,[ss.fA.CRITICAL]:3,[ss.fA.WARNING]:4},oo=(0,v.memo)(()=>{const e=(0,b.wA)(),{formatMessage:t,formatNumber:s}=(0,ee.tz)(),i=(0,b.d4)(e=>(0,Jr.e)(e).status),r=(0,b.d4)($.ji),o=(0,v.useMemo)(()=>Object.values(i),[i]),a=(0,v.useMemo)(()=>o.map(e=>e[eo.x.ID]),[o]),l=(0,v.useCallback)(t=>{e((0,F.HF)(Array.from(t||[])))},[e]),c=(0,v.useCallback)(t=>{e((0,F.HF)(Array.from(t||[])))},[e]),d=(0,v.useCallback)(()=>{e((0,F.HF)([]))},[e]),u=(0,v.useMemo)(()=>o.sort((e,t)=>ro[e[eo.x.ID]]-ro[t[eo.x.ID]]).map(e=>({id:e[eo.x.ID],type:"CHECKBOX",title:`${t({id:io[e[eo.x.ID]]})} (${s(e[eo.x.COUNT])})`,children:[]})),[o,t,s]),m=(0,v.useMemo)(()=>r.length===o.length?"all":new Set(r),[r,o.length]),A=(0,v.useMemo)(()=>new Set(o.filter(e=>!r.includes(e[eo.x.ID])&&!i[e[eo.x.ID]][eo.x.COUNT]).map(e=>e[eo.x.ID])),[o,i,r]);return(0,Xr.A)(r,a,F.HF),o.length?(0,n.jsx)(Qr.A,{label:(0,n.jsx)(ee.sA,{id:"COMMON_STATUS"}),isSingleColumn:!0,children:(0,n.jsx)(qr.A,{items:u,selectedKeys:m,disabledKeys:A,onSelectionChange:l,onSelectAll:c,onDeselectAll:d,shouldAlwaysUseSimplifiedPicker:!0})}):null}),ao={[ss.rW.NONE]:"COMMON_NONE",[ss.rW.POE]:"COMMON_DEVICE_POE_MODE_POE",[ss.rW.POE_PLUS]:"COMMON_DEVICE_POE_MODE_POE_PLUS",[ss.rW.POE_PLUS_PLUS]:"COMMON_DEVICE_POE_MODE_POE_PLUS_PLUS",[ss.rW.POE_PLUS_PLUS_PLUS]:"COMMON_DEVICE_POE_MODE_POE_PLUS_PLUS_PLUS",[ss.rW.POE_PASSTHROUGH]:"COMMON_DEVICE_POE_MODE_PASSTHROUGH",[ss.rW.POE_PASSIVE_24V]:"COMMON_DEVICE_POE_MODE_PASSIVE"},lo={[ss.rW.NONE]:1,[ss.rW.POE]:2,[ss.rW.POE_PLUS]:3,[ss.rW.POE_PLUS_PLUS]:4,[ss.rW.POE_PLUS_PLUS_PLUS]:5,[ss.rW.POE_PASSTHROUGH]:5,[ss.rW.POE_PASSIVE_24V]:6},co=(0,v.memo)(()=>{const e=(0,b.wA)(),{formatNumber:t,formatMessage:s}=(0,ee.tz)(),i=(0,b.d4)(e=>(0,Jr.e)(e).poe),r=(0,b.d4)($.px),o=(0,v.useMemo)(()=>Object.values(i),[i]),a=(0,v.useMemo)(()=>o.map(e=>e[eo.x.ID]),[o]),l=(0,v.useCallback)(t=>{e((0,F.PJ)(Array.from(t||[])))},[e]),c=(0,v.useCallback)(t=>{e((0,F.PJ)(Array.from(t||[])))},[e]),d=(0,v.useCallback)(()=>{e((0,F.PJ)([]))},[e]),u=(0,v.useMemo)(()=>o.sort((e,t)=>lo[e[eo.x.ID]]-lo[t[eo.x.ID]]).map(e=>({id:e[eo.x.ID],type:"CHECKBOX",title:`${s({id:ao[e[eo.x.ID]]})} (${t(e[eo.x.COUNT])})`,children:[]})),[o,t,s]),m=(0,v.useMemo)(()=>r.length===o.length?"all":new Set(r),[r,o.length]),A=(0,v.useMemo)(()=>new Set(o.filter(e=>!r.includes(e[eo.x.ID])&&!i[e[eo.x.ID]][eo.x.COUNT]).map(e=>e[eo.x.ID])),[o,i,r]);return(0,Xr.A)(r,a,F.PJ),o.length?(0,n.jsx)(Qr.A,{label:(0,n.jsx)(ee.sA,{id:"COMMON_DEVICE_POE_MODE_POE"}),isSingleColumn:!0,children:(0,n.jsx)(qr.A,{items:u,selectedKeys:m,disabledKeys:A,onSelectionChange:l,onSelectAll:c,shouldAlwaysUseSimplifiedPicker:!0,onDeselectAll:d})}):null});var uo=s(300842),mo=s(561547);const Ao=(0,v.memo)(()=>{const e=(0,b.wA)(),{formatNumber:t,formatMessage:s}=(0,ee.tz)(),i=(0,b.d4)(e=>(0,Jr.e)(e).nativeVlan),r=(0,b.d4)($.l9),o=(0,v.useMemo)(()=>Object.values(i),[i]),a=(0,v.useMemo)(()=>o.map(e=>e[eo.x.ID]),[o]),l=(0,v.useCallback)(t=>{e((0,F.t4)(Array.from(t||[])))},[e]),c=(0,v.useCallback)(t=>{e((0,F.t4)(Array.from(t||[])))},[e]),d=(0,v.useCallback)(()=>{e((0,F.t4)([]))},[e]),u=(0,v.useMemo)(()=>o.sort((e,t)=>e[eo.x.ID]===Jr.C?1:t[eo.x.ID]===Jr.C?-1:(e[eo.x.VLAN_ID]??1)-(t[eo.x.VLAN_ID]??1)).map(e=>{const n=e[eo.x.NAME],i=n===Jr.C?s({id:"COMMON_NONE"}):n;return{id:e[eo.x.ID],type:"CHECKBOX",title:`${i} (${t(e[eo.x.COUNT])})`,children:[]}}),[o,t,s]),m=(0,v.useMemo)(()=>r.length===o.length?"all":new Set(r),[r,o.length]),A=(0,v.useMemo)(()=>new Set(o.filter(e=>!r.includes(e[eo.x.ID])&&!i[e[eo.x.ID]][eo.x.COUNT]).map(e=>e[eo.x.ID])),[o,i,r]);return(0,Xr.A)(r,a,F.t4),o.length?(0,n.jsx)(uo.A,{id:mo.R.PORTS_NATIVE_VLAN,label:(0,n.jsx)(ee.sA,{id:"COMMON_PORTS_NATIVE_VLAN"}),children:(0,n.jsx)(qr.A,{id:mo.R.PORTS_NATIVE_VLAN,items:u,selectedKeys:m,disabledKeys:A,onSelectionChange:l,onSelectAll:c,onDeselectAll:d})}):null});var po=s(108825),ho=s(951061),xo=s(728091),_o=s(514692);const Eo=()=>{const e=(0,b.wA)(),t=(0,b.d4)($.uC),s=(0,_o.xO)(t)||(0,_o.fX)(),[i,r]=(0,v.useState)([s.min,s.max]),o=(0,v.useMemo)(()=>(0,ho.A)(t=>{const s=(0,_o.N1)({min:t[0],max:t[1]});e((0,F.uN)(s))},500),[e]);(0,v.useEffect)(()=>{r([s.min,s.max])},[s.min,s.max]);const a=(0,v.useCallback)(e=>{Array.isArray(e)&&2===e.length&&(r([e[0],e[1]]),o([e[0],e[1]]))},[o]);(0,v.useEffect)(()=>()=>{o.cancel()},[o]);const l=(0,v.useMemo)(()=>(0,n.jsx)(ee.sA,{id:"COMMON_GENERIC_FROM_TO",values:{from:i[0],to:i[1]}}),[i]);return(0,n.jsx)(uo.A,{label:(0,n.jsx)(ee.sA,{id:"PORTS_AI_ANOMALY_SCORE"}),children:(0,n.jsx)(A.A,{flex:1,width:"100%",paddingLeft:d.kc,children:(0,n.jsx)(xo.A,{defaultValue:[s.min,s.max],value:i,onChange:a,caption:0,captionEnd:100,labelEnd:l,style:{width:"100%"}})})})},go=(0,v.memo)(()=>{const e=(0,b.wA)(),{formatMessage:t}=(0,ee.tz)(),s=(0,b.d4)($.N0),i=(0,b.d4)($.K6),r=(0,b.d4)($.OA),o=(0,b.d4)($.$X),a=(0,b.d4)($.UH),l=(0,ts.Se)(r).type===ss.F7.STACKING_GROUP?"COMMON_UNITS":"COMMON_SWITCHES",c=(0,v.useMemo)(()=>s.map(e=>{const s=void 0!==e.unit_id?t({id:"COMMON_UNIT_N"},{n:e.unit_id}):(0,_e.Q)(e),n=e.isOffline?` (${t({id:"COMMON_OFFLINE"})})`:"";return{id:e.mac,type:"CHECKBOX",title:`${s}${n}`,checkboxProps:{isTruncated:!0},children:[]}}),[s,t]),d=(0,v.useMemo)(()=>new Set(i),[i]),u=(0,v.useCallback)(t=>{const n=Array.from(t||[]);if(!(o&&0===n.length&&i.length>0)&&(e((0,F.is)(n)),0!==n.length)){const t=new Set(s.filter(e=>n.includes(e.mac)&&void 0!==e.unit_id).map(e=>e.unit_id)),i=a.filter(e=>{const{deviceMac:s,unitId:i}=(0,y.q9)(e);return t.size>0?t.has(i):n.includes(s)});i.length!==a.length&&e((0,F.Ao)(i))}},[s,e,o,i.length,a]),m=(0,v.useCallback)(t=>{e((0,F.is)(Array.from(t||[])))},[e]),A=(0,v.useCallback)(()=>{o&&i.length>0||e((0,F.is)([]))},[e,o,i]);return s.length>1?(0,n.jsx)(uo.A,{id:mo.R.PORTS_DEVICES,label:(0,n.jsx)(ee.sA,{id:l}),children:(0,n.jsx)(qr.A,{id:mo.R.PORTS_DEVICES,items:c,selectedKeys:d,onSelectionChange:u,onSelectAll:m,onDeselectAll:A,shouldAlwaysUseSimplifiedPicker:!0,selectionMode:o?"single":"multiple"})}):null});var Co=s(751271),Oo=s(711892),fo=s(284989),No=s(237887),So=s(754237),To=s(974390),Io=s(885404),Mo=s(87449),vo=s(658519),bo=s(70232),jo=s(365236),Do=s(648576),Po=s(436890),ko=s(451336),yo=s(562896),wo=s(159911),Ro=s(643022);const Lo=(0,i.A)("div",(0,q.A)("connectionStatus"))`
  height: ${({connectionStatus:e})=>e===yo.v.OFFLINE?"unset":d.S2};
  flex-wrap: ${({connectionStatus:e})=>e===yo.v.OFFLINE?"wrap":"unset"};
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: ${({connectionStatus:e})=>e===yo.v.OFFLINE?"unset":d.YC};
  * {
    line-height: ${d.Er} !important;
    font-size: 13px !important;
    flex-flow: nowrap !important;
    }
  {/* Target "Connected To" */}
  div > span {
    color: ${({theme:{themeName:e}})=>G.Ay[`desktop-color-neutral-10-${e}`]} !important;
  }
  {/* Target flex container */}
  & > div {
    justify-content: space-between;
    width: ${({connectionStatus:e})=>e===yo.v.OFFLINE?"unset":"100%"};
    min-height: 24px;
  }
`,$o=({device:e,stackingGroupModelName:t})=>{const s=(0,b.d4)($.gR),i=(0,b.d4)($.w2),r=(0,b.d4)($.OA),o=(0,b.wA)(),a=t||(0,_e.Lm)(e?.model||""),{type:l}=(0,ts.Se)(r),c=l===ss.F7.MC_LAG&&i.length>1,u=(0,v.useCallback)(()=>{if(s)return void o((0,J.XP)({type:ie.H.STACKING,id:s}));const e=i[0];e&&o((0,J.XP)({type:ie.H.DEVICE,id:e,tab:X.BC.SETTINGS}))},[s,i,o]);return e&&e.model?(0,n.jsxs)(A.A,{alignItems:"center",gap:d.kc,height:d.S2,justifyContent:"space-between",children:[(0,n.jsx)(H.A,{size:"medium",color:"text-2",children:(0,n.jsx)(ee.sA,{id:"COMMON_MODEL"})}),(0,n.jsxs)(A.A,{alignItems:"center",gap:d.YC,children:[(0,n.jsx)(H.A,{size:"medium",color:"text-3",children:a}),(0,n.jsx)(_s.A,{description:c?(0,n.jsx)(ee.sA,{id:"PORTS_FIRST_SELECT_SWITCH"}):null,children:(0,n.jsx)(bo.A,{size:"small",variant:"neutral",onPress:u,isDisabled:c,...Y.A.addDataTestId(Y.A.TestId.SIDE_PANEL_TRIGGER),children:(0,n.jsx)(vo.A,{})})})]})]}):null},Fo=({firstSelectedDeviceMac:e})=>{const t=(0,b.d4)((0,w.tG)(e)),s=(0,b.d4)($._h),{onUpgradeDevice:i,showButton:r,isPending:o,hasFlashStorageWarning:a,deviceName:l,fromVersion:c,toVersion:u}=(0,jo.S)(t),m=r&&1===s.length;if(!t.displayable_version)return null;const p=(0,Mo.coerce)(t.upgrade_to_firmware)?.version;return(0,n.jsxs)(A.A,{gap:d.kc,alignItems:"center",justifyContent:"space-between",height:d.S2,children:[(0,n.jsx)(H.A,{size:"medium",color:"text-2",children:(0,n.jsx)(ee.sA,{id:"COMMON_VERSION"})}),(0,n.jsxs)(A.A,{gap:d.kc,children:[(0,n.jsx)(H.A,{size:"medium",color:"text-3",children:t.displayable_version}),m?(0,n.jsx)(Po.A,{hasFlashStorageWarning:a,deviceName:l,fromVersion:c,toVersion:u,onConfirm:i,trigger:(0,n.jsx)("div",{children:(0,n.jsx)(Ro.A,{fromVersion:t.displayable_version,toVersion:t.upgrade_to_firmware,model:t.model,children:(0,n.jsx)(Do.Ay,{variant:"inline",disabled:o,size:"medium",children:(0,n.jsx)(ee.sA,{id:"COMMON_ACTION_UPDATE_TO",values:{version:p}})})})})}):null]})]})},Uo=({firstSelectedDeviceMac:e})=>{const t=(0,b.d4)((0,w.tG)(e)),{uplink:s}=t,i=(0,v.useMemo)(()=>(0,wo.H)((0,Fn.S9)(t),s?.type),[t,s?.type]),r=Boolean(t.wan_networkgroup)||Boolean(s?.uplink_device_name),o=(0,Fn.YP)(t);return r&&o?(0,n.jsx)(Lo,{connectionStatus:i,children:(0,n.jsx)(ko.A,{activeItem:{...t,deviceState:(0,Fn.S9)(t)},connectionStatus:i,uplinkNameMaxWidth:i===yo.v.CONNECTED?142:116},t.mac)}):null},Vo=()=>{const e=(0,b.d4)($.IY),t=(0,b.d4)($.w2),s=(0,b.d4)($.OA),i=t[0],r=(0,b.d4)($._h),o=(0,v.useMemo)(()=>{const{type:e}=(0,ts.Se)(s);return e},[s]),a=(0,v.useMemo)(()=>o===ss.F7.MC_LAG,[o]),l=(0,v.useMemo)(()=>o===ss.F7.STACKING_GROUP,[o]),c=(0,b.d4)((0,v.useMemo)(()=>(0,w.nH)(t),[t])),u=(0,b.d4)((0,v.useMemo)(()=>(0,w.nH)(r),[r])),{formatMessage:m}=(0,ee.tz)(),p=m({id:"PORTS_STACKING_MODEL_POE_SUFFIX"}),h=(0,v.useMemo)(()=>l&&0!==u.length?((e,t)=>{if(0===e.length)return null;const s=e.map(e=>(0,_e.Lm)(e.model)),n=Array.from(new Set(s));if(1===n.length)return n[0];const i=n.some(e=>e.toLowerCase().includes("poe")),r=n.some(e=>!e.toLowerCase().includes("poe"));if(i&&r){const e=n.find(e=>!e.toLowerCase().includes("poe"));if(e)return`${e} ${t}`}return n[0]})(u,p):null,[l,u,p]),x=(0,v.useMemo)(()=>a&&c[0]?c[0]:l&&u.length>0&&u[0]?u[0]:e?.device?e.device:null,[a,l,c,u,e]);return(0,n.jsxs)(A.A,{flexDirection:"column",paddingLeft:d.kc,paddingRight:d.kc,gap:d.kc,children:[(0,n.jsxs)(A.A,{flexDirection:"column",children:[(0,n.jsx)($o,{device:x,stackingGroupModelName:h}),(0,n.jsx)(Fo,{firstSelectedDeviceMac:i}),(0,n.jsx)(Uo,{firstSelectedDeviceMac:i})]}),(0,n.jsx)(pr.A,{orientation:"horizontal"})]})},Go=(0,i.A)(No.A)`
  z-index: ${Co.Ay["z-index-side-panel"]-1};
`,Ho=(0,i.A)("div",(0,q.A)("isOffline","themeName"))`
  ${({isOffline:e,themeName:t})=>e?`\n    color: ${Co.Ay.motifs[t].text03} !important;\n  `:""}
`,zo=()=>{const e=(0,b.wA)(),t=(0,b.d4)($.OA),s=(0,b.d4)($.Mi),i=(0,b.d4)($.$X),r=(0,b.d4)($.QR),o=(0,b.d4)($.fD),a=(0,b.d4)(w.Kh),l=(0,v.useRef)(a);l.current=a;const{setSelectedPortsAndAssignColors:c}=mn(),{formatMessage:u}=(0,ee.tz)(),{themeName:m}=(0,K.u)(),p=(0,v.useCallback)(t=>{if(e((0,F.Ao)([])),e((0,F.U)(t)),e((0,F.E1)(t!==is.Zt)),(0,ts.Se)(t).type===ss.F7.STACKING_GROUP&&e((0,F.sv)(!1)),t===is.Zt)return e((0,F.IU)(!1)),void e((0,F.JL)(!1));if(r){const{deviceMacs:e,id:n,type:i}=(0,ts.Se)(t),r=s.find(e=>e.value===t),a=new Set(r?.includeDevices?.length?r.includeDevices:e),d=i===ss.F7.STACKING_GROUP?[...(0,L.Sq)(n,l.current).runtimeMembersByUnitId.values()].filter(e=>a.has(e.mac)).map(e=>e.unit_id):void 0,u=d?.length?new Set(d):void 0,m=o.filter(e=>u?u.has(e.unit_id||0):a.has(e.device.mac)).map(e=>e.id);m.length>0&&c(m)}if(i){const n=s.find(e=>e.value===t);if(n?.includeDevices?.length)return void e((0,F.is)([n?.includeDevices?.[0]]))}e((0,F.is)([]))},[o,s,e,r,i,c]),h=[{value:(0,ts.HN)(ss.F7.ALL,[]),label:u({id:"COMMON_ALL_PORTS"}),image:(0,n.jsx)(fo.A,{})},...s.map(e=>({value:e.value,label:e.label+(e.isOffline?` (${u({id:"COMMON_OFFLINE"})})`:""),isOffline:e.isOffline,image:e.hasError?(0,n.jsx)(z.A,{size:"original",variant:"fill",color:G.Ay[`desktop-color-red-06-${m}`],fill:G.Ay[`desktop-color-neutral-00-${m}`]}):e.hasWarning?(0,n.jsx)(z.A,{size:"original",variant:"fill",color:G.Ay[`desktop-color-orange-06-${m}`],fill:G.Ay[`desktop-color-neutral-00-${m}`]}):e.groupType===ss.F7.STACKING_GROUP?(0,n.jsx)(Io.A,{size:is.NK}):(0,n.jsx)(To.A,{width:is.NK,height:is.NK,model:e.deviceProperties?.model})}))],x=(0,v.useCallback)(e=>(0,n.jsx)(Ho,{isOffline:e.option.isOffline??!1,themeName:m,children:(0,n.jsx)(Oo.q,{...e})}),[m]),_=(0,v.useCallback)(e=>{p(e.value)},[p]);return(0,n.jsxs)(A.A,{flexDirection:"column",gap:d.kc,children:[(0,n.jsx)(Go,{variant:"secondary",searchable:!0,portal:!0,width:"full",onChange:_,options:h,renderOption:x,value:t,maxHeight:So.W}),t!==is.Zt?(0,n.jsx)(Vo,{}):null]})},Wo=(0,v.memo)(()=>{const e=(0,Ys.D)()===Zs.o.SFP_ANALYZER,t=(0,b.d4)($.QR),s=(0,b.d4)($.OA)===is.Zt,i=(0,b.d4)($.$X),r=(0,b.d4)($.wJ),o=(0,b.d4)($.kq),l=(0,Ge.Ki)(r),c=!i,u=!s&&!e,m=!s&&!e&&l,p=!e,h=!s,x=u||p||m||h;return(0,n.jsx)(hr.A,{columns:e?null:(0,n.jsx)(Zr,{}),leftFilterColumnsId:Vr.PORTS,footer:(0,n.jsx)(Gr,{leftFilterPageId:a.g1.PORT_MANAGEMENT}),leftFilterPageId:a.g1.PORT_MANAGEMENT,tabs:(0,n.jsx)(Sr.Ay,{}),children:(0,n.jsxs)(A.A,{flexDirection:"column",children:[(0,n.jsxs)(xr.A,{children:[e?null:(0,n.jsx)(zo,{}),e?null:(0,n.jsx)(go,{}),x?(0,n.jsxs)(A.A,{flexDirection:"column",gap:d.kc,padding:d.kc,children:[(0,n.jsxs)(A.A,{flexDirection:"column",children:[u?(0,n.jsx)(Cr,{}):null,h?(0,n.jsx)(fr,{}):null,h&&o?(0,n.jsx)(Nr,{}):null,m?(0,n.jsx)(gr,{}):null,p?(0,n.jsx)(Or,{}):null]}),(0,n.jsx)(pr.A,{orientation:"horizontal"})]}):null,c?(0,n.jsx)(Eo,{}):null,t?(0,n.jsx)(Kr,{}):null]}),c?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(xr.A,{children:(0,n.jsx)(no,{})}),e?null:(0,n.jsx)(Ao,{}),(0,n.jsxs)(xr.A,{children:[(0,n.jsx)(oo,{}),e?null:(0,n.jsx)(co,{}),(0,n.jsx)(po.Ay,{})]})]}):null]})})}),Bo=(0,i.A)(A.A)`
  flex-direction: column;
  gap: ${d.kc};
  position: relative;
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  padding: ${d.xO} 0 0 ${d.Ln};
`,Ko=()=>((()=>{const e=(0,b.wA)(),t=(0,Ys.D)(),s=t===Zs.o.SFP_ANALYZER,n=(0,v.useRef)(t);(0,v.useEffect)(()=>{e((0,F.EZ)(s)),s&&e((0,F.U)(is.Zt)),n.current!==t&&(e((0,F.Ff)({...is.Fs})),e((0,F.Ao)([])),e((0,F.JL)(!1)),e((0,F.IU)(!1)),e((0,F.T6)(!1)),n.current=t)},[e,s,t])})(),(0,c.A)([(0,l.Zi)(o.B.PORTS),(0,l.Zi)(o.B.DEVICES),(0,l.Zi)(o.B.SETTINGS),(0,f.J4)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}),(0,_.d)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}),(0,I.$3)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}),(0,x.hh)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}),(0,h.F)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}),(0,T.Uc)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}),(0,E.Uc)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}),(0,C.kE)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}),(0,O.Sk)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}),(0,N.s)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}),(0,S.N)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}),(0,g.G)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}),(0,M.ot)(void 0,{crudCacheStrategy:{type:r.e.CACHE}})],(0,n.jsx)(u.A,{mainPanelProps:{gap:d.Ln},children:(0,n.jsx)(m.A,{leftFilterPageId:a.g1.PORT_MANAGEMENT,content:(0,n.jsx)(Wo,{}),overflow:"hidden",paddingBottom:d.Ln,children:(0,n.jsx)(Bo,{children:(0,n.jsx)(Ar,{})})})}),{trackingName:p.VO.PORTS}))},170427(e,t,s){s.d(t,{A:()=>m});var n=s(274934),i=s(179102),r=s(247816),o=s(309130),a=s(304151),l=s(100978);const c=(0,r.A)(i.A)`
  white-space: nowrap;
`,d=(0,r.A)(l.A)`
  align-items: center;
`,u=(0,r.A)(l.A)`
  width: ${o.Ln};
  justify-content: flex-start;
`,m=({indicator:e,description:t,isSingleLine:s,tooltipDescription:i})=>(0,n.jsxs)(d,{marginRight:s?o.kc:0,children:[(0,n.jsx)(u,{children:e}),(0,n.jsx)(c,{size:"small",color:"text-3",children:t}),i?(0,n.jsx)(a.A,{description:i}):null]})},883717(e,t,s){s.d(t,{A:()=>k,T:()=>D});var n=s(274934),i=s(602086),r=s(977872),o=s(505817),a=s(573106),l=s(593330),c=s(892658),d=s(882316),u=s(29834),m=s(232421),A=s(247816),p=s(263705),h=s(306212),x=s(442175),_=s(309130),E=s(100978),g=s(470070),C=s(940229),O=s(576024),f=s(469890),N=s(956978),S=s(754924),T=s(940563),I=s(977782),M=s(291508),v=s(170427);const b=(0,A.A)("div")`
  display: grid;
  grid-template-columns: repeat(3, minmax(min-content, 1fr));
  gap: ${_.YC};
  margin-top: ${_.kc};
`,j=(0,A.A)(E.A)`
  gap: ${_.kc};
  row-gap: ${_.YC};
  flex-wrap: wrap;
`,D=(0,A.A)(h.A,(0,M.A)("borderColor"))`
  flex-shrink: 0;
  border-radius: 0;
  border: ${({borderColor:e,theme:{themeName:t}})=>e&&`1px solid ${(0,C.oX)(e,t)}`};
`,P=(e,t)=>e===I.s.PASSTHROUGH?1:e===I.s.PASSIVE?2:e===I.s.POE?3:e===I.s.POE_PLUS?4:e===I.s.POE_PLUS_PLUS?5:6,k=({deviceMac:e,isSingleLine:t=!1,hidePoe:s=!1,hideDisabled:A=!1,hideDisconnected:h=!1,displayedSpeedList:_})=>{const{themeName:E}=(0,p.u)(),M=(0,r.d4)((0,i.useMemo)(()=>(0,S.tG)(e),[e])),{type:k,model:y}=M;return(0,i.useMemo)(()=>{const e=(0,O.MB)(M),i=(0,N.NuO)(M),r=(0,f._L)(M,i),p=A||(0,N.m_j)(M)||(0,N.Syn)(M)||(0,N.Fp0)(M),S=t?j:b,y=Array.from(r).sort(P).map(e=>{switch(!0){case e===I.s.POE_PLUS_PLUS_PLUS:return(0,n.jsx)(v.A,{description:(0,n.jsx)(g.sA,{id:"COMMON_DEVICE_POE_MODE_POE_PLUS_PLUS_PLUS"}),indicator:(0,n.jsx)(a.A,{color:o.Ay[`desktop-color-neutral-08-${E}`]})},e);case e===I.s.POE_PLUS_PLUS:return(0,n.jsx)(v.A,{description:(0,n.jsx)(g.sA,{id:"COMMON_DEVICE_POE_MODE_POE_PLUS_PLUS"}),indicator:(0,n.jsx)(l.A,{color:o.Ay[`desktop-color-neutral-08-${E}`]})},e);case e===I.s.POE_PLUS:return(0,n.jsx)(v.A,{description:(0,n.jsx)(g.sA,{id:"COMMON_DEVICE_POE_MODE_POE_PLUS"}),indicator:(0,n.jsx)(c.A,{color:o.Ay[`desktop-color-neutral-08-${E}`]})},e);case e===I.s.PASSTHROUGH||e===I.s.PASSIVE||e===I.s.POE:return(0,n.jsx)(v.A,{description:(0,n.jsx)(g.sA,{id:e===I.s.PASSIVE?"COMMON_DEVICE_POE_MODE_PASSIVE":"COMMON_DEVICE_POE_MODE_POE"}),indicator:(0,n.jsx)(d.A,{color:o.Ay[`desktop-color-neutral-08-${E}`]})},e);default:return null}});return(0,n.jsxs)(S,{children:[e.filter(e=>!_||_.includes(e)).sort((e,t)=>e-t).map(e=>(0,n.jsx)(v.A,{description:(0,x.ir)(e),indicator:(0,n.jsx)(D,{color:(0,C.oX)((T.A[e]??T.A.DEFAULT).background,E)})},e)),h?null:(0,n.jsx)(v.A,{description:(0,n.jsx)(g.sA,{id:"COMMON_DISCONNECTED"}),indicator:(0,n.jsx)(D,{color:(0,C.oX)(T.A.DEFAULT.background,E)})},"disconnected"),p?null:(0,n.jsx)(v.A,{description:(0,n.jsx)(g.sA,{id:"COMMON_DISABLED"}),indicator:(0,n.jsx)(D,{color:"transparent",borderColor:T.A.DEFAULT.background}),isSingleLine:t},"disabled"),s?null:y,!(0,N.Tbi)({type:k})||(0,N.Syn)(M)||(0,N.Fp0)(M)?null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v.A,{description:(0,n.jsx)(g.sA,{id:"COMMON_AGGREGATING"}),indicator:(0,n.jsx)(m.A,{color:o.Ay[`desktop-color-neutral-08-${E}`]})},"aggregating"),(0,n.jsx)(v.A,{indicator:(0,n.jsx)(u.A,{}),description:(0,n.jsx)(g.sA,{id:"DEVICE_PORT_STATE_MIRROR"}),tooltipDescription:(0,n.jsx)(g.sA,{id:"DEVICE_PORT_STATE_MIRROR_TOOLTIP"})},"mirror")]})]})},[y,s,A,_,E])}},45523(e,t,s){s.d(t,{$:()=>r,k:()=>i});var n=s(16845);const i={[n.vL.DISABLED]:{background:"neutral-01",border:"neutral-04",text:"neutral-07"},[n.vL.NATIVE]:{background:"neutral-01",border:"neutral-04",text:"neutral-07"},[n.vL.TAGGED]:{background:"green-06",border:"green-06",text:"neutral-00"},[n.vL.BLOCKED]:{background:"neutral-05",border:"neutral-05",text:"neutral-00"},[n.vL.WAN]:{background:"neutral-00",border:"neutral-04",text:"neutral-07"},[n.vL.UNTAGGED_NATIVE]:{background:"ublue-04",border:"ublue-04",text:"neutral-00"}},r="-"},16845(e,t,s){var n,i,r;s.d(t,{at:()=>i,dv:()=>n,vL:()=>r}),function(e){e.DISPLAYED_VLAN_ID="nativeVlanId",e.IS_WAN_PORT="isWanPort",e.ADJUSTED_PORT_NUMBER="adjustedPortNumber",e.IS_MANAGED_BY_PORT_PROFILE="isManagedByPortProfile",e.IS_DISABLED="isDisabled"}(n||(n={})),function(e){e.IS_TAGGED="isTagged",e.IS_NETWORK_NATIVE_ON_PORT="isNetworkNativeOnPort",e.ADJUSTED_PORT_NUMBER="adjustedPortNumber",e.IS_WAN_PORT="isWanPort",e.IS_MANAGED_BY_PORT_PROFILE="isManagedByPortProfile",e.IS_DISABLED="isDisabled"}(i||(i={})),function(e){e.BLOCKED="BLOCKED",e.TAGGED="TAGGED",e.DISABLED="DISABLED",e.NATIVE="NATIVE",e.WAN="WAN",e.UNTAGGED_NATIVE="UNTAGGED_NATIVE"}(r||(r={}))},727337(e,t,s){s.d(t,{E:()=>d,Np:()=>m,SH:()=>u});var n=s(255045),i=s(940229),r=s(64222),o=s(95546),a=s(857780),l=s(16845),c=s(45523);const d=(e,t,s)=>{let n=e.port_table?.find(e=>e.port_idx===t),i=n?.portconf_id?s.find(e=>e._id===n?.portconf_id):void 0;const r=n?.name;let o=t;if(!n?.aggregate_members?.length){const r=e.port_table?.find(e=>e.aggregate_members?.includes(t)&&e.port_idx!==t);null!=r?.port_idx&&(o=r.port_idx,n=r,i=n?.portconf_id?s.find(e=>e._id===n?.portconf_id):void 0)}return{profile:i,portData:n,adjustedPortNumber:o,originalPortName:r}},u=(e,t)=>`${e?.vlan||(t||e&&e?.networkgroup!==a.vj.LAN?c.$:1)}`,m=(e,t,s,c)=>(e.port_table||[]).reduce((m,A)=>{if(null==A.port_idx)return m;const{profile:p,portData:h,adjustedPortNumber:x}=d(e,A.port_idx,t),_=p?p.native_networkconf_id:h?.native_networkconf_id,E=p?p.excluded_networkconf_ids:h?.excluded_networkconf_ids,g=p?p.tagged_vlan_mgmt:h?.tagged_vlan_mgmt,C=_===r.F,O=s.find(e=>e._id===_),f=(0,i.Ue)(h?.ifname,e)||(0,i.m)(e,A.port_idx),N=(0,i.Xq)(h?.ifname,e),S=g===a.sg.BLOCK_ALL,T=g===a.sg.AUTO,I=(0,i.$k)(h?.ifname,e),M=!!h&&(I.includes(n.Vd.INTERFACE_DISABLED)||(0,o.Rj)(h));m.nativeNetwork[A.port_idx]={excluded_networkconf_ids:E,native_networkconf_id:_??c,tagged_vlan_mgmt:g??a.sg.AUTO,[l.dv.DISPLAYED_VLAN_ID]:u(O,C),[l.dv.IS_WAN_PORT]:f,[l.dv.ADJUSTED_PORT_NUMBER]:x,[l.dv.IS_MANAGED_BY_PORT_PROFILE]:!!p,[l.dv.IS_DISABLED]:M};const v=s.reduce((e,t)=>{const s=(_??c)===t?._id&&N,n=!E?.includes(t._id),i=!s&&!S&&N&&(n||T);return e[t._id]={port_idx:A.port_idx,excluded_networkconf_ids:E,[l.at.IS_TAGGED]:i,[l.at.IS_NETWORK_NATIVE_ON_PORT]:s,[l.at.ADJUSTED_PORT_NUMBER]:x,[l.at.IS_WAN_PORT]:f,[l.at.IS_MANAGED_BY_PORT_PROFILE]:!!p,[l.at.IS_DISABLED]:M},e},{});return m.taggedNetworks[A.port_idx]=v,m},{nativeNetwork:{},taggedNetworks:{}})},883571(e,t,s){s.d(t,{Ay:()=>S});var n=s(274934),i=s(602086),r=s(237725),o=s(977872),a=s(716155),l=s(302405);const c=(0,l.w)(e=>(0,i.createElement)("svg",(0,a.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 5h14v9h-2v2H5v-2H3V5Zm3.5 9a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1h-7Z",fill:"currentColor",className:e.twotonedclassname}),(0,i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 14h2V5H3v9h2v2h10v-2Zm2 1a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h1v1a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-1h1Z",fill:"currentColor",className:e.baseclassname}),(0,i.createElement)("path",{d:"M6 14.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5Z",fill:"currentColor",className:e.baseclassname}),(0,i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 14h2V5H3v9h2v2h10v-2Zm2 1a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h1v1a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-1h1Z",fill:"currentColor",className:e.fillclassname}),(0,i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 5h14v9h-2v2H5v-2H3V5Zm3.5 9a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1h-7Z",fill:"currentColor",className:e.fillclassname}))),d=(0,l.w)(e=>(0,i.createElement)("svg",(0,a.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,i.createElement)("path",{d:"M2 5a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5Z",fill:"currentColor",className:e.twotonedclassname}),(0,i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 5H3v8h12V5ZM3 4a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1H3Zm4.765 2.559a.5.5 0 0 1 .514.026l3 2.02a.5.5 0 0 1-.004.833l-3 1.98A.5.5 0 0 1 7.5 11V7a.5.5 0 0 1 .265-.441Zm.735 1.38v2.132l1.599-1.055L8.5 7.939ZM17 6a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1h13V6Z",fill:"currentColor",className:e.baseclassname}),(0,i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5Zm6.28 1.585A.5.5 0 0 0 7.5 7v4a.5.5 0 0 0 .775.417l3-1.98a.5.5 0 0 0 .004-.832l-3-2.02ZM17 6a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1h13V6Z",fill:"currentColor",className:e.fillclassname})));var u,m=s(864477),A=s(101134),p=s(85254),h=s(950681),x=s(367828),_=s(104997),E=s(470070),g=s(20049),C=s(963945);!function(e){e.MAIN="MAIN",e.SFP="SFP",e.AV_MANAGER="AV_MANAGER"}(u||(u={}));const O={[u.MAIN]:x.o.PORTS,[u.SFP]:x.o.SFP_ANALYZER,[u.AV_MANAGER]:x.o.AV_MANAGER},f={[x.o.PORTS]:u.MAIN,[x.o.SFP_ANALYZER]:u.SFP,[x.o.AV_MANAGER]:u.AV_MANAGER},N=[{icon:(0,n.jsx)(m.A,{size:"original"}),label:(0,n.jsx)(E.sA,{id:"COMMON_MAIN"}),id:u.MAIN},{icon:(0,n.jsx)(c,{size:"original"}),label:(0,n.jsx)(E.sA,{id:"COMMON_MEDIA_SFP"}),id:u.SFP},{icon:(0,n.jsx)(d,{size:"original"}),label:(0,n.jsx)(E.sA,{id:"COMMON_AV_MANAGER"}),id:u.AV_MANAGER}],S=(0,i.memo)(()=>{const e=(0,C.D)(),t=f[e]||u.MAIN,s=(()=>{const e=(0,A.A)(_.VO.PORTS),t=(0,A.A)(`${_.VO.PORTS}/${x.o.SFP_ANALYZER}`),s=(0,A.A)(`${_.VO.PORTS}/${x.o.AV_MANAGER}`),n=(0,r.W6)();return(0,i.useCallback)(i=>{switch(i){case x.o.SFP_ANALYZER:n.push(t);break;case x.o.AV_MANAGER:n.push(s);break;default:n.push(e)}},[n,e,t,s])})(),a=(()=>{const e=(0,C.D)()===x.o.SFP_ANALYZER,{upSfpCount:t}=(0,o.d4)(g.Dj),s=(0,o.d4)(h.vC),n=(0,o.d4)(h.OA),r=(0,o.d4)(h.nZ),[a,l]=(0,i.useState)(n);return(0,i.useEffect)(()=>{(t||e)&&l(!0)},[t,e]),(0,i.useMemo)(()=>({[u.MAIN]:s,[u.SFP]:a,[u.AV_MANAGER]:r}),[s,a,r])})(),l=(0,i.useMemo)(()=>N.filter(({id:e})=>a[e]),[a]),c=(0,i.useCallback)(e=>{const t=O[e.id];t&&s(t)},[s]);return(0,i.useEffect)(()=>{!a[t]&&l.length>0&&c(l[0])},[a,t,c,l]),l.length>1?(0,n.jsx)(p.A,{tabs:l,selectedTab:t,onSelectTab:c}):null})},108825(e,t,s){s.d(t,{Ay:()=>C,PB:()=>E});var n=s(274934),i=s(602086),r=s(977872),o=s(19751),a=s(115238),l=s(233288),c=s(470070),d=s(367828),u=s(20049),m=s(963945),A=s(10695),p=s(212635),h=s(795186),x=s(894357);const _=[p.f4.SFP,p.f4.SFPPLUS,p.f4.SFP28,p.f4.QSFP28],E={[p.f4.FE]:"COMMON_MEDIA_FE",[p.f4.GE]:"COMMON_MEDIA_GE",[p.f4.GE_2P5]:"COMMON_MEDIA_2P5GE",[p.f4.GE_10]:"COMMON_MEDIA_10GE",[p.f4.GE_25]:"COMMON_MEDIA_25GE",[p.f4.GE_40]:"COMMON_MEDIA_40GE",[p.f4.GE_100]:"COMMON_MEDIA_100GE",[p.f4.SFP]:"COMMON_MEDIA_SFP",[p.f4.SFPPLUS]:"COMMON_MEDIA_SFPPLUS",[p.f4.SFP28]:"COMMON_MEDIA_SFP28",[p.f4.QSFP28]:"COMMON_MEDIA_QSFP28"},g={[p.f4.FE]:1,[p.f4.GE]:2,[p.f4.GE_2P5]:3,[p.f4.GE_10]:4,[p.f4.GE_25]:5,[p.f4.GE_40]:6,[p.f4.GE_100]:7,[p.f4.SFP]:8,[p.f4.SFPPLUS]:9,[p.f4.SFP28]:10,[p.f4.QSFP28]:11},C=(0,i.memo)(()=>{const e=(0,r.wA)(),{formatNumber:t,formatMessage:s}=(0,c.tz)(),p=(0,r.d4)(e=>(0,x.e)(e).media),C=(0,r.d4)(u.T4),O=(0,i.useMemo)(()=>Object.values(p),[p]),f=(0,m.D)()===d.o.SFP_ANALYZER,N=(0,i.useMemo)(()=>O.map(e=>e[h.x.ID]),[O]),S=(0,i.useCallback)(t=>{e((0,A.Vw)(Array.from(t||[])))},[e]),T=(0,i.useCallback)(t=>{e((0,A.Vw)(Array.from(t||[])))},[e]),I=(0,i.useCallback)(()=>{e((0,A.Vw)([]))},[e]),M=(0,i.useMemo)(()=>O.filter(e=>!f||_.includes(e[h.x.ID])).sort((e,t)=>g[e[h.x.ID]]-g[t[h.x.ID]]).map(e=>({id:e[h.x.ID],type:"CHECKBOX",title:`${s({id:E[e[h.x.ID]]})} (${t(e[h.x.COUNT])})`,children:[]})),[O,f,s,t]),v=(0,i.useMemo)(()=>C.length===O.length?"all":new Set(C),[C,O.length]),b=(0,i.useMemo)(()=>new Set(O.filter(e=>!C.includes(e[h.x.ID])&&!p[e[h.x.ID]][h.x.COUNT]).map(e=>e[h.x.ID])),[O,p,C]);return(0,a.A)(C,N,A.Vw),O.length?(0,n.jsx)(l.A,{label:(0,n.jsx)(c.sA,{id:"COMMON_LINK_SPEED"}),isSingleColumn:!0,children:(0,n.jsx)(o.A,{shouldAlwaysUseSimplifiedPicker:!0,items:M,selectedKeys:v,disabledKeys:b,onSelectionChange:S,onSelectAll:T,onDeselectAll:I})}):null})},894357(e,t,s){s.d(t,{C:()=>d,e:()=>u});var n=s(222102),i=s(430328),r=s(20049),o=s(197571),a=s(212635),l=s(795186),c=s(64350);const d="__NONE__",u=(0,i.WY)()((0,n.Mz)(r.xP,(0,r.IS)([a.s9.PORTS_MEDIA]),(0,r.IS)([a.s9.PORTS_POE]),(0,r.IS)([a.s9.PORTS_NATIVE_VLAN]),(0,r.IS)([a.s9.PORTS_STATUS]),(0,r.IS)([a.s9.PORTS_STP]),o.Ct,r.Hz,(e,t,s,n,i,r,o,u)=>{const m={},A={},p={},h={},x={},_=e.length;for(let t=0;t<_;t+=1){const s=e[t],n=s.filterMedia;n.length&&n.forEach(e=>{m[e]||(m[e]={[l.x.ID]:e,[l.x.NAME]:e,[l.x.COUNT]:0})});const i=s.filterPoe;A[i]||(A[i]={[l.x.ID]:i,[l.x.NAME]:i,[l.x.COUNT]:0});const r=s?.nativeNetworkConfIdSubstituted;if(void 0!==r){const e=""===r,t=e?d:r;if(!p[t]){const s=r?o.find(({_id:e})=>e===r):void 0;p[t]={[l.x.ID]:t,[l.x.NAME]:e?d:s?.name,[l.x.COUNT]:0,[l.x.VLAN_ID]:s?.vlan??1}}}const a=s.filterStatus;a.length&&a.forEach(e=>{h[e]||(h[e]={[l.x.ID]:e,[l.x.NAME]:e,[l.x.COUNT]:0})}),(0,c.L0)(s).forEach(e=>{x[e]||(x[e]={[l.x.ID]:e,[l.x.NAME]:e,[l.x.COUNT]:0})})}u&&!h[a.fA.IN_USE]&&(h[a.fA.IN_USE]={[l.x.ID]:a.fA.IN_USE,[l.x.NAME]:a.fA.IN_USE,[l.x.COUNT]:0});const E=t.length;for(let e=0;e<E;e+=1){const s=t[e].filterMedia;s.length&&s.forEach(e=>{m[e]&&(m[e]={...m[e],[l.x.COUNT]:m[e][l.x.COUNT]+1})})}const g=s.length;for(let e=0;e<g;e+=1){const t=s[e].filterPoe;A[t]&&(A[t]={...A[t],[l.x.COUNT]:A[t][l.x.COUNT]+1})}const C=n.length;for(let e=0;e<C;e+=1){const t=n[e].nativeNetworkConfIdSubstituted;if(void 0!==t){const e=""===t?d:t;p[e]&&(p[e]={...p[e],[l.x.COUNT]:p[e][l.x.COUNT]+1})}}const O=i.length;for(let e=0;e<O;e+=1){const t=i[e].filterStatus;t.length&&t.forEach(e=>{h[e]&&(h[e]={...h[e],[l.x.COUNT]:h[e][l.x.COUNT]+1})})}const f=r.length;for(let e=0;e<f;e+=1)(0,c.L0)(r[e]).forEach(e=>{x[e]&&(x[e]={...x[e],[l.x.COUNT]:x[e][l.x.COUNT]+1})});return{media:m,poe:A,nativeVlan:p,status:h,stp:x}}),e=>e)},795186(e,t,s){var n;s.d(t,{x:()=>n}),function(e){e.COUNT="count",e.NAME="name",e.ID="id",e.VLAN_ID="vlan_id"}(n||(n={}))},963945(e,t,s){s.d(t,{D:()=>l});var n=s(237725),i=s(101134),r=s(367828),o=s(104997),a=s(331302);const l=()=>{const e=(0,i.A)(`${o.VO.PORTS}/${r.o.AV_MANAGER}`),t=Boolean((0,n.W5)(e)),s=(0,i.A)(`${o.VO.PORTS}/:${a.On}`),l=(0,n.W5)(s),c=l?.params?.[a.On];return t?r.o.AV_MANAGER:c===r.o.SFP_ANALYZER?r.o.SFP_ANALYZER:r.o.PORTS}},645951(e,t,s){s.d(t,{A:()=>l});var n=s(274934),i=s(179102),r=s(309130),o=s(470070),a=s(100978);const l=({messages:e=[]})=>e.length?(0,n.jsx)(a.A,{flexDirection:"column",gap:r.kc,children:e.map(([e,t={}])=>(0,n.jsx)(i.A,{color:"inherit",size:"inherit",children:(0,n.jsx)(o.sA,{id:e,values:t})},e))}):null},537417(e,t,s){s.d(t,{A:()=>i});var n=s(179102);const i=(0,s(247816).A)(n.A)`
  white-space: nowrap;
`},530110(e,t,s){s.d(t,{A:()=>N});var n=s(274934),i=s(602086),r=s(977872),o=s(396489),a=s.n(o),l=s(179102),c=s(266824),d=s(858056),u=s(722837),m=s(147328),A=s(486529),p=s(7476),h=s(252445),x=s(470070),_=s(570801),E=s(94411),g=s(230853),C=s(158402),O=s(39279),f=s(696766);const N=({leftFilterPageId:e,...t})=>{const s=(0,r.wA)(),o=(0,i.useRef)(null),N=(0,m.A)(o),S=A.l[t.tableType],T=Boolean(S),I=(0,E.A)(t.tableType),M=(0,r.d4)(_.Bm),v=(0,i.useCallback)(()=>{const e=g.W2.tables?.[t.tableType],n=[...e?.initialColumns||[]],i=e?.columnOrder,r={[t.tableType]:{initialColumns:n,...i?{columnOrder:i}:{},initialColumnSnapshot:n.reduce((e,t)=>(e[String(t)]=!0,e),{...e?.initialColumnSnapshot||{}})}};T&&(r[t.tableType].columnSize=S,t.tableType===u.l.UNIFI_DEVICE&&A.t.forEach(e=>{r[e]={columnSize:S}})),s((0,C.zF)(r))},[s,t.tableType,T,S]),b=(0,i.useCallback)(()=>{s((0,h.Zi)(e))},[s,e]),j=(0,i.useMemo)(()=>{const e=a()([...g.W2.tables?.[t.tableType]?.initialColumns||[]].sort(),[...I?.initialColumns||[]].sort()),s=a()(g.W2.tables?.[t.tableType]?.columnOrder,I?.columnOrder);if(T){let n=!I?.columnSize||a()(S,I?.columnSize);if(t.tableType===u.l.UNIFI_DEVICE){const e=A.t.every(e=>!M[e]?.columnSize||a()(S,M[e]?.columnSize));n=n&&e}return e&&s&&n}return e&&s},[t.tableType,I,T,M,S]);return(0,n.jsx)(f.CW,{hasOverflow:N,children:(0,n.jsxs)(f.kp,{ref:o,children:[(0,n.jsx)(d.D,{variant:"small",children:(0,n.jsx)(x.sA,{id:"COMMON_CUSTOMIZE_COLUMNS"})}),(0,n.jsx)(p.A,{...t}),(0,n.jsxs)(f.Ot,{children:[(0,n.jsx)(O.d$,{}),(0,n.jsx)(c.A,{type:"button",onPress:v,isDisabled:j,children:(0,n.jsx)(l.A,{size:"medium",color:"inherit",children:(0,n.jsx)(x.sA,{id:"COMMON_ACTION_RESTORE"})})}),(0,n.jsx)(c.A,{type:"button",onPress:b,children:(0,n.jsx)(l.A,{size:"medium",color:"inherit",children:(0,n.jsx)(x.sA,{id:"COMMON_ACTION_DONE"})})})]})]})})}},233288(e,t,s){s.d(t,{A:()=>u});var n=s(274934),i=s(300842),r=s(247816),o=s(291508),a=s(309130),l=s(100978);const c=(0,r.A)(l.A,(0,o.A)("columns"))`
  display: grid;
  grid-template-columns: ${({columns:e=2})=>`repeat(${e}, calc((100% - ${e-1} * ${a.kc}) / ${e}))`};
  user-select: none;
  column-gap: ${a.kc};
  max-width: 100%;
`,d=(0,r.A)(l.A)`
  display: flex;
  flex-direction: column;
  user-select: none;
  max-width: 100%;
`,u=({label:e,height:t,isSingleColumn:s=!1,columns:r,isEditorOpen:o=!1,initialExpanded:a=!0,isStatic:l=!1,children:u,hasPaddedContent:m=!1})=>(0,n.jsx)(i.A,{label:e,initialExpanded:a,isStatic:l,hasPaddedContent:m,isEditorOpen:o,children:(0,n.jsx)(s?d:c,{height:t,columns:r,children:u})})},373616(e,t,s){s.d(t,{A:()=>o});var n=s(274934),i=s(558844),r=s(479086);const o=({children:e})=>(0,n.jsx)(r.A,{children:(0,n.jsx)(i.y,{children:e})})},558844(e,t,s){s.d(t,{y:()=>o});var n=s(247816),i=s(309130),r=s(100978);const o=(0,n.A)(r.A)`
  flex-direction: column;
  gap: ${i.kc};
  margin: 0 0 ${i.Ln} ${i.kc};
`},479086(e,t,s){s.d(t,{A:()=>l});var n=s(274934),i=s(602086),r=s(342676),o=s(961231),a=s(614209);const l=({children:e})=>{const{[o.A.IS_MAXIMIZED]:t}=(0,i.useContext)(a.A);return(0,n.jsx)(r.A,{isHidden:t,children:e})}},115238(e,t,s){s.d(t,{A:()=>o});var n=s(602086),i=s(977872),r=s(968021);const o=(e,t,s)=>{const o=(0,i.wA)(),a=[JSON.stringify(e),JSON.stringify(t)].join(),l=(0,r.A)(a);(0,n.useEffect)(()=>{if(a!==l){const n=[],i=e.length;for(let s=0;s<i;s+=1){const i=e[s];t.includes(i)||n.push(i)}n.length&&o(s(e.filter(e=>!n.includes(e))))}},[a,l,e,t,s,o])}},85254(e,t,s){s.d(t,{A:()=>x});var n=s(274934),i=s(602086),r=s(684935),o=s(590979),a=s(202730),l=s(39279),c=s(247816),d=s(309130);const u=(0,c.A)("div")`
  > nav > button {
    display: flex;
    flex-direction: row;
    gap: ${d.YC};
  }
`;var m=s(409844);const A=m.AH`
  height: 32px;
`,p=m.AH`
  padding: ${d.YC} !important;
`,h=m.AH`
  padding: ${d.YC} ${d.Ln} !important;
`,x=({selectedTab:e,tabs:t,...s})=>{const c=t.length<=2,d=(0,i.useMemo)(()=>c?t:t.map(t=>e===t.id?t:{...t,label:void 0,tooltipProps:{description:t.label}}),[t,e,c]);return d.length>1?(0,n.jsx)(l.T_,{...o.A.addDataTestId(a.b.LEFT_FILTER_PANEL_TABS),children:(0,n.jsx)(u,{children:(0,n.jsx)(r.A,{variant:"capsule",stretched:!0,className:A,tabsClassName:A,tabClassName:p,selectedTabClassName:c?void 0:h,tabs:d,selectedTab:e,...s})})}):null}},582588(e,t,s){s.d(t,{A:()=>h});var n=s(274934),i=s(602086),r=s(977872),o=s(684935),a=s(143979),l=s(742303),c=s(947414),d=s(309130),u=s(100978),m=s(897166),A=s(679168);const p=(0,s(247816).A)(A.A)`
  [data-uic-component='RangeCalendar.Container'] {
    padding: 0;
  }
`,h=({presets:e=[],selectedPreset:t,range:s,onSelectTab:A=c.P1,onSelectCustomRange:h=c.P1,showCalendar:x=!1})=>{const _=(0,r.d4)(m.hq),E=(0,i.useMemo)(()=>(0,l.A)(new Date,"ZonedDateTime",_),[_]),g=(0,i.useMemo)(()=>{return(e={start:(0,l.A)(s?.startDate,"ZonedDateTime",_),end:(0,l.A)(s?.endDate,"ZonedDateTime",_)}).start&&e.end?{start:(0,a.gw)(e.start),end:(0,a.gw)(e.end)}:null;var e},[s,_]),C=(0,i.useCallback)(({start:e,end:t})=>{h({startDate:e.toDate(_),endDate:t.toDate(_)})},[h,_]);return(0,n.jsxs)("div",{children:[e.length?(0,n.jsx)(o.A,{variant:"filter",tabs:e,selectedTab:t,onSelectTab:A,stretched:!0}):null,x?(0,n.jsx)(u.A,{marginTop:d.xO,children:(0,n.jsx)(p,{value:g,onChange:C,maxValue:E})}):null]})}},641671(e,t,s){s.d(t,{A:()=>l});var n=s(274934),i=s(579902),r=s(100978),o=s(974390),a=s(650632);const l=({connectedClient:e,connectedDevice:t,size:s,wanProviderAsn:l,wanProviderName:c})=>(0,n.jsxs)(n.Fragment,{children:[c?(0,n.jsx)(i.A,{asn:l,name:c,style:{userSelect:"none",display:"block",height:"20px",width:"20px",objectFit:"contain",margin:"0 auto"},useFallback:!0}):null,!c&&t?(0,n.jsx)(o.A,{model:t.model,width:s,height:s}):null,c||t||!e?null:(0,n.jsx)(r.A,{height:s,minWidth:s,maxWidth:s,justifyContent:"center",alignItems:"center",children:(0,n.jsx)(a.A,{client:e})})]})},528015(e,t,s){s.d(t,{o:()=>i});var n=s(95546);const i=(e,t)=>{const s=Array.from(new Set(t.map(e=>e.unit_id))).sort((e,t)=>(e||0)-(t||0)),i=new Map(t.map(e=>[(0,n.Z2)(e.port_idx||0,e.unit_id),e]));return s.flatMap(t=>e.map((e,s)=>{const r=t||"device";return{key:`PortDiagramRow-${r}-${s+1}`,row:e,rowIndex:s,unitId:t,cells:e.map((e,o)=>({key:`PortDiagramCell-${r}-${s+1}-${o+1}`,port:e&&i.get((0,n.Z2)(e.portNumber||0,t)),rowData:e,rowIndex:s,dataIndex:o,unitId:t}))}}))}},225889(e,t,s){s.d(t,{A:()=>c});var n=s(274934),i=s(247368),r=s(179102),o=s(470070),a=s(100978),l=s(309130);const c=()=>(0,n.jsxs)(a.A,{gap:l.kc,children:[(0,n.jsx)(i.A,{isActive:!0}),(0,n.jsx)(r.A,{size:"small",children:(0,n.jsx)(o.sA,{id:"DEVICE_DIAGRAM_MISSING"})})]})},698950(e,t,s){s.d(t,{A:()=>p});var n=s(274934),i=s(247816),r=s(409844),o=s(291508),a=s(470070),l=s(309130),c=s(100978),d=s(537417);const u=(0,i.A)(c.A,(0,o.A)("alignLeft"))`
  ${({alignLeft:e})=>e?"max-width: 288px;":"max-width: 100%; justify-content: center;"}
  gap: ${l.YC};
  align-items: center;
`,m=r.AH`
  max-width: 50%;
`,A=r.AH`
  flex: 0 1 auto;
  min-width: 0;
`,p=({messageId:e,messageValues:t,buttonEl:s,alignLeft:i=!0,color:r="text-3",variant:o="body-primary"})=>(0,n.jsxs)(u,{alignLeft:i,children:[(0,n.jsx)(d.A,{variant:o,color:r,children:t?(0,n.jsx)(c.A,{maxWidth:288,whiteSpace:"nowrap",paddingRight:l.YC,children:(0,n.jsx)(a.sA,{id:e,values:t})}):(0,n.jsx)(a.sA,{id:e})}),s?(0,n.jsx)(c.A,{className:i?A:m,children:s}):null]})},488287(e,t,s){s.d(t,{A:()=>g});var n=s(274934),i=s(977872),r=s(602086),o=s(179102),a=s(590979),l=s(898809),c=s(309130),d=s(100978),u=s(449339),m=s(785068),A=s(205521),p=s(470070),h=s(754924),x=s(119425),_=s(698950),E=s(208583);const g=({last_uplink_mac:e,last_uplink_name:t,last_uplink_remote_port:s,disconnected_at:g,disabled:C,separatePortNumber:O,maxWidth:f})=>{const{formatMessage:N}=(0,p.tz)(),S=(0,i.wA)(),T=(0,i.d4)(h.CC),I=(0,E.Z)(e,T),M=(0,E.z)(t,s,I,N,O),v=(0,r.useCallback)(()=>{C||S((0,A.XP)({type:u.H.DEVICE,id:e}))},[C,S,e]);return(0,n.jsxs)(n.Fragment,{children:[I?(0,n.jsx)(_.A,{messageId:"COMMON_DEVICE_LAST_CONNECTED_TO",messageValues:{deviceWithPort:(0,n.jsx)(d.A,{width:"100%",overflow:"hidden",paddingLeft:c.YC,children:(0,n.jsx)(m.A,{onClick:v,disabled:C,...a.A.addDataTestId(a.A.TestId.SIDE_PANEL_TRIGGER),name:M,port:s,separatePortNumber:O,maxWidth:f})})}}):null,g?(0,n.jsx)("div",{children:(0,n.jsx)(o.A,{color:"text-3",children:(0,n.jsx)(x.A,{date:(0,l.gH)(g)})})}):null]})}},208583(e,t,s){s.d(t,{Z:()=>i,z:()=>r});var n=s(347625);const i=(e,t)=>e?t.find(({mac:t})=>t===e):void 0,r=(e,t,s,i,r)=>{const o=!r&&t?` ${i({id:"DEVICE_PROPERTIES_PORT_WITH_NUMBER"},{port:t})}`:"";return e?`${e}${o}`:s?`${(0,n.Q)(s)}${o}`:i({id:"COMMON_FALLBACK"})}},783706(e,t,s){s.d(t,{A:()=>l});var n=s(274934),i=s(205240),r=s(956978),o=s(698950),a=s(949283);const l=({type:e,name:t,mac:s,uplink:l,state:c,model:d,disabled:u,alignLeft:m})=>(0,a.n)(c,l)?(0,n.jsx)(o.A,{messageId:(0,r.E4T)({model:d})?"COMMON_CONNECTED_TO":"DEVICE_MESHING_TO",alignLeft:m,buttonEl:(0,n.jsx)(i.E,{device:{type:e,name:t,mac:s,uplink:l},size:"medium",disabled:u})}):null},949283(e,t,s){s.d(t,{n:()=>a});var n=s(977872),i=s(45978),r=s(754924),o=s(313369);const a=(e,t)=>{const s=(0,n.d4)(r.CC),a=t.uplink_mac?s.find(({mac:e})=>e===t.uplink_mac):void 0,l=Boolean(t.signal);return o.q[e]===i.g.CONNECTED&&a&&l?a:void 0}},451336(e,t,s){s.d(t,{A:()=>d});var n=s(274934),i=s(783706),r=s(562896),o=s(488287),a=s(205240),l=s(698950);const c=({type:e,name:t,mac:s,uplink:i,disabled:r,maxWidth:o,peer_ubb:c,deviceState:d,ubb_pairing_state:u})=>(0,n.jsx)(l.A,{messageId:"COMMON_CONNECTED_TO",buttonEl:(0,n.jsx)(a.E,{device:{type:e,name:t,mac:s,uplink:i,peer_ubb:c,deviceState:d,ubb_pairing_state:u},maxWidth:o,disabled:r,separatePortNumber:!0})}),d=({connectionStatus:e,activeItem:{type:t,last_uplink:s,uplink:a,state:l,name:d,mac:u,model:m,disconnected_at:A,peer_ubb:p,deviceState:h,ubb_pairing_state:x},disabled:_,uplinkNameMaxWidth:E=195})=>{switch(e){case r.v.OFFLINE:return(0,n.jsx)(o.A,{last_uplink_mac:s?.uplink_mac||a?.uplink_mac,last_uplink_name:s?.uplink_device_name||a?.uplink_device_name,last_uplink_remote_port:s?.uplink_remote_port||a?.uplink_remote_port,disconnected_at:A||0,disabled:_,separatePortNumber:!0,maxWidth:E});case r.v.MESHING:return(0,n.jsx)(i.A,{type:t,name:d,model:m,mac:u,uplink:a,state:l,disabled:_});case r.v.CONNECTED:return(0,n.jsx)(c,{type:t,name:d,mac:u,uplink:a,disabled:_,maxWidth:E,peer_ubb:p,deviceState:h,ubb_pairing_state:x});default:return null}}},562896(e,t,s){var n;s.d(t,{v:()=>n}),function(e){e.OFFLINE="offline",e.MESHING="meshing",e.CONNECTED_INTERRUPTED="connected-interrupted",e.CONNECTED="connected"}(n||(n={}))},159911(e,t,s){s.d(t,{H:()=>o});var n=s(956978),i=s(857780),r=s(562896);const o=(e,t)=>(0,n.aK8)(e)?r.v.OFFLINE:t===i.au.WIRELESS?r.v.MESHING:r.v.CONNECTED},643022(e,t,s){s.d(t,{A:()=>u});var n=s(274934),i=s(602086),r=s(87449),o=s(977872),a=s(526744),l=s(548941),c=s(470070),d=s(976458);const u=({model:e,fromVersion:t,toVersion:s,children:u})=>{const m=(0,o.d4)(d.qf),A=(0,r.coerce)(s)?.version||s,p=(0,i.useCallback)(()=>{A&&m?.(e,A)},[m,e,A]);return(0,n.jsx)(l.A,{isInteractive:!0,portal:!0,description:A&&s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{children:(0,n.jsx)(c.sA,{id:"COMMON_FROM_TO",values:{from:t,to:A,strong:c.ko}})}),void 0!==m?(0,n.jsx)(a.A,{variant:"inline",onClick:p,children:(0,n.jsx)(c.sA,{id:"COMMON_RELEASE_NOTES"})}):null]}):null,children:u})}},754237(e,t,s){s.d(t,{W:()=>i,k:()=>n});const n=34,i=12*n},279740(e,t,s){s.d(t,{A:()=>b});var n=s(602086),i=s(977872),r=s(244081),o=s(653547),a=s(348185),l=s(747922),c=s(79777),d=s(648552),u=s(795206),m=s(239627),A=s(45978),p=s(648126),h=s(223597);const x=new Map,_="device-watch-mode-listener",E=["mac","state"],g=["uplink_mac","type","unifi_device"],C=({mac:e,state:t},s)=>Boolean(e&&s)&&e!==s&&t===p.A[A.g.CONNECTED],O=e=>e.type!==h.sK.WIRELESS&&e.type!==h.sK.WIRED||e.unifi_device?void 0:e.uplink_mac;var f,N,S=s(222102),T=s(430328),I=s(897166),M=s(754924),v=s(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"}(f||(f={})),function(e){e.INSTANCES="instances",e.TIMEOUT="timeout"}(N||(N={}));const b=e=>{const t=(0,i.wA)(),s=(0,i.d4)((0,n.useMemo)(()=>{return t=e,(0,T.WY)()((0,S.Mz)((0,v.kV)(t,g),O),e=>e);var t},[e])),A=(0,n.useMemo)(()=>s||e,[s,e]),p=(0,i.d4)((0,n.useMemo)(()=>{return e=A,(0,T.WY)()((0,S.Mz)((0,M.bw)(e,E),I.vc,C),e=>e);var e},[A])),h=(0,i.d4)(c.a),b=(0,n.useMemo)(()=>h[d.Uz],[h]),j=(0,n.useCallback)(e=>{b.send({type:a.E.WATCH_DEVICE,device_mac:e})},[b]),D=(0,n.useCallback)(({[f.IS_WATCHED]:e,[f.WATCHED_TIMEOUT]:t,[f.DEVICE_MAC]:s})=>{if(e){const e=1e3*t;if(e>Date.now()){const t=x.get(s);t&&(t[N.TIMEOUT]=setTimeout(()=>{j(s)},(e=>Math.max(e-Date.now()-5e3,5e3))(e)))}}},[j]),P=(0,n.useCallback)(e=>(0,o.K6)(e,D,!1,(e=>`${_}::${e}`)(e)),[D]);(0,n.useEffect)(()=>{if(p){Object.keys((0,o.WM)()).some(e=>e.startsWith(_))||l._[a.E.WATCH_DEVICE].map(P);const e=x.get(A);e?e[N.INSTANCES]+=1:(j(A),x.set(A,{[N.INSTANCES]:1,[N.TIMEOUT]:void 0}))}return()=>{const e=x.get(A);e&&(e[N.INSTANCES]>1?e[N.INSTANCES]-=1:(clearTimeout(e[N.TIMEOUT]),x.delete(A)),x.size||Object.keys((0,o.WM)()).filter(e=>e.startsWith(_)).forEach(o.$N))}},[j,P,A,p]),(0,n.useEffect)(()=>{t((0,u.Uc)(void 0,{crudCacheStrategy:{type:r.e.CACHE}})),t((0,m.$3)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}))},[t])}},56809(e,t,s){s.d(t,{b:()=>n});const n=e=>{if("number"==typeof e)return Number.isFinite(e)?e:null;if("string"==typeof e){const t=Number.parseFloat(e);return!Number.isNaN(t)&&Number.isFinite(t)?t:null}return null}},528116(e,t,s){s.d(t,{$V:()=>a,UE:()=>o,Vi:()=>l});var n=s(368741),i=s.n(n),r=s(232087);const o={NONE:{url:null,grain:null,grainInSeconds:null,translationKey:null},MINUTES:{url:r.FE.MINUTES,grain:3e5,grainInSeconds:300,translationKey:"GRANULARITY_5_MINUTES"},HOURLY:{url:r.FE.HOURLY,grain:36e5,grainInSeconds:3600,translationKey:"GRANULARITY_HOURLY"},DAILY:{url:r.FE.DAILY,grain:864e5,grainInSeconds:86400,translationKey:"GRANULARITY_DAILY"},MONTHLY:{url:r.FE.MONTHLY,grain:2592e6,grainInSeconds:2592e3,translationKey:"GRANULARITY_MONTHLY"}},a=(e,t,s,n)=>{const r=i()(t,e);return s&&(r<1||n&&r<=1)?o.MINUTES:r<=7?o.HOURLY:r<120?o.DAILY:o.MONTHLY},l=(e,t)=>{switch(e){case r.FE.DAILY:return`1${t({id:"COMMON_UNIT_D"})}`;case r.FE.HOURLY:return`1${t({id:"COMMON_UNIT_H"})}`;case r.FE.MINUTES:return`5${t({id:"COMMON_UNIT_MIN"})}`;default:return""}}}}]);