"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[14194],{24006(e,t,a){a.d(t,{A:()=>l});const l={k:{MAX:999999,MIN:64},M:{MAX:1e3,MIN:1}}},736014(e,t,a){a.d(t,{r:()=>s});var l=a(296540),n=a(883840),r=a(916537);const s=[{id:n.C.AUTO,label:l.createElement(r.sA,{id:"COMMON_VALUE_AUTO"})},{id:n.C.MANUAL,label:l.createElement(r.sA,{id:"COMMON_VALUE_MANUAL"})}]},391855(e,t,a){a.d(t,{A:()=>i});var l=a(296540),n=a(271856),r=a(858931),s=a(823858),o=a(71479),c=a(916537);const _=(0,o.A)(s.A)`
  color: #ffffff;
`,i=(0,l.memo)(({isDisabled:e,showLoader:t,showWarning:a,showWarningIcon:s,warning:o,label:i="COMMON_ACTION_APPLY_CHANGES",onSubmit:d,form:m})=>l.createElement(n.A,{description:a?o??l.createElement(c.sA,{id:"COMMON_FORM_CHANGES_TRIGGER_PROVISION"}):null,portal:!0,width:240},l.createElement(r.A,{disabled:e,type:"submit",onClick:d,variant:"primary",Icon:a||s?l.createElement(_,{variant:"fill"}):null,loader:t?"loading":void 0,form:m},l.createElement(c.sA,{id:i}))))},963253(e,t,a){a.d(t,{A:()=>c});var l=a(822336),n=a(71479),r=a(566723),s=a(294303),o=a(311785);const c=(0,n.A)(s.A,(0,o.A)("selected","disabled","allowGreyscale","noMargin"))`
  height: 32px;
  border-radius: ${l.Ay["desktop-radius-base"]};
  padding: ${r.YC} ${r.kc};
  margin-right: ${({noMargin:e})=>e?0:r.kc};
  border: ${({theme:{themeName:e}})=>l.Ay[`desktop-border-divider-${e}`]};
  align-items: center;
  justify-content: center;
  cursor: pointer;
  gap: ${r.kc};
  user-select: none;

  ${({selected:e,theme:{themeName:t}})=>e&&`border-color: ${l.Ay[`desktop-color-ublue-06-${t}`]};`}
  ${({disabled:e,allowGreyscale:t,selected:a})=>e||t&&!a?`> * { opacity: ${r.xN}; }`:void 0}
  ${({disabled:e})=>e&&"pointer-events: none;"}
  ${({allowGreyscale:e,selected:t})=>e&&!t&&"filter: grayscale(100%);"}
`},854246(e,t,a){a.d(t,{A:()=>i});var l=a(822336),n=a(296540),r=a(71479),s=a(132196),o=a(916537),c=a(311785);const _=(0,r.A)("div",(0,c.A)("align"))`
  ${({align:e})=>e&&`text-align: ${e}`};
  color: ${({theme:{themeName:e}})=>l.Ay[`desktop-color-red-06-${e}`]};
  font-size: ${({theme:{fontSizes:e}})=>e[0]}px;
  line-height: 20px;
`,i=({align:e="left",children:t=null,className:a=null,translation:l=null,visible:r=!1})=>r?n.createElement(_,{align:e,className:(0,s.cx)(a)},l?n.createElement(o.sA,{id:l}):null,t):null},272364(e,t,a){a.d(t,{A:()=>A});var l=a(296540),n=a(48925),r=a(916537),s=a(469733),o=a(951272),c=a(979106),_=a(132196),i=a(634610),d=a(736014),m=a(602021);const E=_.AH`
  margin: unset;
`,O=({disabled:e})=>{const{values:t,setValues:a}=(0,o.j7)(),n=(0,s.useSelector)(m.EL),r=(0,l.useCallback)(e=>{const l=(0,i.A)(t,e);l.qos_profile.qos_profile_mode=t.qos_profile.qos_profile_mode,l.avManufacturer=t.avManufacturer,a(l)},[a,t]);return l.createElement(c.A,{variant:"capsule",tabs:d.r,selectedTab:t.setting_preference,onSelectTab:e=>r(e.id),disabled:e||n,tabsClassName:E})},A=({disabled:e})=>l.createElement(n.A,{title:l.createElement(r.sA,{id:"COMMON_ADVANCED"}),titleAction:l.createElement(O,{disabled:e})})},445640(e,t,a){a.d(t,{A:()=>ae});var l=a(296540),n=a(641777),r=a(48925),s=a(916537),o=a(720903),c=a(951272),_=a(566723),i=a(553432),d=a(349665),m=a(143811),E=a(317672),O=a(137625),A=a(294303),u=a(204751),p=a(949330),C=a(936621),M=a(768195),T=a(469733),g=a(757001),b=a(325898),S=a(71479),R=a(311785),L=a(130851),N=a(825032),v=a(302167),P=a(147606),f=a(457311),h=a(963253);const I=(0,S.A)("div",(0,R.A)("columns"))`
  display: grid;
  grid-template-columns: repeat(${({columns:e})=>e}, 1fr);
  width: 100%;
  gap: ${_.YC};
`,D=(0,S.A)("img")`
  width: 100%;
  max-width: 100%;
  object-fit: contain;
