import{a as o,b as D}from"./chunk-JQYQFR5I.js";import{a as S,b as E}from"./chunk-JFZLN2FV.js";import{a as s,b as V}from"./chunk-A22EQSF3.js";import{a as y,b as I}from"./chunk-QGVT6DPT.js";import{r as F,t as C}from"./chunk-HTXYTVN4.js";import{b as g,c as w}from"./chunk-YBNTOQCK.js";import{Nc as p,Oc as d,Pc as v,Qb as f,Sa as P,Ub as l,be as T,d as m,ia as h,ka as c,na as M,o as u,p as A}from"./chunk-WL5U2YIT.js";import{e as b}from"./chunk-ADEKKGI2.js";var _,t,a,Q=b(()=>{A();P();M();D();V();C();I();w();E();T();_=["currentForm"],t=class t extends y{constructor(){super(),this.errorSummaryMessages=[],this.tabTitle="",this.BASE_TITLE="Devolutions Server - ",this.titleService=s.injector.get(F),this.translatorService=s.injector.get(g)}get isDirty(){return this.currentForm?this.currentForm.dirty:this.reactiveForm?this.reactiveForm.dirty:!1}get isValid(){return this.currentForm?this.currentForm.valid:this.reactiveForm?this.reactiveForm.valid:!1}ngOnInit(){this.titleService.setTitle(this.BASE_TITLE+this.translatorService.translate(this.tabTitle)),this.setFormPristineAfterInit()}setFormPristineAfterInit(){this.setFormPristine()}submitForm(){this.errorSummaryMessages=[],this.save().pipe(h(this.destroyed$)).subscribe(e=>{e?this.setFormPristine():this.errorSummaryMessages.length===0&&this.errorSummaryMessages.push(o.setMessageSummary("Unable to save"))})}showError(e){this.errorSummaryMessages.push(o.setMessageSummary(e))}cancelChange(){return!1}rejectChange(){return this.setFormPristine(),!0}validateChange(){return this.save().pipe(c(e=>e?this.setFormPristine():void 0))}save(){return new m}hasErrors(e,r,i=!0){return r.errors&&((i?r.dirty:!1)||r.touched||e.submitted)}setFormPristine(){this.currentForm&&(this.currentForm.form.markAsPristine(),this.currentForm.form.updateValueAndValidity()),this.reactiveForm&&(this.reactiveForm.markAsPristine(),this.reactiveForm.updateValueAndValidity())}};t.\u0275fac=function(r){return new(r||t)},t.\u0275cmp=f({type:t,selectors:[["dvl-inline-editable-form"]],viewQuery:function(r,i){if(r&1&&p(_,5),r&2){let n;d(n=v())&&(i.currentForm=n.first)}},features:[l],decls:0,vars:0,template:function(r,i){},encapsulation:2});a=t;u([S(350)],a.prototype,"setFormPristineAfterInit",null)});export{a,Q as b};
