"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[89891],{208047(e,r,t){t.d(r,{r:()=>l});var n=t(226586),s=t(219582),o=t(437007),i=t(565744);const a=(0,n.Ay)({baseUrl:"/v2",fetch:(...e)=>(0,o.n)(...e).then(i.x9)}),l=(0,s.A)(a)},636432(e,r,t){t.d(r,{Uu:()=>S,iw:()=>E,DZ:()=>p,Zb:()=>u,N0:()=>g,uE:()=>m,Je:()=>D,od:()=>N,Oh:()=>h,dw:()=>T});var n=t(640708),s=t(756275),o=t(995304),i=t(627625),a=t(260334),l=t(403263),d=t(199220);const _=(0,i.S)([d.m9,l.q],{message:(0,a.rn)("SETTINGS_IPV6_ADDRESS_OR_SUBNET_VALIDATION")});var c=t(962946),I=t(115219),A=t(139847),O=t(277822);const u={[O.B.PORT_GROUP]:"SETTINGS_DUPLICATE_PORT_VALIDATION",[O.B.ADDRESS_GROUP]:"SETTINGS_DUPLICATE_IP_VALIDATION",[O.B.IPV6_ADDRESS_GROUP]:"SETTINGS_DUPLICATE_IP_VALIDATION",[O.B.DOMAIN_GROUP]:"SETTINGS_SECURITY_DOMAINS_VALIDATION"},m={[O.B.PORT_GROUP]:{id:"COMMON_PLACEHOLDER_EG",values:{value:"1-10"}},[O.B.ADDRESS_GROUP]:{id:"SETTINGS_IP_SUBNET_RANGE",values:{version:A.oi.IPV4}},[O.B.IPV6_ADDRESS_GROUP]:{id:"SETTINGS_IP_SUBNET_RANGE",values:{version:A.oi.IPV6}},[O.B.DOMAIN_GROUP]:{id:"COMMON_PLACEHOLDER_EG",values:{value:"example.com"}}},p={[O.B.PORT_GROUP]:"SETTINGS_ADD_MULTIPLE_PORTS_PLACEHOLDER",[O.B.ADDRESS_GROUP]:"SETTINGS_ADD_MULTIPLE_IPS_PLACEHOLDER",[O.B.IPV6_ADDRESS_GROUP]:"SETTINGS_ADD_MULTIPLE_IPV6_PLACEHOLDER",[O.B.DOMAIN_GROUP]:"SETTINGS_ADD_MULTIPLE_DOMAINS_PLACEHOLDER"},E=[O.B.ADDRESS_GROUP,O.B.IPV6_ADDRESS_GROUP,O.B.DOMAIN_GROUP,O.B.PORT_GROUP],T=[24,48,72],S=24,h=[O.B.ADDRESS_GROUP,O.B.IPV6_ADDRESS_GROUP,O.B.DOMAIN_GROUP],N={[O.B.PORT_GROUP]:"COMMON_PORT",[O.B.ADDRESS_GROUP]:"COMMON_IPV4",[O.B.IPV6_ADDRESS_GROUP]:"COMMON_IPV6",[O.B.DOMAIN_GROUP]:"COMMON_DOMAIN"},g={[O.B.PORT_GROUP]:"COMMON_PORT",[O.B.ADDRESS_GROUP]:"COMMON_ADDRESS",[O.B.IPV6_ADDRESS_GROUP]:"COMMON_ADDRESS",[O.B.DOMAIN_GROUP]:"COMMON_DOMAIN"},D={[O.B.PORT_GROUP]:(0,i.S)([s.L,o.i],{message:(0,a.rn)("SETTINGS_COMMON_PORT_LIST_VALIDATION_REQUIRED")}),[O.B.ADDRESS_GROUP]:c.q.refine(e=>!e.endsWith("/32"),{message:(0,a.rn)("SETTINGS_REMOVE_SUBNET_SUFFIX",{subnet:32})}),[O.B.IPV6_ADDRESS_GROUP]:_.refine(e=>!e.endsWith("/128"),{message:(0,a.rn)("SETTINGS_REMOVE_SUBNET_SUFFIX",{subnet:128})}).refine(e=>!(0,n.Bu)(e),{message:(0,a.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_RESERVED_SUBNET_INVALID")}),[O.B.DOMAIN_GROUP]:I.a}},277822(e,r,t){var n,s;t.d(r,{B:()=>n,e:()=>s}),function(e){e.PORT_GROUP="port-group",e.ADDRESS_GROUP="address-group",e.IPV6_ADDRESS_GROUP="ipv6-address-group",e.DOMAIN_GROUP="domain-group"}(n||(n={})),function(e){e.STATIC="static",e.DYNAMIC="dynamic"}(s||(s={}))},547967(e,r,t){t.d(r,{AC:()=>A,D7:()=>O,Ie:()=>N,JL:()=>E,JX:()=>h,KY:()=>u,O2:()=>I,Op:()=>c,Rm:()=>m,e$:()=>T,t7:()=>p,yr:()=>S});var n=t(179102),s=t(505817),o=t(247816),i=t(409844),a=t(291508),l=t(61322),d=t(309130),_=t(100978);const c=(0,o.A)(_.A,(0,a.A)("inline","wrap"))`
  position: relative;
  flex: ${({inline:e})=>e?"1 1 0":"0 0 100%"};
  align-items: flex-start;
  flex-flow: ${({wrap:e})=>"row "+(e?"wrap":"nowrap")};
  gap: ${d.kc};
`,I=(0,o.A)(_.A,(0,a.A)("editMaxHeight","editFieldWrap"))`
  flex-direction: column;
  max-height: ${({editMaxHeight:e})=>`${e||300}px`};
  overflow-y: auto;
  overflow-x: hidden;
  gap: ${d.YC};

  ${({editFieldWrap:e,theme:{themeName:r}})=>e?`\n    gap: 0;\n\n    > * {\n      border-bottom: ${s.Ay[`desktop-border-divider-${r}`]};\n      padding-bottom: ${d.kc};\n      padding-top: ${d.kc};\n    }\n\n    > *:first-child {\n      padding-top: 0;\n    }\n\n    > *:last-child {\n      border-bottom: none;\n      padding-bottom: 0;\n    }\n  `:""}
`,A=(0,o.A)("div",(0,a.A)("isWindowsTable","rows","tableMaxHeight","marginTop"))`
  width: 100%;
  // windows table inherits height from parent container
  height: ${({rows:e,isWindowsTable:r})=>r&&`${l.I.ROW_HEIGHT*e+l.I.HEADER_HEIGHT}`}px;
  max-height: ${({tableMaxHeight:e})=>e?`${e}px`:"auto"};
  margin-top: ${({marginTop:e})=>e||d.Ln};

  table {
    td {
      max-width: 170px;

      span {
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
  }
`,O=(0,o.A)(n.A)`
  margin-right: ${d.YC};
`,u=i.AH`
  :first-of-type {
    padding: 0 ${d.fS} 0 0px;
  }
`,m="drag-and-drop-table-row-placeholder",p=(0,o.A)(_.A)`
  flex-direction: column;

  /* Adjust weird padding on the right side for the ID column when right aligned (drag & drop table) */
  table > thead > tr > th:last-of-type {
    padding-right: ${d.kc};
  }

  /* Add missing border between drag and drop groups (tbody elements) */
  table > tbody {
    border-bottom: ${({theme:{themeName:e}})=>s.Ay[`desktop-border-divider-${e}`]};
  }
  /* Last cell in table is hover content which is not used in this table */
  table > tbody[data-rbd-droppable-context-id] td:not(:last-of-type),
  table > thead > tr > th {
    /* Align drag & drop table cell padding to regular table padding */
    padding-right: ${d.kc} !important;
  }
  /* Align drop zone placeholder row when a row is dragged to matched the CSS overrides for drag and drop table we use */
  table .${m} {
    display: flex;
  }
`,E=i.AH`
  /* This is default for the table rows, so we need it for the header. */
  display: flex;
  width: 100%;

  > th:first-child {
    /* Since we flex the header, we must specify this to align with the table rows. */
    width: 24px;
  }
  > th:not(:first-child) {
    /* Something inside UIC sets the padding to 8px for table header and 5px for table rows. This aligns it to make flex work. */
    padding-right: ${d.kc} !important;
  }
`,T=i.AH`
  /* Override the padding-right of the first column to align with manage + drop modes. */
  > th:first-child {
    padding-right: ${d.kc} !important;
  }
  > th:first-child:has(> label) {
    padding-right: 1px !important;
    width: 36px;
  }
`,S=i.AH`
  /* UIC already does this for some table states, like drag and drop and when in manage mode. If we just use this ALWAYS, we're avoiding many issues related to using different alignment techniques in different places. */
  display: flex;
`,h=i.AH`
  tbody {
    display: flex;
    flex-direction: column;
  }
`;function N(e,r){return i.AH`
    width: ${r.width?`${r.width}px`:"auto"};
    min-width: ${r.minWidth?`${r.minWidth}px`:"0px"};
    flex: ${r.growthFactor||0} !important;
    padding-left: ${d.kc} !important;
    padding-right: ${d.kc} !important;
  `}},256468(e,r,t){var n;t.d(r,{EE:()=>o,Uh:()=>n,Vf:()=>s}),function(e){e.SINGLE="single",e.PLURAL="plural"}(n||(n={}));const s="editActive",o=20},531984(e,r,t){t.d(r,{w:()=>i});var n=t(602086),s=t(977872),o=t(205521);const i=e=>{const r=(0,s.wA)();(0,n.useEffect)(()=>{r((0,o.SQ)(e))},[r,e])}},762542(e,r,t){t.d(r,{y:()=>s});var n=t(531984);const s=e=>(0,n.w)(e.formState.isDirty)},753959(e,r,t){t.d(r,{A:()=>l});var n=t(274934),s=t(505817),o=t(247368),i=t(263705),a=t(612389);const l=({children:e,icon:r,background:t,...l})=>{const{themeName:d}=(0,i.u)();return(0,n.jsx)(a.A,{icon:r||(0,n.jsx)(o.A,{variant:"fill",size:"original",color:s.Ay[`desktop-color-ublue-06-${d}`]}),description:e,background:t,...l})}},480562(e,r,t){t.d(r,{i:()=>i});var n=t(274934),s=t(548941),o=t(711892);const i=e=>(0,n.jsx)(s.A,{description:e.option&&"tooltipDescription"in e.option?e.option.tooltipDescription:null,position:"left",portal:!0,children:(0,n.jsx)(o.q,{...e})})},341699(e,r,t){t.d(r,{HV:()=>o,pm:()=>i,vF:()=>s});var n=t(726831);const s=e=>`${n.A.fabricsOrchestration}?orchestrationId=${e?.template_id||""}&orgId=${e?.organization_id||""}`,o=e=>`${n.A.fabricsDeviceTemplates}/${e?.template_id||""}?orgId=${e?.organization_id||""}`,i=()=>`${n.A.fabricsOrchestration}`},245602(e,r,t){t.r(r),t.d(r,{default:()=>Ne});var n=t(274934),s=t(977872),o=t(42220),i=t(159469),a=t(871808),l=t(762542),d=t(988646),_=t(23964),c=t(670241),I=t(635891),A=t(891326),O=t(877840),u=t(121713),m=t(449339),p=t(309130),E=t(756782),T=t(100978),S=t(205521),h=t(700444),N=t(470070),g=t(233313),D=t(6276),R=t(277822),M=t(694169),f=t(309100),P=t(969288),x=t(636432),v=t(897166),L=t(95857),b=t(89469),C=t(115114),G=t(455425);const U=(e,r)=>r===R.e.DYNAMIC&&x.Oh.includes(e),j=e=>{const r=e.group_type??R.B.ADDRESS_GROUP,t=e.source??R.e.STATIC,n=e.update_interval_seconds?Math.round(e.update_interval_seconds/G.KU):x.Uu;return{name:e.name??"",group_type:r,source:t,group_members:e.group_members??[],url:e.url??"",update_interval_hours:n,description:e.description??""}},V=(e,r)=>{const t=e.description.trim(),n=e.group_members.filter(e=>!!e);return U(e.group_type,e.source)?{_id:r,name:e.name,group_type:e.group_type,group_members:[],source:R.e.DYNAMIC,url:e.url,update_interval_seconds:e.update_interval_hours*G.KU,description:t}:{_id:r,name:e.name,group_type:e.group_type,group_members:n,source:R.e.STATIC,description:t}};var w=t(241792),B=t(765282),y=t(260334);const H={[R.B.PORT_GROUP]:"SETTINGS_PROFILES_PORT_IP_GROUPS_FORM_FIELD_GROUP_MEMBERS_PORT_MIN",[R.B.ADDRESS_GROUP]:"SETTINGS_PROFILES_PORT_IP_GROUPS_FORM_FIELD_GROUP_MEMBERS_ADDRESS_MIN",[R.B.IPV6_ADDRESS_GROUP]:"SETTINGS_PROFILES_PORT_IP_GROUPS_FORM_FIELD_GROUP_MEMBERS_ADDRESS_MIN",[R.B.DOMAIN_GROUP]:"SETTINGS_ROUTING_QOS_DOMAINS_VALIDATION"},F=e=>w.Ik({name:w.Yj().min(1,{message:(0,y.rn)("COMMON_REQUIRED")}).max(64,{message:(0,y.rn)("SETTINGS_COMMON_FIELD_SHOULD_NOT_EXCEED_MAX_LENGTH",{name:(0,y.rn)("COMMON_NAME"),limit:64})}),group_type:w.fc(R.B),source:w.fc(R.e),group_members:w.YO(w.Yj()),url:w.Yj(),update_interval_hours:w.ai(),description:w.Yj().max(1024,{message:(0,y.rn)("SETTINGS_COMMON_FIELD_SHOULD_NOT_EXCEED_MAX_LENGTH",{name:(0,y.rn)("COMMON_DESCRIPTION"),limit:1024})})}).superRefine((r,t)=>{if(e.some(e=>e.name===r.name)&&t.addIssue({code:B.eq.custom,path:["name"],message:(0,y.rn)("COMMON_PLEASE_ENTER_UNIQUE_NAME")}),U(r.group_type,r.source))return r.url.startsWith("https://")&&w.Yj().url().safeParse(r.url).success?r.url.length>1024&&t.addIssue({code:B.eq.custom,path:["url"],message:(0,y.rn)("SETTINGS_COMMON_FIELD_SHOULD_NOT_EXCEED_MAX_LENGTH",{name:(0,y.rn)("COMMON_URL"),limit:1024})}):t.addIssue({code:B.eq.custom,path:["url"],message:(0,y.rn)("COMMON_VALIDATION_VALID_URL")}),void(x.dw.includes(r.update_interval_hours)||t.addIssue({code:B.eq.custom,path:["update_interval_hours"],message:(0,y.rn)("COMMON_REQUIRED")}));0===r.group_members.filter(e=>!!e).length&&t.addIssue({code:B.eq.custom,path:["group_members"],message:(0,y.rn)(H[r.group_type])})}),$=({form:e})=>(0,n.jsx)(I.A,{control:e.control,name:"url",label:(0,n.jsx)(N.sA,{id:"COMMON_URL"})});var W=t(602086),k=t(689941);const Y=({form:e})=>{const{formatMessage:r}=(0,N.tz)(),t=(0,W.useMemo)(()=>x.dw.map(e=>({value:e,label:r({id:"COMMON_HOURS"},{hours:e})})),[r]);return(0,n.jsx)(k.A,{control:e.control,name:"update_interval_hours",label:(0,n.jsx)(N.sA,{id:"SETTINGS_NETWORK_LIST_UPDATE_INTERVAL"}),options:t})};var K=t(482609),Q=t(787481),q=t(164487),z=t(597750);const X=({form:e})=>{const r=(0,o.FH)({control:e.control,name:"group_members"});return(0,n.jsxs)(z.A,{children:[(0,n.jsx)(q.A,{children:(0,n.jsx)(N.sA,{id:"COMMON_TYPE"})}),(0,n.jsx)(O.A,{isDisabled:r.length>0,children:(0,n.jsx)(Q.A,{children:x.iw.map(r=>(0,n.jsx)(K.A,{control:e.control,name:"group_type",value:r,children:(0,n.jsx)(N.sA,{id:x.od[r]})},r))})})]})},J=[{value:R.e.STATIC,labelId:"COMMON_STATIC"},{value:R.e.DYNAMIC,labelId:"COMMON_DYNAMIC"}],Z=({form:e,isExistingRecord:r})=>(0,n.jsxs)(z.A,{children:[(0,n.jsx)(q.A,{tooltip:(0,n.jsx)(N.sA,{id:"SETTINGS_NETWORK_LIST_SOURCE_TOOLTIP"}),children:(0,n.jsx)(N.sA,{id:"COMMON_SOURCE"})}),(0,n.jsx)(O.A,{isDisabled:r,children:(0,n.jsx)(Q.A,{children:J.map(({value:r,labelId:t})=>(0,n.jsx)(K.A,{control:e.control,name:"source",value:r,children:(0,n.jsx)(N.sA,{id:t})},r))})})]});var ee=t(999633),re=t(263705),te=t(266824),ne=t(179102),se=t(505817),oe=t(754400);const ie=({index:e,style:r,entries:t})=>(0,n.jsx)("div",{style:r,children:(0,n.jsx)(T.A,{alignItems:"center",padding:`0 ${p.kc}`,children:(0,n.jsx)(ne.A,{size:"medium",children:t[e]})})});var ae=t(14730);const le=({form:e})=>{const{themeName:r}=(0,re.u)(),t=(0,o.FH)({control:e.control,name:"url"})??"",s=(0,o.FH)({control:e.control,name:"group_type"}),{data:i,isFetching:a,error:l,refetch:d}=(0,oe.g)({url:t,groupType:s}),_=(0,W.useMemo)(()=>({entries:i?.entries??[]}),[i]);if(!(0,ae.t)(t))return null;const c=i?.entries??[];return(0,n.jsxs)(T.A,{flexDirection:"column",gap:p.kc,children:[(0,n.jsx)(T.A,{children:(0,n.jsx)(te.A,{fontSize:"medium",isDisabled:a,onPress:()=>{d()},children:(0,n.jsx)(N.sA,{id:"SETTINGS_NETWORK_LIST_PREVIEW_BUTTON"})})}),l?(0,n.jsx)(ne.A,{size:"small",color:"destructive",children:(0,n.jsx)(N.sA,{id:(0,ae.B)(l)})}):null,i?(0,n.jsxs)(T.A,{flexDirection:"column",gap:p.kc,children:[(0,n.jsx)(q.A,{children:(0,n.jsx)(N.sA,{id:"SETTINGS_NETWORK_LIST_PREVIEW_HEADER",values:{count:c.length}})}),c.length>0?(0,n.jsx)(T.A,{background:se.Ay[`desktop-color-input-bg-normal-${r}`],borderRadius:p.YC,overflow:"hidden",width:"100%",children:(0,n.jsx)(ee.B8,{defaultHeight:Math.min(24*c.length,240),rowComponent:ie,rowCount:c.length,rowHeight:24,rowProps:_,style:{maxHeight:240,width:"100%"}})}):null]}):null]})};var de=t(753959),_e=t(793442),ce=t(341699);const Ie=({existingRecord:e})=>(0,n.jsx)(de.A,{children:(0,n.jsxs)(T.A,{flexDirection:"column",children:[(0,n.jsx)(N.sA,{id:"COMMON_MANAGED_BY_FABRIC",values:{feature:(0,n.jsx)(N.sA,{id:"COMMON_NETWORK_LIST"})}}),(0,n.jsx)(_e.A,{id:"COMMON_VIEW_IN_SITE_MANAGER",href:(0,ce.vF)(e?.cloud_template)})]})});var Ae=t(858098),Oe=t(635187),ue=t(202730),me=t(590979),pe=t(756275);const Ee=e=>{const r=e.split(Oe.jr);return 2===r.length&&(0,pe.w)(r[0])&&(0,pe.w)(r[1])&&Number(r[0])<Number(r[1])?[Number(r[0]),Number(r[1])]:(0,pe.w)(e)?[Number(e),Number(e)]:null},Te=e=>[...e].sort((e,r)=>{const t=Ee(e),n=Ee(r);return t&&n?t[0]-n[0]:0}),Se=({form:e})=>{const{formatMessage:r}=(0,N.tz)(),t=(0,o.FH)({control:e.control,name:"group_type"}),s=x.N0[t],i=x.uE[t],a=r({id:i.id},i.values),l=r({id:x.DZ[t]}),d=(0,W.useCallback)((e,t)=>{const n=Ee(e);if(!n)return!0;for(const e of t){const t=Ee(e);if(t&&n[0]<=t[1]&&t[0]<=n[1])return r({id:"SETTINGS_PORT_RANGE_OVERLAP_VALIDATION"},{entry:e})}return!0},[r]);return(0,n.jsxs)(z.A,{"data-field-error":"group_members",...me.A.addDataTestId(ue.b.POLICY_BASED_ROUTES_DOMAIN),children:[(0,n.jsx)(q.A,{children:(0,n.jsx)(N.sA,{id:s})}),(0,n.jsx)(Ae.A,{form:e,name:"group_members",fieldLabel:s,hideBatchAddLabel:!0,modalTitle:(0,n.jsx)(N.sA,{id:"SETTINGS_ADD_MULTIPLE_NETWORK_LIST_VALUES"}),modalFieldPlaceholder:l,itemSchema:x.Je[t],placeholder:a,getDuplicationMessage:()=>r({id:x.Zb[t]}),splitBy:t===R.B.PORT_GROUP?Oe.KE:void 0,validateInArray:t===R.B.PORT_GROUP?d:void 0,sortValue:t===R.B.PORT_GROUP?Te:void 0})]})},he="network-list-profile-form",Ne=({activeItem:e})=>{const r=(0,s.wA)(),t=e._id===P.R6,G=(0,s.d4)(M.O9),U=(0,u.m)({schema:F(G.filter(({_id:r})=>r!==e._id)),defaultValues:j(t?{...e,group_members:[]}:e),mode:"onSubmit"}),w=(0,o.FH)({control:U.control,name:"group_type"}),B=(0,o.FH)({control:U.control,name:"source"}),y=(0,a.A)(L.Xj.FIREWALL_DYNAMIC_LISTS),H=x.Oh.includes(w),W=H&&B===R.e.DYNAMIC,k=(0,d.S)(c.v.NETWORK_OBJECTS),K=(0,s.d4)(v.EL),Q=(0,D.A)(e);(0,l.y)(U);const q=U.handleSubmit(async n=>{r((0,f.Qe)(V(n,t?null:e._id))).then(e=>{r((0,S.SQ)(!1)),t&&r((0,S.XP)({id:e._id,type:m.H.NETWORK_LIST_PROFILE}))}).then(()=>{U.reset()}).catch(e=>{r((0,h.ox)({errorMessage:e.msg,errorValues:e,icon:i.C.danger,message:"SETTINGS_PROFILES_NETWORK_OBJECT_FORM_SAVE_FAILURE",values:{name:n.name}}))})});return(0,n.jsx)(O.A,{isDisabled:k||K||Q,children:(0,n.jsx)("form",{onSubmit:q,id:he,children:(0,n.jsxs)(T.A,{width:"100%",gap:p.Ln,flexDirection:"column",children:[(0,n.jsx)(_.A,{feature:c.v.NETWORK_OBJECTS,renderWarning:({children:e})=>(0,n.jsx)(g.A,{children:(0,n.jsx)(E.A,{children:e})})}),(0,n.jsxs)(E.A,{children:[Q?(0,n.jsx)(Ie,{existingRecord:e}):null,(0,n.jsx)(I.A,{autoFocus:!0,control:U.control,name:"name",label:(0,n.jsx)(N.sA,{id:"COMMON_NAME"})})]}),(0,n.jsx)(E.A,{children:(0,n.jsxs)(b.A,{children:[(0,n.jsx)(X,{form:U}),H&&y?(0,n.jsx)(Z,{form:U,isExistingRecord:!t}):null,W?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)($,{form:U}),(0,n.jsx)(Y,{form:U}),(0,n.jsx)(le,{form:U})]}):(0,n.jsx)(Se,{form:U}),(0,n.jsx)(A.A,{control:U.control,name:"description",rows:3,label:(0,n.jsx)(N.sA,{id:"COMMON_DESCRIPTION"}),tooltip:(0,n.jsx)(N.sA,{id:"SETTINGS_NETWORK_LIST_DESCRIPTION_TOOLTIP"})})]})}),(0,n.jsx)(C.A,{onFormCancel:()=>U.reset(),isDirty:U.formState.isDirty||t&&!k,hideCancelButton:!U.formState.isDirty,submitButtonText:t?"COMMON_ACTION_ADD":void 0,form:he,isSubmitting:U.formState.isSubmitting})]})})})}},14730(e,r,t){t.d(r,{B:()=>i,t:()=>o});var n=t(565744),s=t(352210);const o=e=>{if(!e||e.length>1024)return!1;try{const r=new URL(e);return"https:"===r.protocol&&!!r.host}catch{return!1}},i=e=>{if((0,n.d7)(e)){const r=s.API_STRING_TRANSLATION[e.original.meta.msg];if(r)return r}return"SETTINGS_NETWORK_LIST_PREVIEW_ERROR_FETCH_FAILED"}},754400(e,r,t){t.d(r,{g:()=>l,u:()=>d});var n=t(101325),s=t(208047),o=t(455425);const i=(e,r)=>s.r.queryOptions("post","/api/firewall-groups/preview",{body:{url:e,group_type:r}},{retry:!1,staleTime:1/0,gcTime:5*o.ti});var a=t(14730);const l=({url:e,groupType:r,enabled:t=!1})=>(0,n.I)({...i(e,r),enabled:t}),d=(e,r)=>{const t=e??"",n=(0,a.t)(t),{data:s,isFetching:o,isError:i}=l({url:t,groupType:r,enabled:n});return{urlIsValid:n,entries:s?.entries,isFetching:o,isError:i}}},61322(e,r,t){t.d(r,{I:()=>n});const n={HEADER_HEIGHT:32,ROW_HEIGHT:32,EDIT_FIELD_HEIGHT:36,getHeight(e,r,t,n){return Math.min((n||this.ROW_HEIGHT)*e+(t??this.HEADER_HEIGHT),(n||this.ROW_HEIGHT)*r+(t??this.HEADER_HEIGHT))},getEditContainerHeight(e,r,t){return Math.min((t||this.EDIT_FIELD_HEIGHT)*e,(t||this.EDIT_FIELD_HEIGHT)*r)}}},858098(e,r,t){t.d(r,{A:()=>c});var n=t(274934),s=t(602086),o=t(42220),i=t(260334),a=t(184931),l=t(100978),d=t(470070),_=t(680163);const c=function({form:e,name:r,fieldLabel:t,modalTitle:c,modalFieldPlaceholder:I,placeholder:A,itemSchema:O,transformValue:u,getDuplicationMessage:m,extraDisplayColumns:p,actions:E,max:T,disableMultiEdit:S=!1,splitBy:h,validateInArray:N,sortValue:g,hideBatchAddLabel:D=!1}){const R=(0,a.mQ)(),M=(0,i.L_)(),{formatMessage:f}=(0,d.tz)(),P=(0,s.useMemo)(()=>({fieldLabel:t,modalTitle:c,modalFieldPlaceholder:I}),[t,I,c]),x=(0,s.useMemo)(()=>({getDuplicationMessage:m??(()=>f({id:"SETTINGS_VALUE_UNIQUE"})),validateInArray:N,validate:e=>{if(h&&"string"==typeof e){const r=e.split(h).map(e=>e.trim()).filter(Boolean);for(const t of r.length>0?r:[e]){const e=O.safeParse(t);if(!e.success)return M(e.error.issues[0]?.message)}return!0}const r=O.safeParse(e);return!!r.success||M(r.error.issues[0]?.message)}}),[f,M,m,O,h,N]),v=(0,s.useMemo)(()=>({placeholder:A,translatePlaceholder:!1,parser:u?e=>u(e?.[0]?.target?.value):void 0}),[A,u]);return(0,n.jsx)(o.xI,{control:e.control,name:r,render:({field:e,fieldState:r,formState:t})=>(0,n.jsx)(l.A,{flexDirection:"column",width:"100%",children:(0,n.jsx)(_.A,{disabled:R,labels:P,fieldValidation:x,extraFieldConfig:v,value:g?g(e.value||[]):e.value||[],onChange:r=>e.onChange(r),invalid:r.invalid?M((0,o.Jt)(t.errors,e.name)?.message)||!0:void 0,extraDisplayColumns:p,actions:E,disableMultiEdit:S,max:T,splitBy:h,transformValue:u,hideBatchAddLabel:D})})})}},689941(e,r,t){t.d(r,{A:()=>I});var n=t(274934),s=t(310075),o=t(42220),i=t(480562),a=t(164487),l=t(597750),d=t(147045),_=t(260334),c=t(184931);const I=function({control:e,name:r,label:t,options:I,tooltip:A,tooltipProps:O,placeholder:u,renderOption:m,onChange:p,onAfterChange:E,searchable:T,searchableProps:S,portal:h,maxHeight:N,variant:g="secondary",disableValidationMessage:D,isReadOnly:R,[d.L]:M}){const f=(0,c.mQ)(),P=(0,_.L_)();return(0,n.jsx)(o.xI,{control:e,name:r,render:({field:e,fieldState:d,formState:_})=>(0,n.jsxs)(l.A,{gap:2,children:[t?(0,n.jsx)(a.A,{htmlFor:r,tooltip:A,tooltipProps:{portal:!0,...O},children:t}):null,(0,n.jsx)(s.A,{variant:g,width:"100%",renderOption:m??i.i,options:I,...e,readOnly:R,disabled:f,onChange:(r,t)=>{const n=p?p(t,{field:e,fieldState:d,formState:_}):e.onChange(t);return E?.(t),n},value:e.value??"",invalid:d.invalid&&!D?P((0,o.Jt)(_.errors,r)?.message)||!0:void 0,placeholder:u,searchable:T,searchableProps:S,portal:h,"data-testid":M,maxHeight:N})]})})}},482609(e,r,t){t.d(r,{A:()=>c});var n=t(274934),s=t(602086),o=t(42220),i=t(87562),a=t(309130),l=t(304151),d=t(100978),_=t(184931);const c=(0,s.forwardRef)(function({control:e,name:r,children:t,tooltip:s,tooltipProps:c,value:I,onCheck:A,...O},u){const m=(0,_.mQ)();return(0,n.jsx)(o.xI,{control:e,name:r,render:({field:e})=>(0,n.jsxs)(d.A,{gap:a.YC,alignItems:"center",ref:u,...O,children:[(0,n.jsx)(i.A,{id:e.name,onChange:({target:{checked:r}})=>{r&&(e.onChange(I),A?.())},checked:e.value===I,disabled:m,value:e.value,children:t}),s?(0,n.jsx)(l.A,{description:s,...c}):null]})})})},635891(e,r,t){t.d(r,{A:()=>_});var n=t(274934),s=t(42220),o=t(699709),i=t(775250),a=t(309130),l=t(260334),d=t(184931);const _=function({control:e,name:r,label:t,placeholder:_,tooltip:c,tooltipProps:I,autoFocus:A,motif:O,onChange:u,onBlur:m,onAfterChange:p,onPaste:E,onKeyDown:T,passwordToggle:S,type:h,helperMessage:N,autoComplete:g,contentBefore:D,contentAfter:R,onFocus:M,value:f,invalid:P}){const x=(0,d.mQ)(),v=(0,d.Im)(),L=(0,d.q)(),b=(0,l.L_)();return(0,n.jsx)(s.xI,{control:e,name:r,render:({field:e,fieldState:l,formState:d})=>(0,n.jsx)(o.A,{type:h||(S?"password":"text"),variant:"secondary",width:"100%",autoFocus:A,...e,onChange:r=>{u?u(r,e,d):e.onChange(r),p?.(r)},onBlur:r=>{m?m(r,e,d):e.onBlur()},onFocus:M,onPaste:E,disabled:x,value:f??e.value?.toString(),invalid:P||(l.invalid?(0,n.jsxs)(i.A,{variant:"inherit",style:{overflowWrap:"break-word"},children:[b((0,s.Jt)(d.errors,r)?.message)||!0," "]}):void 0),label:t,placeholder:_,labelTooltip:c,labelTooltipProps:{style:{opacity:v?a.xN:void 0,pointerEvents:L?"none":void 0,...I?.style},...I},motif:O,passwordToggle:S,helperMessage:N,autoComplete:g,onKeyDown:T,contentBefore:D,contentAfter:R})})}},115219(e,r,t){t.d(r,{a:()=>i});var n=t(241792),s=t(570866),o=t(260334);const i=n.Yj({message:(0,o.rn)("COMMON_DOMAIN_VALIDATION")}).max(253,{message:(0,o.rn)("COMMON_DOMAIN_VALIDATION")}).refine(e=>e.split(".").every(e=>e.length<=63),{message:(0,o.rn)("COMMON_DOMAIN_VALIDATION")}).refine(e=>s.V2.test(e),{message:(0,o.rn)("COMMON_DOMAIN_VALIDATION")})},149450(e,r,t){t.d(r,{B:()=>a,b:()=>i});var n=t(241792),s=t(745454),o=t(260334);const i=n.Yj({message:(0,o.rn)("COMMON_VALIDATION_VALID_IPV4")}).refine(e=>!e||(0,s.isValidIpv4)(e),{message:(0,o.rn)("COMMON_VALIDATION_VALID_IPV4")}),a=n.Yj({message:(0,o.rn)("COMMON_VALIDATION_VALID_IPV4")}).refine(e=>(0,s.isValidIpv4)(e),{message:(0,o.rn)("COMMON_VALIDATION_VALID_IPV4")})},962946(e,r,t){t.d(r,{q:()=>A});var n=t(627625),s=t(260334),o=t(847849),i=t(241792),a=t(745454),l=t(810024),d=t(570866),_=t(635187);const c=i.Yj({message:(0,s.rn)("COMMON_VALIDATION_IPV4_SUBNET")}).refine(e=>{const r=e.split(_.jr),[t,n]=r;return 2===r.length&&t&&n&&d.zF.test(t)&&d.zF.test(n)&&(0,a.isValidIpv4)(t)&&(0,a.isValidIpv4)(n)&&(0,l.GQ)(t)<(0,l.GQ)(n)},{message:(0,s.rn)("COMMON_VALIDATION_IPV4_SUBNET")});var I=t(149450);const A=(0,n.S)([I.B,o.K,c],{message:(0,s.rn)("SETTINGS_ROUTING_NAT_FORM_IP_OR_SUBNET_OR_RANGE_VALIDATION")})},847849(e,r,t){t.d(r,{K:()=>a});var n=t(241792),s=t(810024),o=t(570866),i=t(260334);const a=n.Yj({message:(0,i.rn)("COMMON_VALIDATION_IPV4_SUBNET")}).regex(o.wK,{message:(0,i.rn)("COMMON_VALIDATION_IPV4_SUBNET")}).refine(s.N7,{message:(0,i.rn)("COMMON_VALIDATION_IPV4_SUBNET")})},199220(e,r,t){t.d(r,{Jh:()=>a,XK:()=>i,m9:()=>l});var n=t(241792),s=t(640708),o=t(260334);const i=n.Yj().ip({version:"v6",message:(0,o.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_INVALID")}).refine(e=>!e||!e.includes("%"),{message:(0,o.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_INVALID")}),a=n.KC([n.Yj().ip({version:"v6",message:(0,o.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_INVALID")}),n.eu("")]).optional().refine(e=>!e||!e.includes("%"),{message:(0,o.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_INVALID")}),l=i.refine(e=>!(0,s.m0)(e),{message:(0,o.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_IPV4_MAPPED_IPV6_INVALID")}).refine(e=>!(0,s.aN)(e),{message:(0,o.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_MULTICAST_INVALID")})},403263(e,r,t){t.d(r,{q:()=>i});var n=t(241792),s=t(640708),o=t(260334);const i=n.Yj({message:(0,o.rn)("COMMON_VALIDATION_IPV6_SUBNET")}).refine(s.In,{message:(0,o.rn)("COMMON_VALIDATION_IPV6_SUBNET")})},995304(e,r,t){t.d(r,{i:()=>a});var n=t(241792),s=t(635187),o=t(260334),i=t(756275);const a=n.Yj().refine(e=>{const r=e.split(s.jr);return 2===r.length&&(0,i.w)(r[0])&&(0,i.w)(r[1])&&Number(r[0])<Number(r[1])},{message:(0,o.rn)("SETTINGS_COMMON_SINGLE_PORT_RANGE_VALIDATION_REQUIRED")})},756275(e,r,t){t.d(r,{L:()=>a,w:()=>i});var n=t(241792),s=t(260334);const o=/^\d+$/,i=e=>{if(!o.test(e)||e.startsWith("0"))return!1;const r=Number.parseInt(e,10);return!Number.isNaN(r)&&Number.isInteger(r)&&r>=1&&r<=65535},a=n.Yj().refine(e=>i(e),{message:(0,s.rn)("SETTINGS_COMMON_SINGLE_PORT_VALIDATION_REQUIRED")})},627625(e,r,t){t.d(r,{S:()=>s});var n=t(241792);function s(e,{message:r}){return n.Ie(r=>n.KC(e).safeParse(r).success,{message:r})}},871808(e,r,t){t.d(r,{A:()=>i});var n=t(602086),s=t(977872),o=t(167933);const i=e=>(0,s.d4)((0,n.useMemo)(()=>(0,o.jN)(e),[e]))}}]);