"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[6757],{320761:(e,t,n)=>{n.r(t),n.d(t,{default:()=>a});var r=n(296540),s=n(808690);const a=({activeItem:e})=>r.createElement(s.A,{activeItem:e,key:e?._id})},631293:(e,t,n)=>{n.d(t,{A:()=>A});var r=n(296540),s=n(784045),a=n(469733),i=n(758649),l=n(294303),_=n(711748),c=n(566723),N=n(459449),o=n(454195),u=n(188738),I=n(994133),m=n(575211);const A=function({form:e,name:t,types:n,getDisabledReason:A,onAfterChange:O}){const d=(0,a.useSelector)(_.O9),[E,g]=(0,r.useState)(!1),p=(0,r.useMemo)(()=>(0,s.A)(d.filter(({group_type:e})=>n.includes(e)),({name:e})=>e,"asc").map(({_id:e,name:t,group_type:n})=>{const r=A?.({group_type:n});return{value:e,label:t,disabled:!!r,tooltipDescription:r}}),[A,d,n]),T=(0,I.e)();return r.createElement(l.A,{flexDirection:"column",width:"100%"},r.createElement(l.A,{gap:c.kc,alignItems:"flex-start"},p.length?r.createElement(l.A,{flexDirection:"column",width:"100%",flex:1},r.createElement(u.A,{control:e.control,name:t,searchable:!0,options:p,onAfterChange:O})):null,r.createElement(l.A,{height:o.b},r.createElement(i.A,{type:"button",variant:"inline",size:"medium",disabled:T,onClick:()=>g(!0)},r.createElement(N.sA,{id:p.length?"COMMON_NEW":"COMMON_CREATE_NEW"})))),E?r.createElement(m.A,{hideModal:()=>g(!1),handleGroupField:r=>{n.includes(r?.group_type)&&r._id&&(e.setValue(t,r._id),O?.(r._id))},types:n}):null)}},242299:(e,t,n)=>{n.d(t,{q:()=>I});var r=n(143985),s=n(950700),a=n(263963),i=n(961386),l=n(360847),_=n(620637),c=n(546391),N=n(149133),o=n(348466);const u=l.Yj({message:(0,a.rn)("COMMON_VALIDATION_IPV4_SUBNET")}).refine(e=>{const t=e.split(o.jr),[n,r]=t;return 2===t.length&&n&&r&&c.zF.test(n)&&c.zF.test(r)&&(0,_.isValidIpv4)(n)&&(0,_.isValidIpv4)(r)&&(0,N.GQ)(n)<(0,N.GQ)(r)},{message:(0,a.rn)("COMMON_VALIDATION_IPV4_SUBNET")}),I=(0,i.S)([r.B,s.K,u],{message:(0,a.rn)("SETTINGS_ROUTING_NAT_FORM_IP_OR_SUBNET_OR_RANGE_VALIDATION")})},950700:(e,t,n)=>{n.d(t,{K:()=>l});var r=n(360847),s=n(546391),a=n(149133),i=n(263963);const l=r.Yj({message:(0,i.rn)("COMMON_VALIDATION_IPV4_SUBNET")}).regex(s.wK,{message:(0,i.rn)("COMMON_VALIDATION_IPV4_SUBNET")}).refine(a.N7,{message:(0,i.rn)("COMMON_VALIDATION_IPV4_SUBNET")})},790163:(e,t,n)=>{n.d(t,{i:()=>l});var r=n(360847),s=n(348466),a=n(263963),i=n(976118);const l=r.Yj().refine(e=>{const t=e.split(s.jr);return 2===t.length&&((0,i.w)(t[0])&&(0,i.w)(t[1])&&Number(t[0])<Number(t[1]))},{message:(0,a.rn)("SETTINGS_COMMON_SINGLE_PORT_RANGE_VALIDATION_REQUIRED")})},976118:(e,t,n)=>{n.d(t,{L:()=>l,w:()=>i});var r=n(360847),s=n(263963);const a=/^\d+$/,i=e=>{if(!a.test(e))return!1;const t=parseInt(e,10);return!Number.isNaN(t)&&Number.isInteger(t)&&t>=1&&t<=65535},l=r.Yj().refine(e=>i(e),{message:(0,s.rn)("SETTINGS_COMMON_SINGLE_PORT_VALIDATION_REQUIRED")})},961386:(e,t,n)=>{n.d(t,{S:()=>s});var r=n(360847);function s(e,{message:t}){return r.Ie(t=>r.KC(e).safeParse(t).success,{message:t})}}}]);