"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[83151],{306892(e,t,n){n.d(t,{A:()=>a});const a={MIN:1,MAX:65535}},175522(e,t,n){n.d(t,{A:()=>l,Q:()=>r});var a=n(416348);const l="_",r=[a.ZM,a.Je]},335928(e,t,n){n.d(t,{A:()=>r});var a=n(951272),l=n(465543);const r=()=>{const{dirty:e}=(0,a.j7)();return(0,l.w)(e),null}},465543(e,t,n){n.d(t,{w:()=>i});var a=n(296540),l=n(469733),r=n(845030);const i=e=>{const t=(0,l.useDispatch)();(0,a.useEffect)(()=>{t((0,r.SQ)(e))},[t,e])}},263130(e,t,n){n.d(t,{A:()=>m});var a=n(822336),l=n(296540),r=n(217439),i=n(71479),o=n(382389),s=n(566723),d=n(294303);const c=(0,i.A)(r.A)`
  line-height: 20px;
`,m=({icon:e,description:t,action:n,footer:r,background:i,...m})=>{const{themeName:_}=(0,o.u)();return l.createElement(d.A,{flexGrow:1,borderRadius:s.YC,padding:s.kc,background:i||a.Ay[`desktop-color-neutral-01-${_}`],gap:s.kc,flexDirection:"column",...m},l.createElement(d.A,{flexGrow:1,gap:s.kc},e,t?l.createElement(c,{size:"medium"},t):null,n?l.createElement(d.A,{marginLeft:"auto"},l.createElement(c,{size:"medium"},n)):null),r)}},823084(e,t,n){n.d(t,{A:()=>s});var a=n(822336),l=n(296540),r=n(162420),i=n(382389),o=n(263130);const s=({children:e,icon:t,background:n,...s})=>{const{themeName:d}=(0,i.u)();return l.createElement(o.A,{icon:t||l.createElement(r.A,{variant:"fill",size:"original",color:a.Ay[`desktop-color-ublue-06-${d}`]}),description:e,background:n,...s})}},689965(e,t,n){n.d(t,{A:()=>E,I:()=>a});var a,l=n(296540),r=n(822336),i=n(963724),o=n(71479),s=n(825032),d=n(566723),c=n(294303),m=n(311785);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(a||(a={}));const _=(0,o.A)(c.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||r.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  padding: ${({theme:e,isButtonList:t,padding:n})=>n||(t?`0 ${e.spacing["spacing-l"]}`:e.spacing["spacing-l"])};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({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}})=>r.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,A=(0,o.A)(i.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||r.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  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,theme:{themeName:t}})=>e||r.Ay[t===s.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${d.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${d.Ln} ${d.Ln};
      }
    }
  }
`,E=({type:e,marginBottom:t,margin:n,padding:r,flex:i,width:o,nested:s,...d})=>"items"in d?l.createElement(A,{marginBottom:t,margin:n,padding:r,flex:i,nested:s,...d}):l.createElement(_,{nested:s,width:o,marginBottom:t,margin:n,padding:r,flex:i,isButtonList:e===a.BUTTON_LIST,...d},d.children)},391855(e,t,n){n.d(t,{A:()=>c});var a=n(296540),l=n(271856),r=n(858931),i=n(823858),o=n(71479),s=n(916537);const d=(0,o.A)(i.A)`
  color: #ffffff;
`,c=(0,a.memo)(({isDisabled:e,showLoader:t,showWarning:n,showWarningIcon:i,warning:o,label:c="COMMON_ACTION_APPLY_CHANGES",onSubmit:m,form:_})=>a.createElement(l.A,{description:n?o??a.createElement(s.sA,{id:"COMMON_FORM_CHANGES_TRIGGER_PROVISION"}):null,portal:!0,width:240},a.createElement(r.A,{disabled:e,type:"submit",onClick:m,variant:"primary",Icon:n||i?a.createElement(d,{variant:"fill"}):null,loader:t?"loading":void 0,form:_},a.createElement(s.sA,{id:c}))))},821580(e,t,n){n.d(t,{A:()=>o});var a=n(296540),l=n(454195),r=n(566723),i=n(294303);const o=e=>a.createElement(i.A,{paddingTop:r.YC,paddingBottom:r.YC,gap:r.Ln,rowGap:r.YC,flexWrap:"wrap",minHeight:l.b,alignItems:"center",...e})},372382(e,t,n){n.d(t,{A:()=>o});var a=n(296540),l=n(951272),r=n(86838),i=n(79760);const o=({fieldName:e,validationMessageProps:t={}})=>{const{errors:n,touched:o,submitCount:s}=(0,l.j7)(),d=(0,i.t$)(e,n,o,s);return d?a.createElement(r.A,{isInvalid:!0,style:{padding:0},...t,label:d}):null}},242366(e,t,n){n.d(t,{A:()=>i});var a=n(296540),l=n(566723),r=n(294303);const i=(0,a.forwardRef)((e,t)=>a.createElement(r.A,{ref:t,flexDirection:"column",gap:l.kc,width:"100%",...e}))},48925(e,t,n){n.d(t,{A:()=>p});var a=n(822336),l=n(296540),r=n(217439),i=n(71479),o=n(566723),s=n(968906),d=n(199582),c=n(311785),m=n(766624),_=n(294303),A=n(689965),E=n(242366);const u=(0,i.A)(A.A,(0,c.A)("isOutlined"))`
  border: ${({theme:{themeName:e},isOutlined:t})=>`1px solid ${t?a.Ay[`desktop-color-ublue-06-${e}`]:"transparent"}`};
`,p=({children:e,title:t,tooltip:n,tooltipProps:a,[d.L]:i,titleAction:c,isOutlined:A})=>{const p=(e=>l.Children.toArray(e).length>0)(e);return l.createElement(u,{marginBottom:"none",...s.A.addDataTestId(i??""),isOutlined:A},l.createElement(_.A,{flexDirection:"column",...p&&{gap:o.Ln},width:"100%"},t?l.createElement(_.A,{alignItems:"center",gap:o.YC,justifyContent:"space-between",width:"100%"},l.createElement(_.A,{gap:o.YC,alignItems:"center"},l.createElement(r.A,{variant:"heading-medium"},t),n?l.createElement(m.A,{description:n,portal:!0,...a}):null),c?l.createElement(_.A,null,c):null):null,p?l.createElement(E.A,null,e):null))}},329109(e,t,n){n.d(t,{A:()=>c});var a=n(296540),l=n(691441),r=n(71479),i=n(132196),o=n(373229);const s=(0,r.A)("div")`
  height: 66px;
`,d=i.AH`
  padding: 0px !important;
`,c=({isDirty:e,onFormSubmit:t,onFormCancel:n,isInvalid:r,...i})=>e?a.createElement(l.A,null,a.createElement(o.A,{isDirty:e,onFormCancel:n,onFormSubmit:t,isInvalid:r,className:d,...i})):a.createElement(s,null)},407406(e,t,n){n.r(t),n.d(t,{default:()=>Te});var a=n(469733),l=n(296540),r=n(951272),i=n(742920),o=n(38671),s=n(335928),d=n(398300),c=n(845030),m=n(675359),_=n(140614),A=n(602021),E=n(959341),u=n(689956),p=n(379040),b=n(566723),g=n(48925),h=n(391855),I=n(294303),f=n(916537),S=n(302167),N=n(823084),T=n(264184),v=n(329109),O=n(454195),C=n(766624),R=n(143811);const D=({disabled:e})=>l.createElement(I.A,{alignItems:"center",minHeight:O.b},l.createElement(I.A,{alignItems:"center",gap:b.YC},l.createElement(R.A,{type:"realCheckbox",name:"wireless_networks_enabled",disabled:e},l.createElement(f.sA,{id:"COMMON_WIRELESS_NETWORKS"})),l.createElement(C.A,{description:l.createElement(f.sA,{id:"SETTINGS_ADVANCED_RADIUS_PROFILE_FORM_LABEL_ENABLE_WIRELESS_NETWORKS_DESC"})}))),w=({disabled:e})=>l.createElement(I.A,{alignItems:"center",minHeight:O.b},l.createElement(I.A,{alignItems:"center",gap:b.YC},l.createElement(R.A,{type:"realCheckbox",name:"wired_networks_enabled",disabled:e},l.createElement(f.sA,{id:"COMMON_WIRED_NETWORKS"})),l.createElement(C.A,{description:l.createElement(f.sA,{id:"SETTINGS_ADVANCED_RADIUS_PROFILE_FORM_LABEL_ENABLE_WIRED_NETWORKS_DESC"})})));var x=n(217439),M=n(372382),k=n(588915),L=n(155791),y=n(258840);const F=({onUpload:e,id:t})=>l.createElement(I.A,{minHeight:O.b,alignItems:"center"},l.createElement(I.A,{height:b.Er},l.createElement(k.A,{id:t,name:t,variant:"inline",onChange:async({target:t})=>{const n=t.files?.[0];if(n)try{const t=await(0,y.Gu)(n);e({base64Content:btoa(t),filename:n.name})}catch(e){}},Icon:L.A},l.createElement(x.A,{size:"medium",color:"inherit"},l.createElement(f.sA,{id:"COMMON_UPLOAD"})))));var P=n(506327),V=n(758649),H=n(705145),G=n(747280),U=n(725508);const B=({files:e,onRemoveFile:t})=>l.createElement(I.A,{flexDirection:"column",width:"100%"},e.map((e,n)=>l.createElement(I.A,{key:`${e}-${n+1}`,minHeight:O.b,alignItems:"center",gap:b.YC,justifyContent:"space-between",width:"100%"},l.createElement(I.A,{gap:b.YC,alignItems:"center",flex:1,overflow:"hidden"},l.createElement(P.A,{status:"positive"}),l.createElement(U.A,{size:"original"}),l.createElement(H.A,{isTruncated:!0,variant:"body-primary"},e)),l.createElement(V.A,{variant:"inline",color:"danger",type:"button",onClick:()=>t(n)},l.createElement(G.A,{size:"original"}))))),$=({name:e,fieldName:t})=>{const{values:n,setFieldValue:a}=(0,r.j7)(),i=(0,r.O6)(n,t);return l.createElement(I.A,{width:"fit-content",flexDirection:"column"},i?l.createElement(B,{files:[i],onRemoveFile:()=>{a(e,void 0),a(t,void 0)}}):l.createElement(F,{id:e,onUpload:n=>{a(e,n.base64Content),a(t,n.filename)}}))};var W=n(573531);const z=({fieldName:e})=>{const{values:t,setFieldValue:n}=(0,r.j7)(),a=(0,r.O6)(t,e)||[];return l.createElement(I.A,{flexDirection:"column",width:"fit-content"},a.length?l.createElement(B,{files:a.map(e=>e.filename||W.L),onRemoveFile:t=>{n(e,a.filter((e,n)=>n!==t))}}):null,l.createElement(F,{key:a.length,id:`${e}-${a.length}`,onUpload:t=>n(e,[...a,{fileContent:t.base64Content,filename:t.filename}])}))},K=({disabled:e})=>{const{values:t,setValues:n,setFieldValue:a}=(0,r.j7)(),i=(0,l.useCallback)(e=>{e.target.checked?a("tls_enabled",!0):n({...t,tls_enabled:!1,x_client_crt_filename:"",x_client_crt:"",x_client_private_key_filename:"",x_client_private_key:"",x_client_private_key_password:"",x_ca_crts:[]})},[n,a,t]);return l.createElement(I.A,{flexDirection:"column",gap:b.kc,width:"100%"},l.createElement(I.A,{height:O.b,alignItems:"center"},l.createElement(R.A,{name:"tls_enabled",type:"realCheckbox",tooltipMessage:l.createElement(f.sA,{id:"SETTINGS_NETWORKS_FORM_FIELD_RADIUS_TLS_TOOLTIP"}),disabled:e,checked:t.tls_enabled,onChange:i},l.createElement(f.sA,{id:"SETTINGS_NETWORKS_FORM_FIELD_RADIUS_TLS"}))),t.tls_enabled?l.createElement(I.A,{flexDirection:"column",width:"100%",gap:b.kc},l.createElement(I.A,{flexDirection:"column"},l.createElement(I.A,{gap:b.kc,alignItems:"center",width:"100%"},l.createElement(x.A,null,l.createElement(f.sA,{id:"SETTINGS_NETWORKS_FORM_FIELD_RADIUS_CLIENT_CERTIFICATE"})),l.createElement($,{fieldName:"x_client_crt_filename",name:"x_client_crt"})),l.createElement(M.A,{fieldName:"x_client_crt_filename"})),l.createElement(I.A,{flexDirection:"column",gap:b.kc,alignItems:"flex-start"},l.createElement(I.A,{flexDirection:"column"},l.createElement(I.A,{gap:b.kc,alignItems:"center",width:"100%"},l.createElement(x.A,null,l.createElement(f.sA,{id:"COMMON_PRIVATE_KEY"})),l.createElement($,{fieldName:"x_client_private_key_filename",name:"x_client_private_key"})),l.createElement(M.A,{fieldName:"x_client_private_key_filename"})),l.createElement(R.A,{name:"x_client_private_key_password",type:"password",variant:"secondary",passwordToggle:!0,full:!0,label:l.createElement(f.sA,{id:"SETTINGS_NETWORKS_FORM_FIELD_RADIUS_PRIVATE_KEY_PASSWORD"}),disabled:e})),l.createElement(I.A,{flexDirection:"column"},l.createElement(I.A,{gap:b.kc,alignItems:"flex-start",width:"100%"},l.createElement(I.A,{alignItems:"center",height:O.b},l.createElement(x.A,null,l.createElement(f.sA,{id:"SETTINGS_NETWORKS_FORM_FIELD_RADIUS_CA_CERTIFICATE"}))),l.createElement(z,{fieldName:"x_ca_crts"})),l.createElement(M.A,{fieldName:"x_ca_crts"}))):null)};var Y=n(438628),j=n(132196),q=n(870443),X=n(901371),Q=n(369596),J=n(586371),Z=n(546391),ee=n(306892),te=n(667368);const ne=q.A.object().shape({ip:q.A.string().label("COMMON_IP_ADDRESS").required().matches(Z.zF,{message:l.createElement(f.sA,{id:"COMMON_VALIDATION_VALID_IPV4"})}),port:q.A.number().label("COMMON_PORT").min(ee.A.MIN).max(ee.A.MAX),x_secret:q.A.string().label("COMMON_SHARED_SECRET").required()}),ae=q.A.object().shape({name:q.A.string().label("COMMON_NAME").max(64,l.createElement(f.sA,{id:"SETTINGS_COMMON_FIELD_SHOULD_NOT_EXCEED_MAX_LENGTH",values:{name:l.createElement(f.sA,{id:"COMMON_NAME"}),limit:64}})).required(),auth_servers:q.A.array().of(ne).min(1,l.createElement(f.sA,{id:"SETTINGS_ADVANCED_RADIUS_PROFILE_AUTH_SERVER_ERROR"})),accounting_enabled:q.A.boolean(),interim_update_enabled:q.A.boolean(),interim_update_interval:q.A.number().when("interim_update_enabled",{is:!0,then:q.A.number().label("COMMON_INTERIM_UPDATE_INTERVAL").required().min(te.fR).max(te.l9)}),acct_servers:q.A.array().when("accounting_enabled",{is:!0,then:q.A.array().of(ne).min(1,l.createElement(f.sA,{id:"SETTINGS_ADVANCED_RADIUS_PROFILE_ACCT_SERVER_ERROR"}))}),tls_enabled:q.A.boolean(),x_client_crt_filename:q.A.string().when("tls_enabled",{is:!0,then:q.A.string().label("SETTINGS_NETWORKS_FORM_FIELD_RADIUS_CLIENT_CERTIFICATE").required()}),x_client_private_key_filename:q.A.string().when("tls_enabled",{is:!0,then:q.A.string().label("COMMON_PRIVATE_KEY").required()}),x_ca_crts:q.A.array().when("tls_enabled",{is:!0,then:q.A.array().of(q.A.object().shape({filename:q.A.string(),fileContent:q.A.string()})).min(1,l.createElement(f.sA,{id:"COMMON_VALIDATION_EMPTY",values:{name:l.createElement(f.sA,{id:"SETTINGS_NETWORKS_FORM_FIELD_RADIUS_CA_CERTIFICATE"})}}))})}),le=j.AH`
  color: unset !important;
`,re=j.AH`
  color: currentColor !important;
`,ie="id",oe="servers",se="ip",de="port",ce="x_secret",me={[se]:"COMMON_IP_ADDRESS",[de]:"COMMON_PORT",[ce]:"COMMON_SHARED_SECRET"},_e=[{id:se,label:l.createElement(f.sA,{id:me[se]}),renderCell:({ip:e})=>e,sortable:!1,minWidth:112},{id:de,label:l.createElement(f.sA,{id:me[de]}),renderCell:({port:e})=>e,sortable:!1,minWidth:48},{id:ce,label:l.createElement(f.sA,{id:me[ce]}),renderCell:e=>l.createElement(Y.A,{name:"empty-password",type:"password",value:e[ce],disabled:!0,passwordToggle:!0,iconClassName:re,inputClassName:le}),sortable:!1,minWidth:147},{id:ie,label:"",renderCell:()=>null,sortable:!1,minWidth:20}],Ae=q.A.object().shape({[J.Vf]:q.A.boolean(),[se]:q.A.string().when(J.Vf,{is:!1,then:q.A.string().label(me[se]).required().matches(Z.zF,{message:l.createElement(f.sA,{id:"COMMON_VALIDATION_VALID_IPV4"})})}),[de]:q.A.number().when(J.Vf,{is:!1,then:q.A.number().label(me[de]).min(X.DV).max(X.JX)}),[ce]:q.A.string().when(J.Vf,{is:!1,then:q.A.string().label(me[ce]).required()}),[oe]:q.A.array().of(q.A.object().shape({[se]:q.A.string().when(J.Vf,{is:!0,then:q.A.string().label(me[se]).required().matches(Z.zF,{message:l.createElement(f.sA,{id:"COMMON_VALIDATION_VALID_IPV4"})})}),[de]:q.A.number().when(J.Vf,{is:!0,then:q.A.number().label(me[de]).min(X.DV).max(X.JX)}),[ce]:q.A.string().when(J.Vf,{is:!0,then:q.A.string().label(me[oe]).required()})}))}),Ee=[{name:se,label:me[se],type:"text",validated:!0,autoComplete:"disabled",containerFlexProps:{minWidth:140,maxWidth:240}},{name:de,label:me[de],type:"text",validated:!0,containerFlexProps:{minWidth:88,maxWidth:88}},{name:ce,label:me[ce],type:"password",passwordToggle:!0,validated:!0,autoComplete:"disabled",containerFlexProps:{width:"100%"},wrap:!0}],ue=({disabled:e,parentFieldName:t,defaultPort:n})=>{const{setFieldValue:a,values:i}=(0,r.j7)(),o=i[t],s=(0,l.useMemo)(()=>({[J.Vf]:!1,[se]:"",[de]:n,[ce]:"",[oe]:[...o.map((e,t)=>({...e,[ie]:String(t)}))]}),[o,n]);return l.createElement(l.Fragment,null,l.createElement(Q.A,{idField:"id",editable:!e,fieldName:oe,columns:_e,fieldLabels:me,initialValues:s,newFields:Ee,validationSchema:Ae,onAddItem:e=>{a(t,[...o,{[ie]:String(o.length),[se]:e[se],[de]:e[de],[ce]:e[ce]}])},onRemoveItem:({[ie]:e})=>{a(t,o.filter((t,n)=>String(n)!==e))},onEditSubmit:e=>{a(t,e.map(e=>({[ie]:e[ie],[se]:e[se],[de]:e[de],[ce]:e[ce]})))},max:4,editFieldWrap:!0,renderHoverContent:(e,t)=>l.createElement(I.A,{alignItems:"center",marginRight:b.YC},l.createElement(V.A,{name:`remove-${oe}-${e.id}`,variant:"inline",color:"danger",type:"button",onClick:t},l.createElement(G.A,{size:"original"})))}),l.createElement(M.A,{fieldName:t}))},pe=({disabled:e})=>l.createElement(R.A,{full:!0,maxLength:64,name:"name",variant:"secondary",disabled:e,label:l.createElement(f.sA,{id:"COMMON_NAME"})}),be=({disabled:e})=>{const{values:t}=(0,r.j7)();return l.createElement(I.A,{alignItems:"center",minHeight:O.b,gap:b.kc},l.createElement(R.A,{type:"realCheckbox",name:"interim_update_enabled",disabled:e},l.createElement(f.sA,{id:"COMMON_INTERIM_UPDATE_INTERVAL"})),t.interim_update_enabled?l.createElement(I.A,{width:164},l.createElement(R.A,{type:"number",name:"interim_update_interval",variant:"secondary",contentAfter:l.createElement(f.sA,{id:"COMMON_UNIT_SECONDS"}),disabled:e})):null)};var ge=n(821580),he=n(504779);const Ie=({disabled:e,disabledTooltip:t})=>l.createElement(ge.A,null,l.createElement(he.A,{reason:t},l.createElement(R.A,{name:"accounting_enabled",type:"realCheckbox",disabled:e},l.createElement(f.sA,{id:"SETTINGS_ADVANCED_RADIUS_TABLE_LABEL_ACCT_SERVERS"}))));var fe=n(60320);const Se="customRadiusProfileSidePanelForm",Ne=({existingRecord:e,disabled:t})=>{const{values:n,resetForm:i,handleSubmit:o,dirty:s,isSubmitting:d,submitForm:c,isValid:m}=(0,r.j7)(),_=(0,a.useSelector)(A.EL),E=(0,a.useSelector)(S.QC),u=(0,a.useSelector)(S.fX),p=!!e&&(0,T.B_)(e?._id,u),O=(0,l.useMemo)(()=>(0,fe.zr)(E),[E]),C=!!e&&!e.canDisableAccounting;return l.createElement("form",{onSubmit:o,style:{height:"100%"},id:Se},l.createElement(I.A,{flexDirection:"column",gap:b.xO,width:"100%",overflow:"hidden"},l.createElement(g.A,null,l.createElement(pe,{disabled:t})),l.createElement(g.A,{title:l.createElement(f.sA,{id:"SETTINGS_ADVANCED_RADIUS_PROFILE_FORM_TITLE_RADIUS_VLAN"})},l.createElement(w,{disabled:_}),l.createElement(D,{disabled:_})),l.createElement(g.A,null,l.createElement(K,{disabled:_})),l.createElement(g.A,null,l.createElement(ue,{disabled:_,parentFieldName:"auth_servers",defaultPort:O.auth_port}),p&&e&&(0,T.RC)({...e,auth_servers:n.auth_servers})?l.createElement(N.A,null,l.createElement(f.sA,{id:"SETTINGS_ADVANCED_RADIUS_PROFILE_HOTSPOT_SECRET_TOO_LONG"})):null,l.createElement(Ie,{disabled:_||C,disabledTooltip:C?l.createElement(f.sA,{id:"SETTINGS_ADVANCED_RADIUS_TABLE_LABEL_ACCT_SERVERS_DISABLED_WHEN_DAS_ENABLED_TOOLTIP",values:{name:e?.wifiNetworkName}}):void 0}),n.accounting_enabled?l.createElement(ue,{disabled:_,parentFieldName:"acct_servers",defaultPort:O.acct_port}):null,l.createElement(be,{disabled:_}))),l.createElement(v.A,{onFormCancel:i,allowCancel:s,applyButton:l.createElement(h.A,{isDisabled:_,showLoader:d,label:e?"COMMON_ACTION_APPLY_CHANGES":"COMMON_ACTION_ADD",form:Se,onSubmit:c}),isDirty:s,isSubmitting:d,isInvalid:!m}))},Te=({activeItem:e})=>{const t=e?._id===E.R6?void 0:e,n=(0,a.useDispatch)(),b=(0,a.useSelector)(A.EL),g=(0,l.useMemo)(()=>(e=>({...p.oP,...e,wireless_networks_enabled:e?.vlan_wlan_mode===u.z.ENABLED,wired_networks_enabled:e?.vlan_enabled||!1,acct_servers:e?.acct_servers.map((e,t)=>({...e,id:String(t)}))||[],auth_servers:e?.auth_servers.map((e,t)=>({...e,id:String(t)}))||[],x_ca_crts:e?.x_ca_crts?.map(e=>({filename:e.filename||"",fileContent:e.x_ca_crt}))||[]}))(t),[t]),h=(0,l.useCallback)((e,{setSubmitting:t})=>(t(!0),n((0,_.createOrUpdateCustomRadiusProfile)((e=>{const{wired_networks_enabled:t,wireless_networks_enabled:n,...a}=e;return{...a,vlan_wlan_mode:e.wireless_networks_enabled?u.z.ENABLED:u.z.DISABLED,vlan_enabled:e.wired_networks_enabled,auth_servers:e.auth_servers.map(({id:e,...t})=>({...t})),acct_servers:e.acct_servers.map(({id:e,...t})=>({...t})),x_ca_crts:e.x_ca_crts?.map(({filename:e,fileContent:t})=>({filename:e,x_ca_crt:t}))}})(e))).then(async e=>(await n((0,_.fetchRadiusProfiles)()),e)).then(e=>{n((0,c.SQ)(!1)),n((0,c.XP)({type:d.H.CUSTOM_RADIUS_PROFILE,id:e._id}))}).catch(e=>{const t=(0,o.F)(e)?e:void 0;n((0,m.ox)({icon:i.C.danger,message:"SETTINGS_UNABLE_TO_APPLY_CHANGES",errorMessage:t?.msg}))}).finally(()=>t(!1))),[n]);return(0,l.useEffect)(()=>{t?._id&&t._id!==E.R6&&n((0,_.fetchRadiusProfiles)())},[n,t?._id]),l.createElement(r.l1,{initialValues:g,onSubmit:h,enableReinitialize:!0,validationSchema:ae},l.createElement(l.Fragment,null,l.createElement(s.A,null),l.createElement(Ne,{existingRecord:t,disabled:b})))}},667368(e,t,n){n.d(t,{KW:()=>m,XE:()=>A,fR:()=>d,l9:()=>c,sD:()=>E,ww:()=>_});var a=n(296540),l=n(870443),r=n(306892),i=n(546391),o=n(916537),s=n(379040);const d=60,c=86400,m=3600,_=1812,A=1813,E=l.A.object().shape({x_secret:l.A.string().label("COMMON_SHARED_SECRET").min(1).max(s.IF).matches(i.Aq,{message:a.createElement(o.sA,{id:"SETTINGS_RADIUS_SHARED_SECRET_VALIDATION"})}).required(),auth_port:l.A.number().label("SETTINGS_ADVANCED_RADIUS_SERVER_FORM_LABEL_AUTHENTICATION_PORT").min(r.A.MIN).max(r.A.MAX).required(),acct_port:l.A.number().label("SETTINGS_ADVANCED_RADIUS_SERVER_FORM_LABEL_ACCOUNTING_PORT").min(r.A.MIN).max(r.A.MAX).required(),interim_update_interval:l.A.number().label("COMMON_INTERIM_UPDATE_INTERVAL").required().min(d).max(c),tunneled_reply:l.A.boolean()})},60320(e,t,n){n.d(t,{Ct:()=>m,F8:()=>s,Wo:()=>o,dE:()=>i,fr:()=>c,zr:()=>d});var a=n(261218),l=n(689956),r=n(667368);const i=(e,t)=>({_id:e._id,name:e.name,enabled:t.enabled,configure_whole_network:t.configure_whole_network,attr_hidden_id:e.attr_hidden_id,attr_no_delete:e.attr_no_delete,attr_no_edit:e.attr_no_edit,x_secret:t.x_secret,auth_port:t.auth_port??r.ww,acct_port:t.acct_port??r.XE,tunneled_reply:t.tunneled_reply??!0,interim_update_interval:t.interim_update_interval??r.KW,wireless_networks_enabled:e.vlan_wlan_mode===l.z.ENABLED,wired_networks_enabled:e.vlan_enabled||!1}),o=e=>{const{wired_networks_enabled:t,wireless_networks_enabled:n,...a}=e;return{...a,vlan_wlan_mode:e.wireless_networks_enabled?l.z.ENABLED:l.z.DISABLED,vlan_enabled:e.wired_networks_enabled}},s=e=>({key:a.FP.RADIUS,enabled:e.enabled,configure_whole_network:e.configure_whole_network,x_secret:e.x_secret,auth_port:e.auth_port,acct_port:e.acct_port,tunneled_reply:e.tunneled_reply,interim_update_interval:e.interim_update_interval}),d=e=>({acct_port:e.acct_port||r.XE,auth_port:e.auth_port||r.ww}),c=(e,t)=>e.wired_networks_enabled!==t.wired_networks_enabled||e.wireless_networks_enabled!==t.wireless_networks_enabled,m=(e,t)=>e.enabled!==t.enabled||e.configure_whole_network!==t.configure_whole_network||e.x_secret!==t.x_secret||e.auth_port!==t.auth_port||e.acct_port!==t.acct_port||e.tunneled_reply!==t.tunneled_reply||e.interim_update_interval!==t.interim_update_interval},280258(e,t,n){n.d(t,{H:()=>a});const a=""},596441(e,t,n){n.d(t,{I:()=>a});const a={HEADER_HEIGHT:32,ROW_HEIGHT:32,EDIT_FIELD_HEIGHT:36,getHeight(e,t,n,a){return Math.min((a||this.ROW_HEIGHT)*e+(n??this.HEADER_HEIGHT),(a||this.ROW_HEIGHT)*t+(n??this.HEADER_HEIGHT))},getEditContainerHeight(e,t,n){return Math.min((n||this.EDIT_FIELD_HEIGHT)*e,(n||this.EDIT_FIELD_HEIGHT)*t)}}},504779(e,t,n){n.d(t,{A:()=>d});var a=n(296540),l=n(271856),r=n(132196),i=n(284428),o=n(641777);const s=r.AH`
  width: fit-content;
`,d=({reasons:e,reason:t,children:n,isInteractive:r,noWrap:d,position:c,fitContent:m})=>{const _=(0,i.pv)(),A=[t,...e||[]].filter(Boolean)[0]||null,E=!!A;return a.createElement(o.A,{isDisabled:{fields:E,labels:E,tooltipIcons:E,tooltipPopovers:!_.fields&&E}},a.createElement(l.A,{description:_.fields?null:A,portal:!0,isInteractive:r,noWrap:d,position:c,className:m?s:void 0},n))}},641777(e,t,n){n.d(t,{A:()=>i});var a=n(296540),l=n(284428),r=n(451449);const i=({isDisabled:e,isAdditive:t=!0,children:n})=>{const i=(0,l.pv)(),o=(0,a.useMemo)(()=>"boolean"==typeof e?{fields:e,labels:e,tooltipIcons:e,tooltipPopovers:!1}:e,[e]),s=(0,a.useMemo)(()=>({fields:t?o.fields||i.fields:o.fields,labels:t?o.labels||i.labels:o.labels,tooltipIcons:t?o.tooltipIcons||i.tooltipIcons:o.tooltipIcons,tooltipPopovers:t?o.tooltipPopovers||i.tooltipPopovers:o.tooltipPopovers}),[t,o.fields,o.labels,o.tooltipIcons,o.tooltipPopovers,i.fields,i.labels,i.tooltipIcons,i.tooltipPopovers]);return a.createElement(r.I.Provider,{value:s},n)}},362412(e,t,n){n.d(t,{A:()=>m});var a=n(296540),l=n(469733),r=n(436331),i=n(805837),o=n(282556),s=n(71265);const d=e=>a.createElement(r.A,{renderOption:i.q,...e}),c=e=>a.createElement(d,{...e});c.Sorted=e=>{const t=(0,l.useSelector)(o.zi),n=(0,a.useMemo)(()=>(0,s.k)(t),[t]);return a.createElement(d,{...e,sortBy:n})};const m=c},71265(e,t,n){n.d(t,{R:()=>m,k:()=>_});var a=n(280258),l=n(190497),r=n(953048),i=n(175522),o=n(936621),s=n(742525);const d=[...new Set([a.H,i.Q.join(i.A),r.Zt,o.F,l.nc,s.Vr])],c={numeric:!0,sensitivity:"base"},m=(e,t)=>{const n=[];for(let a=e;a<=t;a+=1)n.push({value:a,label:String(a)});return n},_=e=>({value:t,label:n},{value:a,label:l})=>d.includes(t?.toString())||d.includes(a?.toString())?1/0:n?.toString().localeCompare(l?.toString(),e,c)??-1}}]);