import{a as i,b as w}from"./chunk-LBARZOQF.js";import{a as s,b as V}from"./chunk-EXSN6QWV.js";import{a as S,b as _}from"./chunk-BXBF54ET.js";import{a as y,b as I}from"./chunk-TS62PHQY.js";import{b as g,c as E}from"./chunk-IOINCEV4.js";import{R as F,T as C}from"./chunk-Z5RJRCWC.js";import{Gd as T,Jc as p,Kc as d,Lc as v,Ob as l,Sb as f,d as m,ia as h,ka as c,ma as M,na as P,o as u,p as A}from"./chunk-JSJB5BKT.js";import{e as b}from"./chunk-SZAW6ZBW.js";var D,o,Q=b(()=>{A();P();M();w();V();C();I();E();_();T();D=["currentForm"],o=class n 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(i.setMessageSummary("Unable to save"))})}showError(e){this.errorSummaryMessages.push(i.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,t=!0){return r.errors&&((t?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())}static{this.\u0275fac=function(r){return new(r||n)}}static{this.\u0275cmp=l({type:n,selectors:[["dvl-inline-editable-form"]],viewQuery:function(r,t){if(r&1&&p(D,5),r&2){let a;d(a=v())&&(t.currentForm=a.first)}},features:[f],decls:0,vars:0,template:function(r,t){},encapsulation:2})}};u([S(350)],o.prototype,"setFormPristineAfterInit",null)});export{o as a,Q as b};
