"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[7290],{430329:(e,t,n)=>{n.d(t,{DP:()=>o,XD:()=>l,kY:()=>s,mH:()=>a,vt:()=>A});var i=n(524936),r=n(233187),_=n(348466);const s=(e,t)=>!(!(0,i.jp)(e)&&!(0,i._L)(e))||(!(!t.isOpenVpnTrafficRoutesSupported||!(0,i.MY)(e))||(!(!t.isSiteToSiteOpenVpnTrafficRoutesSupported||!(0,i.qf)(e))||(!(!t.isSiteToSiteWireguardTrafficRoutesSupported||!(0,i.$p)(e))||(!!(t.isSiteToSiteIpsecTrafficRoutesSupported&&(0,i.Mc)(e)&&e.ipsec_dynamic_routing&&e.ipsec_tunnel_ip_enabled)||!(!(0,i.ok)(e)||!(0,i.o1)(e)||(0,i.sp)(e)))))),l=(e,t)=>t.isSiteToSiteIpsecTrafficRoutesSupported&&(0,i.Mc)(e)&&e.ipsec_dynamic_routing&&!e.ipsec_tunnel_ip_enabled?"SETTINGS_TRAFFIC_ROUTES_INTERFACE_DISABLED_TUNNEL_IP":t.isSiteToSiteIpsecTrafficRoutesSupported&&(0,i.Mc)(e)&&!e.ipsec_dynamic_routing?"SETTINGS_TRAFFIC_ROUTES_INTERFACE_DISABLED_POLICY_BASED":e.routing_table_id||(0,i.JJ)(t.networks).size?null:"SETTINGS_ROUTING_TABLES_EXCEEDED_POLICY_BASED_ROUTES",a=e=>(0,i.ok)(e)&&(0,i.o1)(e)&&e.purpose!==r.rR.VLAN_ONLY,o=e=>{const[t,n=""]=e.split(_.oH),i=n.split(_.KE).filter(Boolean),r=i.filter(e=>!e.includes(_.jr)),s=i.filter(e=>e.includes(_.jr));return{domain:t,ports:r.map(Number),port_ranges:s.map(e=>{const[t,n]=e.split(_.jr).map(Number);return{port_start:t,port_stop:n}})}},A=e=>{const t=e.port_ranges.map(({port_start:e,port_stop:t})=>`${e}${_.jr}${t}`),n=[...e.ports,...t].join(_.KE);return[e.domain,n].filter(Boolean).join(_.oH)}},837867:(e,t,n)=>{n.d(t,{A:()=>O});var i=n(296540),r=n(951272),_=n(469733),s=n(725508),l=n(71479),a=n(588915),o=n(23835),A=n(12207),E=n(459449),p=n(705426),d=n(294303),c=n(742920),I=n(675359),T=n(566723);const R=(0,l.A)(d.A)`
  padding: ${T.fS} 0;
  margin: 0 ${T.kc};

  textarea {
    line-height: 20px;
    padding: 10px ${T.Ln} 18px ${T.Ln};
    resize: none;
  }
`,S=(0,l.A)(a.A)`
  margin-top: ${T.S2};
  svg {
    margin-right: 6px;
  }
`,m=(0,l.A)(p.A)`
  width: 431px;
  header {
    height: ${T.nf};
    align-items: center;
    display: flex;

    > div {
      font-size: 16px;
      line-height: 20px;
    }
  }
  footer {
    padding: ${T.fS} ${T.Yc};
    button {
      height: ${T.fS};
    }
    > div {
      div:last-child button {
        width: 137px;
      }
    }
  }
