"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[8032],{688032:(e,t,n)=>{n.r(t),n.d(t,{default:()=>U});var a=n(296540),r=n(54227),l=n(469733),c=n(553432),i=n(459449),s=n(582724),o=n(464265),d=n(598796),S=n(504779),u=n(959341),E=n(649594),_=n(532419),m=n(419042),G=n(602021),P=n(472926),p=n(49748),A=n(830137),T=n(467802),I=n(547913),O=n(473714),N=n(921266);const f={[P.Z.BGP]:"SETTINGS_ROUTING_BGP_NAME",[P.Z.OSPF]:"SETTINGS_ROUTING_OSPF_NAME"},R={[P.Z.BGP]:A.default,[P.Z.OSPF]:p.default},v={[P.Z.BGP]:T.default.dependencies,[P.Z.OSPF]:I.default.dependencies},y=({type:e,typeSelector:t})=>{const n=R[e],r=a.createElement(n,{typeSelector:t,activeItem:{_id:u.R6}});return(0,s.A)(v[e]||[],r,{renderKey:e,placeholder:a.createElement(a.Fragment,{key:"fallback"},r),pastDelay:0})},F=({activeItem:e})=>{const t=(0,o.A)(d.Xj.OSPF_ROUTING),n=(0,o.A)(d.Xj.BGP_ROUTING),s=(0,o.A)(d.Xj.SWITCH_BGP_ROUTING),u=(0,l.useSelector)(E.Z0),P=(0,l.useSelector)(m._V),p=(0,l.useSelector)(_.UV),A=(0,l.useSelector)(G.vc),T=(0,a.useMemo)(()=>N.A.map(e=>({option:e,disabledReason:(0,O.x)(e,u,P,p,A,n,s,t)})),[P,p,n,t,s,u,A]),[I,R]=(0,a.useState)(e.type||T.filter(({disabledReason:e})=>!e)[0]?.option);return a.createElement(y,{type:I,typeSelector:a.createElement(c.A,null,T.map(({option:e,disabledReason:t})=>a.createElement(S.A,{key:e,reason:I!==e&&t},a.createElement(r.A,{value:e,id:e,checked:I===e,onChange:()=>R(e),disabled:!!t&&I!==e},a.createElement(i.sA,{id:f[e]}))))),key:I})},U=({activeItem:e})=>a.createElement(F,{key:e.type,activeItem:e})},921266:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(472926);const r=[a.Z.OSPF,a.Z.BGP]},473714:(e,t,n)=>{n.d(t,{x:()=>i});var a=n(296540),r=n(459449),l=n(271751),c=n(472926);const i=(e,t,n,i,s,o,d,S)=>{if(e===c.Z.OSPF&&!S)return a.createElement(r.sA,{id:"SETTINGS_OSPF_NOT_SUPPORTED"});if(e===c.Z.OSPF&&t.length>=l.XM)return a.createElement(r.sA,{id:"SETTINGS_OSPF_MAX_CONFIGURATIONS_REACHED"});if(e===c.Z.BGP&&!o&&!d)return a.createElement(r.sA,{id:"SETTINGS_BGP_NOT_SUPPORTED"});if(e===c.Z.BGP){if(!i.map(({mac:e})=>e).concat(o&&s?[s]:[]).some(e=>!n.some(({device_mac:t})=>t===e)))return a.createElement(r.sA,{id:"SETTINGS_ROUTING_BGP_ALREADY_CONFIGURED_DEVICES"})}return null}},504779:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(271856),r=n(296540),l=n(641777),c=n(994133);const i=({reasons:e,reason:t,children:n,isInteractive:i,noWrap:s})=>{const o=(0,c.e)(),d=[t,...e||[]].filter(Boolean)[0]||null;return r.createElement(l.A,{isDisabled:!!d},r.createElement(a.A,{description:o?null:d,portal:!0,isInteractive:i,noWrap:s},n))}}}]);