"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[50570],{277822(e,O,s){var _,I;s.d(O,{B:()=>_,e:()=>I}),function(e){e.PORT_GROUP="port-group",e.ADDRESS_GROUP="address-group",e.IPV6_ADDRESS_GROUP="ipv6-address-group",e.DOMAIN_GROUP="domain-group"}(_||(_={})),function(e){e.STATIC="static",e.DYNAMIC="dynamic"}(I||(I={}))},155514(e,O,s){s.r(O),s.d(O,{default:()=>B});var _=s(274934),I=s(977872),t=s(602086),a=s(87562),A=s(724081),n=s(871808),T=s(846294),i=s(787481),d=s(470070),r=s(106047),S=s(897166),c=s(95857),N=s(754924),o=s(741331),D=s(969288),P=s(515215),E=s(129401),l=s(8834),p=s(122985),R=s(379727),C=s(233114),G=s(880976),m=s(699177),M=s(327784),u=s(277299);const U=[P.Z.OSPF,P.Z.BGP,P.Z.STATIC_ROUTE,P.Z.POLICY_BASED_ROUTE],Z={[P.Z.BGP]:"SETTINGS_ROUTING_BGP_NAME",[P.Z.OSPF]:"SETTINGS_ROUTING_OSPF_NAME",[P.Z.STATIC_ROUTE]:"COMMON_STATIC",[P.Z.POLICY_BASED_ROUTE]:"COMMON_POLICY_BASED"},V={[P.Z.BGP]:M.default,[P.Z.OSPF]:C.default,[P.Z.STATIC_ROUTE]:E.A,[P.Z.POLICY_BASED_ROUTE]:p.A},f={[P.Z.BGP]:m.default.getDependencies(),[P.Z.OSPF]:G.default.getDependencies(),[P.Z.STATIC_ROUTE]:l.default.getDependencies(),[P.Z.POLICY_BASED_ROUTE]:R.default.getDependencies()},L=({type:e,typeSelector:O})=>{const s=(0,_.jsx)(V[e],{typeSelector:O,activeItem:{_id:D.R6}});return(0,A.A)(f[e]||[],s,{renderKey:e,placeholder:(0,_.jsx)(t.Fragment,{children:s},"fallback"),pastDelay:0})},g=({activeItem:e})=>{const O=(0,n.A)(c.Xj.OSPF_ROUTING),s=(0,n.A)(c.Xj.BGP_ROUTING),A=(0,n.A)(c.Xj.SWITCH_BGP_ROUTING),D=(0,I.d4)(r.Z0),E=(0,I.d4)(o._V),l=(0,I.d4)(S.vc),p=(0,I.d4)(N.n_),R=(0,t.useMemo)(()=>U.map(e=>({option:e,disabledReason:(0,u.x)(e,D,E,p,l,s,A,O)})),[p,E,s,O,A,D,l]),[C,G]=(0,t.useState)(()=>{const O=R.filter(({disabledReason:e})=>!e);return e.type&&O.some(({option:O})=>O===e.type)?e.type:O[0]?.option??P.Z.STATIC_ROUTE});return(0,_.jsx)(L,{type:C,typeSelector:(0,_.jsx)(i.A,{children:R.map(({option:e,disabledReason:O})=>(0,_.jsx)(T.A,{reason:C!==e&&O,children:(0,_.jsx)(a.A,{value:e,id:e,checked:C===e,onChange:()=>G(e),disabled:!!O&&C!==e,children:(0,_.jsx)(d.sA,{id:Z[e]})})},e))})},C)},B=({activeItem:e})=>(0,_.jsx)(g,{activeItem:e},e.type)},277299(e,O,s){s.d(O,{x:()=>n});var _=s(274934),I=s(470070),t=s(788307),a=s(586566),A=s(515215);const n=(e,O,s,n,T,i,d,r)=>e===A.Z.STATIC_ROUTE||e===A.Z.POLICY_BASED_ROUTE?null:e!==A.Z.OSPF||r?e!==A.Z.OSPF||n.some(e=>(0,t.Y)(e,r,T)&&!O.some(O=>(O.device_mac??T)===e.mac))?e!==A.Z.BGP||i||d?e!==A.Z.BGP||n.filter(e=>(0,a.Et)(e.switch_caps?.feature_caps)).map(({mac:e})=>e).concat(i&&T?[T]:[]).some(e=>!s.some(({device_mac:O})=>O===e))?null:(0,_.jsx)(I.sA,{id:"SETTINGS_ROUTING_BGP_ALREADY_CONFIGURED_DEVICES"}):(0,_.jsx)(I.sA,{id:"SETTINGS_BGP_NOT_SUPPORTED"}):(0,_.jsx)(I.sA,{id:"SETTINGS_ROUTING_OSPF_ALREADY_CONFIGURED_DEVICES"}):(0,_.jsx)(I.sA,{id:"SETTINGS_OSPF_NOT_SUPPORTED"})},115219(e,O,s){s.d(O,{a:()=>a});var _=s(241792),I=s(570866),t=s(260334);const a=_.Yj({message:(0,t.rn)("COMMON_DOMAIN_VALIDATION")}).max(253,{message:(0,t.rn)("COMMON_DOMAIN_VALIDATION")}).refine(e=>e.split(".").every(e=>e.length<=63),{message:(0,t.rn)("COMMON_DOMAIN_VALIDATION")}).refine(e=>I.V2.test(e),{message:(0,t.rn)("COMMON_DOMAIN_VALIDATION")})},149450(e,O,s){s.d(O,{B:()=>A,b:()=>a});var _=s(241792),I=s(745454),t=s(260334);const a=_.Yj({message:(0,t.rn)("COMMON_VALIDATION_VALID_IPV4")}).refine(e=>!e||(0,I.isValidIpv4)(e),{message:(0,t.rn)("COMMON_VALIDATION_VALID_IPV4")}),A=_.Yj({message:(0,t.rn)("COMMON_VALIDATION_VALID_IPV4")}).refine(e=>(0,I.isValidIpv4)(e),{message:(0,t.rn)("COMMON_VALIDATION_VALID_IPV4")})}}]);