`,k=({disabled:e,isPtpSupported:t=!1})=>{const a=(0,T.useDispatch)(),{values:n,setFieldValue:r}=(0,c.j7)(),o=(0,T.useSelector)(L.p),i=(0,T.useSelector)(v.zu),d=(0,l.useCallback)(e=>{r("avManufacturer",e),r("qos_profile.qos_profile_mode",(p.BR[e]||[])[0])},[r]),E=(0,l.useCallback)(()=>a((0,f.OD)({...i,jumboframe_enabled:!0})),[a,i]),O=(0,l.useMemo)(()=>(p.BR[n.avManufacturer]||[]).map(e=>({label:p.XB[e],value:e})),[n.avManufacturer]),{motif:C}=(0,b.A)(),M=C===N.S.DARK?"dark":"light",S=(0,l.useMemo)(()=>t?9:8,[t]),R=(0,l.useMemo)(()=>9===S?3:4,[S]);return l.createElement(A.A,{flexDirection:"column",gap:_.kc,width:"100%"},l.createElement(I,{columns:R},l.createElement(h.A,{onClick:()=>d(u.CC.UNIFI),selected:n.avManufacturer===u.CC.UNIFI,allowGreyscale:!0,width:"100%",disabled:e},l.createElement(g.A,{size:"small"})),l.createElement(h.A,{onClick:()=>d(u.CC.DANTE),selected:n.avManufacturer===u.CC.DANTE,allowGreyscale:!0,noMargin:!0,width:"100%",disabled:e},l.createElement(D,{src:`${o}/avManufacturers/${M}/dante.svg`,height:13})),l.createElement(h.A,{onClick:()=>d(u.CC.QSYS),selected:n.avManufacturer===u.CC.QSYS,allowGreyscale:!0,noMargin:!0,width:"100%",disabled:e},l.createElement(D,{src:`${o}/avManufacturers/${M}/qsys.svg`,height:13})),l.createElement(h.A,{onClick:()=>d(u.CC.NDI),selected:n.avManufacturer===u.CC.NDI,allowGreyscale:!0,noMargin:!0,width:"100%",disabled:e},l.createElement(D,{src:`${o}/avManufacturers/${M}/ndi.svg`,height:11})),i.jumboframe_enabled||n.avManufacturer===u.CC.SDVOE?l.createElement(h.A,{onClick:()=>d(u.CC.SDVOE),selected:n.avManufacturer===u.CC.SDVOE,allowGreyscale:!0,noMargin:!0,width:"100%",disabled:e},l.createElement(D,{src:`${o}/avManufacturers/${M}/sd.svg`,height:19})):l.createElement(P.A,{title:l.createElement(s.sA,{id:"PORTS_ENABLE_JUMBO_FRAMES_TITLE"}),message:l.createElement(s.sA,{id:"PORTS_ENABLE_JUMBO_FRAMES_SDVOE_MESSAGE"}),onConfirm:async()=>{await E(),d(u.CC.SDVOE)},onClose:()=>d(u.CC.SDVOE),confirmButtonVariant:"emphasis",confirmButtonLabel:"COMMON_ACTION_ENABLE",cancelButtonLabel:"PORTS_KEEP_DISABLED",trigger:l.createElement(h.A,{allowGreyscale:!0,noMargin:!0,width:"100%",disabled:e},l.createElement(D,{src:`${o}/avManufacturers/${M}/sd.svg`,height:19}))}),l.createElement(h.A,{onClick:()=>d(u.CC.SHURE),selected:n.avManufacturer===u.CC.SHURE,allowGreyscale:!0,noMargin:!0,width:"100%",disabled:e},l.createElement(D,{src:`${o}/avManufacturers/${M}/shure.svg`,height:9})),l.createElement(h.A,{onClick:()=>d(u.CC.AES67),selected:n.avManufacturer===u.CC.AES67,allowGreyscale:!0,noMargin:!0,width:"100%",disabled:e},l.createElement(D,{src:`${o}/avManufacturers/${M}/aes.svg`,height:16})),l.createElement(h.A,{onClick:()=>d(u.CC.CRESTON),selected:n.avManufacturer===u.CC.CRESTON,allowGreyscale:!0,noMargin:!0,width:"100%",disabled:e},l.createElement(D,{src:`${o}/avManufacturers/${M}/crestron.svg`,height:8})),t?l.createElement(h.A,{onClick:()=>d(u.CC.SMPTE),selected:n.avManufacturer===u.CC.SMPTE,allowGreyscale:!0,noMargin:!0,width:"100%",disabled:e},l.createElement(D,{src:`${o}/avManufacturers/${M}/smpte.svg`,height:14})):null),O.length>1?l.createElement(m.A,{name:"qos_profile.qos_profile_mode",type:"dropdown",portal:!0,variant:"secondary",options:O,translateOptions:!0,full:!0,disabled:e}):null)};var F,w=a(271856),y=a(86838),U=a(758649),V=a(79760),q=a(968906),G=a(776309),B=a(126457),x=a(205975),$=a(963070),H=a(189643);!function(e){e.MATCH_PROTOCOL="matchProtocol",e.MATCH_TYPE="matchType",e.REMARK="remark",e.QUEUE="queue"}(F||(F={}));const K={[F.MATCH_PROTOCOL]:"COMMON_PROTOCOL",[F.MATCH_TYPE]:"PORTS_QOS_POLICY_MATCH_TYPE",[F.REMARK]:"PORTS_QOS_POLICY_REMARK",[F.QUEUE]:"PORTS_QOS_POLICY_QUEUE"},W=[{id:F.MATCH_PROTOCOL,label:l.createElement(s.sA,{id:K[F.MATCH_PROTOCOL]}),minWidth:60,renderCell:({matchProtocol:e})=>"number"==typeof e?e:l.createElement(s.sA,{id:(0,H.Wi)(e)})},{id:F.MATCH_TYPE,label:l.createElement(s.sA,{id:K[F.MATCH_TYPE]}),minWidth:100,renderCell:({matchType:e})=>e},{id:F.REMARK,label:l.createElement(s.sA,{id:K[F.REMARK]}),minWidth:100,renderCell:({remark:e})=>e},{id:F.QUEUE,label:l.createElement(s.sA,{id:K[F.QUEUE]}),minWidth:60,renderCell:({queue:e})=>e}],j=(0,l.memo)(({addCallback:e,disabled:t})=>{const{values:a,setFieldValue:n}=(0,c.j7)(),{qos_profile:r}=a,{qos_policies:o}=r||{},i=(0,x.JS)(o||[]),d=(0,T.useDispatch)(),m=(0,l.useCallback)(e=>{if(t)return;const a=(o??[]).filter((t,a)=>a!==e);n("qos_profile.qos_policies",a)},[t,n,o]),E=(0,l.useCallback)(({id:e})=>t?null:l.createElement(A.A,{width:"100%",justifyContent:"flex-end",paddingRight:_.Ln,alignItems:"center"},l.createElement(U.A,{color:"danger",type:"button",variant:"inline",onClick:()=>m(e)},l.createElement(s.sA,{id:"COMMON_ACTION_REMOVE"}))),[t,m]),O=(0,l.useCallback)(a=>{if(t)return;const l=o?.[a.id];d((0,B.to)({modalType:G.A.QOS_POLICY_MODAL,modalProps:{addCallback:e,existingItem:l,existingItemIndex:a.id}}))},[e,t,d,o]);return l.createElement(A.A,{opacity:t?_.xN:void 0,pointerEvents:t?"none":void 0},l.createElement($.A,{items:i,idField:"id",truncateHeaderCells:!0,columns:W,disableColumnFilters:!0,renderHoverContent:E,onRowClick:O}))}),Q=({disabled:e})=>{const{values:t,setFieldValue:a,errors:n,touched:r,submitCount:i}=(0,c.j7)(),d=(0,T.useDispatch)(),m=(0,V.t$)("qosEnabled",n,r,i),E=!e&&(t.qos_profile?.qos_policies?.length??0)>=p.aW,O=(0,l.useCallback)((e,l)=>{const n=(0,x.Dz)(e),r=(0,o.A)(t.qos_profile?.qos_policies)||[];if(void 0!==l)return r[l]=n,void a("qos_profile.qos_policies",r.sort((e,t)=>(t.qos_marking?.queue||0)-(e.qos_marking?.queue||0)));a("qos_profile.qos_policies",[...r,n].sort((e,t)=>(t.qos_marking?.queue||0)-(e.qos_marking?.queue||0)))},[a,t.qos_profile?.qos_policies]),u=(0,l.useCallback)(()=>{d((0,B.to)({modalType:G.A.QOS_POLICY_MODAL,modalProps:{addCallback:O}}))},[O,d]),C=(0,l.useMemo)(()=>l.createElement(w.A,{description:E?l.createElement(s.sA,{id:"PORTS_QOS_POLICIES_LIMIT_REACHED",values:{limit:p.aW}}):null,portal:!0},l.createElement(U.A,{variant:"inline",onClick:u,type:"button",size:"medium",disabled:e||E,...q.A.addDataTestId(q.A.TestId.MODAL_TRIGGER)},l.createElement(s.sA,{id:"COMMON_CREATE_NEW"}))),[u,e,E]);return t.qosEnabled?l.createElement(A.A,{flexDirection:"column",gap:_.kc},t.qos_profile?.qos_policies?.length?l.createElement(A.A,{gap:_.kc,flexDirection:"column"},l.createElement(j,{addCallback:O,disabled:e}),e?null:C):C,m?l.createElement(y.A,{isInvalid:!0,label:m}):null):null};var Y;!function(e){e.OFF="OFF",e.PRO_AV="PRO_AV",e.CUSTOM="CUSTOM"}(Y||(Y={}));const z=({disabled:e,isPtpSupported:t=!1})=>{const{values:a,setValues:n}=(0,c.j7)(),[r,T]=(0,l.useState)(!1),g=a.proAvEnabled?Y.PRO_AV:a.qosEnabled?Y.CUSTOM:Y.OFF,b=(0,l.useCallback)(e=>{if(e===Y.OFF)n({...a,proAvEnabled:!1,avManufacturer:void 0,qos_profile:(0,o.A)(p.a$),qosEnabled:!1});else if(e===Y.PRO_AV){const e=a.avManufacturer??u.CC.UNIFI;n({...a,proAvEnabled:!0,avManufacturer:e,qos_profile:{...(0,o.A)(p.a$),qos_profile_mode:(p.BR[e]||[])[0]??u.If.UNIFI_PLAY},qosEnabled:!1})}else e===Y.CUSTOM&&n({...a,proAvEnabled:!1,avManufacturer:void 0,qos_profile:(0,o.A)(p.a$),qosEnabled:!0})},[a,n]),S=(0,l.useCallback)(()=>{a.tagged_vlan_mgmt!==M.sg.BLOCK_ALL?T(!0):b(Y.PRO_AV)},[a.tagged_vlan_mgmt,b]),R=(0,l.useCallback)(()=>{T(!1);const e=a.avManufacturer??u.CC.UNIFI;n({...a,proAvEnabled:!0,tagged_vlan_mgmt:M.sg.BLOCK_ALL,taggedVlans:[],voice_networkconf_id:C.F,voiceNetworkConfEnabled:!1,avManufacturer:e,qos_profile:{...(0,o.A)(p.a$),qos_profile_mode:(p.BR[e]||[])[0]??u.If.UNIFI_PLAY},qosEnabled:!1})},[a,n]),L=(0,l.useCallback)(()=>{T(!1),b(Y.PRO_AV)},[b]);return l.createElement(A.A,{flexDirection:"column",gap:_.kc},l.createElement(d.A,null,l.createElement(E.A,{tooltip:l.createElement(s.sA,{id:"PORTS_QOS_MODE_TOOLTIP"})},l.createElement(s.sA,{id:"PORTS_QOS_MODE"})),l.createElement(i.A,null,l.createElement(m.A,{value:Y.OFF,type:"radio",name:"qosModeRadio",checked:g===Y.OFF,onChange:()=>b(Y.OFF),disabled:e},l.createElement(s.sA,{id:"COMMON_OFF"})),l.createElement(O.A,{title:"PORTS_PRO_AV_BLOCK_TAGGED_VLANS_TITLE",message:"PORTS_PRO_AV_BLOCK_TAGGED_VLANS_MESSAGE",buttonMessage:"PORTS_PRO_AV_BLOCK_TAGGED_VLANS_BLOCK",cancelButtonMessage:"PORTS_PRO_AV_BLOCK_TAGGED_VLANS_KEEP_CURRENT",isOpen:r,handleConfirm:R,handleClose:()=>T(!1),handleCancel:L},l.createElement(m.A,{value:Y.PRO_AV,type:"radio",name:"qosModeRadio",checked:g===Y.PRO_AV,onChange:S,disabled:e,tooltipMessage:l.createElement(s.sA,{id:"PORTS_PRO_AV_RADIO_TOOLTIP"})},l.createElement(s.sA,{id:"COMMON_PRO_AV"}))),l.createElement(m.A,{value:Y.CUSTOM,type:"radio",name:"qosModeRadio",checked:g===Y.CUSTOM,onChange:()=>b(Y.CUSTOM),disabled:e},l.createElement(s.sA,{id:"COMMON_CUSTOM"})))),g===Y.PRO_AV?l.createElement(k,{disabled:e,isPtpSupported:t}):null,g===Y.CUSTOM?l.createElement(Q,{disabled:e}):null)};var X=a(504779),J=a(768941),Z=a(987588);const ee=({disabled:e,showPercentage:t})=>{const{values:a,setFieldValue:r,initialValues:o,errors:O,touched:u,submitCount:p}=(0,c.j7)(),C=(0,V.t$)("stormControlEnabled",O,u,p),M=a.proAvEnabled;return l.createElement(A.A,{flexDirection:"column",gap:_.kc},l.createElement(Z.l2,null,l.createElement(m.A,{name:"stormControlEnabled",type:"realCheckbox",checked:a.stormControlEnabled,onChange:({target:{checked:e}})=>{r("stormControlEnabled",e),e||(r("stormctrl_ucast_enabled",!1),r("stormctrl_mcast_enabled",!1),r("stormctrl_bcast_enabled",!1),r("stormctrl_ucast_rate",o.stormctrl_ucast_rate),r("stormctrl_mcast_rate",o.stormctrl_mcast_rate),r("stormctrl_bcast_rate",o.stormctrl_bcast_rate),r("stormctrl_ucast_level",o.stormctrl_ucast_level),r("stormctrl_mcast_level",o.stormctrl_mcast_level),r("stormctrl_bcast_level",o.stormctrl_bcast_level))},tooltipMessage:l.createElement(s.sA,{id:"COMMON_STORM_CONTROL_TOOLTIP"}),disabled:e},l.createElement(s.sA,{id:"COMMON_DEVICE_CAP_SWITCH_CAP_STORM_CONTROL"}))),a.stormControlEnabled?l.createElement(l.Fragment,null,t?l.createElement(d.A,{paddingLeft:_.S2},l.createElement(n.A,{isDisabled:!!e},l.createElement(E.A,{htmlFor:"stormctrl_type",tooltip:l.createElement(s.sA,{id:"PORTS_STORM_CONTROL_MODE_TOOLTIP"})},l.createElement(s.sA,{id:"COMMON_MODE"}))),l.createElement(i.A,null,l.createElement(m.A,{value:J.d5.LEVEL,type:"radio",name:"stormctrl_type",checked:a.stormctrl_type===J.d5.LEVEL,disabled:e},l.createElement(s.sA,{id:"COMMON_PERCENTAGE"})),l.createElement(m.A,{value:J.d5.RATE,type:"radio",name:"stormctrl_type",checked:a.stormctrl_type===J.d5.RATE,disabled:e},l.createElement(s.sA,{id:"COMMON_RATE"})))):null,l.createElement(A.A,{gap:_.Ln,justifyContent:"space-between",paddingLeft:_.S2},l.createElement(Z.l2,null,l.createElement(m.A,{disabled:e,name:"stormctrl_ucast_enabled",type:"realCheckbox",checked:a.stormctrl_ucast_enabled,onChange:({target:{checked:e}})=>{r("stormctrl_ucast_enabled",e),e||(r("stormctrl_ucast_rate",o.stormctrl_ucast_rate),r("stormctrl_ucast_level",o.stormctrl_ucast_level))},tooltipMessage:l.createElement(s.sA,{id:"COMMON_STORM_CONTROL_UNICAST_TOOLTIP"}),tooltipProps:{portal:!0}},l.createElement(s.sA,{id:"COMMON_PORTS_FORM_FIELD_STORMCTRL_UCAST_LABEL"}))),a.stormctrl_ucast_enabled?l.createElement(m.A,t&&a.stormctrl_type===J.d5.LEVEL?{name:"stormctrl_ucast_level",type:"number",value:a.stormctrl_ucast_level,variant:"secondary",contentAfter:"%",min:1,max:100,full:!0,className:Z.rH,disabled:e}:{name:"stormctrl_ucast_rate",type:"number",variant:"secondary",contentAfter:l.createElement(s.sA,{id:"COMMON_PORTS_FORM_FIELD_STORMCTRL_UNIT"}),full:!0,className:Z.rH,disabled:e}):null),l.createElement(A.A,{gap:_.Ln,justifyContent:"space-between",paddingLeft:_.S2},l.createElement(Z.l2,null,l.createElement(X.A,{reason:M?l.createElement(s.sA,{id:"PORTS_MULTICAST_SET_BY_AV"}):void 0},l.createElement(A.A,null,l.createElement(m.A,{disabled:e,name:"stormctrl_mcast_enabled",type:"realCheckbox",checked:a.stormctrl_mcast_enabled&&!M,onChange:({target:{checked:e}})=>{r("stormctrl_mcast_enabled",e),e||(r("stormctrl_mcast_rate",o.stormctrl_mcast_rate),r("stormctrl_mcast_level",o.stormctrl_mcast_level))},tooltipMessage:l.createElement(s.sA,{id:"COMMON_STORM_CONTROL_MULTICAST_TOOLTIP"}),tooltipProps:{portal:!0}},l.createElement(s.sA,{id:"COMMON_MULTICAST"}))))),a.stormctrl_mcast_enabled&&!M?l.createElement(m.A,t&&a.stormctrl_type===J.d5.LEVEL?{name:"stormctrl_mcast_level",type:"number",value:a.stormctrl_mcast_level,variant:"secondary",contentAfter:"%",min:1,max:100,full:!0,className:Z.rH,disabled:e}:{name:"stormctrl_mcast_rate",type:"number",variant:"secondary",contentAfter:l.createElement(s.sA,{id:"COMMON_PORTS_FORM_FIELD_STORMCTRL_UNIT"}),full:!0,className:Z.rH,disabled:e}):null),l.createElement(A.A,{gap:_.Ln,justifyContent:"space-between",paddingLeft:_.S2},l.createElement(Z.l2,null,l.createElement(m.A,{disabled:e,name:"stormctrl_bcast_enabled",checked:a.stormctrl_bcast_enabled,type:"realCheckbox",onChange:({target:{checked:e}})=>{r("stormctrl_bcast_enabled",e),e||(r("stormctrl_bcast_rate",o.stormctrl_bcast_rate),r("stormctrl_bcast_level",o.stormctrl_bcast_level))},tooltipMessage:l.createElement(s.sA,{id:"COMMON_STORM_CONTROL_BROADCAST_TOOLTIP"}),tooltipProps:{portal:!0}},l.createElement(s.sA,{id:"COMMON_PORTS_FORM_FIELD_STORMCTRL_BCAST_LABEL"}))),a.stormctrl_bcast_enabled?l.createElement(m.A,t&&a.stormctrl_type===J.d5.LEVEL?{name:"stormctrl_bcast_level",type:"number",value:a.stormctrl_bcast_level,variant:"secondary",contentAfter:"%",min:1,max:100,full:!0,className:Z.rH,disabled:e}:{name:"stormctrl_bcast_rate",type:"number",variant:"secondary",contentAfter:l.createElement(s.sA,{id:"COMMON_PORTS_FORM_FIELD_STORMCTRL_UNIT"}),full:!0,className:Z.rH,disabled:e}):null)):null,C&&a.stormControlEnabled?l.createElement(y.A,{isInvalid:!0,label:C}):null)},te=({disabled:e})=>{const{values:t,initialValues:a,setFieldValue:n}=(0,c.j7)();return l.createElement(Z.l2,{justifyContent:"space-between",width:"100%"},l.createElement(m.A,{name:"egress_rate_limit_kbps_enabled",type:"realCheckbox",disabled:e,onChange:({target:{checked:e}})=>{n("egress_rate_limit_kbps_enabled",e),e||n("egress_rate_limit_kbps",a.egress_rate_limit_kbps)},tooltipMessage:l.createElement(s.sA,{id:"COMMON_EGRESS_TOOLTIP"}),tooltipProps:{portal:!0}},l.createElement(s.sA,{id:"COMMON_DEVICE_CAP_SWITCH_CAP_EGRESS_RATE_LIMIT"})),t.egress_rate_limit_kbps_enabled?l.createElement(m.A,{name:"egress_rate_limit_kbps",type:"number",variant:"secondary",className:Z.rH,contentAfter:l.createElement(s.sA,{id:"COMMON_SPEED_METRICS_MBPS"}),min:1,max:1e3,full:!0}):null)},ae=({disabled:e,isPtpSupported:t,showPercentage:a,showQos:o=!0,showStormControl:c=!0,showEgressRateLimit:_=!0})=>l.createElement(n.A,{isDisabled:!!e},l.createElement(r.A,{title:l.createElement(s.sA,{id:o?"PORTS_PROAV_AND_TRAFFIC_CONTROL":"PORTS_TRAFFIC_CONTROL"})},o?l.createElement(z,{disabled:e,isPtpSupported:t}):null,c?l.createElement(ee,{disabled:e,showPercentage:a}):null,_?l.createElement(te,{disabled:e}):null))},100615(e,t,a){a.d(t,{A:()=>V});var l=a(296540),n=a(641777),r=a(48925),s=a(916537),o=a(132196),c=a(951272),_=a(854246),i=a(41343),d=a(469733),m=a(592563),E=a(400261),O=a(393832),A=a(19607),u=a(263963),p=a(294303),C=a(543815),M=a(859510),T=a(239417),g=a(532419);const b=({addressList:e,changeAddressListCallback:t,disabled:a})=>{const{formatMessage:n}=(0,s.tz)(),r=(0,u.L_)(),[o,c]=(0,l.useState)(!1),_=(0,d.useSelector)(g.ID),b=(0,d.useSelector)(T.GB),S=(0,l.useMemo)(()=>[{id:"name",label:l.createElement(s.sA,{id:"COMMON_NAME"}),sortable:!1,renderCell:e=>(0,O.K)(_,b,e.item_id)}],[b,_]),R=(0,l.useMemo)(()=>({getDuplicationMessage:()=>n({id:"DEVICE_PORT_FORM_MAC_MUST_BE_UNIQUE"}),validate:e=>{const t=A.V.safeParse(e);return!!t.success||l.createElement(l.Fragment,null,r(t.error.issues[0]?.message))}}),[n,r]),L=(0,l.useCallback)(e=>{t(e)},[t]),N=(0,l.useCallback)(t=>{c(!1),L((0,i.A)([...e,...t.map(e=>(0,E.Z)(e))]))},[e,L]);return l.createElement(p.A,{width:"100%"},l.createElement(M.A,{disabled:a,labels:{fieldLabel:"COMMON_MAC_ADDRESS",modalTitle:l.createElement(s.sA,{id:"SETTINGS_SECURITY_ADD_MULTIPLE_MACS"}),modalFieldPlaceholder:n({id:"SETTINGS_SECURITY_MULTIPLE_MACS_PLACEHOLDER"})},fieldValidation:R,extraFieldConfig:{placeholder:n({id:"COMMON_PLACEHOLDER_EG"},{value:"ab:cd:ef:12:34:56"}),translatePlaceholder:!1,parser:e=>(0,E.Z)((Array.isArray(e)?e[0]?.target?.value:void 0)??"")},extraDisplayColumns:S,value:e,onChange:L,invalid:!1,actions:l.createElement(m.A,{type:"button",onPress:()=>c(!0),fontSize:"medium"},l.createElement(s.sA,{id:"COMMON_ADD_CLIENT"}))}),o?l.createElement(C.A,{onClose:()=>{c(!1)},onSubmit:N}):null)};var S=a(143811);const R=o.AH`
  align-items: start;