`,N=({onClose:e,title:t,placeholder:n})=>{const{formatMessage:l}=(0,E.tz)(),a=(0,_.useDispatch)(),{values:p,errors:d,setFieldValue:T,submitCount:N,handleSubmit:u}=(0,r.j7)(),O=(0,i.useMemo)(()=>[{text:i.createElement(E.sA,{id:"COMMON_ACTION_CANCEL"}),type:"button",variant:"default",onClick:e},{text:i.createElement(E.sA,{id:"COMMON_ACTION_ADD"}),type:"button",variant:"primary",onClick:()=>u()}],[e,u]);return i.createElement(m,{size:"small",isOpen:!0,title:i.createElement(E.sA,{id:t}),actions:O},i.createElement(R,{flexDirection:"column"},i.createElement(o.A,{rows:7,name:"text",value:p.text,onChange:(e,t)=>T("text",t),placeholder:n&&l({id:n}),full:!0}),d?.text&&N>0?i.createElement(A.A,null,d?.text):null,i.createElement(S,{accept:"text/plain",variant:"inline",Icon:s.A,onChange:async(e,t)=>{const n=!!t&&"current"in t&&t.current?.files?.[0],i=await((e,t)=>new Promise((n,i)=>{const r=new FileReader;r.onerror=function(){i(),t((0,I.ox)({icon:c.C.warning,message:"COMMON_NOTICE_UPLOAD_ERROR"}))},r.onload=function(){n(r.result)},r.readAsText(e)}))(n,a);T("text",i)}},i.createElement(E.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_BATCH_ADD_MODAL_IMPORT_BUTTON"}))))},u={text:""},O=({onClose:e,onSubmit:t,validationSchema:n,title:_,placeholder:s})=>{const l=(0,i.useCallback)(n=>{t(n.text),e()},[e,t]);return i.createElement(r.l1,{enableReinitialize:!0,initialValues:u,validationSchema:n,onSubmit:l},i.createElement(N,{onClose:e,title:_,placeholder:s}))}},65755:(e,t,n)=>{n.d(t,{f:()=>h,A:()=>f});var i,r=n(296540),_=n(54227),s=n(951272),l=n(758649),a=n(369596),o=n(459449),A=n(294303),E=n(333080),p=n(657781),d=n(566723),c=n(870443),I=n(553432),T=n(242366),R=n(573531),S=n(383653),m=n(837867),N=n(620637),u=n(546391),O=n(901371),C=n(68783),M=n(149133);!function(e){e.SINGLE="single",e.RANGE="range"}(i||(i={}));const D=(0,O.jp)(!1),b=e=>e?.split(u.Mi)?.map(e=>e.trim()).filter(Boolean).map(e=>(e=>{let t,n=e;return e.includes("[")&&e.includes("]")&&(n=e.split("]")[0].replace("[",""),[,t]=e.split("]")),(0,C.or)([u.zF,u.wK]).test(e.split(":")[0])&&([n,t]=e.split(":")),{ip:n,port:t||""}})(e)),g=()=>c.A.string().label("COMMON_IP_ADDRESS").test("isValidIpOrSubnet",r.createElement(o.sA,{id:"COMMON_VALIDATION_VALID_IP"}),e=>!e||[N.isValidIpv4,M.N7,(0,S.es)()].some(t=>t(e))).test("isValidSubnetV4",r.createElement(o.sA,{id:"COMMON_VALIDATION_VALID_IP_SUBNET_FORMAT"}),e=>!e||!u.wK.test(e)||(0,M.nX)(e)===e).test("isValidSubnetV6",r.createElement(o.sA,{id:"COMMON_VALIDATION_VALID_IPV6_SUBNET_FORMAT"}),e=>!e||!u.QD.test(e)||(0,S.dS)(e)).test("isNotIpv4MappedIpv6Address",r.createElement(o.sA,{id:"SETTINGS_NETWORKS_IPV6_ADDRESS_IPV4_MAPPED_IPV6_INVALID"}),e=>!(0,S.m0)(e)).test("isNotIPv6MulticastAddress",r.createElement(o.sA,{id:"SETTINGS_NETWORKS_IPV6_ADDRESS_MULTICAST_INVALID"}),e=>!(0,S.aN)(e)),L=()=>c.A.string().label("COMMON_IP_ADDRESS").test("isValidIp",r.createElement(o.sA,{id:"COMMON_VALIDATION_VALID_IP"}),e=>!e||[N.isValidIpv4,N.isValidIpv6].some(t=>t(e))).test("isNotIpv4MappedIpv6Address",r.createElement(o.sA,{id:"SETTINGS_NETWORKS_IPV6_ADDRESS_IPV4_MAPPED_IPV6_INVALID"}),e=>!(0,S.m0)(e)).test("isNotIPv6MulticastAddress",r.createElement(o.sA,{id:"SETTINGS_NETWORKS_IPV6_ADDRESS_MULTICAST_INVALID"}),e=>!(0,S.aN)(e)),G=[{id:"id",label:r.createElement(o.sA,{id:"COMMON_IP_ADDRESS"}),sortable:!1,renderCell:e=>(0,p.ef)(e),minWidth:160},{id:"all_ports",label:r.createElement(o.sA,{id:"COMMON_PORT"}),sortable:!1,renderCell:e=>e.type===i.SINGLE&&(0,p.J)(e)||R.L,minWidth:120}],P=[{id:i.SINGLE,label:r.createElement(o.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_IP_TAB"})},{id:i.RANGE,label:r.createElement(o.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_IP_RANGE_TAB"})}],F=[{id:"first",getFieldType:()=>"text",getFieldName:e=>e.type===i.SINGLE?"ip_or_subnet":"ip_start",getFieldLabel:e=>e.type===i.SINGLE?"COMMON_IP_ADDRESS":"COMMON_START"},{id:"second",getFieldType:()=>"text",getFieldName:e=>e.type===i.SINGLE?"all_ports":"ip_stop",getFieldLabel:e=>e.type===i.SINGLE?"COMMON_PORT":"COMMON_STOP"}],h=({value:e,onChange:t,invalid:n})=>{const[s,E]=(0,r.useState)(i.SINGLE),[R,u]=(0,r.useState)(!1),O=(0,r.useMemo)(()=>({editActive:!1,combinedIpAddresses:e.map(e=>"ip_or_subnet"in e?{...e,id:(0,p.rK)(e),type:i.SINGLE,all_ports:(0,p.J)(e)}:{...e,id:(0,p.rK)(e),type:i.RANGE,all_ports:""}),new_ip_or_subnet_address:"",new_ports:"",new_ip_or_subnet_address_start:"",new_ip_or_subnet_address_stop:""}),[e]),C=(0,r.useMemo)(()=>s===i.SINGLE?[{name:"new_ip_or_subnet_address",label:"COMMON_IP_ADDRESS",inline:!0},{name:"new_ports",label:"COMMON_PORT",inline:!0,hideMainFormInvalidState:!0}]:[{name:"new_ip_or_subnet_address_start",label:"COMMON_START",placeholder:"COMMON_IP_ADDRESS",inline:!0},{name:"new_ip_or_subnet_address_stop",label:"COMMON_STOP",placeholder:"COMMON_IP_ADDRESS",inline:!0}],[s]),h=(0,r.useCallback)(e=>t(e),[t]),f=(0,r.useCallback)(t=>{const{new_ip_or_subnet_address:n,new_ports:r,new_ip_or_subnet_address_start:_,new_ip_or_subnet_address_stop:l}=t;if(s===i.SINGLE){const t=r.split(",").filter(Boolean),i=t.filter(e=>!e.includes("-")),_=t.filter(e=>e.includes("-"));h([...e,{ip_or_subnet:n,ports:i.length?i.map(Number):[],port_ranges:_.map(e=>({port_start:Number(e.split("-")[0]),port_stop:Number(e.split("-")[1])})),ip_version:[(0,S.wt)(),(0,S.vS)()].some(e=>e(n))?"v6":"v4"}])}else h([...e,{ip_start:_,ip_stop:l,ip_version:[(0,S.wt)(),(0,S.vS)()].some(e=>e(_))?"v6":"v4"}])},[s,e,h]),v=(0,r.useCallback)(e=>{h(e.map(e=>{if(e.type===i.SINGLE){const t=e.all_ports?.split(",").filter(Boolean),n=t?.filter(e=>!e.includes("-"))||[],i=t?.filter(e=>e.includes("-"))||[];return{ip_or_subnet:e.ip_or_subnet,ports:n.length?n.map(Number):[],port_ranges:i.map(e=>({port_start:Number(e.split("-")[0]),port_stop:Number(e.split("-")[1])})),ip_version:e.ip_version}}return{ip_start:e.ip_start,ip_stop:e.ip_stop,ip_version:e.ip_version}}))},[h]),U=(0,r.useCallback)(({id:t})=>h(e.filter(e=>(0,p.rK)(e)!==t)),[h,e]);return r.createElement(T.A,null,R?r.createElement(m.A,{onClose:()=>u(!1),onSubmit:n=>{const i=b(n);t([...e,...i.map(e=>{const t=e.port?.split(",").filter(Boolean)||[],n=t.filter(e=>!e.includes("-")),i=t.filter(e=>e.includes("-"));return{ip_or_subnet:e.ip,ports:n.map(Number),port_ranges:i.map(e=>({port_start:Number(e.split("-")[0]),port_stop:Number(e.split("-")[1])}))}})])},validationSchema:(V=e.map(e=>"ip_or_subnet"in e?e.ip_or_subnet:""),c.A.object().shape({text:c.A.string().label("SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_BATCH_ADD_MODAL_THIS_FIELD").required().test("isValidIpv6-NotIpv4Mapped",r.createElement(o.sA,{id:"SETTINGS_NETWORKS_IPV6_ADDRESS_IPV4_MAPPED_IPV6_INVALID"}),e=>{if(!e)return!0;const t=b(e).filter(e=>(0,S.es)()(e.ip));return t?.every(e=>(0,S.es)({excludeIpv4Mapped:!0})(e.ip))}).test("isValidIpv6-NotMulticast",r.createElement(o.sA,{id:"SETTINGS_NETWORKS_IPV6_ADDRESS_MULTICAST_INVALID"}),e=>{if(!e)return!0;const t=b(e).filter(e=>(0,S.es)()(e.ip));return t?.every(e=>(0,S.es)({excludeMulticast:!0})(e.ip))}).test("isValidList",r.createElement(o.sA,{id:"COMMON_VALIDATION_VALID_PORT_RANGE"}),e=>{if(!e)return!0;const t=b(e);return t?.every(e=>(!e.port||D(e.port))&&[N.isValidIpv4,M.N7,(0,S.es)()].some(t=>t(e.ip)))}).test("hasDuplicates",r.createElement(o.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_UNIQUE_ERROR"}),e=>{if(!e)return!0;const t=b(e),n=[...V,...(t||[])?.map(e=>e.ip)||[]];return n.length===new Set(n).size}).isNotWildcardIP(r.createElement(o.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero(r.createElement(o.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"}))})),title:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_BATCH_ADD_MODAL_HEADER",placeholder:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_BATCH_ADD_MODAL_PLACEHOLDER"}):null,r.createElement(I.A,null,P.map(({id:e,label:t})=>r.createElement(_.A,{key:e,id:e,onChange:()=>E(e),checked:s===e},t))),r.createElement(A.A,{width:"100%",flexDirection:"column",gap:d.YC},r.createElement(a.A,{fieldName:"combinedIpAddresses",columns:G,newFields:C,onAddItem:f,onRemoveItem:U,onEditSubmit:v,initialValues:O,invalid:n,validationSchema:c.A.lazy(e=>((e,t)=>{const n={arrayFieldName:"combinedIpAddresses",stringFieldName:"ip_or_subnet",errorMessage:r.createElement(o.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_UNIQUE_ERROR"})};return c.A.object().shape({...t===i.RANGE?{new_ip_or_subnet_address_start:e.editActive?c.A.string():L().isIPUnique({formValues:null,...n}).isNotWildcardIP(r.createElement(o.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero(r.createElement(o.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).required(),new_ip_or_subnet_address_stop:e.editActive?c.A.string():L().isIPUnique({formValues:null,...n}).isNotWildcardIP(r.createElement(o.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero(r.createElement(o.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).test("isGreaterThanStart",r.createElement(o.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_STOP_AFTER_START"}),t=>!t||!e.new_ip_or_subnet_address_start||((0,N.isValidIpv4)(t)&&(0,N.isValidIpv4)(e.new_ip_or_subnet_address_start)?(0,M.GQ)(t)>(0,M.GQ)(e.new_ip_or_subnet_address_start):!(0,N.isValidIpv6)(t)||!(0,N.isValidIpv6)(e.new_ip_or_subnet_address_start)||(0,S.zt)(e.new_ip_or_subnet_address_start,t))).required()}:{new_ip_or_subnet_address:e.editActive?c.A.string():g().isIPUnique({formValues:null,...n}).isNotWildcardIP(r.createElement(o.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero(r.createElement(o.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).required(),new_ports:e.editActive?c.A.string():c.A.string().label("COMMON_PORT").unifiPortRange(r.createElement(o.sA,{id:"COMMON_VALIDATION_VALID_PORT_RANGE"}))},combinedIpAddresses:c.A.array().of(c.A.object().shape({type:c.A.string().oneOf([i.SINGLE,i.RANGE]),ip_or_subnet:c.A.string().when("type",{is:i.SINGLE,then:g().isIPUnique({formValues:null,...n}).isNotWildcardIP(r.createElement(o.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero(r.createElement(o.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).required()}),all_ports:c.A.string().when("type",{is:i.SINGLE,then:c.A.string().label("COMMON_PORT").unifiPortRange(r.createElement(o.sA,{id:"COMMON_VALIDATION_VALID_PORT_RANGE"}))}),ip_start:c.A.string().when("type",{is:i.RANGE,then:L().isIPUnique({formValues:null,...n}).isNotWildcardIP(r.createElement(o.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero(r.createElement(o.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).required()}),ip_stop:c.A.string().when("type",{is:i.RANGE,then:L().isIPUnique({formValues:null,...n}).isNotWildcardIP(r.createElement(o.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero(r.createElement(o.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).required()})})),editActive:c.A.bool()})})(e,s)),editColumns:F,isWindowTable:!0}),s===i.SINGLE?r.createElement(A.A,null,r.createElement(l.A,{type:"button",variant:"inline",size:"medium",onClick:()=>u(!0)},r.createElement(o.sA,{id:"COMMON_ADD_MULTIPLE"}))):null));var V},f=({name:e})=>{const{values:t,setFieldValue:n,errors:i,submitCount:_,touched:l}=(0,s.j7)();return r.createElement(h,{value:(0,s.O6)(t,e),onChange:t=>n(e,t),invalid:(0,E.t$)(e,i,l,_)})}},579979:(e,t,n)=>{n.d(t,{s:()=>r});var i=n(948177);const r=(0,n(71479).A)(i.A)`
  color: ${({theme:{motifPalette:{neutral08:e}}})=>e};
