1import{t as O}from"./chunk-JDKZG5EX.js";import{s as E}from"./chunk-NU4FUAG2.js";import{Eh as V,Fh as j,Gh as I,Ia as d,L as h,Li as S,Na as c,Ri as w,Vi as $,_i as F,a as v,b,eb as m,nd as x,nh as T,t as C,wa as f}from"./chunk-CPOZEFYP.js";var L=(()=>{let r=class r{get isEnterprise(){return this.getProductType()===E.Enterprise}getProductType(){return this.productType}loadProductType(){return this.getProductType$.pipe(h(t=>{this.productType=t}))}constructor(t){this.api=t,this.certificateList="certificate.query",this.caList="certificateauthority.query",this.updateRunning=new m,this.updateRunningNoticeSent=new m,this.updateIsDone$=new C,this.getProductType$=this.api.call("system.product_type").pipe(f({refCount:!1,bufferSize:1})),this.isEnterprise$=this.getProductType$.pipe(h(e=>e===E.Enterprise),f({refCount:!0,bufferSize:1}))}getCertificateAuthorities(){return this.api.call(this.caList,[])}getCertificates(){return this.api.call(this.certificateList)}getUnsignedCertificates(){return this.api.call(this.certificateList,[[["CSR","!=",null]]])}getUnsignedCas(){return this.api.call(this.caList,[[["privatekey","!=",null]]])}getCertificateCountryChoices(){return this.api.call("certificate.country_choices")}ipChoicesv4(){return this.api.call("system.general.ui_address_choices")}ipChoicesv6(){return this.api.call("system.general.ui_v6address_choices")}kbdMapChoices(){return this.api.call("system.general.kbdmap_choices").pipe(h(t=>Object.keys(t||{}).map(e=>({label:"".concat(t[e]," (").concat(e,")"),value:e}))))}languageChoices(){return this.api.call("system.general.language_choices")}languageOptions(t){return this.languageChoices().pipe(h(e=>{let o=Object.keys(e||{}).map(i=>({label:t?"".concat(e[i]," (").concat(i,")"):"".concat(i," (").concat(e[i],")"),value:i}));return o=T(o,t?"label":"value"),o}))}timezoneChoices(){return this.api.call("system.general.timezone_choices").pipe(h(t=>Object.keys(t||{}).map(e=>({label:t[e],value:e}))))}uiCertificateOptions(){return this.api.call("system.general.ui_certificate_choices")}uiHttpsProtocolsOptions(){return this.api.call("system.general.ui_httpsprotocols_choices")}refreshDirServicesCache(){return this.api.job("directoryservices.cache_refresh")}updateDone(){this.updateIsDone$.next()}};r.\u0275fac=function(e){return new(e||r)(c(w))},r.\u0275prov=d({token:r,factory:r.\u0275fac,providedIn:"root"});let a=r;return a})();var g=function(a){return a.Validation="VALIDATION",a}(g||{});var Y=(()=>{let r=class r{constructor(t,e,o,i){this.dialog=t,this.errorHandler=e,this.formService=o,this.document=i,this.isFocusedOnError=!1,this.needToShowError=!1}handleValidationErrors(t,e,o={},i=void 0){if(I(t)&&V(t.error.data)&&t.error.data.errname===S.Validation&&t.error.data.extra){this.handleValidationError(t.error.data,e,o,i);return}if(j(t)&&t.exc_info.type===g.Validation&&t.exc_info.extra){this.handleValidationError(b(v({},t),{extra:t.exc_info.extra}),e,o,i);return}this.dialog.error(this.errorHandler.parseError(t))}handleValidationError(t,e,o,i){this.isFocusedOnError=!1,this.needToShowError=!1;let n=t.extra;for(let u of n){let s=u[0].split(".").pop();if(!s)return;let l=u[1],p=this.getFormField(e,s,o),N=this.formService.getControlNames();if(i&&p&&!N.includes(s)){let y=this.document.getElementById(i);if(y){y.click(),setTimeout(()=>{this.showValidationError({control:this.getFormField(e,s,o),field:s,errorMessage:l,error:t})});return}}this.showValidationError({control:p,field:s,errorMessage:l,error:t})}this.needToShowError&&this.dialog.error(this.errorHandler.parseError(t))}showValidationError({control:t,field:e,error:o,errorMessage:i}){var u;let n=this.formService.getControlNames();if(!t||!n.includes(e)){console.error("Could not find control ".concat(e,".")),this.needToShowError=!0;return}if((u=t.controls)!=null&&u.length){let s=(l,p)=>new RegExp("\\b".concat(p,"\\b")).test(l);t=t.controls.find(l=>s(i,l.value))}if(!t)this.dialog.error(this.errorHandler.parseError(o));else{t.setErrors({manualValidateError:!0,manualValidateErrorMsg:i,ixManualValidateError:{message:i}}),t.markAsTouched();let s=this.formService.getElementByControlName(e);s&&!this.isFocusedOnError&&setTimeout(()=>{s.scrollIntoView({behavior:"smooth",block:"center"}),s.focus(),this.isFocusedOnError=!0})}}getFormField(t,e,o){var n;let i=(n=o[e])!=null?n:e;return t.get(i)}};r.\u0275fac=function(e){return new(e||r)(c(F),c($),c(O),c(x))},r.\u0275prov=d({token:r,factory:r.\u0275fac,providedIn:"root"});let a=r;return a})();export{Y as a,L as b}; 2//# sourceMappingURL=chunk-C3ZBQYK6.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.