`,L=({disabled:e,isPortMacFilteringSupported:t})=>{const{values:a,setFieldValue:n,errors:r,submitCount:o}=(0,c.j7)(),i=!!a.macFilteringEnabled,d=(0,l.useCallback)(()=>{i?(n("macFilteringEnabled",!1),n("port_security_mac_address",[])):n("macFilteringEnabled",!0)},[i,n]),m=(0,l.useCallback)(e=>{n("port_security_mac_address",e)},[n]);return t?l.createElement(l.Fragment,null,l.createElement(S.A,{name:"portSecurityRestricted",type:"realCheckbox",checked:i,onChange:d,disabled:e,tooltipMessage:l.createElement(s.sA,{id:"PORTS_MAC_ADDRESS_FILTER_TOOLTIP"})},l.createElement(s.sA,{id:"COMMON_MAC_ADDRESS_FILTER"})),i?l.createElement(p.A,{flexDirection:"column",className:R},l.createElement(b,{changeAddressListCallback:m,addressList:a.port_security_mac_address??[],disabled:!!e}),l.createElement(_.A,{visible:r&&!!o&&!!r.port_security_mac_address},r.port_security_mac_address)):null):null};var N=a(566723),v=a(504779),P=a(317672),f=a(768941),h=a(112707),I=a(987588);const D=[{label:"COMMON_PORTS_FORM_FIELD_DOT1X_CTRL_OPTION_AUTO",value:f.Je.AUTO},{label:"COMMON_PORTS_FORM_FIELD_DOT1X_CTRL_OPTION_FORCE_AUTHORIZED",value:f.Je.FORCE_AUTHORIZED},{label:"COMMON_PORTS_FORM_FIELD_DOT1X_CTRL_OPTION_FORCE_UNAUTHORIZED",value:f.Je.FORCE_UNAUTHORIZED},{label:"COMMON_PORTS_FORM_FIELD_DOT1X_CTRL_OPTION_MAC_BASED",value:f.Je.MAC_BASED},{label:"COMMON_PORTS_FORM_FIELD_DOT1X_CTRL_OPTION_MULTI_HOST",value:f.Je.MULTI_HOST}],k=({disabled:e,dot1xDisabledReason:t})=>{const{values:{dot1x_ctrl:a},setFieldValue:r,initialValues:o}=(0,c.j7)(),_=e||!!t;return l.createElement(p.A,{flexDirection:"column",gap:N.Ln},l.createElement(v.A,{reason:t,isInteractive:!0,position:"topStart"},l.createElement(S.A,{name:"dot1x_ctrl",checked:a,label:l.createElement(n.A,{isDisabled:!!_},l.createElement(P.A,{tooltip:l.createElement(s.sA,{id:"PORTS_DOT1X_TOOLTIP"}),tooltipProps:{portal:!0}},l.createElement(s.sA,{id:"COMMON_DEVICE_CAP_SWITCH_CAP_DOT1X"}))),type:"dropdown",options:D,translateOptions:!0,disabled:_,variant:"secondary",onChange:(e,t)=>{r("dot1x_ctrl",t),t!==f.Je.MAC_BASED&&r("dot1x_idle_timeout",o.dot1x_idle_timeout)},full:!0})),a===f.Je.MAC_BASED?l.createElement(S.A,{name:"dot1x_idle_timeout",label:"COMMON_PORTS_FORM_FIELD_IDLE_TIMEOUT_LABEL",type:"number",variant:"secondary",contentAfter:l.createElement(s.sA,{id:"COMMON_UNIT_SEC"}),min:h.S.MIN,max:h.S.MAX,full:!0,className:I.rH,disabled:_}):null)};var F=a(162420),w=a(263130),y=a(780811);const U=({disabled:e,model:t})=>{const{values:a}=(0,c.j7)(),n=a.isolation&&(0,y.CIk)({model:t});return l.createElement(p.A,{flexDirection:"column",gap:N.kc},l.createElement(I.l2,null,l.createElement(S.A,{name:"isolation",type:"realCheckbox",tooltipMessage:l.createElement(s.sA,{id:"COMMON_PORT_ISOLATION_DESC"}),disabled:e},l.createElement(s.sA,{id:"COMMON_DEVICE_CAP_SWITCH_CAP_PORT_ISOLATION"}))),n?l.createElement(w.A,{icon:l.createElement(F.A,{isActive:!0,size:"original",variant:"fill"}),description:l.createElement(s.sA,{id:"COMMON_PORT_ISOLATION_ALERT",values:{hyphen:l.createElement(l.Fragment,null,"‑")}})}):null)},V=({disabled:e,showSecurityMac:t=!0,isPortMacFilteringSupported:a,showDot1x:o=!0,dot1xDisabledReason:c,showIsolation:_=!0,model:i})=>l.createElement(n.A,{isDisabled:!!e},l.createElement(r.A,{title:l.createElement(s.sA,{id:"PORTS_PORT_SECURITY"})},t?l.createElement(L,{disabled:e,isPortMacFilteringSupported:a}):null,o?l.createElement(k,{disabled:e,dot1xDisabledReason:c}):null,_?l.createElement(U,{disabled:e,model:i}):null))},63105(e,t,a){a.d(t,{A:()=>F});var l=a(296540),n=a(641777),r=a(48925),s=a(916537),o=a(951272),c=a(596176),_=a(143811),i=a(936621),d=a(987588);const m=({disabled:e})=>{const{setFieldValue:t,values:a}=(0,o.j7)(),n=(0,l.useCallback)(({target:{checked:e}})=>{t("lldpmed_enabled",e),a.lldpmed_enabled&&(t("voiceNetworkConfEnabled",!1),t("voice_networkconf_id",i.F))},[t,a.lldpmed_enabled]);return l.createElement(d.l2,{width:"100%"},l.createElement(_.A,{name:"lldpmed_enabled",type:"realCheckbox",disabled:e,onChange:n,tooltipMessage:l.createElement(c.A,{messages:[["COMMON_LLDP_MED_TOOLTIP_1"],["COMMON_LLDP_MED_TOOLTIP_2"]]}),tooltipProps:{portal:!0}},l.createElement(s.sA,{id:"COMMON_DEVICE_CAP_SWITCH_CAP_LLDP_MED"})))};var E=a(469733),O=a(180524),A=a(566723),u=a(294303),p=a(32047);const C=({disabled:e})=>{const{values:t,setFieldValue:a}=(0,o.j7)(),n=(0,E.useSelector)((0,p.c)(t.native_networkconf_id,t.taggedVlans,t.tagged_vlan_mgmt)),r=!e&&0===n.length&&t.voice_networkconf_id===i.F,c=!e&&!t.lldpmed_enabled,{disableMessage:m,fieldDisabled:C}=(0,l.useMemo)(()=>{const t=r||c||e;return{disableMessage:(()=>{if(r)return l.createElement(s.sA,{id:"COMMON_PORTS_FORM_FIELD_VOICE_NETWORKCONF_ID_DISABLED_NO_OPTIONS"})})(),fieldDisabled:t}},[e,r,c]);return l.createElement(u.A,{flexDirection:"column",gap:A.kc},l.createElement(d.l2,{width:"100%"},l.createElement(O.A,{description:m},l.createElement("span",null,l.createElement(_.A,{name:"voiceNetworkConfEnabled",type:"realCheckbox",disabled:C,onChange:({target:{checked:e}})=>{a("voiceNetworkConfEnabled",e),e||a("voice_networkconf_id",i.F)},tooltipMessage:C?void 0:l.createElement(s.sA,{id:"COMMON_PORTS_FORM_FIELD_VOICE_NETWORKCONF_ID_LABEL_DESC_1"}),tooltipProps:{portal:!0},checked:t.voiceNetworkConfEnabled},l.createElement(s.sA,{id:"COMMON_PORTS_FORM_FIELD_VOICE_NETWORKCONF_ID_LABEL"}))))),t.voiceNetworkConfEnabled?l.createElement(_.A,{searchable:!0,name:"voice_networkconf_id",options:n,type:"dropdown",sortedOptions:!0,full:!0,variant:"secondary"}):null)};var M=a(396660),T=a(79760),g=a(15095),b=a(504779),S=a(836645),R=a(196010),L=a(627440),N=a(959207),v=a(366188),P=a(959341),f=a(768195),h=a(553432),I=a(302167),D=a(877299);const k=({disabled:e})=>{const t=(0,E.useSelector)(v.Ct),a=(0,g.A)(`${L.VO.SETTINGS}/${P.Cs}`),{values:n,setFieldValue:r,errors:c,touched:i,submitCount:m}=(0,o.j7)(),O=(0,E.useSelector)(I.s4),{multicast_router_networkconf_ids:p,multicast_router_mode:C}=n,k=!O.enabled,F=(0,l.useMemo)(()=>t.filter(e=>O.network_ids?.includes(e._id)&&(0,N.H2)(e)).sort(M.Cv).map(e=>{const t=!(0,D.iw)(n.tagged_vlan_mgmt,n.native_networkconf_id,n.taggedVlans,[e._id])&&!n.multicast_router_networkconf_ids?.includes(e._id);return{label:(0,N.gm)(e),additionalInfo:(0,N.mC)(e),value:e._id,disabled:t,tooltipDescription:t?l.createElement(s.sA,{id:"COMMON_VLAN_NOT_CONFIGURED_FOR_PORT"}):null,tooltipPortal:!0}}),[t,O.network_ids,n.tagged_vlan_mgmt,n.native_networkconf_id,n.multicast_router_networkconf_ids,n.taggedVlans]),w=(0,l.useMemo)(()=>(0,D.iw)(n.tagged_vlan_mgmt,n.native_networkconf_id,n.taggedVlans,O.network_ids),[n.tagged_vlan_mgmt,n.native_networkconf_id,n.taggedVlans,O.network_ids]),y=(0,T.t$)("multicast_router_networkconf_ids",c,i,m),U=k?l.createElement(s.sA,{id:"PORTS_IGMP_MULTICAST_ROUTER_PORT_DISABLED_DESCRIPTION",values:{link:l.createElement(R.A,{to:a},l.createElement(s.sA,{id:"COMMON_IGMP_SNOOPING"}))}}):w||n.multicast_router_mode!==f.bK.NONE?null:l.createElement(s.sA,{id:"COMMON_MULTICAST_ROUTER_PORT_NETWORK_MISMATCH_DESCRIPTION"});return l.createElement(u.A,{flexDirection:"column",gap:A.kc,width:"100%"},l.createElement(b.A,{reason:U,isInteractive:!0,position:"topStart"},l.createElement(d.l2,{justifyContent:"space-between",width:"100%"},l.createElement(_.A,{type:"realCheckbox",full:!0,disabled:e,name:"multicast_router_mode",label:"COMMON_MULTICAST_ROUTER_PORT",checked:C!==f.bK.NONE,tooltipMessage:l.createElement(s.sA,{id:"COMMON_MULTICAST_ROUTER_PORTS_TOOLTIP"}),tooltipProps:{portal:!0},afterChange:e=>{r("multicast_router_mode",e?f.bK.ALL:f.bK.NONE)}},l.createElement(s.sA,{id:"COMMON_MULTICAST_ROUTER_PORT"}))),C!==f.bK.NONE?l.createElement(h.A,null,l.createElement(_.A,{value:f.bK.ALL,type:"radio",name:"multicast_router_mode",disabled:e},l.createElement(s.sA,{id:"COMMON_ALL_IGMP_VLANS"})),l.createElement(_.A,{value:f.bK.CUSTOM,type:"radio",name:"multicast_router_mode",disabled:e},l.createElement(s.sA,{id:"COMMON_CUSTOM"}))):null,C===f.bK.CUSTOM?l.createElement(u.A,{width:"100%",flexDirection:"column"},l.createElement(S.A,{options:F,disabled:e,isDefaultOpen:0===p?.length,list:p,onChange:e=>{r("multicast_router_networkconf_ids",e)},validationMessage:y,isFullWidth:!0,truncateLabels:!0,triggerButtonText:"COMMON_ACTION_SELECT_VLANS"})):null))},F=({disabled:e,showLldpMed:t=!0,showVoiceNetwork:a=!0,showMulticastRouterPort:o=!0})=>l.createElement(n.A,{isDisabled:!!e},l.createElement(r.A,{title:l.createElement(s.sA,{id:"COMMON_SERVICES"})},t?l.createElement(m,{disabled:e}):null,a?l.createElement(C,{disabled:e}):null,o?l.createElement(k,{disabled:e}):null))},587310(e,t,a){a.d(t,{A:()=>m});var l=a(296540),n=a(641777),r=a(48925),s=a(916537),o=a(174897),c=a(596176),_=a(143811),i=a(987588);const d=({disabled:e})=>l.createElement(i.l2,null,l.createElement(_.A,{name:"port_keepalive_enabled",type:"realCheckbox",disabled:e,tooltipMessage:l.createElement(c.A,{messages:[["COMMON_KEEP_ALIVE_TOOLTIP"],["COMMON_KEEP_ALIVE_TOOLTIP_2"]]}),tooltipProps:{portal:!0}},l.createElement(s.sA,{id:"COMMON_LOOP_PROTECTION"}))),m=({disabled:e,showStp:t=!0,showBpduGuard:a,showAutoEdge:c,showUplink:_,isUplink:i,showKeepAliveLoopProtection:m=!0})=>l.createElement(n.A,{isDisabled:!!e},l.createElement(r.A,{title:l.createElement(s.sA,{id:"PORTS_LAYER_2_STP_GUARD"})},t?l.createElement(o.A,{disabled:e,showBpduGuard:a,showAutoEdge:c,showUplink:_,isUplink:i}):null,m?l.createElement(d,{disabled:e}):null))},104436(e,t,a){a.d(t,{HX:()=>C,Ib:()=>A,l8:()=>p,mH:()=>u,tI:()=>E,tn:()=>M,v7:()=>d,xc:()=>m});var l=a(296540),n=a(870443),r=a(916537),s=a(768941),o=a(153643),c=a(24006),_=a(112707),i=a(768195);const d=e=>n.A.number().when(["stormctrl_type",`stormctrl_${e}_enabled`],{is:(e,t)=>e===s.d5.RATE&&t,then:n.A.number().label(`COMMON_PORTS_FORM_FIELD_STORMCTRL_${e.toUpperCase()}_LABEL`).min(o.A.MIN).max(o.A.MAX).integer().required()}),m=e=>n.A.number().when(["stormctrl_type",`stormctrl_${e}_enabled`],{is:(e,t)=>e===s.d5.LEVEL&&t,then:n.A.number().label(`COMMON_PORTS_FORM_FIELD_STORMCTRL_${e.toUpperCase()}_LABEL`).min(o.r.MIN).max(o.r.MAX).integer().required()}),E=n.A.number().when("dot1x_ctrl",{is:e=>e===s.Je.MAC_BASED,then:n.A.number().label("COMMON_PORTS_FORM_FIELD_IDLE_TIMEOUT_LABEL").min(_.S.MIN).max(_.S.MAX).required()}),O=(e=!1)=>{const t=e?c.A.M:c.A.k;return l.createElement(r.sA,{id:"COMMON_VALIDATION_HINT_RANGE",values:{min:t.MIN,max:t.MAX}})},A=n.A.number().when(["egress_rate_limit_kbps_enabled"],{is:!0,then:n.A.number().required(O(!0)).min(c.A.M.MIN,O(!0)).max(c.A.M.MAX,O(!0))}),u=n.A.array().of(n.A.string()).test({name:"dontAllowEmptyTaggedVlansWhileCustom",test:(e,t)=>t.parent.tagged_vlan_mgmt!==i.sg.CUSTOM||t.parent.taggedVlans?.length>0||t.createError({message:l.createElement(r.sA,{id:"PORTS_FORM_TAGGED_VLANS_VALIDATION"})})}),p=n.A.bool().test({name:"lldpmedEnabledValid",test:(e,t)=>!(!e&&t.parent.op_mode===s.RC.SWITCH&&t.parent.voice_networkconf_id),message:l.createElement(r.sA,{id:"COMMON_PORTS_FORM_FIELD_LLDPMED_ENABLED_VALIDATION_REQUIRED"})}),C=n.A.boolean().test({name:"atLeastOneQosRule",test:(e,t)=>!(e&&!((t.parent.qos_profile?.qos_policies?.length??0)>0))||t.createError({message:l.createElement(r.sA,{id:"PORTS_FORM_VALIDATION_QOS_AT_LEAST_ONE_POLICY"})})}),M=n.A.bool().test({name:"atLeastOneStormCtrlEnabled",test:(e,t)=>{if(!e)return!0;const{stormctrl_bcast_enabled:a,stormctrl_ucast_enabled:n,stormctrl_mcast_enabled:s}=t.parent;return!!(a||n||s)||t.createError({message:l.createElement(r.sA,{id:"PORTS_FORM_VALIDATION_STORMCTRL_AT_LEAST_ONE_ENABLED"})})}})},696097(e,t,a){a.d(t,{A:()=>d});var l=a(296540),n=a(951272),r=a(180524),s=a(566723),o=a(143811),c=a(294303),_=a(916537),i=a(987588);const d=({disabled:e,disableReason:t,overrideValue:a})=>{const{values:d}=(0,n.j7)(),m=a??d.flow_control_enabled;return l.createElement(c.A,{flexDirection:"column",gap:s.kc},l.createElement(r.A,{description:e?t:void 0},l.createElement(i.l2,null,l.createElement(o.A,{name:"flow_control_enabled",type:"realCheckbox",tooltipMessage:t?void 0:l.createElement(_.sA,{id:"COMMON_FLOW_CONTROL_TOOLTIP"}),disabled:e,checked:m},l.createElement(_.sA,{id:"COMMON_FLOW_CONTROL"})))))}},898257(e,t,a){a.d(t,{A:()=>c});var l=a(296540),n=a(594827),r=a(774570),s=a(143811),o=a(916537);const c=({disabled:e,networkGroup:t})=>{const{formatMessage:a}=(0,o.tz)(),c=!!t&&(0,n.pg)(t),_=t?"PORTS_NAME_WITH_INTERFACE":"COMMON_NAME",i=t?{networkGroup:c?(0,n.qY)(t,a):(0,r.bR)(t,a)}:{};return l.createElement(s.A,{disabled:e,full:!0,name:"name",placeholder:"COMMON_DEFAULT",variant:"secondary",label:_,labelValues:i,translateLabel:!0})}},961863(e,t,a){a.d(t,{A:()=>p});var l=a(296540),n=a(469733),r=a(720903),s=a(951272),o=a(805837),c=a(396660),_=a(641777),i=a(596176),d=a(317672),m=a(143811),E=a(916537),O=a(936621),A=a(959207),u=a(366188);const p=({disabled:e,hideTooltip:t})=>{const{formatMessage:a}=(0,E.tz)(),p=(0,n.useSelector)(u.SB),{values:C,setFieldValue:M}=(0,s.j7)(),T=(0,l.useMemo)(()=>[...(0,r.A)(p).sort(c.Cv).map(e=>({label:(0,A.gm)(e),value:e._id,additionalInfo:(0,A.mC)(e)})),{label:a({id:"COMMON_NONE"}),value:O.F}],[p,a]);return l.createElement(m.A,{disabled:e,full:!0,name:"native_networkconf_id",onChange:({value:e})=>{M("native_networkconf_id",e),C.taggedVlans?.includes(e)&&M("taggedVlans",C.taggedVlans?.filter(t=>t!==e)),C.voice_networkconf_id===e&&(M("voice_networkconf_id",O.F),M("voiceNetworkConfEnabled",!1))},options:T,renderOption:o.q,searchable:!0,type:"dropdown",variant:"secondary",label:l.createElement(_.A,{isDisabled:!!e},l.createElement(d.A,{tooltip:t?null:l.createElement(i.A,{messages:[["COMMON_PORTS_FORM_NATIVE_LABEL_DESC"],["COMMON_PORTS_FORM_NATIVE_LABEL_DESC_2"]]})},l.createElement(E.sA,{id:"COMMON_PORTS_NATIVE_VLAN_NETWORKS"})))})}},173068(e,t,a){a.d(t,{A:()=>T});var l=a(296540),n=a(951272),r=a(162420),s=a(566723),o=a(596176),c=a(854246),_=a(143811),i=a(294303),d=a(263130),m=a(916537),E=a(768941),O=a(356927),A=a(457329),u=a(768195),p=a(204751),C=a(161374),M=a(987588);const T=({disabled:e,optionsOverride:t,showFec:a,media:T,showMixedSpeedWarning:g})=>{const{values:b,setFieldValue:S,errors:R,setValues:L}=(0,n.j7)(),N=Object.keys(O.A).map(C.MT),v=(0,l.useCallback)(e=>{const{value:t}=e,{autoneg:a,full_duplex:l,speed:n}=O.A[t],r=A.e.includes(t)?(0,C.Tg)(n):u._t.DISABLED;L({...b,autoneg:a,full_duplex:l,speed:n,portSpeed:t,fec_mode:r})},[L,b]),P=b.portconf_id||!t?N:t,f=(0,l.useMemo)(()=>{const e=P.filter(e=>e.value!==E.n5.PORTSPEED_AUTO_NEG),t=(0,C.it)(e.map(e=>e.value)),a=new Map(e.map(e=>[e.value,e]));return t.map(e=>a.get(e))},[P]),h=(0,l.useCallback)(e=>{e.currentTarget.checked?v({value:E.n5.PORTSPEED_AUTO_NEG}):f[0]&&v({value:f[0].value})},[f,v]);(0,l.useEffect)(()=>{if(!P.some(e=>e.value===b.portSpeed)){const{autoneg:e,full_duplex:t,speed:a}=O.A[E.n5.PORTSPEED_AUTO_NEG];L({...b,autoneg:e,full_duplex:t,speed:a,portSpeed:E.n5.PORTSPEED_AUTO_NEG})}},[P,L,b,b.portconf_id]);const I=b.portSpeed===E.n5.PORTSPEED_AUTO_NEG,D=a&&P.some(e=>A.e.includes(e.value));return l.createElement(l.Fragment,null,l.createElement(i.A,{flexDirection:"column",width:"100%"},l.createElement(M.l2,null,l.createElement(_.A,{name:"autoneg",checked:I,type:"realCheckbox",disabled:e,onChange:h,tooltipMessage:D?l.createElement(m.sA,{id:T===p.kC.QSFP28?"COMMON_PORTS_FORM_FIELD_PORT_SPEED_TOOLTIP_QSFP_FEC":"COMMON_PORTS_FORM_FIELD_PORT_SPEED_TOOLTIP_FEC"}):void 0},l.createElement(m.sA,{id:"COMMON_AUTO_NEGOTIATE_LINK_SPEED"}))),I?null:l.createElement(_.A,{name:"portSpeed",options:f,translateOptions:!0,type:"dropdown",full:!0,variant:"secondary",onChange:v,disabled:e}),l.createElement(c.A,{visible:!!R.portSpeed},R.portSpeed),g&&b.portSpeed===E.n5.PORTSPEED_FULL_25G?l.createElement(d.A,{marginTop:s.kc,icon:l.createElement(r.A,{isActive:!0,size:"original",variant:"fill"}),description:l.createElement(m.sA,{id:"COMMON_PORT_FORM_LINK_SPEED_SFP28_ALERT"})}):null,I?null:l.createElement(d.A,{marginTop:s.kc,icon:l.createElement(r.A,{isActive:!0,size:"original",variant:"fill"}),description:l.createElement(m.sA,{id:"COMMON_PORT_FORM_LINK_SPEED_NON_AUTO_NEG_ALERT"})})),A.e.includes(b.portSpeed)&&a?l.createElement(i.A,{flexDirection:"column"},l.createElement(M.l2,null,l.createElement(_.A,{name:"fec_mode_enabled",checked:b.fec_mode!==u._t.DISABLED,type:"realCheckbox",disabled:e,onChange:({target:{checked:e}})=>{S("fec_mode",e?(0,C.Tg)(O.A[b.portSpeed].speed):u._t.DISABLED)},tooltipMessage:l.createElement(o.A,{messages:[["COMMON_PORTS_FORM_FIELD_PORT_SPEED_FEC_TOOLTIP_1"],["COMMON_PORTS_FORM_FIELD_PORT_SPEED_FEC_TOOLTIP_2"]]})},l.createElement(m.sA,{id:"COMMON_PORTS_FORM_FIELD_PORT_SPEED_FEC_LABEL"}))),b.fec_mode!==u._t.DISABLED?l.createElement(_.A,{searchable:!0,name:"fec_mode",disabled:e,options:A.p[b.portSpeed],type:"dropdown",full:!0,variant:"secondary"}):null):null)}},928402(e,t,a){a.d(t,{A:()=>A});var l=a(296540),n=a(469733),r=a(951272),s=a(553432),o=a(349665),c=a(143811),_=a(641777),i=a(317672),d=a(916537),m=a(936621),E=a(366188),O=a(768195);const A=({disabled:e})=>{const{values:t,setValues:a}=(0,r.j7)(),A=(0,n.useSelector)(E.nT),u=!!t.portDisabled,p=(0,l.useCallback)(e=>{const l={portDisabled:!e,macFilteringEnabled:!1};e||(l.port_security_mac_address=[],l.tagged_vlan_mgmt=O.sg.BLOCK_ALL,l.taggedVlans=[],l.voice_networkconf_id=m.F,l.voiceNetworkConfEnabled=!1,l.native_networkconf_id=m.F),e&&t.portDisabled&&A?._id&&(l.port_security_mac_address=[],l.tagged_vlan_mgmt=O.sg.AUTO,l.native_networkconf_id=A._id),a({...t,...l})},[A?._id,a,t]);return l.createElement(o.A,null,l.createElement(_.A,{isDisabled:!!e},l.createElement(i.A,null,l.createElement(d.sA,{id:"PORTS_PORT_STATE"}))),l.createElement(s.A,null,l.createElement(c.A,{value:"true",type:"radio",name:"portStateRadio",checked:!u,onChange:()=>p(!0),disabled:e},l.createElement(d.sA,{id:"COMMON_ACTIVE"})),l.createElement(c.A,{value:"false",type:"radio",name:"portStateRadio",checked:u,onChange:()=>p(!1),disabled:e},l.createElement(d.sA,{id:"COMMON_DISABLED"}))))}},877995(e,t,a){a.d(t,{L:()=>r});var l=a(189643),n=a(204751);const r={qos_marking:{cos_code:n.hQ.BACKGROUND,dscp_code:n.ee.DEFAULT,ip_precedence_code:n.lF.ROUTINE,queue:0},qos_matching:{cos_code:n.hQ.BACKGROUND,dscp_code:n.ee.DEFAULT,ip_precedence_code:n.lF.ROUTINE,protocol:l.aS.ALL},enableDestinationPort:!1,enableSourcePort:!1,enableQosMarking:!1,matchingTrafficType:n.ev.DSCP,markingTrafficType:n.ev.DSCP,protocolNumber:0}},205975(e,t,a){a.d(t,{Dz:()=>i,JS:()=>_,zN:()=>d});var l=a(189643),n=a(573531),r=a(204751),s=a(949330),o=a(877995);const c=e=>void 0!==e.cos_code?`CoS ${e.cos_code} (${s.e8[e.cos_code]})`:void 0!==e.dscp_code?`DSCP ${e.dscp_code}${s.HH[e.dscp_code]?` (${s.HH[e.dscp_code]})`:""}`:void 0!==e.ip_precedence_code?`IPP ${e.ip_precedence_code} (${s.Dc[e.ip_precedence_code]})`:n.L,_=e=>e.map((e,t)=>({matchProtocol:e.qos_matching.protocol??l.aS.ALL,matchType:c(e.qos_matching),remark:c(e.qos_marking),queue:e.qos_marking.queue,id:t})),i=e=>{const t={qos_marking:{...e.qos_marking},qos_matching:{...e.qos_matching}};switch(e.qos_matching.protocol===l.aS.ALL&&(delete t.qos_matching.src_port,delete t.qos_matching.dst_port,delete t.qos_matching.protocol),e.qos_matching.protocol===l.aS.NUMBER&&(t.qos_matching.protocol=e.protocolNumber),e.enableDestinationPort||delete t.qos_matching.dst_port,e.enableSourcePort||delete t.qos_matching.src_port,e.markingTrafficType){case r.ev.DSCP:delete t.qos_marking.cos_code,delete t.qos_marking.ip_precedence_code;break;case r.ev.COS:delete t.qos_marking.dscp_code,delete t.qos_marking.ip_precedence_code}switch(e.matchingTrafficType){case r.ev.DSCP:delete t.qos_matching.cos_code,delete t.qos_matching.ip_precedence_code;break;case r.ev.IP_PRECEDENCE:delete t.qos_matching.dscp_code,delete t.qos_matching.cos_code;break;case r.AC:delete t.qos_matching.dscp_code,delete t.qos_matching.cos_code,delete t.qos_matching.ip_precedence_code}return e.enableQosMarking||(delete t.qos_marking.cos_code,delete t.qos_marking.dscp_code,delete t.qos_marking.ip_precedence_code),t},d=e=>{const t={qos_marking:{cos_code:e.qos_marking.cos_code||o.L.qos_marking.cos_code,dscp_code:e.qos_marking.dscp_code||o.L.qos_marking.dscp_code,ip_precedence_code:e.qos_marking.ip_precedence_code||o.L.qos_marking.ip_precedence_code,queue:e.qos_marking.queue||o.L.qos_marking.queue},qos_matching:{protocol:"number"==typeof e?.qos_matching?.protocol?l.aS.NUMBER:e.qos_matching.protocol||o.L.qos_matching.protocol,cos_code:e.qos_matching.cos_code||o.L.qos_matching.cos_code,dscp_code:e.qos_matching.dscp_code||o.L.qos_matching.dscp_code,ip_precedence_code:e.qos_matching.ip_precedence_code||o.L.qos_matching.ip_precedence_code,dst_port:e.qos_matching.dst_port||o.L.qos_matching.dst_port,src_port:e.qos_matching.src_port||o.L.qos_matching.src_port}};return t.enableDestinationPort=void 0!==e.qos_matching.dst_port,t.enableSourcePort=void 0!==e.qos_matching.src_port,t.enableQosMarking=void 0!==e.qos_marking.cos_code||void 0!==e.qos_marking.dscp_code||void 0!==e.qos_marking.ip_precedence_code,t.markingTrafficType=void 0!==e.qos_marking.cos_code?r.ev.COS:r.ev.DSCP,t.matchingTrafficType=void 0!==e.qos_matching.dscp_code?r.ev.DSCP:void 0!==e.qos_matching.ip_precedence_code?r.ev.IP_PRECEDENCE:r.AC,t.protocolNumber="number"==typeof e.qos_matching.protocol?e.qos_matching.protocol:0,t}},174897(e,t,a){a.d(t,{A:()=>T,c:()=>M});var l=a(296540),n=a(951272),r=a(596176),s=a(143811),o=a(916537),c=a(349665),_=a(566723),i=a(294303),d=a(768195),m=a(317672),E=a(553432),O=a(641777),A=a(504779),u=a(147606),p=a(491817),C=a(987588);const M=l.createElement(r.A,{messages:[["COMMON_SPANNING_TREE_TOOLTIP"],["COMMON_SPANNING_TREE_TOOLTIP_2"]]}),T=({disabled:e,showBpduGuard:t,showAutoEdge:a,showUplink:r,isUplink:T})=>{const{values:g,setValues:b,setFieldValue:S}=(0,n.j7)(),R=t||a||r,L=(0,l.useCallback)(e=>{e||b({...g,stp_port_mode:e,stp_edge_state:p.ZV.stp_edge_state,stp_uplink:p.ZV.stp_uplink,stp_bpdu_guard_enabled:p.ZV.stp_bpdu_guard_enabled})},[g,b]);(0,l.useEffect)(()=>{T&&g.stp_bpdu_guard_enabled&&S("stp_bpdu_guard_enabled",!1)},[T,g.stp_bpdu_guard_enabled,S]);const N=!!T,v=(0,l.useMemo)(()=>l.createElement(s.A,{name:"stp_bpdu_guard_enabled",type:"realCheckbox",checked:g.stp_bpdu_guard_enabled,tooltipMessage:l.createElement(o.sA,{id:"PORTS_BPDU_GUARD_TOOLTIP"}),tooltipProps:{portal:!0},onChange:()=>{g.stp_bpdu_guard_enabled&&S("stp_bpdu_guard_enabled",!1)}},l.createElement(o.sA,{id:"PORTS_BPDU_GUARD"})),[g.stp_bpdu_guard_enabled,S]);return l.createElement(O.A,{isDisabled:!!e},l.createElement(i.A,{flexDirection:"column",gap:_.kc},l.createElement(C.l2,null,l.createElement(s.A,{name:"stp_port_mode",type:"realCheckbox",checked:g.stp_port_mode,tooltipMessage:M,tooltipProps:{portal:!0},afterChange:L},l.createElement(o.sA,{id:"COMMON_DEVICE_CAP_SWITCH_CAP_STP"}))),g.stp_port_mode&&R?l.createElement(c.A,{gap:_.Ln,paddingLeft:_.S2},a?l.createElement(l.Fragment,null,l.createElement(c.A,null,l.createElement(m.A,{htmlFor:"stp_edge_state",tooltip:l.createElement(o.sA,{id:"PORTS_STP_EDGE_TOOLTIP"})},l.createElement(o.sA,{id:"PORTS_STP_EDGE"})),l.createElement(E.A,null,l.createElement(s.A,{value:d.MV.AUTO,type:"radio",name:"stp_edge_state",tooltipMessage:l.createElement(o.sA,{id:"PORTS_STP_EDGE_AUTO_TOOLTIP"}),tooltipProps:{portal:!0}},l.createElement(o.sA,{id:"COMMON_AUTO"})),l.createElement(s.A,{value:d.MV.ENABLED,type:"radio",name:"stp_edge_state",tooltipMessage:l.createElement(o.sA,{id:"PORTS_STP_EDGE_ENABLED_TOOLTIP"}),tooltipProps:{portal:!0}},l.createElement(o.sA,{id:"COMMON_ENABLED"})),l.createElement(s.A,{value:d.MV.DISABLED,type:"radio",name:"stp_edge_state",tooltipMessage:l.createElement(o.sA,{id:"PORTS_STP_EDGE_DISABLED_TOOLTIP"}),tooltipProps:{portal:!0}},l.createElement(o.sA,{id:"COMMON_DISABLED"}))))):null,r?l.createElement(C.l2,{justifyContent:"space-between",width:"100%"},l.createElement(s.A,{name:"stp_uplink",type:"realCheckbox",checked:g.stp_uplink,tooltipMessage:l.createElement(o.sA,{id:"PORTS_STP_UPLINK_TOOLTIP"}),tooltipProps:{portal:!0}},l.createElement(o.sA,{id:"PORTS_STP_UPLINK"}))):null,t?l.createElement(i.A,null,l.createElement(A.A,{reason:N?l.createElement(o.sA,{id:"PORTS_BPDU_GUARD_DISABLED_UPLINK"}):null},g.stp_bpdu_guard_enabled||N?v:l.createElement(u.A,{message:l.createElement(o.sA,{id:"PORTS_BPDU_GUARD_ENABLE_CONFIRMATION_MESSAGE"}),title:l.createElement(o.sA,{id:"PORTS_BPDU_GUARD_ENABLE_CONFIRMATION_TITLE"}),confirmButtonLabel:"COMMON_ACTION_CONFIRM",onConfirm:()=>{S("stp_bpdu_guard_enabled",!0)},trigger:l.createElement("div",null,v)}))):null):null))}},699736(e,t,a){a.d(t,{A:()=>f});var l=a(296540),n=a(956347),r=a(469733),s=a(951272),o=a(758649),c=a(217439),_=a(162420),i=a(79760),d=a(566723),m=a(596176),E=a(553432),O=a(836645),A=a(317672),u=a(143811),p=a(294303),C=a(263130),M=a(627440),T=a(916537),g=a(187483),b=a(936621),S=a(366188),R=a(768195),L=a(242281),N=a(959341),v=a(641777),P=a(32047);const f=({disabled:e,isVlanTaggingSupported:t,showSwitchVlanLimit:a,showApVlanLimit:f})=>{const h=(0,n.W6)(),{site:I}=(0,n.g)(),D=(0,r.useSelector)(g.Xt),k=(0,n.tW)(D,{site:I}),{values:{native_networkconf_id:F,tagged_vlan_mgmt:w,voice_networkconf_id:y,taggedVlans:U,portconf_id:V},setFieldValue:q,errors:G,touched:B,submitCount:x,values:$,setValues:H}=(0,s.j7)(),K=(0,r.useSelector)((0,S.lq)(F)),W=(0,r.useSelector)((0,P.y)(F)),j=(0,l.useCallback)(e=>{const t={};t.tagged_vlan_mgmt=e,t.taggedVlans=[],t.voice_networkconf_id=b.F,t.voiceNetworkConfEnabled=!1,H({...$,...t})},[H,$]),Q=(0,l.useCallback)(e=>{j(e)},[j]),Y=(0,l.useCallback)(()=>{h.push(`${k}/${M.VO.SETTINGS}/${N.E5}`)},[h,k]),z=0===W?.length||!t;return(0,l.useEffect)(()=>{w===R.sg.CUSTOM&&z&&!V&&j(R.sg.AUTO)},[w,z,j,V]),(0,l.useEffect)(()=>{t||V||K||q("tagged_vlan_mgmt",R.sg.BLOCK_ALL)},[t,K,q,V,F]),l.createElement(l.Fragment,null,t?null:l.createElement(C.A,{icon:l.createElement(_.A,{isActive:!0,size:"original",variant:"fill"}),description:l.createElement(T.sA,{id:"PORTS_FORM_VLAN_TAGGING_NOT_SUPPORTED"})}),l.createElement(p.A,{flexDirection:"column"},l.createElement(v.A,{isDisabled:e},l.createElement(A.A,{tooltip:l.createElement(m.A,{messages:[["COMMON_PORTS_FORM_TAGGED_VLAN_MODE_DESC"],["COMMON_PORTS_FORM_TAGGED_VLAN_MODE_DESC_2"],["COMMON_PORTS_FORM_TAGGED_VLAN_MODE_DESC_3"]]})},l.createElement(T.sA,{id:"COMMON_PORTS_TAGGED_VLAN_MANAGEMENT"}))),l.createElement(E.A,null,l.createElement(u.A,{value:R.sg.AUTO,type:"radio",name:"tagged_vlan_mgmt",onChange:()=>Q(R.sg.AUTO),disabled:e||!t&&!K},l.createElement(T.sA,{id:"COMMON_ALLOW_ALL"})),l.createElement(u.A,{value:R.sg.BLOCK_ALL,type:"radio",name:"tagged_vlan_mgmt",onChange:()=>Q(R.sg.BLOCK_ALL),disabled:e},l.createElement(T.sA,{id:"COMMON_BLOCK_ALL"})),l.createElement(u.A,{value:R.sg.CUSTOM,type:"radio",name:"tagged_vlan_mgmt",disabled:e||z,onChange:()=>Q(R.sg.CUSTOM)},l.createElement(T.sA,{id:"COMMON_CUSTOM"}))),a?l.createElement(C.A,{marginTop:d.kc,icon:l.createElement(_.A,{isActive:!0,size:"original",variant:"fill"}),description:l.createElement(T.sA,{id:"PORTS_DEVICE_VLAN_LIMIT_INFO",values:{limit:L.Oz}})}):null,f?l.createElement(C.A,{marginTop:d.kc,icon:l.createElement(_.A,{isActive:!0,size:"original",variant:"fill"}),description:l.createElement(T.sA,{id:"PORTS_DEVICE_VLAN_LIMIT_INFO",values:{limit:L.pC}})}):null),w===R.sg.CUSTOM?l.createElement(p.A,{flexDirection:"column"},l.createElement(O.A,{options:W,list:U,onChange:e=>{const t={};t.taggedVlans=e,e.includes(y)||(t.voice_networkconf_id=b.F,t.voiceNetworkConfEnabled=!1),H({...$,...t})},disabled:e,triggerButtonText:"COMMON_ACTION_SELECT_VLANS",validationMessage:(0,i.t$)("taggedVlans",G,B,x),truncateLabels:!0,label:l.createElement(T.sA,{id:"COMMON_TAGGED_VLANS"}),tooltipDescription:l.createElement(p.A,{flexDirection:"column",gap:d.xO},l.createElement(c.A,{color:"text-1",size:"small"},l.createElement(T.sA,{id:"COMMON_PORTS_FORM_TAGGED_VLANS_DESC"})),l.createElement(c.A,{color:"text-1",size:"small"},l.createElement(T.sA,{id:"COMMON_PORTS_FORM_TAGGED_VLANS_DESC_2",values:{link:l.createElement(o.A,{type:"button",variant:"inline",onClick:Y},l.createElement(T.sA,{id:"COMMON_ETHERNET_PORT_PROFILE"}))}}))),tooltipProps:{portal:!0,isInteractive:!0}})):null)}},987588(e,t,a){a.d(t,{EV:()=>_,l2:()=>o,rH:()=>c});var l=a(71479),n=a(132196),r=a(566723),s=a(294303);const o=(0,l.A)(s.A)`
  min-height: ${r.fS};
  align-items: center;
  align-self: flex-start;
