"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[55863],{258978(e,t,n){var i;n.d(t,{d:()=>i}),function(e){e.DOMAIN="DOMAIN",e.INTERNET="INTERNET",e.IP="IP",e.REGION="REGION"}(i||(i={}))},808926(e,t,n){n.d(t,{A:()=>c});var i=n(274934),r=n(625637),d=n(717218),o=n(156007),a=n(100978),s=n(470070),l=n(266039);const c=function({item:e,getValues:t,renderSingleItem:n,serialize:c}){const A=e.type===l.S.OBJECT?e.children||[]:e.type===l.S.FIREWALL_POLICY&&e.children?.length?e.children:[e];if(!A.length)return(0,i.jsx)(o.A,{enabled:e.enabled,children:(0,i.jsx)(s.sA,{id:"COMMON_FALLBACK"})});const T=(0,r.A)(A.flatMap(e=>t(e)).filter(e=>null!=e),c);return T.length?1===T.length?(0,i.jsx)(i.Fragment,{children:n(T[0])}):(0,i.jsx)(a.A,{maxWidth:"100%",children:(0,i.jsx)(d.A,{children:(0,i.jsx)(o.A,{enabled:e.enabled,children:(0,i.jsx)(s.sA,{id:"COMMON_MULTIPLE"})})})}):(0,i.jsx)(o.A,{enabled:e.enabled,children:(0,i.jsx)(s.sA,{id:"COMMON_FALLBACK"})})}},457523(e,t,n){n.d(t,{A:()=>c,Y:()=>i});var i,r=n(274934),d=n(977872),o=n(156007),a=n(470070),s=n(197571),l=n(808926);!function(e){e.NETWORK="network",e.ANY="any"}(i||(i={}));const c=({item:e})=>{const t=(0,d.d4)(s.Ct);return(0,r.jsx)(l.A,{item:e,getValues:e=>e.interface?[e.interface]:[],renderSingleItem:n=>{if(n?.type===i.ANY)return(0,r.jsx)(o.A,{enabled:e.enabled,children:(0,r.jsx)(a.sA,{id:"COMMON_ANY"})});if(n?.type===i.NETWORK){const i=t.find(({_id:e})=>e===n.id);if(i)return(0,r.jsx)(o.A,{enabled:e.enabled,children:i.name})}return(0,r.jsx)(o.A,{enabled:e.enabled,children:(0,r.jsx)(a.sA,{id:"COMMON_FALLBACK"})})},serialize:e=>JSON.stringify(e)})}},266039(e,t,n){var i;n.d(t,{S:()=>i}),function(e){e.POLICY_BASED_ROUTE="policy-based-route",e.STATIC_ROUTE="static-route",e.QOS_RULE="qos-rule",e.PORT_FORWARD="port-forward",e.DNS_RECORD="device-dns-record",e.NAT_RULE="nat-rule",e.FIREWALL_POLICY="firewall-policy",e.ACL_RULE="acl-rule",e.OBJECT="object"}(i||(i={}))},891651(e,t,n){n.d(t,{A:()=>A,z:()=>a});var i=n(457523),r=n(556059),d=n(258978),o=n(981803);const a="Multiple",s=e=>[...e.ip_addresses.map(e=>e.ip_or_subnet),...e.ip_ranges.map(({ip_start:e,ip_stop:t})=>`${e}-${t}`)],l=e=>{switch(e.matching_target){case d.d.IP:return s(e).join(", ");case d.d.DOMAIN:return e.domains.map(e=>e.domain).join(", ");case d.d.REGION:return e.regions?.join(", ")??"";default:return"0.0.0.0/0"}},c=(e,t)=>{const n=e.target_devices;if(0===n.length||n.some(e=>e.type===r.Q.ALL_CLIENTS))return;if(n.length>1)return a;const i=n[0];return i.type===r.Q.CLIENT?i.client_mac??void 0:i.type===r.Q.NETWORK&&i.network_id?t.get(i.network_id)?.name??i.network_id:void 0},A=(e,t)=>({type:o.m.POLICY_BASED,id:`pbr-${e._id}`,trafficRouteId:e._id,predefined:e.predefined??!1,matchingTarget:e.matching_target,domains:e.domains.map(e=>e.domain),ips:s(e),regions:e.regions??[],sourceLabel:c(e,t),destination:l(e),nextHop:void 0,interface:{type:i.Y.NETWORK,id:e.network_id},origin:o.V.POLICY_BASED,rawOrigin:void 0,distance:void 0,weight:void 0,description:e.description,enabled:e.enabled,inUse:e.enabled})},981803(e,t,n){var i,r;n.d(t,{V:()=>r,m:()=>i}),function(e){e.KERNEL="kernel",e.POLICY_BASED="policy-based",e.STATIC="static"}(i||(i={})),function(e){e.BGP="bgp",e.DHCP="dhcp",e.DEFAULT_GATEWAY="default-gateway",e.ISIS="isis",e.KERNEL="kernel",e.OSPF="ospf",e.OTHER="other",e.POLICY_BASED="policy-based",e.ROUTER_ADVERTISEMENT="router-advertisement",e.RIP="rip",e.STATIC="static",e.TELEPORT="teleport",e.VPN="vpn",e.WWAN="wwan"}(r||(r={}))},535322(e,t,n){n.d(t,{A:()=>E,I:()=>i});var i,r=n(274934),d=n(505817),o=n(753583),a=n(247816),s=n(565527),l=n(309130),c=n(100978),A=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(i||(i={}));const T=(0,a.A)(c.A,(0,A.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||d.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${s.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${s.S.LIGHT}`]};
  ${({nested:e,theme:{themeName:t}})=>e?`border: ${d.Ay[`desktop-border-divider-${t}`]};`:""}
  padding: ${({isButtonList:e,padding:t})=>t||(e?`0 ${l.Ln}`:l.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||l.Ln};
  ${({margin:e})=>e?`margin: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  width: ${({width:e="100%"})=>e};
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  ${({isButtonList:e})=>e?`\n    > div {\n      display: flex;\n      height: 48px;\n      border-bottom: ${({theme:{themeName:e}})=>d.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,O=(0,a.A)(o.A,(0,A.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||d.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${s.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${s.S.LIGHT}`]};
  ${({nested:e,theme:{themeName:t}})=>e?`border: ${d.Ay[`desktop-border-divider-${t}`]};`:""}
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  ${({padding:e})=>e?`padding: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  > li {
    > div:first-child {
      background: ${({background:e,nested:t,theme:{themeName:n}})=>e||d.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${s.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${s.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${l.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${l.Ln} ${l.Ln};
      }
    }
  }
`,E=({type:e,marginBottom:t,margin:n,padding:d,flex:o,width:a,nested:s,...l})=>"items"in l?(0,r.jsx)(O,{marginBottom:t,margin:n,padding:d,flex:o,nested:s,...l}):(0,r.jsx)(T,{nested:s,width:a,marginBottom:t,margin:n,padding:d,flex:o,isButtonList:e===i.BUTTON_LIST,...l,children:l.children})},828196(e,t,n){n.d(t,{A:()=>c});var i=n(274934),r=n(179102),d=n(775250),o=n(247816),a=n(470070),s=n(664092);const l=(0,o.A)(r.A)`
  white-space: nowrap;
`,c=({id:e,color:t,values:n,children:r})=>(0,i.jsxs)(s.A,{children:[(0,i.jsx)(l,{color:"text-2",size:"medium",children:(0,i.jsx)(a.sA,{id:e,values:n})}),(0,i.jsx)(d.A,{color:t||"text-3",size:"medium",isTruncated:!0,children:r})]})},664092(e,t,n){n.d(t,{A:()=>l});var i=n(274934),r=n(247816),d=n(309130),o=n(100978),a=n(291508);const s=(0,r.A)(o.A,(0,a.A)("valueMaxWidth","keyMinWidth","compact"))`
  &:not(:last-child) {
    ${({compact:e})=>e?"":`margin-bottom: ${d.kc};`}
  }
  & > {
    &:nth-child(1) {
      min-width: ${({keyMinWidth:e})=>e}px;
    }
    &:nth-child(2) {
      max-width: ${({valueMaxWidth:e})=>e}px;
    }
  }
`,l=({children:e,valueMaxWidth:t=215,keyMinWidth:n=0,flexProps:r={},compact:o=!1})=>(0,i.jsx)(s,{width:"100%",justifyContent:"space-between",gap:d.kc,height:o?void 0:24,valueMaxWidth:t,keyMinWidth:n,compact:o,...r,children:e})},455863(e,t,n){n.r(t),n.d(t,{default:()=>m});var i=n(274934),r=n(602086),d=n(977872),o=n(266824),a=n(535322),s=n(891651),l=n(981803),c=n(470070),A=n(205521),T=n(100978),O=n(828196),E=n(197571),_=n(457523);const u=({item:e})=>{const t=(0,d.d4)(E.Ct),n=e.interface;if(n?.type===_.Y.NETWORK){const e=t.find(({_id:e})=>e===n.id);if(e)return(0,i.jsx)(i.Fragment,{children:e.name})}return(0,i.jsx)(c.sA,{id:"COMMON_FALLBACK"})};var N=n(449339);const h={[l.V.BGP]:"SETTINGS_ROUTING_BGP_NAME",[l.V.DHCP]:"COMMON_DHCP",[l.V.DEFAULT_GATEWAY]:"SETTINGS_NETWORKS_FORM_FIELD_DHCP_GATEWAY_IP_ENABLED",[l.V.ISIS]:"SETTINGS_ROUTING_ISIS_NAME",[l.V.KERNEL]:"SETTINGS_ROUTING_KERNEL",[l.V.OSPF]:"SETTINGS_ROUTING_OSPF_NAME",[l.V.OTHER]:"COMMON_OTHER",[l.V.POLICY_BASED]:"COMMON_POLICY_BASED",[l.V.ROUTER_ADVERTISEMENT]:"SETTINGS_SECURITY_ICMP_TYPENAME_ROUTER_ADVERTISEMENT",[l.V.RIP]:"SETTINGS_ROUTING_RIP_NAME",[l.V.STATIC]:"COMMON_STATIC",[l.V.TELEPORT]:"COMMON_TELEPORT",[l.V.VPN]:"COMMON_VPN",[l.V.WWAN]:"SETTINGS_ROUTING_WWAN"},m=({activeItem:e})=>{const{formatMessage:t}=(0,c.tz)(),n=(0,d.wA)(),E=(()=>{if(e.type!==l.m.POLICY_BASED||!e.sourceLabel)return e.description;const n=e.sourceLabel===s.z?t({id:"COMMON_MULTIPLE"}):e.sourceLabel;return`${e.description}, ${t({id:"COMMON_SOURCE"})}: ${n}`})(),_=(I=e).type===l.m.STATIC?{labelId:"SETTINGS_ROUTING_OPEN_STATIC_ROUTE",panelType:N.H.STATIC_ROUTE,id:I.staticRouteId}:I.type===l.m.KERNEL&&I.linkedStaticRouteId?{labelId:"SETTINGS_ROUTING_OPEN_STATIC_ROUTE",panelType:N.H.STATIC_ROUTE,id:I.linkedStaticRouteId}:I.type===l.m.POLICY_BASED?{labelId:"SETTINGS_ROUTING_OPEN_POLICY_BASED_ROUTE",panelType:I.predefined?N.H.PREDEFINED_POLICY_BASED_ROUTE:N.H.POLICY_BASED_ROUTE,id:I.trafficRouteId}:null,m=(0,r.useCallback)(()=>{_&&n((0,A.XP)({type:_.panelType,id:_.id}))},[n,_]);var I;return(0,i.jsxs)(a.A,{children:[(0,i.jsx)(O.A,{id:"COMMON_DESTINATION",children:e.destination||(0,i.jsx)(c.sA,{id:"COMMON_FALLBACK"})}),(0,i.jsx)(O.A,{id:"COMMON_NEXT_HOP",children:e.nextHop??(0,i.jsx)(c.sA,{id:"COMMON_FALLBACK"})}),(0,i.jsx)(O.A,{id:"COMMON_INTERFACE",children:(0,i.jsx)(u,{item:e})}),(0,i.jsx)(O.A,{id:"COMMON_TYPE",children:e.origin?(0,i.jsx)(c.sA,{id:h[e.origin]}):e.rawOrigin||(0,i.jsx)(c.sA,{id:"COMMON_FALLBACK"})}),(0,i.jsx)(O.A,{id:"COMMON_METRIC",children:e.distance??(0,i.jsx)(c.sA,{id:"COMMON_FALLBACK"})}),(0,i.jsx)(O.A,{id:"COMMON_DESCRIPTION",children:E||(0,i.jsx)(c.sA,{id:"COMMON_FALLBACK"})}),(0,i.jsx)(O.A,{id:"SETTINGS_ROUTING_ROUTE_STATE",children:(0,i.jsx)(c.sA,{id:e.inUse?"SETTINGS_ROUTING_INSTALLED":"SETTINGS_ROUTING_OTHER"})}),_?(0,i.jsx)(T.A,{children:(0,i.jsx)(o.A,{type:"button",fontSize:"medium",onPress:m,children:(0,i.jsx)(c.sA,{id:_.labelId})})}):null]})}},181839(e,t,n){n.d(t,{A:()=>d});var i=n(21628);const r=function(e){return e!=e},d=function(e,t){return!(null==e||!e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var i=n-1,r=e.length;++i<r;)if(e[i]===t)return i;return-1}(e,t,n):(0,i.A)(e,r,n)}(e,t,0)>-1}},858282(e,t,n){n.d(t,{A:()=>i});const i=function(e,t,n){for(var i=-1,r=null==e?0:e.length;++i<r;)if(n(t,e[i]))return!0;return!1}},21628(e,t,n){n.d(t,{A:()=>i});const i=function(e,t,n,i){for(var r=e.length,d=n+(i?1:-1);i?d--:++d<r;)if(t(e[d],d,e))return d;return-1}},809613(e,t,n){n.d(t,{A:()=>c});var i=n(941267),r=n(181839),d=n(858282),o=n(619742),a=n(671426);var s=n(430254);const l=a.A&&1/(0,s.A)(new a.A([,-0]))[1]==1/0?function(e){return new a.A(e)}:function(){},c=function(e,t,n){var a=-1,c=r.A,A=e.length,T=!0,O=[],E=O;if(n)T=!1,c=d.A;else if(A>=200){var _=t?null:l(e);if(_)return(0,s.A)(_);T=!1,c=o.A,E=new i.A}else E=t?[]:O;e:for(;++a<A;){var u=e[a],N=t?t(u):u;if(u=n||0!==u?u:0,T&&N==N){for(var h=E.length;h--;)if(E[h]===N)continue e;t&&E.push(N),O.push(u)}else c(E,N,n)||(E!==O&&E.push(N),O.push(u))}return O}},625637(e,t,n){n.d(t,{A:()=>d});var i=n(913970),r=n(809613);const d=function(e,t){return e&&e.length?(0,r.A)(e,(0,i.A)(t,2)):[]}}}]);