`},657781:(e,t,n)=>{n.d(t,{GJ:()=>b,J:()=>M,PI:()=>C,Q$:()=>O,ef:()=>D,rK:()=>g});var i=n(296540),r=n(927099),_=n(948177),s=n(412933),l=n(884740),a=n(459449),o=n(848576),A=n(411502),E=n(566723),p=n(814356),d=(n(28694),n(348466)),c=n(601242),I=n(269889),T=n(294303),R=n(455155),S=n(802123),m=n(323030),N=n(757639),u=n(524803);const O=(e=[],t=!1)=>(t?e.length===N._O.length:e.length===A.hS.length)?[s.n_]:e,C=e=>{const{domain:t,ports:n=[],port_ranges:i=[]}=e,r=[...n,...i.map(({port_start:e,port_stop:t})=>`${e}${d.jr}${t}`)].join(",");return r.length?`${t}:${r}`:t},M=e=>{const{ports:t=[],port_ranges:n=[]}=e;return[t.length>0?`${t.map((e,n)=>`${e}${n===t.length?",":""}`)}`:"",n.length>0?`${n.map((e,t)=>`${e.port_start}-${e.port_stop}${t===n.length?",":""}`)}`:""].filter(Boolean).join(",")},D=(e,t)=>e.ip_or_subnet?`${e.ip_or_subnet}${t&&M(e)?`:${M(e)}`:""}`:`${e.ip_start}-${e.ip_stop}`,b=({matching_target:e,app_ids:t=[],enabled:n,app_category_ids:s=[],domains:A=[],ip_addresses:d=[],ip_ranges:M=[],regions:b=[],network_ids:g=[]},L)=>{switch(e){case o.Kl.APP:if(t.length>1)return i.createElement(S.A,{enabled:n,label:i.createElement(a.sA,{id:"COMMON_APP_COUNT",values:{count:t.length}}),tooltipItems:(G=t.map(e=>(0,c.HH)(e)),G.sort(({name:e=""},{name:t=""})=>e.localeCompare(t))).filter(e=>e.name&&e.iconFileName).map(e=>i.createElement(r.A,{key:e.name,inheritAll:!0},i.createElement(T.A,{alignItems:"center",gap:E.kc},i.createElement(R.A,{iconFileName:e.iconFileName}),i.createElement("span",null,e.name)))),neverShowListMarkers:!0});if(1===t.length){const{name:e,iconFileName:r}=(0,c.HH)(t[0]);if(e&&r)return i.createElement(T.A,{alignItems:"center",gap:E.kc},i.createElement(R.A,{iconFileName:r}),i.createElement(I.A,{enabled:n,size:"body"},e))}return i.createElement(I.A,{enabled:n},i.createElement(a.sA,{id:"COMMON_FALLBACK"}));case o.Kl.APP_CATEGORY:{const e=O(s,!0);if("string"==typeof e[0])return i.createElement(a.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_APP_CATEGORY_OPTION_ALL"});const t=e.map(e=>i.createElement(a.sA,{key:e,id:N.QK[e]||N.QK[255]}));if(s.length>1)return i.createElement(S.A,{enabled:n,label:i.createElement(a.sA,{id:"COMMON_CATEGORY_COUNT",values:{count:s.length}}),tooltipItems:t});if(1===s.length){const e=i.createElement(a.sA,{id:N.QK[s[0]]||N.QK[255]});return(0,u.Po)(e,n,"pointer")}return i.createElement(I.A,{enabled:n},i.createElement(a.sA,{id:"COMMON_FALLBACK"}))}case o.Kl.DOMAIN:if(A.length>1){const e=A.map(e=>C(e));return i.createElement(S.A,{enabled:n,label:i.createElement(a.sA,{id:"COMMON_DOMAIN_COUNT",values:{count:A.length}}),tooltipItems:e})}return 1===A.length?(0,u.Po)(C(A[0]),n,"pointer"):i.createElement(I.A,{enabled:n},i.createElement(a.sA,{id:"COMMON_FALLBACK"}));case o.Kl.IP:{const e=[...d,...M];if(e.length>1){const t=e.map(e=>D(e,!0));return i.createElement(S.A,{enabled:n,label:i.createElement(a.sA,{id:"COMMON_IP_COUNT",values:{count:e.length}}),tooltipItems:t})}return 1===e.length?i.createElement(I.A,{size:"body",enabled:n},D(e[0],!0)):i.createElement(I.A,{enabled:n},i.createElement(a.sA,{id:"COMMON_FALLBACK"}))}case o.Kl.REGION:if(b.length>1){const e=b.map(e=>i.createElement(T.A,{key:e,gap:E.kc,alignItems:"center"},i.createElement(m.A,{countryCode:e,width:16,height:16,style:{borderRadius:2,objectFit:"cover"}}),(0,p.q)(e.toUpperCase())));return i.createElement(S.A,{enabled:n,label:i.createElement(a.sA,{id:"COMMON_REGION_COUNT",values:{count:b.length}}),tooltipItems:e,neverShowListMarkers:!0})}if(1===b.length){const e=b[0];return(0,u.Po)(i.createElement(i.Fragment,null,i.createElement(m.A,{countryCode:e,width:16,height:16,style:{borderRadius:2,objectFit:"cover"}}),i.createElement("span",{style:{marginLeft:E.kc}},(0,p.q)(e.toUpperCase()))),n,"pointer")}return i.createElement(I.A,{enabled:n},i.createElement(a.sA,{id:"COMMON_FALLBACK"}));case o.Kl.INTERNET:return i.createElement(I.A,{size:"body",enabled:n},i.createElement(a.sA,{id:"COMMON_ANY"}));case o.Kl.LOCAL_NETWORK:{const e=g.filter(e=>L.find(t=>t._id===e));if(e.length>1){const t=e.map(e=>{const t=L.find(t=>t._id===e);return i.createElement(T.A,{key:e,alignItems:"center",gap:E.kc},i.createElement(_.A,{size:"original"})," ",t?.name||e)});return i.createElement(S.A,{enabled:n,label:i.createElement(a.sA,{id:"COMMON_NETWORK_COUNT",values:{count:e.length}}),tooltipItems:t,neverShowListMarkers:!0})}if(1===e.length){const t=L.find(t=>t._id===e[0]);return(0,u.Po)(i.createElement(i.Fragment,null,i.createElement(_.A,{width:N.qj,height:N.qj}),i.createElement("span",{style:{marginLeft:E.kc}},t?.name||e[0])),n,"pointer")}return i.createElement(I.A,{enabled:n},i.createElement(l.A,null))}default:return i.createElement(I.A,{enabled:n},i.createElement(a.sA,{id:"COMMON_FALLBACK"}))}var G},g=e=>e.ip_or_subnet||`${e.ip_start}-${e.ip_stop}`},884740:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(296540),r=n(998837),_=n(823858),s=n(271856),l=n(459449);const a=(0,i.memo)(()=>i.createElement(s.A,{portal:!0,description:i.createElement(l.sA,{id:"SETTINGS_FIREWALL_RULES_MISSING_NETWORK_TOOLTIP"})},i.createElement(_.A,{color:(0,r.u)().motifPalette.warning,size:"original"})))},527726:(e,t,n)=>{n.d(t,{gb:()=>s,om:()=>_,tY:()=>l});var i,r=n(346070);!function(e){e.DEVICE="device",e.NETWORK="network"}(i||(i={}));const _=(e,t)=>[i.DEVICE,e].join(t),s=(e,t)=>[i.NETWORK,e].join(t),l=(e,t)=>{const[n,_]=e.split(t);return n===i.DEVICE?{type:r.Q.CLIENT,client_mac:_}:{type:r.Q.NETWORK,network_id:_}}},68783:(e,t,n)=>{n.d(t,{or:()=>i});const i=(e,t)=>{if(!Array.isArray(e)||e.length<2)throw new Error("Unable to combine - missing source regexes");const n=e.map(e=>`(${(e=>e.toString().substring(1).split(/\/([^/]*)$/))(e)[0]})`).join("|");return new RegExp(n,t)}}}]);