`,c=n.AH`
  max-width: 130px;
  width: 130px;
`,_=n.AH`
  > div {
    margin: 0 !important;
  }
`},32047(e,t,a){a.d(t,{c:()=>_,y:()=>c});var l=a(801081),n=a(396660),r=a(959207),s=a(366188),o=a(768195);const c=e=>(0,l.Mz)(s.Tn,t=>t.filter(({_id:t})=>t!==e).sort(n.Cv).map(e=>({label:(0,r.gm)(e),value:e._id,additionalInfo:(0,r.mC)(e)}))),_=(e,t,a)=>(0,l.Mz)(s.Tn,l=>l.filter(l=>(t.includes(l._id)||a===o.sg.AUTO)&&e!==l._id&&!(0,r.uH)(l)).sort(n.Cv).map(e=>({label:(0,r.gm)(e),value:e._id,additionalInfo:(0,r.mC)(e)})))},372737(e,t,a){var l;a.d(t,{U:()=>l}),function(e){e.ARROW_LEFT="ArrowLeft",e.ARROW_RIGHT="ArrowRight",e.ARROW_DOWN="ArrowDown",e.ARROW_UP="ArrowUp",e.ENTER="Enter",e.ESCAPE="Escape",e.BACKSPACE="Backspace",e.DELETE="Delete",e.TAB="Tab"}(l||(l={}))},393832(e,t,a){a.d(t,{K:()=>s});var l=a(573531),n=a(951106),r=a(6510);const s=(e,t,a)=>{const s=e.find(e=>e.mac===a);if(s){const e=(0,r.Q)(s);if(e&&e!==a)return e;const t=(0,r.Lm)(s.model);if(t)return t}const o=t.find(e=>"mac"in e&&e.mac===a);if(o){const e=(0,n.tn)(o);if(e&&e!==a)return e}return l.L}},634610(e,t,a){a.d(t,{A:()=>l});const l=function(e,t){const a={...e.advancedConfigSwap},l={...e,advancedConfigSwap:{}};return Object.keys(a).forEach(e=>{const t=a[e];a[e]=l[e],l[e]=t}),l.advancedConfigSwap=a,l.setting_preference=t,l}}}]);