"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[74445],{494824(e,t,n){n.d(t,{A:()=>o});var a=n(602086),r=n(716155);const o=(0,n(302405).w)(e=>(0,a.createElement)("svg",(0,r.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,a.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3a1 1 0 0 1 1-1h7a1 1 0 0 1 .707.293l3 3A1 1 0 0 1 16 6v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V3Z",fill:"currentColor",className:e.twotonedclassname}),(0,a.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V6a1 1 0 0 0-.293-.707l-3-3A1 1 0 0 0 12 2H5Zm0 15V3h6.999v2a1 1 0 0 0 1 1h2L15 17H5Z",fill:"currentColor",className:e.baseclassname}),(0,a.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.999 2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V6a1 1 0 0 0-.293-.707l-3-3A1 1 0 0 0 12 2H5Zm10 4.5h-2.5a1 1 0 0 1-1-1V3L15 6.5Z",fill:"currentColor",className:e.fillclassname})))},559388(e,t,n){n.d(t,{A:()=>o});var a=n(602086),r=n(716155);const o=(0,n(302405).w)(e=>(0,a.createElement)("svg",(0,r.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,a.createElement)("rect",{x:5,y:5,width:10,height:12,rx:1,fill:"currentColor",className:e.twotonedclassname}),(0,a.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.5 5V4a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1h3a.5.5 0 0 1 0 1h-13a.5.5 0 0 1 0-1h3Zm6 0V4h-5v1h5Z",fill:"currentColor",className:e.baseclassname}),(0,a.createElement)("path",{d:"M14 17H6a1 1 0 0 1-1-1V7.5a.5.5 0 0 1 1 0V16h8V7.5a.5.5 0 0 1 1 0V16a1 1 0 0 1-1 1Z",fill:"currentColor",className:e.baseclassname}),(0,a.createElement)("path",{d:"M8 13.5a.5.5 0 0 0 1 0v-4a.5.5 0 0 0-1 0v4Zm3.5.5a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 1 0v4a.5.5 0 0 1-.5.5Z",fill:"currentColor",className:e.baseclassname}),(0,a.createElement)("path",{d:"M16.854 5.854A.502.502 0 0 0 16.5 5h-3V4a1 1 0 0 0-1-1h-5a1 1 0 0 0-1 1v1h-3a.502.502 0 0 0-.5.5.5.5 0 0 0 .5.5h13a.502.502 0 0 0 .354-.146Z",fill:"currentColor",className:e.fillclassname}),(0,a.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 7h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1Zm2.5 7a.5.5 0 0 0 .5-.5v-4a.502.502 0 0 0-.5-.5.5.5 0 0 0-.5.5v4a.5.5 0 0 0 .5.5Zm3 0a.5.5 0 0 0 .5-.5v-4a.502.502 0 0 0-.5-.5.5.5 0 0 0-.5.5v4a.5.5 0 0 0 .5.5Z",fill:"currentColor",className:e.fillclassname})))},287654(e,t,n){n.d(t,{A:()=>a});const a=(0,n(602086).createContext)({isStandalone:!0,header:[null,()=>{}],footer:[null,()=>{}]})},388294(e,t,n){n.d(t,{A:()=>o});var a=n(602086),r=n(287654);function o(e){const{children:t}=e,{isStandalone:n,footer:[,o]}=(0,a.useContext)(r.A);return(0,a.useLayoutEffect)(()=>{if(!n)return o(t),()=>o(null)},[n,t]),a.createElement(a.Fragment,null,n&&t)}},392452(e,t,n){n.d(t,{A:()=>s,R:()=>s});var a=n(602086),r=n(862388),o=n(605769);const i=(0,n(310749).c)(o.A),s=a.forwardRef(function(e,t){const{accept:n,multiple:o=!1,id:s="file-upload",name:l="file-upload",className:c="",inputClassName:d="",onChange:m=r.A,children:u,...A}=e,p=(0,a.useRef)(null),_=t||p;return a.createElement("label",{className:c,tabIndex:0,onKeyDown:e=>{var t;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),null===(t=_.current)||void 0===t||t.click())}},a.createElement("input",{type:"file",id:s,name:l,accept:n,multiple:o,ref:_,onChange:e=>m(e,_),className:i.concat(d)("input"),...A}),u)})},605769(e,t,n){n.d(t,{A:()=>r});var a=n(802548),r={input:"input__kxWRaesR",uploadButton:"uploadButton__kxWRaesR"};(0,a.A)(".input__kxWRaesR{display:none}.uploadButton__kxWRaesR{-webkit-appearance:none;-moz-appearance:none;appearance:none}")},108940(e,t,n){n.d(t,{A:()=>d});var a=n(602086),r=n(392452),o=n(605769),i=n(310749),s=n(526744),l=n(490138);const c=(0,i.c)(o.A),d=(0,l.A)(({id:e="file",name:t="file",accept:n,multiple:o=!1,motif:i="light",disabled:l,children:d,onChange:m,className:u,buttonClassName:A,forwardedRef:p,..._})=>a.createElement(r.R,{id:e,name:t,accept:n,multiple:o,onChange:m,className:u,disabled:l},a.createElement(s.A,{component:"span",className:c.concat(A)("uploadButton"),motif:i,ref:p,disabled:l,..._},d)))},612389(e,t,n){n.d(t,{A:()=>m});var a=n(274934),r=n(505817),o=n(179102),i=n(247816),s=n(263705),l=n(309130),c=n(100978);const d=(0,i.A)(o.A)`
  line-height: 20px;
`,m=({icon:e,description:t,action:n,footer:o,background:i,...m})=>{const{themeName:u}=(0,s.u)();return(0,a.jsxs)(c.A,{flexGrow:1,borderRadius:l.YC,padding:l.kc,background:i||r.Ay[`desktop-color-neutral-01-${u}`],gap:l.kc,flexDirection:"column",...m,children:[(0,a.jsxs)(c.A,{flexGrow:1,gap:l.kc,children:[e,t?(0,a.jsx)(d,{size:"medium",children:t}):null,n?(0,a.jsx)(c.A,{marginLeft:"auto",children:(0,a.jsx)(d,{size:"medium",children:n})}):null]}),o]})}},753959(e,t,n){n.d(t,{A:()=>l});var a=n(274934),r=n(505817),o=n(247368),i=n(263705),s=n(612389);const l=({children:e,icon:t,background:n,...l})=>{const{themeName:c}=(0,i.u)();return(0,a.jsx)(s.A,{icon:t||(0,a.jsx)(o.A,{variant:"fill",size:"original",color:r.Ay[`desktop-color-ublue-06-${c}`]}),description:e,background:n,...l})}},535322(e,t,n){n.d(t,{A:()=>p,I:()=>a});var a,r=n(274934),o=n(505817),i=n(753583),s=n(247816),l=n(565527),c=n(309130),d=n(100978),m=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(a||(a={}));const u=(0,s.A)(d.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||o.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.LIGHT}`]};
  ${({nested:e,theme:{themeName:t}})=>e?`border: ${o.Ay[`desktop-border-divider-${t}`]};`:""}
  padding: ${({isButtonList:e,padding:t})=>t||(e?`0 ${c.Ln}`:c.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||c.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}})=>o.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,A=(0,s.A)(i.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||o.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.LIGHT}`]};
  ${({nested:e,theme:{themeName:t}})=>e?`border: ${o.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||o.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${c.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${c.Ln} ${c.Ln};
      }
    }
  }
`,p=({type:e,marginBottom:t,margin:n,padding:o,flex:i,width:s,nested:l,...c})=>"items"in c?(0,r.jsx)(A,{marginBottom:t,margin:n,padding:o,flex:i,nested:l,...c}):(0,r.jsx)(u,{nested:l,width:s,marginBottom:t,margin:n,padding:o,flex:i,isButtonList:e===a.BUTTON_LIST,...c,children:c.children})},89469(e,t,n){n.d(t,{A:()=>s});var a=n(274934),r=n(602086),o=n(309130),i=n(100978);const s=(0,r.forwardRef)((e,t)=>(0,a.jsx)(i.A,{ref:t,flexDirection:"column",gap:o.kc,width:"100%",...e}))},756782(e,t,n){n.d(t,{A:()=>E});var a=n(274934),r=n(505817),o=n(602086),i=n(179102),s=n(247816),l=n(309130),c=n(590979),d=n(147045),m=n(291508),u=n(304151),A=n(100978),p=n(535322),_=n(89469);const f=(0,s.A)(p.A,(0,m.A)("isOutlined"))`
  border: ${({theme:{themeName:e},isOutlined:t})=>`1px solid ${t?r.Ay[`desktop-color-ublue-06-${e}`]:"transparent"}`};
`,E=({children:e,title:t,tooltip:n,tooltipProps:r,[d.L]:s,titleAction:m,isOutlined:p})=>{const E=(e=>o.Children.toArray(e).length>0)(e);return(0,a.jsx)(f,{marginBottom:"none",...c.A.addDataTestId(s??""),isOutlined:p,children:(0,a.jsxs)(A.A,{flexDirection:"column",...E&&{gap:l.Ln},width:"100%",children:[t?(0,a.jsxs)(A.A,{alignItems:"center",gap:l.YC,justifyContent:"space-between",width:"100%",children:[(0,a.jsxs)(A.A,{gap:l.YC,alignItems:"center",children:[(0,a.jsx)(i.A,{variant:"heading-medium",children:t}),n?(0,a.jsx)(u.A,{description:n,portal:!0,...r}):null]}),m?(0,a.jsx)(A.A,{children:m}):null]}):null,E?(0,a.jsx)(_.A,{children:e}):null]})})}},115114(e,t,n){n.d(t,{A:()=>d});var a=n(274934),r=n(388294),o=n(247816),i=n(409844),s=n(751636);const l=(0,o.A)("div")`
  height: 66px;
`,c=i.AH`
  padding: 0px !important;
`,d=({isDirty:e,onFormSubmit:t,onFormCancel:n,isInvalid:o,...i})=>e?(0,a.jsx)(r.A,{children:(0,a.jsx)(s.A,{isDirty:e,onFormCancel:n,onFormSubmit:t,isInvalid:o,className:c,...i})}):(0,a.jsx)(l,{})},751636(e,t,n){n.d(t,{A:()=>d});var a=n(274934),r=n(526744),o=n(470070),i=n(247816),s=n(291508),l=n(309130);const c=(0,i.A)("footer",(0,s.A)("hasFormResetButton"))`
  display: flex;
  justify-content: ${({hasFormResetButton:e})=>e?"space-between":"flex-end"};
  padding: ${l.S2} ${l.fS};
  gap: ${l.kc};
`,d=({allowCancel:e,isDirty:t,isInvalid:n,isSubmitting:i,onFormSubmit:s,onFormReset:l,onFormCancel:d,className:m,submitButtonText:u,customButton:A,applyButton:p,hideCancelButton:_,form:f,testConfigFooter:E})=>(0,a.jsx)(c,{className:m,hasFormResetButton:!!l,children:E||(0,a.jsxs)(a.Fragment,{children:[A,_?null:(0,a.jsx)(r.A,{name:"cancel",variant:"default",type:"button",onClick:d,disabled:!e&&!t,children:(0,a.jsx)(o.sA,{id:"COMMON_ACTION_CANCEL"})}),l?(0,a.jsx)(r.A,{name:"reset",variant:"default",type:"button",onClick:l,disabled:!t,children:(0,a.jsx)(o.sA,{id:"COMMON_ACTION_RESET_TO_DEFAULT"})}):null,p||(0,a.jsx)(r.A,{name:"submit",variant:"primary",type:"submit",onClick:s,disabled:!t||n||i,form:f,children:(0,a.jsx)(o.sA,{id:u||"COMMON_ACTION_APPLY_CHANGES"})})]})})},174445(e,t,n){n.r(t),n.d(t,{default:()=>H});var a=n(274934),r=n(977872),o=n(159469),i=n(464920),s=n(121713),l=n(205521),c=n(700444),d=n(427017),m=n(115114),u=n(115378),A=n(241792),p=n(260334);const _=A.E$(A.Ik({name:A.Yj({message:(0,p.rn)("SETTINGS_SYSTEM_CTRL_CERTIFICATES_NAME_VALIDATION")}).min(1,{message:(0,p.rn)("SETTINGS_SYSTEM_CTRL_CERTIFICATES_NAME_VALIDATION")}).max(64,{message:(0,p.rn)("SETTINGS_COMMON_FIELD_SHOULD_NOT_EXCEED_MAX_LENGTH",{limit:64,name:(0,p.rn)("COMMON_NAME")})})}),A.KC([A.Ik({type:A.eu(u.M.SELF_SIGNED),commonName:A.Yj().min(1,{message:(0,p.rn)("SETTINGS_SYSTEM_CTRL_CERTIFICATES_COMMON_NAME_VALIDATION")}),alternativeName:A.Yj()}),A.Ik({type:A.eu(u.M.UPLOAD),certificate:A.Yj().min(1,{message:(0,p.rn)("SETTINGS_SYSTEM_CTRL_CERTIFICATES_UPLOAD_CERTIFICATE_VALIDATION")}),private_key:A.Yj().min(1,{message:(0,p.rn)("SETTINGS_SYSTEM_CTRL_CERTIFICATES_UPLOAD_PRIVATE_KEY_VALIDATION")}),certificateFileName:A.Yj().min(1),private_keyFileName:A.Yj().min(1)})]));var f=n(42220),E=n(684935),T=n(179102),h=n(409844),S=n(635891),g=n(309130),N=n(753959),I=n(756782),C=n(89469),x=n(793442),v=n(100978),b=n(470070),L=n(726831),M=n(505817),O=n(108940),R=n(526744),y=n(775250),j=n(399935),F=n(559388),D=n(494824),k=n(263705),$=n(296261),w=n(304151);const G=h.AH`
  padding: 0;
`,V=({form:e,name:t,fileNameField:n,label:r,tooltip:o,accept:i})=>{const{themeName:s}=(0,k.u)(),l=(0,p.L_)(),c=(0,f.FH)({control:e.control,name:n});return(0,a.jsx)(f.xI,{control:e.control,name:t,render:({field:d,fieldState:m})=>{const u=Boolean(d.value&&c);return(0,a.jsxs)(v.A,u?{flexDirection:"column",alignItems:"flex-start",children:[(0,a.jsxs)(v.A,{borderRadius:g.YC,padding:g.YC,gap:g.kc,width:"100%",background:M.Ay[`desktop-color-neutral-01-${s}`],minHeight:g.fS,alignItems:"center",children:[(0,a.jsx)(D.A,{size:"original",variant:"fill",color:M.Ay[`desktop-color-neutral-08-${s}`]}),(0,a.jsx)(y.A,{isTruncated:!0,style:{flex:1},color:"text-2",children:c}),(0,a.jsx)(f.xI,{control:e.control,name:n,render:({field:e})=>(0,a.jsx)(R.A,{variant:"inline",onClick:()=>{d.onChange(""),e.onChange("")},children:(0,a.jsx)(F.A,{size:"original",color:M.Ay[`desktop-color-neutral-08-${s}`]})})})]}),m.error?(0,a.jsx)(j.A,{isInvalid:!0,label:l(m.error.message)}):null]}:{flexDirection:"column",alignItems:"flex-start",children:[(0,a.jsxs)(v.A,{minHeight:g.fS,alignItems:"center",gap:g.kc,children:[(0,a.jsx)(f.xI,{control:e.control,name:n,render:({field:e})=>(0,a.jsx)(O.A,{name:t,variant:"link",accept:i,buttonClassName:h.AH`
                      ${G}
                    `,onChange:async({target:t})=>{const n=t.files?.[0];if(n)try{const t=await(0,$.Gu)(n);e.onChange(n.name),d.onChange(t)}catch{}else e.onChange(""),d.onChange("")},children:r})}),o?(0,a.jsx)(w.A,{description:o,portal:!0}):null]}),m.error?(0,a.jsx)(j.A,{isInvalid:!0,label:l(m.error.message)}):null]})}})},Y=[{id:u.M.SELF_SIGNED,label:(0,a.jsx)(b.sA,{id:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_SELF_SIGNED"})},{id:u.M.UPLOAD,label:(0,a.jsx)(b.sA,{id:"COMMON_UPLOAD"})}],B=({form:e,isContentFiltering:t})=>{const n=(0,f.FH)({control:e.control,name:"type"}),{formatMessage:r}=(0,b.tz)();return(0,a.jsx)(I.A,{children:(0,a.jsxs)(v.A,{flexDirection:"column",width:"100%",gap:g.Ln,children:[(0,a.jsx)(N.A,{children:(0,a.jsx)(b.sA,{id:n===u.M.SELF_SIGNED?t?"SETTINGS_SYSTEM_CTRL_CERTIFICATES_SELF_SIGNED_INFO_CONTENT_FILTERING":"SETTINGS_SYSTEM_CTRL_CERTIFICATES_SELF_SIGNED_INFO":t?"SETTINGS_SYSTEM_CTRL_CERTIFICATES_ADD_NEW_INFO_CONTENT_FILTERING":"SETTINGS_SYSTEM_CTRL_CERTIFICATES_ADD_NEW_INFO",values:{link:(0,a.jsx)(x.A,{id:"COMMON_LEARN_MORE",href:L.A.sslInspectionArticle,noWrap:!0})}})}),(0,a.jsx)(S.A,{control:e.control,name:"name",label:(0,a.jsx)(b.sA,{id:"COMMON_NAME"})}),(0,a.jsx)(f.xI,{control:e.control,name:"type",render:({field:e})=>(0,a.jsx)(E.A,{tabsClassName:h.AH`
                flex: 1;
              `,variant:"capsule",tabs:Y,selectedTab:e.value,onSelectTab:({id:t})=>e.onChange(t)})}),(0,a.jsxs)(C.A,n===u.M.SELF_SIGNED?{children:[(0,a.jsx)(S.A,{control:e.control,name:"commonName",label:(0,a.jsx)(b.sA,{id:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_COMMON_NAME"}),tooltip:(0,a.jsx)(b.sA,{id:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_COMMON_NAME_TOOLTIP"}),placeholder:r({id:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_COMMON_NAME_PLACEHOLDER"})}),(0,a.jsx)(S.A,{control:e.control,name:"alternativeName",label:(0,a.jsx)(b.sA,{id:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_ALTERNATIVE_NAME"}),tooltip:(0,a.jsx)(b.sA,{id:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_ALTERNATIVE_NAME_TOOLTIP"})}),(0,a.jsx)(T.A,{size:"small",color:"text-3",children:(0,a.jsx)(b.sA,{id:"SETTINGS_SYSTEM_CTRL_CERTIFICATE_EXPIRES_AT"})})]}:{alignItems:"flex-start",children:[(0,a.jsx)(V,{form:e,name:"certificate",fileNameField:"certificateFileName",label:(0,a.jsx)(b.sA,{id:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_UPLOAD"}),tooltip:(0,a.jsx)(b.sA,{id:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_UPLOAD_TOOLTIP"}),accept:".crt,.cer,.ca-bundle,.p7b,.p7c,.p7s,.pem"}),(0,a.jsx)(V,{form:e,name:"private_key",fileNameField:"private_keyFileName",label:(0,a.jsx)(b.sA,{id:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_UPLOAD_PRIVATE_KEY"}),tooltip:(0,a.jsx)(b.sA,{id:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_UPLOAD_PRIVATE_KEY_TOOLTIP"}),accept:".pfx,p12"})]})]})})},P={type:u.M.SELF_SIGNED,name:"",commonName:"",alternativeName:"",certificate:"",private_key:"",certificateFileName:"",private_keyFileName:""},H=({activeItem:e})=>{const t=(0,r.wA)(),n=(0,s.m)({schema:_,defaultValues:P}),A=n.handleSubmit(async e=>{try{await(async e=>{const n=e.type===u.M.SELF_SIGNED?(0,d.pY)({name:e.name,common_name:e.commonName||"",alternative_name:e.alternativeName||""}):(0,d.GX)({name:e.name,certificate:btoa(e.certificate||""),private_key:btoa(e.private_key||"")});return t(n)})(e),t((0,d.d6)()),t((0,l.K5)()),n.reset()}catch(e){const n=(0,i.F)(e)?e:void 0;t((0,c.ox)({type:o.C.danger,message:"SETTINGS_SYSTEM_CTRL_CERTIFICATES_ADD_ERROR",errorMessage:n?.msg}))}});return(0,a.jsxs)("form",{onSubmit:A,style:{height:"100%"},children:[(0,a.jsx)(B,{form:n,isContentFiltering:e.id===u.I.CONTENT_FILTERING}),(0,a.jsx)(m.A,{onFormSubmit:A,onFormCancel:()=>n.reset(),isDirty:n.formState.isDirty,isSubmitting:n.formState.isSubmitting,submitButtonText:"SETTINGS_SYSTEM_CTRL_CERTIFICATE_ADD"})]})}},115378(e,t,n){var a,r;n.d(t,{I:()=>r,M:()=>a}),function(e){e.SELF_SIGNED="SELF_SIGNED",e.UPLOAD="UPLOAD"}(a||(a={})),function(e){e.SSL_INSPECTION="sslInspection",e.CONTENT_FILTERING="contentFiltering"}(r||(r={}))},121713(e,t,n){n.d(t,{m:()=>p});var a=n(602086),r=n(977872),o=n(42220),i=n(369289),s=n(721533),l=n(700444),c=n(159469),d=n(260334);const m=(e,t=[])=>{if(!e||"object"!=typeof e)return[];const n=e;return[...Object.keys(n).filter(e=>"ref"!==e).flatMap(e=>m(n[e],[...t,e])),..."string"==typeof n.message&&n.message?[{path:n.ref?.name??t.join("."),message:n.message}]:[]]},u=e=>[...Array.from(document.getElementsByName(e)),document.getElementById(e),document.querySelector(`label[for="${e}"]`),document.querySelector(`[data-field-error="${e}"]`)].find(e=>e instanceof HTMLElement&&null!==e.offsetParent)??null,A=e=>{const t=(e.split(".").pop()??e).replaceAll(/([a-z0-9])([A-Z])/g,"$1 $2").replaceAll(/[_-]+/g," ").trim().toLowerCase();return t?t.charAt(0).toUpperCase()+t.slice(1):e};function p({schema:e,defaultValues:t,presets:n,mode:p="onTouched"}){const _=(0,r.wA)(),f=(0,d.L_)(),E=(0,a.useMemo)(()=>n?(0,i.A)(n,e=>e.defaultValues):{},[n]),T=(0,a.useMemo)(()=>({...t,...E}),[E,t]),h=(0,o.mN)({resolver:(0,s.u)(e),shouldFocusError:!0,defaultValues:T,shouldUseNativeValidation:!1,mode:p}),S=(0,a.useRef)(T);S.current=T;const g=(0,a.useRef)(null),{submitCount:N}=h.formState;(0,a.useEffect)(()=>{const e=g.current;if(g.current=null,!e)return;const t=m(e),n=t[0],a=n?.path??Object.keys(e)[0];if(a)try{const e=t.map(e=>u(e.path)).find(Boolean)??(t.length?null:u(a));if(e)e.scrollIntoView?.({behavior:"smooth",block:"center"}),e.focus?.({preventScroll:!0});else{const e=n&&f(n.message);_((0,l.ox)(n&&e?{icon:c.C.danger,title:"COMMON_VALIDATION_HIDDEN_FIELDS_TITLE",translateTitle:!0,message:"COMMON_VALIDATION_HIDDEN_FIELDS_DETAIL",values:{field:A(n.path),message:e}}:{icon:c.C.danger,message:"COMMON_VALIDATION_HIDDEN_FIELDS_TITLE"}))}}catch{}},[N,_,f]);const I=(0,a.useCallback)((...e)=>{const[t,...n]=e;return h.reset(t?{...t,...E}:S.current,...n)},[E,h]);return{...h,reset:I,formState:{...h.formState,isDirty:!!Object.keys(h.formState.dirtyFields).length,isSubmitting:h.formState.isSubmitting,defaultValues:h.formState.defaultValues},handleSubmit:(...e)=>h.handleSubmit(e[0],(t,...n)=>{g.current=t,e[1]?.(t,...n)})}}},260334(e,t,n){n.d(t,{L_:()=>d,MS:()=>c,rn:()=>l});var a=n(602086),r=n(949812),o=n(765282),i=n(470070);const s="{::}",l=(e,t)=>`${e}${s}${JSON.stringify(t??{})}`,c=(e,t)=>{if("string"!=typeof t)return;const[n,...a]=t.split(s);if(!n||!a.length)return t;let r={};try{r=Object.fromEntries(Object.entries(JSON.parse(a.join(s))).map(([t,n])=>[t,"string"==typeof n?c(e,n):n]))}catch{}return e.formatMessage({id:n},r)};function d(){const{formatMessage:e}=(0,i.tz)();return(0,a.useCallback)(t=>c({formatMessage:e},t),[e])}r.pJ((e,t)=>e.message?{message:e.message}:e.code===o.eq.too_small&&"string"===e.type?{message:l("COMMON_MIN_CHARS",{min:Number(e.minimum)})}:e.code===o.eq.too_big&&"string"===e.type?{message:l("COMMON_MAX_CHARS",{name:l("COMMON_VALUE"),max:Number(e.maximum)})}:e.code===o.eq.invalid_type&&"array"===e.expected&&"undefined"===e.received?{message:l("COMMON_SELECT_AT_LEAST_ONE_ITEM")}:e.code===o.eq.too_small&&"array"===e.type?{message:l("COMMON_ADD_AT_LEAST_X_ITEMS",{min:Number(e.minimum)})}:e.code===o.eq.invalid_type&&"undefined"===e.received?{message:l("COMMON_VALIDATION_VALUE_REQUIRED")}:e.code===o.eq.invalid_type&&"number"===e.expected?{message:l("COMMON_VALIDATION_PLEASE_ENTER_A_NUMBER")}:{message:t.defaultError})},635891(e,t,n){n.d(t,{A:()=>d});var a=n(274934),r=n(42220),o=n(699709),i=n(775250),s=n(309130),l=n(260334),c=n(184931);const d=function({control:e,name:t,label:n,placeholder:d,tooltip:m,tooltipProps:u,autoFocus:A,motif:p,onChange:_,onBlur:f,onAfterChange:E,onPaste:T,onKeyDown:h,passwordToggle:S,type:g,helperMessage:N,autoComplete:I,contentBefore:C,contentAfter:x,onFocus:v,value:b,invalid:L}){const M=(0,c.mQ)(),O=(0,c.Im)(),R=(0,c.q)(),y=(0,l.L_)();return(0,a.jsx)(r.xI,{control:e,name:t,render:({field:e,fieldState:l,formState:c})=>(0,a.jsx)(o.A,{type:g||(S?"password":"text"),variant:"secondary",width:"100%",autoFocus:A,...e,onChange:t=>{_?_(t,e,c):e.onChange(t),E?.(t)},onBlur:t=>{f?f(t,e,c):e.onBlur()},onFocus:v,onPaste:T,disabled:M,value:b??e.value?.toString(),invalid:L||(l.invalid?(0,a.jsxs)(i.A,{variant:"inherit",style:{overflowWrap:"break-word"},children:[y((0,r.Jt)(c.errors,t)?.message)||!0," "]}):void 0),label:n,placeholder:d,labelTooltip:m,labelTooltipProps:{style:{opacity:O?s.xN:void 0,pointerEvents:R?"none":void 0,...u?.style},...u},motif:p,passwordToggle:S,helperMessage:N,autoComplete:I,onKeyDown:h,contentBefore:C,contentAfter:x})})}},721533(e,t,n){n.d(t,{u:()=>d});var a=n(42220);const r=(e,t,n)=>{if(e&&"reportValidity"in e){const r=(0,a.Jt)(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},o=(e,t)=>{for(const n in t.fields){const a=t.fields[n];a&&a.ref&&"reportValidity"in a.ref?r(a.ref,n,e):a&&a.refs&&a.refs.forEach(t=>r(t,n,e))}},i=(e,t)=>{t.shouldUseNativeValidation&&o(e,t);const n={};for(const r in e){const o=(0,a.Jt)(t.fields,r),i=Object.assign(e[r]||{},{ref:o&&o.ref});if(s(t.names||Object.keys(e),r)){const e=Object.assign({},(0,a.Jt)(n,r));(0,a.hZ)(e,"root",i),(0,a.hZ)(n,r,e)}else(0,a.hZ)(n,r,i)}return n},s=(e,t)=>{const n=l(t);return e.some(e=>l(e).match(`^${n}\\.\\d+`))};function l(e){return e.replace(/\]|\[/g,"")}function c(e,t){for(var n={};e.length;){var r=e[0],o=r.code,i=r.message,s=r.path.join(".");if(!n[s])if("unionErrors"in r){var l=r.unionErrors[0].errors[0];n[s]={message:l.message,type:l.code}}else n[s]={message:i,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var c=n[s].types,d=c&&c[r.code];n[s]=(0,a.Gb)(s,t,n,o,d?[].concat(d,r.message):r.message)}e.shift()}return n}function d(e,t,n){return void 0===n&&(n={}),function(a,r,s){try{return Promise.resolve(function(r,i){try{var l=Promise.resolve(e["sync"===n.mode?"parse":"parseAsync"](a,t)).then(function(e){return s.shouldUseNativeValidation&&o({},s),{errors:{},values:n.raw?Object.assign({},a):e}})}catch(e){return i(e)}return l&&l.then?l.then(void 0,i):l}(0,function(e){if(function(e){return Array.isArray(null==e?void 0:e.errors)}(e))return{values:{},errors:i(c(e.errors,!s.shouldUseNativeValidation&&"all"===s.criteriaMode),s)};throw e}))}catch(e){return Promise.reject(e)}}}}}]);