"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[78248],{258978(e,t,s){var i;s.d(t,{d:()=>i}),function(e){e.DOMAIN="DOMAIN",e.INTERNET="INTERNET",e.IP="IP",e.REGION="REGION"}(i||(i={}))},164398(e,t,s){s.d(t,{DP:()=>a,XD:()=>o,kY:()=>_,mH:()=>l,vt:()=>d});var i=s(423564),n=s(581814),r=s(635187);const _=(e,t)=>!(!(0,i.jp)(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))),o=(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",l=e=>(0,i.ok)(e)&&(0,i.o1)(e)&&e.purpose!==n.rR.VLAN_ONLY,a=e=>{const[t,s=""]=e.split(r.oH),i=s.split(r.KE).filter(Boolean),n=i.filter(e=>!e.includes(r.jr)),_=i.filter(e=>e.includes(r.jr));return{domain:t,ports:n.map(Number),port_ranges:_.map(e=>{const[t,s]=e.split(r.jr).map(Number);return{port_start:t,port_stop:s}})}},d=e=>{const t=e.port_ranges.map(({port_start:e,port_stop:t})=>`${e}${r.jr}${t}`),s=[...e.ports,...t].join(r.KE);return[e.domain,s].filter(Boolean).join(r.oH)}},745966(e,t,s){s.d(t,{A:()=>C});var i=s(274934),n=s(602086),r=s(977872),_=s(843871),o=s(948866),l=s(335220),a=s(104669),d=s(471567),A=s(247816),p=s(159469),I=s(309130),T=s(384783),c=s(100978),R=s(700444),S=s(470070);const N=(0,A.A)(c.A)`
  padding: ${I.fS} 0;
  margin: 0 ${I.kc};

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

    > div {
      font-size: 16px;
      line-height: 20px;
    }
  }
  footer {
    padding: ${I.fS} ${I.Yc};
    button {
      height: ${I.fS};
    }
    > div {
      div:last-child button {
        width: 137px;
      }
    }
  }
`,O=({onClose:e,title:t,placeholder:s})=>{const{formatMessage:o}=(0,S.tz)(),A=(0,r.wA)(),{values:I,errors:T,setFieldValue:c,submitCount:O,handleSubmit:M}=(0,_.j7)(),C=(0,n.useMemo)(()=>[{text:(0,i.jsx)(S.sA,{id:"COMMON_ACTION_CANCEL"}),type:"button",variant:"default",onClick:e},{text:(0,i.jsx)(S.sA,{id:"COMMON_ACTION_ADD"}),type:"button",variant:"primary",onClick:()=>M()}],[e,M]);return(0,i.jsx)(E,{size:"small",isOpen:!0,title:(0,i.jsx)(S.sA,{id:t}),actions:C,children:(0,i.jsxs)(N,{flexDirection:"column",children:[(0,i.jsx)(l.A,{rows:7,name:"text",value:I.text,onChange:(e,t)=>c("text",t),placeholder:s&&o({id:s}),full:!0}),T?.text&&O>0?(0,i.jsx)(a.A,{isInvalid:!0,label:T?.text}):null,(0,i.jsx)(u,{accept:"text/plain",variant:"inline",Icon:d.A,onChange:async(e,t)=>{const s=await((e,t)=>new Promise((s,i)=>{const n=new FileReader;n.onerror=function(){i(),t((0,R.ox)({icon:p.C.warning,message:"COMMON_NOTICE_UPLOAD_ERROR"}))},n.onload=function(){s(n.result)},n.readAsText(e)}))(!!t&&"current"in t&&t.current?.files?.[0],A);c("text",s)},children:(0,i.jsx)(S.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_BATCH_ADD_MODAL_IMPORT_BUTTON"})})]})})},M={text:""},C=({onClose:e,onSubmit:t,validationSchema:s,title:r,placeholder:o})=>{const l=(0,n.useCallback)(s=>{t(s.text),e()},[e,t]);return(0,i.jsx)(_.l1,{enableReinitialize:!0,initialValues:M,validationSchema:s,onSubmit:l,children:(0,i.jsx)(O,{onClose:e,title:r,placeholder:o})})}},198301(e,t,s){s.d(t,{f:()=>G,A:()=>f});var i,n=s(274934),r=s(602086),_=s(843871),o=s(956976),l=s(599110),a=s(640708),d=s(318087),A=s(950804),p=s(254590),I=s(309130),T=s(787481),c=s(89469),R=s(100978),S=s(82296),N=s(470070),u=s(74835),E=s(745966),O=s(745454),M=s(933428),C=s(810024),h=s(93902),x=s(570866);!function(e){e.SINGLE="single",e.RANGE="range"}(i||(i={}));const m=(0,h.jp)(!1),g=e=>e?.split(x.Mi)?.map(e=>e.trim()).filter(Boolean).map(e=>(e=>{let t,s=e;return e.includes("[")&&e.includes("]")&&(s=e.split("]")[0].replace("[",""),[,t]=e.split("]")),(0,M.or)([x.zF,x.wK]).test(e.split(":")[0])&&([s,t]=e.split(":")),{ip:s,port:t||""}})(e)),j=()=>A.A.string().label("COMMON_IP_ADDRESS").test("isValidIpOrSubnet",(0,n.jsx)(N.sA,{id:"COMMON_VALIDATION_VALID_IP"}),e=>!e||[O.isValidIpv4,C.N7,(0,a.es)()].some(t=>t(e))).test("isValidSubnetV4",(0,n.jsx)(N.sA,{id:"COMMON_VALIDATION_VALID_IP_SUBNET_FORMAT"}),e=>!e||!x.wK.test(e)||(0,C.nX)(e)===e).test("isValidSubnetV6",(0,n.jsx)(N.sA,{id:"COMMON_VALIDATION_VALID_IPV6_SUBNET_FORMAT"}),e=>!e||!x.QD.test(e)||(0,a.dS)(e)).test("isNotIpv4MappedIpv6Address",(0,n.jsx)(N.sA,{id:"SETTINGS_NETWORKS_IPV6_ADDRESS_IPV4_MAPPED_IPV6_INVALID"}),e=>!(0,a.m0)(e)).test("isNotIPv6MulticastAddress",(0,n.jsx)(N.sA,{id:"SETTINGS_NETWORKS_IPV6_ADDRESS_MULTICAST_INVALID"}),e=>!(0,a.aN)(e)),b=()=>A.A.string().label("COMMON_IP_ADDRESS").test("isValidIp",(0,n.jsx)(N.sA,{id:"COMMON_VALIDATION_VALID_IP"}),e=>!e||[O.isValidIpv4,O.isValidIpv6].some(t=>t(e))).test("isNotIpv4MappedIpv6Address",(0,n.jsx)(N.sA,{id:"SETTINGS_NETWORKS_IPV6_ADDRESS_IPV4_MAPPED_IPV6_INVALID"}),e=>!(0,a.m0)(e)).test("isNotIPv6MulticastAddress",(0,n.jsx)(N.sA,{id:"SETTINGS_NETWORKS_IPV6_ADDRESS_MULTICAST_INVALID"}),e=>!(0,a.aN)(e)),D=[{id:"id",label:(0,n.jsx)(N.sA,{id:"COMMON_IP_ADDRESS"}),sortable:!1,renderCell:e=>(0,S.ef)(e),minWidth:160},{id:"all_ports",label:(0,n.jsx)(N.sA,{id:"COMMON_PORT"}),sortable:!1,renderCell:e=>e.type===i.SINGLE&&(0,S.J)(e)||p.L,minWidth:120}],P=[{id:i.SINGLE,label:(0,n.jsx)(N.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_IP_TAB"})},{id:i.RANGE,label:(0,n.jsx)(N.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_IP_RANGE_TAB"})}],L=[{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"}],G=({value:e,onChange:t,invalid:s})=>{const[_,d]=(0,r.useState)(i.SINGLE),[p,M]=(0,r.useState)(!1),h=(0,r.useMemo)(()=>({editActive:!1,combinedIpAddresses:e.map(e=>"ip_or_subnet"in e?{...e,id:(0,S.rK)(e),type:i.SINGLE,all_ports:(0,S.J)(e)}:{...e,id:(0,S.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]),x=(0,r.useMemo)(()=>_===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}],[_]),G=(0,r.useCallback)(e=>t(e),[t]),f=(0,r.useCallback)(t=>{const{new_ip_or_subnet_address:s,new_ports:n,new_ip_or_subnet_address_start:r,new_ip_or_subnet_address_stop:o}=t;if(_===i.SINGLE){const t=n.split(",").filter(Boolean),i=t.filter(e=>!e.includes("-")),r=t.filter(e=>e.includes("-"));G([...e,{ip_or_subnet:s,ports:i.length?i.map(Number):[],port_ranges:r.map(e=>({port_start:Number(e.split("-")[0]),port_stop:Number(e.split("-")[1])})),ip_version:[(0,a.wt)(),(0,a.vS)()].some(e=>e(s))?"v6":"v4"}])}else G([...e,{ip_start:r,ip_stop:o,ip_version:[(0,a.wt)(),(0,a.vS)()].some(e=>e(r))?"v6":"v4"}])},[_,e,G]),F=(0,r.useCallback)(e=>{G(e.map(e=>{if(e.type===i.SINGLE){const t=e.all_ports?.split(",").filter(Boolean),s=t?.filter(e=>!e.includes("-"))||[],i=t?.filter(e=>e.includes("-"))||[];return{ip_or_subnet:e.ip_or_subnet,ports:s.length?s.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}}))},[G]),v=(0,r.useCallback)(({id:t})=>G(e.filter(e=>(0,S.rK)(e)!==t)),[G,e]);return(0,n.jsxs)(c.A,{children:[p?(0,n.jsx)(E.A,{onClose:()=>M(!1),onSubmit:s=>{const i=g(s);t([...e,...i.map(e=>{const t=e.port?.split(",").filter(Boolean)||[],s=t.filter(e=>!e.includes("-")),i=t.filter(e=>e.includes("-"));return{ip_or_subnet:e.ip,ports:s.map(Number),port_ranges:i.map(e=>({port_start:Number(e.split("-")[0]),port_stop:Number(e.split("-")[1])}))}})])},validationSchema:(U=e.map(e=>"ip_or_subnet"in e?e.ip_or_subnet:""),A.A.object().shape({text:A.A.string().label("SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_BATCH_ADD_MODAL_THIS_FIELD").required().test("isValidIpv6-NotIpv4Mapped",(0,n.jsx)(N.sA,{id:"SETTINGS_NETWORKS_IPV6_ADDRESS_IPV4_MAPPED_IPV6_INVALID"}),e=>{if(!e)return!0;const t=g(e).filter(e=>(0,a.es)()(e.ip));return t?.every(e=>(0,a.es)({excludeIpv4Mapped:!0})(e.ip))}).test("isValidIpv6-NotMulticast",(0,n.jsx)(N.sA,{id:"SETTINGS_NETWORKS_IPV6_ADDRESS_MULTICAST_INVALID"}),e=>{if(!e)return!0;const t=g(e).filter(e=>(0,a.es)()(e.ip));return t?.every(e=>(0,a.es)({excludeMulticast:!0})(e.ip))}).test("isValidList",(0,n.jsx)(N.sA,{id:"COMMON_VALIDATION_VALID_PORT_RANGE"}),e=>{if(!e)return!0;const t=g(e);return t?.every(e=>(!e.port||m(e.port))&&[O.isValidIpv4,C.N7,(0,a.es)()].some(t=>t(e.ip)))}).test("hasDuplicates",(0,n.jsx)(N.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_UNIQUE_ERROR"}),e=>{if(!e)return!0;const t=g(e),s=[...U,...(t||[])?.map(e=>e.ip)||[]];return s.length===new Set(s).size}).isNotWildcardIP((0,n.jsx)(N.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero((0,n.jsx)(N.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,(0,n.jsx)(T.A,{children:P.map(({id:e,label:t})=>(0,n.jsx)(o.A,{id:e,onChange:()=>d(e),checked:_===e,children:t},e))}),(0,n.jsxs)(R.A,{width:"100%",flexDirection:"column",gap:I.YC,children:[(0,n.jsx)(u.A,{fieldName:"combinedIpAddresses",columns:D,newFields:x,onAddItem:f,onRemoveItem:v,onEditSubmit:F,initialValues:h,invalid:s,validationSchema:A.A.lazy(e=>((e,t)=>{const s={arrayFieldName:"combinedIpAddresses",stringFieldName:"ip_or_subnet",errorMessage:(0,n.jsx)(N.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_UNIQUE_ERROR"})};return A.A.object().shape({...t===i.RANGE?{new_ip_or_subnet_address_start:e.editActive?A.A.string():b().isIPUnique({formValues:null,...s}).isNotWildcardIP((0,n.jsx)(N.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero((0,n.jsx)(N.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).required(),new_ip_or_subnet_address_stop:e.editActive?A.A.string():b().isIPUnique({formValues:null,...s}).isNotWildcardIP((0,n.jsx)(N.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero((0,n.jsx)(N.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).test("isGreaterThanStart",(0,n.jsx)(N.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_STOP_AFTER_START"}),t=>!t||!e.new_ip_or_subnet_address_start||((0,O.isValidIpv4)(t)&&(0,O.isValidIpv4)(e.new_ip_or_subnet_address_start)?(0,C.GQ)(t)>(0,C.GQ)(e.new_ip_or_subnet_address_start):!(0,O.isValidIpv6)(t)||!(0,O.isValidIpv6)(e.new_ip_or_subnet_address_start)||(0,a.zt)(e.new_ip_or_subnet_address_start,t))).required()}:{new_ip_or_subnet_address:e.editActive?A.A.string():j().isIPUnique({formValues:null,...s}).isNotWildcardIP((0,n.jsx)(N.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero((0,n.jsx)(N.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).required(),new_ports:e.editActive?A.A.string():A.A.string().label("COMMON_PORT").unifiPortRange((0,n.jsx)(N.sA,{id:"COMMON_VALIDATION_VALID_PORT_RANGE"}))},combinedIpAddresses:A.A.array().of(A.A.object().shape({type:A.A.string().oneOf([i.SINGLE,i.RANGE]),ip_or_subnet:A.A.string().when("type",{is:i.SINGLE,then:j().isIPUnique({formValues:null,...s}).isNotWildcardIP((0,n.jsx)(N.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero((0,n.jsx)(N.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).required()}),all_ports:A.A.string().when("type",{is:i.SINGLE,then:A.A.string().label("COMMON_PORT").unifiPortRange((0,n.jsx)(N.sA,{id:"COMMON_VALIDATION_VALID_PORT_RANGE"}))}),ip_start:A.A.string().when("type",{is:i.RANGE,then:b().isIPUnique({formValues:null,...s}).isNotWildcardIP((0,n.jsx)(N.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero((0,n.jsx)(N.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).required()}),ip_stop:A.A.string().when("type",{is:i.RANGE,then:b().isIPUnique({formValues:null,...s}).isNotWildcardIP((0,n.jsx)(N.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero((0,n.jsx)(N.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).required()})})),editActive:A.A.bool()})})(e,_)),editColumns:L,isWindowTable:!0}),_===i.SINGLE?(0,n.jsx)(R.A,{children:(0,n.jsx)(l.A,{type:"button",variant:"inline",size:"medium",onClick:()=>M(!0),children:(0,n.jsx)(N.sA,{id:"COMMON_ADD_MULTIPLE"})})}):null]})]});var U},f=({name:e})=>{const{values:t,setFieldValue:s,errors:i,submitCount:r,touched:o}=(0,_.j7)();return(0,n.jsx)(G,{value:(0,_.O6)(t,e),onChange:t=>s(e,t),invalid:(0,d.t$)(e,i,o,r)})}},398693(e,t,s){s.d(t,{v:()=>l});var i=s(274934),n=s(125799),r=s(938984);const _={size:"inherit",color:"inherit"},o={portal:!0,maxWidth:"unset",width:"auto",style:{display:"flex",alignItems:"center"}},l=({text:e,textElement:t,textProps:s,tooltipProps:l,isTooltipDisabled:a=!1})=>{const d=t||(0,i.jsx)(r.A,{..._,...s,children:e});return a?d:(0,i.jsx)(n.A,{...o,description:e,...l,children:d})}},82296(e,t,s){s.d(t,{GJ:()=>m,J:()=>h,PI:()=>C,Q$:()=>M,ef:()=>x,rK:()=>g});var i=s(274934),n=s(938984),r=s(256498),_=s(707096),o=s(805521),l=s(609553),a=(s(150025),s(309130)),d=s(599041),A=s(470070),p=s(551173),I=s(887481),T=s(635187),c=s(16944),R=s(600416),S=s(638644),N=s(737364),u=s(100978),E=s(86635),O=s(880080);const M=(e=[],t=!1)=>(t?e.length===O._O.length:e.length===l.hS.length)?[r.n_]:e,C=e=>{const{domain:t,ports:s=[],port_ranges:i=[]}=e,n=[...s,...i.map(({port_start:e,port_stop:t})=>`${e}${T.jr}${t}`)].join(",");return n.length?`${t}:${n}`:t},h=e=>{const{ports:t=[],port_ranges:s=[]}=e;return[t.length>0?`${t.map((e,s)=>`${e}${s===t.length?",":""}`)}`:"",s.length>0?`${s.map((e,t)=>`${e.port_start}-${e.port_stop}${t===s.length?",":""}`)}`:""].filter(Boolean).join(",")},x=(e,t)=>e.ip_or_subnet?`${e.ip_or_subnet}${t&&h(e)?`:${h(e)}`:""}`:`${e.ip_start}-${e.ip_stop}`,m=({matching_target:e,app_ids:t=[],enabled:s,app_category_ids:r=[],domains:l=[],ip_addresses:T=[],ip_ranges:h=[],regions:m=[],network_ids:g=[]},j)=>{switch(e){case p.Kl.APP:if(t.length>1)return(0,i.jsx)(N.A,{enabled:s,label:(0,i.jsx)(A.sA,{id:"COMMON_APP_COUNT",values:{count:t.length}}),tooltipItems:(b=t.map(e=>(0,o.HH)(e)),b.sort(({name:e=""},{name:t=""})=>e.localeCompare(t))).filter(e=>e.name&&e.iconFileName).map(e=>(0,i.jsx)(n.A,{size:"inherit",color:"inherit",children:(0,i.jsxs)(u.A,{alignItems:"center",gap:a.kc,children:[(0,i.jsx)(c.A,{iconFileName:e.iconFileName}),(0,i.jsx)("span",{children:e.name})]})},e.name)),neverShowListMarkers:!0});if(1===t.length){const{name:e,iconFileName:n}=(0,o.HH)(t[0]);if(e&&n)return(0,i.jsxs)(u.A,{alignItems:"center",gap:a.kc,children:[(0,i.jsx)(c.A,{iconFileName:n}),(0,i.jsx)(S.A,{enabled:s,size:"medium",children:e})]})}return(0,i.jsx)(S.A,{enabled:s,children:(0,i.jsx)(A.sA,{id:"COMMON_FALLBACK"})});case p.Kl.APP_CATEGORY:{const e=M(r,!0);if("string"==typeof e[0])return(0,i.jsx)(A.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_APP_CATEGORY_OPTION_ALL"});const t=e.map(e=>(0,i.jsx)(A.sA,{id:O.QK[e]||O.QK[255]},e));if(r.length>1)return(0,i.jsx)(N.A,{enabled:s,label:(0,i.jsx)(A.sA,{id:"COMMON_CATEGORY_COUNT",values:{count:r.length}}),tooltipItems:t});if(1===r.length){const e=(0,i.jsx)(A.sA,{id:O.QK[r[0]]||O.QK[255]});return(0,R.Po)(e,s,"pointer")}return(0,i.jsx)(S.A,{enabled:s,children:(0,i.jsx)(A.sA,{id:"COMMON_FALLBACK"})})}case p.Kl.DOMAIN:if(l.length>1){const e=l.map(e=>C(e));return(0,i.jsx)(N.A,{enabled:s,label:(0,i.jsx)(A.sA,{id:"COMMON_DOMAIN_COUNT",values:{count:l.length}}),tooltipItems:e})}return 1===l.length?(0,R.Po)(C(l[0]),s,"pointer"):(0,i.jsx)(S.A,{enabled:s,children:(0,i.jsx)(A.sA,{id:"COMMON_FALLBACK"})});case p.Kl.IP:{const e=[...T,...h];if(e.length>1){const t=e.map(e=>x(e,!0));return(0,i.jsx)(N.A,{enabled:s,label:(0,i.jsx)(A.sA,{id:"COMMON_IP_COUNT",values:{count:e.length}}),tooltipItems:t})}return(0,i.jsx)(S.A,1===e.length?{size:"medium",enabled:s,children:x(e[0],!0)}:{enabled:s,children:(0,i.jsx)(A.sA,{id:"COMMON_FALLBACK"})})}case p.Kl.REGION:if(m.length>1){const e=m.map(e=>(0,i.jsxs)(u.A,{gap:a.kc,alignItems:"center",children:[(0,i.jsx)(E.A,{countryCode:e,width:16,height:16,style:{borderRadius:2,objectFit:"cover"}}),(0,I.qQ)(e.toUpperCase())]},e));return(0,i.jsx)(N.A,{enabled:s,label:(0,i.jsx)(A.sA,{id:"COMMON_REGION_COUNT",values:{count:m.length}}),tooltipItems:e,neverShowListMarkers:!0})}if(1===m.length){const e=m[0];return(0,R.Po)((0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(E.A,{countryCode:e,width:16,height:16,style:{borderRadius:2,objectFit:"cover"}}),(0,i.jsx)("span",{style:{marginLeft:a.kc},children:(0,I.qQ)(e.toUpperCase())})]}),s,"pointer")}return(0,i.jsx)(S.A,{enabled:s,children:(0,i.jsx)(A.sA,{id:"COMMON_FALLBACK"})});case p.Kl.INTERNET:return(0,i.jsx)(S.A,{size:"medium",enabled:s,children:(0,i.jsx)(A.sA,{id:"COMMON_ANY"})});case p.Kl.LOCAL_NETWORK:{const e=g.filter(e=>j.find(t=>t._id===e));if(e.length>1){const t=e.map(e=>{const t=j.find(t=>t._id===e);return(0,i.jsxs)(u.A,{alignItems:"center",gap:a.kc,children:[(0,i.jsx)(_.A,{size:"original"})," ",t?.name||e]},e)});return(0,i.jsx)(N.A,{enabled:s,label:(0,i.jsx)(A.sA,{id:"COMMON_NETWORK_COUNT",values:{count:e.length}}),tooltipItems:t,neverShowListMarkers:!0})}if(1===e.length){const t=j.find(t=>t._id===e[0]);return(0,R.Po)((0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_.A,{width:O.qj,height:O.qj}),(0,i.jsx)("span",{style:{marginLeft:a.kc},children:t?.name||e[0]})]}),s,"pointer")}return(0,i.jsx)(S.A,{enabled:s,children:(0,i.jsx)(d.A,{})})}default:return(0,i.jsx)(S.A,{enabled:s,children:(0,i.jsx)(A.sA,{id:"COMMON_FALLBACK"})})}var b},g=e=>e.ip_or_subnet||`${e.ip_start}-${e.ip_stop}`},796091(e,t,s){s.d(t,{A:()=>o});var i=s(274934),n=s(833466),r=s(309130),_=s(100978);const o=e=>(0,i.jsx)(_.A,{paddingTop:r.YC,paddingBottom:r.YC,gap:r.Ln,rowGap:r.YC,flexWrap:"wrap",minHeight:n.b,alignItems:"center",...e})},480562(e,t,s){s.d(t,{i:()=>_});var i=s(274934),n=s(125799),r=s(767822);const _=e=>(0,i.jsx)(n.A,{description:e.option&&"tooltipDescription"in e.option?e.option.tooltipDescription:null,position:"left",portal:!0,children:(0,i.jsx)(r.q,{...e})})},599041(e,t,s){s.d(t,{A:()=>d});var i=s(274934),n=s(814557),r=s(602086),_=s(125799),o=s(600191),l=s(263705),a=s(470070);const d=(0,r.memo)(()=>{const{themeName:e}=(0,l.u)();return(0,i.jsx)(_.A,{portal:!0,description:(0,i.jsx)(a.sA,{id:"SETTINGS_FIREWALL_RULES_MISSING_NETWORK_TOOLTIP"}),children:(0,i.jsx)(o.A,{color:n.Ay[`desktop-color-orange-06-${e}`],size:"original"})})})},638644(e,t,s){s.d(t,{A:()=>r});var i=s(274934),n=s(938984);const r=({enabled:e,color:t,children:s,...r})=>(0,i.jsx)(n.A,{color:!1===e?"disabled":t||"inherit",size:"inherit",...r,children:s})},218333(e,t,s){s.d(t,{p:()=>n});var i=s(247816);s(409844).AH`
  th {
    span {
      font-size: 14px;
      font-weight: 600;
    }
    svg {
      width: 16px;
      height: 16px;
    }
  }
`;const n=(0,i.A)("div")`
  width: 100%;
  .${"truncate-text-tooltip"} {
    display: flex;
  }
`},600416(e,t,s){s.d(t,{Po:()=>p,eX:()=>A,rR:()=>d});var i=s(274934),n=s(125799),r=s(470070),_=s(398693),o=s(218333),l=s(638644),a=s(737364);const d=(e,t,s={},_={})=>o=>(0,i.jsx)(n.A,{portal:!0,description:e?(0,i.jsx)(r.sA,{id:e,values:_}):t,...s,children:o}),A=(e,t,s,n="default",r=!1)=>{const d=(0,i.jsx)(_.v,{text:t,textElement:(0,i.jsx)(l.A,{enabled:s,isTruncated:!0,children:t}),tooltipProps:{cursorType:n}});return(0,i.jsx)(o.p,{children:(0,i.jsx)(a.A,{label:d,tooltipItems:e,enabled:s,showMatchOppositeIcon:r})})},p=(e,t,s="default")=>(0,i.jsx)(_.v,{text:e,tooltipProps:{cursorType:s,style:{display:"grid"}},textProps:{isTruncated:!0,color:t?"inherit":"disabled",size:"inherit"}})},150025(e,t,s){s.d(t,{g:()=>n});var i=s(258978);const n={ALL:"COMMON_ALL",[i.d.DOMAIN]:"COMMON_DOMAIN_NAME",[i.d.IP]:"COMMON_IP_ADDRESS",[i.d.INTERNET]:"COMMON_INTERNET",[i.d.REGION]:"COMMON_REGION"}},625133(e,t,s){s.d(t,{A:()=>d});var i=s(274934),n=s(42220),r=s(762705),_=s(309130),o=s(304151),l=s(100978),a=s(184931);const d=function({control:e,name:t,children:s,tooltip:d,tooltipProps:A,onToggle:p,renderCheckbox:I,inputClassName:T}){const c=(0,a.mQ)();return(0,i.jsx)(n.xI,{control:e,name:t,render:({field:e})=>{const t=(0,i.jsx)(r.A,{id:e.name,onChange:({target:{checked:t}})=>{e.onChange(t),p?.(t)},checked:!!e.value,disabled:c,inputClassName:T,children:s});return(0,i.jsxs)(l.A,{gap:_.YC,alignItems:"center",children:[I?I(t,e):t,d?(0,i.jsx)(o.A,{description:d,...A}):null]})}})}},689941(e,t,s){s.d(t,{A:()=>p});var i=s(274934),n=s(693371),r=s(42220),_=s(480562),o=s(164487),l=s(597750),a=s(147045),d=s(260334),A=s(184931);const p=function({control:e,name:t,label:s,options:p,tooltip:I,tooltipProps:T,placeholder:c,renderOption:R,onChange:S,onAfterChange:N,searchable:u,searchableProps:E,portal:O,maxHeight:M,disableValidationMessage:C,isReadOnly:h,[a.L]:x}){const m=(0,A.mQ)(),g=(0,d.L_)();return(0,i.jsx)(r.xI,{control:e,name:t,render:({field:e,fieldState:a,formState:d})=>(0,i.jsxs)(l.A,{gap:2,children:[s?(0,i.jsx)(o.A,{htmlFor:t,tooltip:I,tooltipProps:{portal:!0,...T},children:s}):null,(0,i.jsx)(n.A,{variant:"secondary",width:"100%",renderOption:R??_.i,options:p,...e,readOnly:h,disabled:m,onChange:(t,s)=>{const i=S?S(s,{field:e,fieldState:a,formState:d}):e.onChange(s);return N?.(s),i},value:e.value??"",invalid:a.invalid&&!C?g((0,r.Jt)(d.errors,t)?.message)||!0:void 0,placeholder:c,searchable:u,searchableProps:E,portal:O,"data-testid":x,maxHeight:M})]})})}},933428(e,t,s){s.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 s=e.map(e=>`(${(e=>e.toString().substring(1).split(/\/([^/]*)$/))(e)[0]})`).join("|");return new RegExp(s,t)}}}]);