import{a as k,c as B,d as M}from"./chunk-5T6TZLDM.js";import{f as d,t as h}from"./chunk-ZVQ5RRLK.js";import{b as I}from"./chunk-FJD7O57P.js";import{b as x,e as R}from"./chunk-RCWJCOBH.js";import{B as A,D as L,Xa as T,o as a,q as S,r as D,u as b,w as N,z as U}from"./chunk-NKXT7PF4.js";import{a as v,b as c}from"./chunk-IGFM5CCE.js";import{ua as y}from"./chunk-TDUJNOEU.js";import{Db as E,dc as r,ec as g,fc as _,fd as u,gc as l,gd as n,lb as p,qb as C,wb as o,zd as F}from"./chunk-I3FGJX2C.js";import{d as f,n as H}from"./chunk-INB5GR2I.js";H();var e,O=(e=class{constructor(s,t,m){this._fb=s,this._cdr=t,this._localizationService=m,this.isEdit=!1,this.formReady=new C}ngDoCheck(){this._cdr.markForCheck()}ngOnInit(){this._buildForm(),this.formReady.emit(this.companyForm),this.companyForm.valueChanges.pipe(c(this)).subscribe(()=>this._cdr.markForCheck()),this.companyForm.statusChanges.pipe(c(this)).subscribe(()=>this._cdr.markForCheck())}_buildForm(){this.companyForm=this._fb.group({name:this._fb.nonNullable.control(this.initialValue?.name??"",[a.required,a.minLength(d.min),a.maxLength(d.max)]),address:this._fb.nonNullable.control(this.initialValue?.address??"",[k(),M(h.min,this._localizationService.getSync.bind(this._localizationService)),B(h.max,this._localizationService.getSync.bind(this._localizationService))])})}},e.\u0275fac=function(t){return new(t||e)(o(A),o(F),o(R))},e.\u0275cmp=E({type:e,selectors:[["tis-warehouse-upsert-form"]],inputs:{isEdit:"isEdit",initialValue:"initialValue"},outputs:{formReady:"formReady"},decls:6,vars:11,consts:[[3,"formGroup"],["token","name","formControlName","name",3,"label"],["formControlName","address","token","address",3,"minHeight","label","placeholder"]],template:function(t,m){t&1&&(g(0,"form",0),l(1,"tis-text-field",1),u(2,"translate"),l(3,"wk-text-area",2),u(4,"translate"),u(5,"translate"),_()),t&2&&(r("formGroup",m.companyForm),p(),r("label",n(2,5,"\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u0441\u043A\u043B\u0430\u0434\u0430")),p(2),r("minHeight",68)("label",n(4,7,"\u0410\u0434\u0440\u0435\u0441 \u0441\u043A\u043B\u0430\u0434\u0430"))("placeholder",n(5,9,"\u041D\u0430\u043F\u0440\u0438\u043C\u0435\u0440: \u041A\u0430\u0437\u0430\u0445\u0441\u0442\u0430\u043D, \u0410\u043A\u043C\u043E\u043B\u0438\u043D\u0441\u043A\u0430\u044F \u041E\u0431\u043B\u0430\u0441\u0442\u044C, \u0433. \u0410\u0441\u0442\u0430\u043D\u0430, \u0443\u043B. \u0414\u043E\u0441\u0442\u044B\u043A 33, \u043E\u0444\u0438\u0441 125")))},dependencies:[y,T,I,L,b,S,D,N,U,x],styles:[`[_nghost-%COMP%]{display:block}
/*# sourceMappingURL=warehouse-upsert-form.component-TJZEQSMB.css.map */`],changeDetection:0}),e);O=f([v()],O);function oe(i){return{type:"success",header:i("\u0421\u043A\u043B\u0430\u0434"),message:i("\u0421\u043A\u043B\u0430\u0434 \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0441\u043E\u0437\u0434\u0430\u043D")}}function re(i){return{type:"success",header:i("\u0421\u043A\u043B\u0430\u0434"),message:i("\u0421\u043A\u043B\u0430\u0434 \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u043E\u0442\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D")}}function ue(i){return{type:"error",header:i("\u041E\u0448\u0438\u0431\u043A\u0430"),message:i("\u0417\u0430\u043F\u0440\u043E\u0448\u0435\u043D\u043D\u044B\u0439 \u0441\u043A\u043B\u0430\u0434 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D")}}export{O as a,oe as b,re as c,ue as d};
//# sourceMappingURL=chunk-WTL34N2Z.js.map
