text: (window.webpackJsonp=window.webpackJsonp||[]).push([[13],{"7mxs":function(t,e,o){"use strict";o.d(e,"a",(function(){return h}));var a=o("tk/3"),n=o("Oj5W"),r=o("AytR"),c=o("M5Uu"),i=o("LAY5"),s=o("A2WV"),l=o("LRne"),b=o("lJxs"),u=o("fXoL"),d=o("EIzb"),m=o("4E86");let h=(()=>{class t extends s.a{constructor(t,e,o){super(t,e),this.http=t,this.alertModalService=e,this.appSettings=o,this.$api=""+r.a.baseUrl}getPersonal(){const t=`${this.$api}${c.a.TRABAJADOR_LISTAR}`,e=new a.d;return this.getMethod(t,e,n.a.formatRequestPersonalList)}obtenerTrabajdoresPorBusquedaTexto(t,e){let o=`${this.$api}${c.a.TRABAJADOR_LISTAR}`;const r=new a.d;t&&(o=o.concat("?texto="+t));const i=-1!==o.indexOf("?")?"&":"?";return this.appSettings.isIntranet?e&&(o=o.concat(`${i}empresaId=${e}`)):o=o.concat(`${i}empresaId=${this.appSettings.proveedorId}`),this.getMethod(o,r,n.a.formatRequestPersonalList)}consultaDnisTrabajador(t){let e=`${this.$api}${c.a.TRABAJADOR_DNI}`;const o=new a.d;return t&&t.length&&(e=e.concat("?dnis="+JSON.stringify(t))),this.getMethod(e,o,n.a.formatRequestTrabajadorSearchDniList)}consultaMasivamenteDnisTrabajador(t,e,o=!1){return this.postMethod(`${this.$api}${c.a.TRABAJADOR_CONSULTA_DNI}`,{ListaDnis:t,ProveedorId:e,validaProveedor:o}).pipe(Object(b.a)(t=>n.a.formatRequestTrabajadorSearchDniList(t)))}obtenerTrabajadoresByParams(t,e){if(t&&e){let o=`${this.$api}${c.a.TRABAJADOR_PLANILLA}?planilla=${t}&departamaneto=${e}`;this.appSettings.isIntranet||(o=o.concat("&proveedorId="+this.appSettings.proveedorId));const r=new a.d;return this.getMethod(o,r,n.a.formatRequestTrabajadorSearchDniList)}return this.alertModalService.alert(i.a.warning,"Se requiere los parametros planilla y departamento"),Object(l.a)([])}}return t.\u0275fac=function(e){return new(e||t)(u.Zb(a.b),u.Zb(d.a),u.Zb(m.a))},t.\u0275prov=u.Lb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},KZqF:function(t,e,o){"use strict";o.d(e,"a",(function(){return P}));var a=o("fXoL"),n=o("3Pt+"),r=o("XNiG"),c=o("1G5W"),i=o("Kj3r"),s=o("/uUt"),l=o("7mxs"),b=o("EHkv"),u=o("kmnG"),d=o("ofXK"),m=o("qFsG"),h=o("/1cH"),p=o("bTqV"),f=o("NFeN"),g=o("FKr1");function C(t,e){1&t&&(a.Vb(0,"span"),a.Ic(1,"*"),a.Ub())}function S(t,e){if(1&t){const t=a.Wb();a.Tb(0),a.Vb(1,"mat-icon",10),a.dc("click",(function(){return a.Ac(t),a.hc(2).cleanInput()})),a.Ic(2,"close"),a.Ub(),a.Sb()}}function v(t,e){if(1&t&&(a.Vb(0,"mat-icon"),a.Ic(1),a.Ub()),2&t){const t=a.hc(2);a.Cb(1),a.Jc(t.matIcon)}}function I(t,e){if(1&t&&(a.Vb(0,"a",7),a.Gc(1,S,3,0,"ng-container",8),a.Gc(2,v,2,1,"ng-template",null,9,a.Hc),a.Ub()),2&t){const t=a.xc(3),e=a.hc();a.Gb("spinner",e.loadingBuscarTrabajador),a.Cb(1),a.nc("ngIf",e.controlTrabajadorBuscar.value)("ngIfElse",t)}}function A(t,e){if(1&t&&(a.Vb(0,"mat-option",11),a.Ic(1),a.Ub()),2&t){const t=e.$implicit;a.nc("value",t.trab_id),a.Cb(1),a.Lc(" ",t.Apellidos," ",t.Nombre," ")}}let P=(()=>{class t{constructor(t,e){this.caTrabajadorService=t,this.platformService=e,this.errorMessage="",this.label="Buscar Trabajadores",this.matIcon="search",this.placeholder="",this.readonly=!1,this.required=!1,this.empresaId="",this.trabajadorSelected=new a.o,this.listTrabajadores=[],this.loadingBuscarTrabajador=!1,this.filteredTrabajador=new r.a,this.controlTrabajadorBuscar=new n.f,this.unsubscribe$=new r.a,this.onChange=t=>{},this.onTouch=()=>{},this.displayTrabajadorWithFn=t=>{let e=this.controlTrabajadorBuscar.value||"";if(t){const o=this.listTrabajadores.find(e=>e.trab_id===t);o&&(this.onTouch(),this.onChange(o.trab_id),this.trabajadorSelected.next(o),e=`${o.Apellidos} ${o.Nombre}`)}return e}}ngOnInit(){this.required&&(this.controlTrabajadorBuscar=new n.f(null,n.v.required)),this.initializeSubscriptionChangeValueBusquedTrabajador()}ngOnDestroy(){this.unsubscribe$.complete(),this.unsubscribe$.unsubscribe()}ngAfterViewInit(){}writeValue(t){this.controlTrabajadorBuscar.setValue(t||null)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouch=t}setDisabledState(t){t?this.controlTrabajadorBuscar.disable():this.controlTrabajadorBuscar.enable()}initializeSubscriptionChangeValueBusquedTrabajador(){this.controlTrabajadorBuscar.valueChanges.pipe(Object(c.a)(this.unsubscribe$),Object(i.a)(400),Object(s.a)()).subscribe(t=>{if(!t||!t.trim())return this.filteredTrabajador.next([]),void(this.listTrabajadores=[]);this.subcriptionBuscarTrabajador&&this.subcriptionBuscarTrabajador.unsubscribe();const e=(this.listTrabajadores||[]).find(e=>e.trab_id===t);e&&e.trab_id||(this.loadingBuscarTrabajador=!0,this.subcriptionBuscarTrabajador=this.caTrabajadorService.obtenerTrabajdoresPorBusquedaTexto(t,this.empresaId).pipe(Object(c.a)(this.unsubscribe$)).subscribe(t=>{this.loadingBuscarTrabajador=!1,this.listTrabajadores=t||[],this.filteredTrabajador.next(t||[]),this.controlTrabajadorBuscar.value&&this.controlTrabajadorBuscar.setValue(this.controlTrabajadorBuscar.value)}))})}cleanInput(){this.onTouch(),this.onChange(null),this.trabajadorSelected.next(null),this.controlTrabajadorBuscar.setValue(null)}}return t.\u0275fac=function(e){return new(e||t)(a.Pb(l.a),a.Pb(b.a))},t.\u0275cmp=a.Jb({type:t,selectors:[["pca-autocomplete-trabajador"]],inputs:{errorMessage:"errorMessage",label:"label",matIcon:"matIcon",placeholder:"placeholder",readonly:"readonly",required:"required",empresaId:"empresaId"},outputs:{trabajadorSelected:"trabajadorSelected"},features:[a.Bb([{provide:n.n,useExisting:Object(a.U)(()=>t),multi:!0}])],decls:10,vars:15,consts:[["appearance","outline",1,"w-100"],[4,"ngIf"],["matInput","",3,"placeholder","formControl","matAutocomplete","readonly"],["mat-icon-button","","matSuffix","",3,"spinner",4,"ngIf"],[3,"displayWith"],["autoTrabajador","matAutocomplete"],[3,"value",4,"ngFor","ngForOf"],["mat-icon-button","","matSuffix",""],[4,"ngIf","ngIfElse"],["elseTemplate",""],[3,"click"],[3,"value"]],template:function(t,e){if(1&t&&(a.Vb(0,"mat-form-field",0),a.Vb(1,"mat-label"),a.Ic(2),a.Gc(3,C,2,0,"span",1),a.Ub(),a.Qb(4,"input",2),a.Gc(5,I,4,4,"a",3),a.Vb(6,"mat-autocomplete",4,5),a.Gc(8,A,2,3,"mat-option",6),a.ic(9,"async"),a.Ub(),a.Ub()),2&t){const t=a.xc(7);a.Fc("font-size",e.platformService.fontZize(),"rem")("color",e.controlTrabajadorBuscar.errors&&e.controlTrabajadorBuscar.touched?"red !important":null),a.Cb(2),a.Kc("",e.label," "),a.Cb(1),a.nc("ngIf",e.required),a.Cb(1),a.nc("placeholder",e.placeholder)("formControl",e.controlTrabajadorBuscar)("matAutocomplete",t)("readonly",e.readonly),a.Cb(1),a.nc("ngIf",!e.readonly&&!e.controlTrabajadorBuscar.disabled),a.Cb(1),a.nc("displayWith",e.displayTrabajadorWithFn),a.Cb(2),a.nc("ngForOf",a.jc(9,13,e.filteredTrabajador))}},directives:[u.b,u.f,d.m,m.b,n.c,h.c,n.p,n.g,h.a,d.l,p.a,u.h,f.a,g.o],pipes:[d.b],styles:["[_nghost-%COMP%]{width:100%;padding:0;margin:0;display:flex;justify-content:center}"]}),t})()},M2k1:function(t,e,o){"use strict";o.d(e,"a",(function(){return w}));var a=o("fXoL"),n=o("3Pt+"),r=o("RrUJ"),c=o("XNiG"),i=o("1G5W"),s=o("pLZG"),l=o("/uUt"),b=o("lJxs"),u=o("tk/3"),d=o("Oj5W"),m=o("AytR"),h=o("M5Uu"),p=o("A2WV"),f=o("EIzb");let g=(()=>{class t extends p.a{constructor(t,e){super(t,e),this.http=t,this.alertModalService=e,this.$api=""+m.a.baseUrl}obtenerDepartamentosPorParametros(t,e,o){let a=`${this.$api}${h.a.DEPARTAMENTO_LISTAR}`;const n=new u.d;t&&(a=a.concat("?texto="+t));let r=-1!==a.indexOf("?")?"&":"?";return e&&(a=a.concat(`${r}niveles=${e}`)),r=-1!==a.indexOf("?")?"&":"?",o&&(a=a.concat(`${r}usuario=${o}`)),this.getMethod(a,n,d.a.formatRequestDepartamentoList)}}return t.\u0275fac=function(e){return new(e||t)(a.Zb(u.b),a.Zb(f.a))},t.\u0275prov=a.Lb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var C=o("EHkv"),S=o("kmnG"),v=o("ofXK"),I=o("qFsG"),A=o("/1cH"),P=o("bTqV"),T=o("NFeN"),$=o("FKr1");function O(t,e){1&t&&(a.Vb(0,"span"),a.Ic(1,"*"),a.Ub())}function j(t,e){if(1&t){const t=a.Wb();a.Tb(0),a.Vb(1,"mat-icon",10),a.dc("click",(function(){return a.Ac(t),a.hc(2).cleanInput()})),a.Ic(2,"close"),a.Ub(),a.Sb()}}function U(t,e){if(1&t&&(a.Vb(0,"mat-icon"),a.Ic(1),a.Ub()),2&t){const t=a.hc(2);a.Cb(1),a.Jc(t.matIcon)}}function R(t,e){if(1&t&&(a.Vb(0,"a",7),a.Gc(1,j,3,0,"ng-container",8),a.Gc(2,U,2,1,"ng-template",null,9,a.Hc),a.Ub()),2&t){const t=a.xc(3),e=a.hc();a.Gb("spinner",e.loadingBuscarDepartamento),a.Cb(1),a.nc("ngIf",e.controlDepartamentoBuscar.value)("ngIfElse",t)}}function V(t,e){if(1&t&&(a.Vb(0,"mat-option",11),a.Ic(1),a.Ub()),2&t){const t=e.$implicit;a.nc("value",t.id),a.Cb(1),a.Lc(" ",t.id," - ",t.nombre," ")}}let w=(()=>{class t{constructor(t,e){this.caDepartamentoService=t,this.platformService=e,this.errorMessage="",this.required=!1,this.label="Buscar Departamento",this.matIcon="search",this.placeholder="",this.readonly=!1,this.usuario="",this.niveles="",this.departamentoSelected=new a.o,this.listDepartamentos=[],this.loadingBuscarDepartamento=!1,this.filteredDepartamento=new c.a,this.controlDepartamentoBuscar=new n.f,this.unsubscribe$=new c.a,this.onChange=t=>{},this.onTouch=()=>{},this.displayDepartamentoWithFn=t=>{let e="";if(t){const o=this.listDepartamentos.find(e=>e.id.trim()===t.trim());o&&(this.onTouch(),this.onChange(o.id),this.departamentoSelected.next(o),e=`${o.id} - ${o.nombre}`)}return e}}ngOnInit(){this.required&&(this.controlDepartamentoBuscar=new n.f(null,n.v.required)),this.onChangeValueFiltered(),this.obtenerDepartamentos()}ngOnDestroy(){this.unsubscribe$.complete(),this.unsubscribe$.unsubscribe()}ngAfterViewInit(){}writeValue(t){this.controlDepartamentoBuscar.setValue(t||null)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouch=t}setDisabledState(t){t?this.controlDepartamentoBuscar.disable():this.controlDepartamentoBuscar.enable()}onChangeValueFiltered(){this.controlDepartamentoBuscar.valueChanges.pipe(Object(i.a)(this.unsubscribe$),Object(s.a)(t=>null!=t),Object(l.a)(),Object(b.a)((t="")=>"string"==typeof t?t:t.descProv),Object(b.a)(t=>t?this._filterProveedor(t):this.listDepartamentos.slice())).subscribe(t=>{this.filteredDepartamento.next(t||[])})}obtenerDepartamentos(){this.loadingBuscarDepartamento=!0,this.subcriptionBuscarDepartamento=this.caDepartamentoService.obtenerDepartamentosPorParametros("",this.niveles,this.usuario).pipe(Object(i.a)(this.unsubscribe$)).subscribe(t=>{this.loadingBuscarDepartamento=!1,this.listDepartamentos=t,this.filteredDepartamento.next(t||[]),this.controlDepartamentoBuscar.value&&this.controlDepartamentoBuscar.setValue(this.controlDepartamentoBuscar.value)})}_concatForceEmptyOrTextUpperCase(t){let e="";return t&&(e=`${(t.id||"").trim()} - ${(t.nombre||"").trim()}`.toLowerCase()),e}_filterProveedor(t){const e=t.toLowerCase();return this.listDepartamentos.filter(t=>-1!==r.a.textToUpperOrEmpty(t.nombre).indexOf(e)||-1!==r.a.textToUpperOrEmpty(t.id).indexOf(e)||-1!==this._concatForceEmptyOrTextUpperCase(t).indexOf(e))}cleanInput(){this.onTouch(),this.onChange(null),this.filteredDepartamento.next(this.listDepartamentos||[]),this.departamentoSelected.next(null),this.controlDepartamentoBuscar.setValue(null)}}return t.\u0275fac=function(e){return new(e||t)(a.Pb(g),a.Pb(C.a))},t.\u0275cmp=a.Jb({type:t,selectors:[["pca-autocomplete-departamento"]],inputs:{errorMessage:"errorMessage",required:"required",label:"label",matIcon:"matIcon",placeholder:"placeholder",readonly:"readonly",usuario:"usuario",niveles:"niveles"},outputs:{departamentoSelected:"departamentoSelected"},features:[a.Bb([{provide:n.n,useExisting:Object(a.U)(()=>t),multi:!0}])],decls:10,vars:15,consts:[["appearance","outline",1,"w-100"],[4,"ngIf"],["matInput","",3,"placeholder","formControl","matAutocomplete","readonly"],["mat-icon-button","","matSuffix","",3,"spinner",4,"ngIf"],[3,"displayWith"],["autoDepartamento","matAutocomplete"],[3,"value",4,"ngFor","ngForOf"],["mat-icon-button","","matSuffix",""],[4,"ngIf","ngIfElse"],["elseTemplate",""],[3,"click"],[3,"value"]],template:function(t,e){if(1&t&&(a.Vb(0,"mat-form-field",0),a.Vb(1,"mat-label"),a.Ic(2),a.Gc(3,O,2,0,"span",1),a.Ub(),a.Qb(4,"input",2),a.Gc(5,R,4,4,"a",3),a.Vb(6,"mat-autocomplete",4,5),a.Gc(8,V,2,3,"mat-option",6),a.ic(9,"async"),a.Ub(),a.Ub()),2&t){const t=a.xc(7);a.Fc("font-size",e.platformService.fontZize(),"rem")("color",e.controlDepartamentoBuscar.errors&&e.controlDepartamentoBuscar.touched?"red !important":null),a.Cb(2),a.Kc("",e.label," "),a.Cb(1),a.nc("ngIf",e.required),a.Cb(1),a.nc("placeholder",e.placeholder)("formControl",e.controlDepartamentoBuscar)("matAutocomplete",t)("readonly",e.readonly),a.Cb(1),a.nc("ngIf",!e.readonly&&!e.controlDepartamentoBuscar.disabled),a.Cb(1),a.nc("displayWith",e.displayDepartamentoWithFn),a.Cb(2),a.nc("ngForOf",a.jc(9,13,e.filteredDepartamento))}},directives:[S.b,S.f,v.m,I.b,n.c,A.c,n.p,n.g,A.a,v.l,P.a,S.h,T.a,$.o],pipes:[v.b],styles:["[_nghost-%COMP%]{width:100%;padding:0;margin:0;display:flex;justify-content:center}"]}),t})()},Mdhe:function(t,e,o){"use strict";o.d(e,"a",(function(){return u}));var a=o("tk/3"),n=o("A2WV"),r=o("AytR"),c=o("Oj5W"),i=o("M5Uu"),s=o("fXoL"),l=o("EIzb"),b=o("4E86");let u=(()=>{class t extends n.a{constructor(t,e,o){super(t,e),this.http=t,this.alertModalService=e,this.appSetting=o,this.$api=""+r.a.baseUrl}obtenerAreasList(){const t=this.$api+"area/listar",e=new a.d;return this.getMethod(t,e)}getListDepartament(){const t=`${this.$api}${i.a.DEPARTAMENTO_LISTAR}`,e=new a.d;return this.getMethod(t,e)}getListUProduccion(t){let e=this.$api+"UnidadProduccion/listar";const o=new a.d;return t&&(e=e.concat("?texto="+t)),this.getMethod(e,o)}getListPuntoControlByUnidadProduccion(t,e){let o=`${this.$api}${i.a.PUNTO_CONTROL_LISTAR}`;const n=new a.d;return t&&(o=o.concat(`?UnidadProduccionId=${t}&DepartamentoId=${e}&set_id=${r.a.SET_ID}`)),this.getMethod(o,n)}getPuntoControlById(t){const e=`${this.$api}${i.a.PUNTO_CONTROL}/${t}`,o=new a.d;return this.getMethod(e,o,c.a.formatRequestPuntoControlById)}upsertPuntoControl(t){return 0===t.id?this.addPuntoControl(t):this.editPuntoControl(t)}addPuntoControl(t){const e=`${this.$api}${i.a.PUNTO_CONTROL_AGREGAR}`,o=c.a.formatResponsePuntoControlForms(t,this.appSetting.currentUser);return this.postMethod(e,o)}editPuntoControl(t){const e=`${this.$api}${i.a.PUNTO_CONTROL}/${t.id}`,o=c.a.formatResponsePuntoControlForms(t,this.appSetting.currentUser);return this.postMethod(e,o)}obtenerSerializadoFormatoImportacion(){return this.getMethodDownloadFile(`${this.$api}${i.a.PUNTO_CONTROL_GENERAR_EXCEL}`)}importMasivoPuntoControl(t){const e=`${this.$api}${i.a.PUNTO_CONTROL_IMPORT}`,o=c.a.formatResponsePuntoControlImportList(t,this.appSetting.currentUser);return this.postMethod(e,o)}}return t.\u0275fac=function(e){return new(e||t)(s.Zb(a.b),s.Zb(l.a),s.Zb(b.a))},t.\u0275prov=s.Lb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},xPwC:function(t,e,o){"use strict";o.r(e),o.d(e,"CaRolAccesoModule",(function(){return re}));var a=o("ofXK"),n=o("tyNb"),r=o("3Pt+"),c=o("fXoL"),i=o("0IaG"),s=o("XNiG"),l=o("M9IT"),b=o("Dh3D"),u=o("1G5W");class d{constructor(t){t&&Object.assign(this,t)}fullName(){let t="";return t=this.Nombre&&this.Apellidos?`${this.Apellidos}, ${this.Nombre}`:""+this.Nombre,t}}var m=o("+0xr");const h=["nombre","departamento.nombre","area.nombre","estado","action"],p=["dni","fullName","Departamento","FechaIngreso","Estado","action"];var f=o("mrSG"),g=o("XKlN");let C=(()=>{class t{constructor(t){this.id=(null==t?void 0:t.id)||0,this.nombre=(null==t?void 0:t.nombre)||null,this.puntosControl=(null==t?void 0:t.puntosControl)||[],this.trabajadores=(null==t?void 0:t.trabajadores)||[],this.estado=(null==t?void 0:t.estado)||null,this.operadorCreador=(null==t?void 0:t.operadorCreador)||"",this.fechaCreacion=(null==t?void 0:t.fechaCreacion)||null,this.lenghtPuntosControl=this.puntosControl.length,this.lenghtPersonas=this.trabajadores.length}}return Object(f.b)([Object(g.e)()],t.prototype,"id",void 0),Object(f.b)([Object(g.e)()],t.prototype,"cia_id",void 0),Object(f.b)([Object(g.e)(),Object(g.f)({message:"* Campo obligatorio."}),Object(g.c)({value:50,message:"M\xe1ximo de catacteres permitidos es 50"})],t.prototype,"nombre",void 0),Object(f.b)([Object(g.e)(),Object(g.d)({value:1,message:"* Seleccione por lo menos un punto de control"})],t.prototype,"lenghtPuntosControl",void 0),Object(f.b)([Object(g.e)()],t.prototype,"puntosControl",void 0),Object(f.b)([Object(g.e)(),Object(g.d)({value:1,message:"* Seleccione por lo menos una persona"})],t.prototype,"lenghtPersonas",void 0),Object(f.b)([Object(g.e)()],t.prototype,"trabajadores",void 0),Object(f.b)([Object(g.e)()],t.prototype,"estado",void 0),Object(f.b)([Object(g.e)()],t.prototype,"operadorCreador",void 0),t})();var S=o("LAY5"),v=o("Oj5W"),I=o("EIzb"),A=o("Mdhe"),P=o("7mxs"),T=o("tk/3"),$=o("AytR"),O=o("A2WV"),j=o("M5Uu"),U=o("4E86");let R=(()=>{class t extends O.a{constructor(t,e,o){super(t,e),this.http=t,this.alertModalService=e,this.appSetting=o,this.$api=""+$.a.baseUrl}obtenerRolesAcceso(){const t=`${this.$api}${j.a.ROL_ACCESOS_LISTAR}`,e=new T.d;return this.getMethod(t,e,v.a.formatRequestRolAccesoList)}obtenerRolesAccesoById(t){const e=`${this.$api}${j.a.ROL_ACCESOS}/${t}`,o=new T.d;return this.getMethod(e,o,v.a.formatRequestRolAcceso)}upsertRolesAcceso(t){return t.id?this.updateRolesAcceso(t):this.insertRolesAcceso(t)}updateRolesAcceso(t){const e=`${this.$api}${j.a.ROL_ACCESOS}/${t.id}`,o=v.a.formatResponseRolAcceso(t,this.appSetting.currentUser);return this.postMethod(e,o)}insertRolesAcceso(t){const e=`${this.$api}${j.a.ROL_ACCESOS_AGREGAR}`,o=v.a.formatResponseRolAcceso(t,this.appSetting.currentUser);return this.postMethod(e,o)}deleteRolesAcceso(t){return this.deleteMethod(`${this.$api}${j.a.ROL_ACCESOS}/${t}/${this.appSetting.currentUser}`)}cambiarEstado(t,e){return this.postMethod(`${this.$api}${j.a.ROL_ACCESOS_CAMBIAR_ESTADO}`,{id:t,usuario:this.appSetting.currentUser,estado:e})}}return t.\u0275fac=function(e){return new(e||t)(c.Zb(T.b),c.Zb(I.a),c.Zb(U.a))},t.\u0275prov=c.Lb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var V=o("EHkv"),w=o("Js5l"),G=o("f0Cb"),D=o("bTqV"),y=o("Qu3c"),M=o("NFeN"),x=o("kmnG"),F=o("qFsG"),B=o("wZkO"),E=o("1GFE"),_=o("M2k1"),L=o("d3UM"),k=o("FKr1"),N=o("KZqF");function q(t,e){if(1&t){const t=c.Wb();c.Vb(0,"button",14),c.dc("click",(function(){return c.Ac(t),c.hc().save()})),c.Vb(1,"mat-icon"),c.Ic(2,"save"),c.Ub(),c.Ub()}if(2&t){const t=c.hc();c.Gb("spinner",t.loadingSave),c.nc("disabled",!t.rolAccessFormGroup.valid)}}function W(t,e){1&t&&(c.Vb(0,"span",16),c.Ic(1," (*)"),c.Ub())}function K(t,e){if(1&t&&(c.Ic(0," Puntos de Control "),c.Gc(1,W,2,0,"span",15)),2&t){const t=c.hc();c.Cb(1),c.nc("ngIf",null==t.rolAccessFormGroup.controls.lenghtPuntosControl?null:t.rolAccessFormGroup.controls.lenghtPuntosControl.errors)}}function z(t,e){1&t&&c.Rb(0)}function H(t,e){1&t&&(c.Vb(0,"span",16),c.Ic(1," (*)"),c.Ub())}function J(t,e){if(1&t&&(c.Ic(0," Personas "),c.Gc(1,H,2,0,"span",15)),2&t){const t=c.hc();c.Cb(1),c.nc("ngIf",null==t.rolAccessFormGroup.controls.lenghtPersonas?null:t.rolAccessFormGroup.controls.lenghtPersonas.errors)}}function Q(t,e){1&t&&c.Rb(0)}function Z(t,e){1&t&&(c.Vb(0,"mat-header-cell",38),c.Ic(1," Puntos De Control "),c.Ub())}function X(t,e){if(1&t&&(c.Tb(0),c.Ic(1),c.Sb()),2&t){const t=c.hc().$implicit;c.Cb(1),c.Kc(" ",t.nombre," ")}}function Y(t,e){if(1&t){const t=c.Wb();c.Vb(0,"mat-form-field",6),c.Vb(1,"input",41),c.dc("ngModelChange",(function(e){return c.Ac(t),c.hc().$implicit.nombre=e})),c.Ub(),c.Ub()}if(2&t){const t=c.hc().$implicit,e=c.hc(2);c.Fc("font-size",e.platformService.fontZize(),"rem")("width",100,"%"),c.Cb(1),c.nc("ngModel",t.nombre)}}function tt(t,e){if(1&t&&(c.Vb(0,"mat-cell"),c.Gc(1,X,2,1,"ng-container",39),c.Gc(2,Y,2,5,"ng-template",null,40,c.Hc),c.Ub()),2&t){const t=e.$implicit,o=c.xc(3);c.Cb(1),c.nc("ngIf",!t.editable)("ngIfElse",o)}}function et(t,e){1&t&&(c.Vb(0,"mat-header-cell",38),c.Ic(1," Departamentos "),c.Ub())}function ot(t,e){if(1&t&&(c.Tb(0),c.Ic(1),c.Sb()),2&t){const t=c.hc().$implicit;c.Cb(1),c.Kc(" ",null==t.departamento?null:t.departamento.nombre," ")}}function at(t,e){if(1&t){const t=c.Wb();c.Vb(0,"pca-autocomplete-departamento",43),c.dc("ngModelChange",(function(e){return c.Ac(t),c.hc().$implicit.departamento.id=e}))("departamentoSelected",(function(e){c.Ac(t);const o=c.hc().$implicit;return c.hc(2).departamentoSelected(e,o)})),c.Ub()}if(2&t){const t=c.hc().$implicit;c.Fc("width",100,"%"),c.nc("required",!0)("label","Departamento")("ngModel",t.departamento.id)}}function nt(t,e){if(1&t&&(c.Vb(0,"mat-cell"),c.Gc(1,ot,2,1,"ng-container",39),c.Gc(2,at,1,5,"ng-template",null,42,c.Hc),c.Ub()),2&t){const t=e.$implicit,o=c.xc(3);c.Cb(1),c.nc("ngIf",!t.editable)("ngIfElse",o)}}function rt(t,e){1&t&&(c.Vb(0,"mat-header-cell",44),c.Ic(1," \xc1rea "),c.Ub()),2&t&&c.nc("ngClass","mat-column-area")}function ct(t,e){if(1&t&&(c.Tb(0),c.Ic(1),c.Sb()),2&t){const t=c.hc().$implicit;c.Cb(1),c.Kc(" ",null==t.area?null:t.area.nombre," ")}}function it(t,e){if(1&t&&(c.Vb(0,"mat-option",49),c.Ic(1),c.Ub()),2&t){const t=e.$implicit;c.nc("value",t.id),c.Cb(1),c.Kc("",t.nombre," ")}}function st(t,e){if(1&t){const t=c.Wb();c.Vb(0,"mat-form-field",6),c.Vb(1,"mat-label"),c.Ic(2,"Area"),c.Ub(),c.Vb(3,"mat-select",47),c.dc("ngModelChange",(function(e){return c.Ac(t),c.hc().$implicit.areaId=e}))("valueChange",(function(e){c.Ac(t);const o=c.hc().$implicit;return c.hc(2).areaSelected(e,o)})),c.Gc(4,it,2,2,"mat-option",48),c.Ub(),c.Ub()}if(2&t){const t=c.hc().$implicit,e=c.hc(2);c.Fc("font-size",e.platformService.fontZize(),"rem")("width",100,"%"),c.Cb(3),c.nc("ngModel",t.areaId),c.Cb(1),c.nc("ngForOf",e.listArea)}}function lt(t,e){if(1&t&&(c.Vb(0,"mat-cell",45),c.Gc(1,ct,2,1,"ng-container",39),c.Gc(2,st,5,6,"ng-template",null,46,c.Hc),c.Ub()),2&t){const t=e.$implicit,o=c.xc(3);c.nc("ngClass","mat-column-area"),c.Cb(1),c.nc("ngIf",!t.editable)("ngIfElse",o)}}function bt(t,e){1&t&&(c.Vb(0,"mat-header-cell",44),c.Ic(1," Estado "),c.Ub()),2&t&&c.nc("ngClass","mat-column-estado")}function ut(t,e){if(1&t&&(c.Vb(0,"mat-cell",45),c.Ic(1),c.Ub()),2&t){const t=e.$implicit;c.nc("ngClass","mat-column-estado"),c.Cb(1),c.Kc(" ",t.estado," ")}}function dt(t,e){1&t&&(c.Vb(0,"mat-header-cell",44),c.Ic(1," Acciones "),c.Ub()),2&t&&c.nc("ngClass","mat-column-eliminar")}function mt(t,e){if(1&t){const t=c.Wb();c.Tb(0),c.Vb(1,"mat-icon",53),c.dc("click",(function(){c.Ac(t);const e=c.hc().$implicit;return c.hc(2).removePuntoControlItem(e.id)})),c.Ic(2,"delete"),c.Ub(),c.Sb()}}function ht(t,e){if(1&t){const t=c.Wb();c.Vb(0,"mat-icon",54),c.dc("click",(function(){c.Ac(t);const e=c.hc().$implicit;return c.hc(2).cancelEditarPuntoControl(e)})),c.Ic(1,"close"),c.Ub()}}function pt(t,e){if(1&t){const t=c.Wb();c.Vb(0,"mat-cell",50),c.Vb(1,"mat-icon",51),c.dc("click",(function(){c.Ac(t);const o=e.$implicit;return c.hc(2).editarOrSavePuntoControl(o)})),c.Ic(2),c.Ub(),c.Gc(3,mt,3,0,"ng-container",39),c.Gc(4,ht,2,0,"ng-template",null,52,c.Hc),c.Ub()}if(2&t){const t=e.$implicit,o=c.xc(5);c.nc("ngClass","mat-column-eliminar"),c.Cb(1),c.nc("matTooltip",t.title),c.Cb(1),c.Jc(t.icon||"edit"),c.Cb(1),c.nc("ngIf",!t.editable)("ngIfElse",o)}}function ft(t,e){1&t&&c.Qb(0,"mat-header-row")}const gt=function(t){return{"spinner-container spinner":t}};function Ct(t,e){1&t&&c.Qb(0,"mat-row",45),2&t&&c.nc("ngClass",c.rc(1,gt,e.$implicit.loadingRow))}const St=function(){return[10,25,50,100]};function vt(t,e){if(1&t){const t=c.Wb();c.Vb(0,"div",17),c.Vb(1,"div",18),c.Vb(2,"pca-autocomplete-punto-control",19),c.dc("puntoControlSelected",(function(e){return c.Ac(t),c.hc().selectPuntoControl(e)})),c.Ub(),c.Ub(),c.Vb(3,"div",20),c.Vb(4,"button",21),c.dc("click",(function(){c.Ac(t);const e=c.hc();return e.addPuntosControl(e.controlPuntoControl.value)})),c.Ic(5,"Agregar"),c.Ub(),c.Ub(),c.Ub(),c.Vb(6,"div",22),c.Vb(7,"mat-table",23,24),c.Tb(9,25),c.Gc(10,Z,2,0,"mat-header-cell",26),c.Gc(11,tt,4,2,"mat-cell",27),c.Sb(),c.Tb(12,28),c.Gc(13,et,2,0,"mat-header-cell",26),c.Gc(14,nt,4,2,"mat-cell",27),c.Sb(),c.Tb(15,29),c.Gc(16,rt,2,1,"mat-header-cell",30),c.Gc(17,lt,4,3,"mat-cell",31),c.Sb(),c.Tb(18,32),c.Gc(19,bt,2,1,"mat-header-cell",30),c.Gc(20,ut,2,2,"mat-cell",31),c.Sb(),c.Tb(21,33),c.Gc(22,dt,2,1,"mat-header-cell",30),c.Gc(23,pt,6,5,"mat-cell",34),c.Sb(),c.Gc(24,ft,1,0,"mat-header-row",35),c.Gc(25,Ct,1,3,"mat-row",36),c.Ub(),c.Qb(26,"mat-paginator",37),c.Ub()}if(2&t){const t=c.hc();c.Cb(2),c.nc("formControl",t.controlPuntoControl)("errorMessage",t.rolAccessFormGroup.controls.lenghtPuntosControl.errorMessage),c.Cb(5),c.nc("dataSource",t.dataSourcePuntoControl),c.Cb(17),c.nc("matHeaderRowDef",t.displayedColumnsPuntosControl),c.Cb(1),c.nc("matRowDefColumns",t.displayedColumnsPuntosControl),c.Cb(1),c.nc("pageSizeOptions",c.qc(6,St))}}function It(t,e){1&t&&(c.Vb(0,"mat-header-cell",44),c.Ic(1," Documento "),c.Ub()),2&t&&c.nc("ngClass","mat-column-dni")}function At(t,e){if(1&t&&(c.Vb(0,"mat-cell",50),c.Ic(1),c.Ub()),2&t){const t=e.$implicit;c.nc("ngClass","mat-column-dni"),c.Cb(1),c.Kc(" ",t.dni," ")}}function Pt(t,e){1&t&&(c.Vb(0,"mat-header-cell",38),c.Ic(1," Trabajador "),c.Ub())}function Tt(t,e){if(1&t&&(c.Vb(0,"mat-cell"),c.Ic(1),c.Ub()),2&t){const t=e.$implicit;c.Cb(1),c.Kc(" ",t.fullName()," ")}}function $t(t,e){1&t&&(c.Vb(0,"mat-header-cell",44),c.Ic(1," Departamento "),c.Ub()),2&t&&c.nc("ngClass","mat-column-departamento")}function Ot(t,e){if(1&t&&(c.Vb(0,"mat-cell",45),c.Ic(1),c.Ub()),2&t){const t=e.$implicit;c.nc("ngClass","mat-column-departamento"),c.Cb(1),c.Kc(" ",t.departamento||t.Departamento," ")}}function jt(t,e){1&t&&(c.Vb(0,"mat-header-cell",44),c.Ic(1," Fecha Ingreso "),c.Ub()),2&t&&c.nc("ngClass","mat-column-fechaingreso")}function Ut(t,e){if(1&t&&(c.Vb(0,"mat-cell",45),c.Ic(1),c.ic(2,"date"),c.Ub()),2&t){const t=e.$implicit;c.nc("ngClass","mat-column-fechaingreso"),c.Cb(1),c.Kc(" ",c.kc(2,2,t.FechaIngreso,"dd/MM/yyyy")," ")}}function Rt(t,e){1&t&&(c.Vb(0,"mat-header-cell",44),c.Ic(1," Estado "),c.Ub()),2&t&&c.nc("ngClass","mat-column-estado")}function Vt(t,e){if(1&t&&(c.Vb(0,"mat-cell",45),c.Ic(1),c.Ub()),2&t){const t=e.$implicit;c.nc("ngClass","mat-column-estado"),c.Cb(1),c.Kc(" ",t.Estado," ")}}function wt(t,e){1&t&&(c.Vb(0,"mat-header-cell",44),c.Ic(1," Eliminar "),c.Ub()),2&t&&c.nc("ngClass","mat-column-eliminar")}function Gt(t,e){if(1&t){const t=c.Wb();c.Vb(0,"mat-cell",50),c.Vb(1,"mat-icon",53),c.dc("click",(function(){c.Ac(t);const o=e.$implicit;return c.hc(2).removePersonaItem(o.trab_id)})),c.Ic(2,"delete"),c.Ub(),c.Ub()}2&t&&c.nc("ngClass","mat-column-eliminar")}function Dt(t,e){1&t&&c.Qb(0,"mat-header-row")}function yt(t,e){1&t&&c.Qb(0,"mat-row")}function Mt(t,e){if(1&t){const t=c.Wb();c.Vb(0,"div",17),c.Vb(1,"div",18),c.Vb(2,"pca-autocomplete-trabajador",55),c.dc("trabajadorSelected",(function(e){return c.Ac(t),c.hc().selectTrabajador(e)})),c.Ub(),c.Ub(),c.Vb(3,"div",20),c.Vb(4,"button",21),c.dc("click",(function(){c.Ac(t);const e=c.hc();return e.addPersonas(e.controlTrabajdor.value)})),c.Ic(5,"Agregar"),c.Ub(),c.Ub(),c.Ub(),c.Vb(6,"div",22),c.Vb(7,"mat-table",23,56),c.Tb(9,57),c.Gc(10,It,2,1,"mat-header-cell",30),c.Gc(11,At,2,2,"mat-cell",34),c.Sb(),c.Tb(12,58),c.Gc(13,Pt,2,0,"mat-header-cell",26),c.Gc(14,Tt,2,1,"mat-cell",27),c.Sb(),c.Tb(15,59),c.Gc(16,$t,2,1,"mat-header-cell",30),c.Gc(17,Ot,2,2,"mat-cell",31),c.Sb(),c.Tb(18,60),c.Gc(19,jt,2,1,"mat-header-cell",30),c.Gc(20,Ut,3,5,"mat-cell",31),c.Sb(),c.Tb(21,61),c.Gc(22,Rt,2,1,"mat-header-cell",30),c.Gc(23,Vt,2,2,"mat-cell",31),c.Sb(),c.Tb(24,33),c.Gc(25,wt,2,1,"mat-header-cell",30),c.Gc(26,Gt,3,1,"mat-cell",34),c.Sb(),c.Gc(27,Dt,1,0,"mat-header-row",35),c.Gc(28,yt,1,0,"mat-row",62),c.Ub(),c.Qb(29,"mat-paginator",37),c.Qb(30,"br"),c.Ub()}if(2&t){const t=c.hc();c.Cb(2),c.nc("formControl",t.controlTrabajdor)("errorMessage",t.rolAccessFormGroup.controls.lenghtPersonas.errorMessage),c.Cb(5),c.nc("dataSource",t.dataSourcePersonas),c.Cb(20),c.nc("matHeaderRowDef",t.displayedColumnsPersonas),c.Cb(1),c.nc("matRowDefColumns",t.displayedColumnsPersonas),c.Cb(1),c.nc("pageSizeOptions",c.qc(6,St))}}let xt=(()=>{class t{constructor(t,e,o,a,n,i,l,b,u,d){this.formBuilder=t,this.dialogRef=e,this.alertModalService=o,this.data=a,this.caPuntoControlService=n,this.caTrabajadorService=i,this.caRolAccesoService=l,this.platformService=b,this.caAreaService=u,this.appSettings=d,this.paginator=new c.E,this.sort=new c.E,this.unsubscribe$=new s.a,this.puntosControl=[],this.loadingPuntosControl=!1,this.personas=[],this.loadingPersonas=!1,this.loadingSave=!1,this.displayedColumnsPuntosControl=h,this.dataSourcePuntoControl=new m.k([]),this.displayedColumnsPersonas=p,this.dataSourcePersonas=new m.k([]),this.controlTrabajdor=new r.f,this.controlPuntoControl=new r.f,this.listArea=[],this.tempModelChanged={}}ngOnInit(){this.rolAccessFormGroup=this.formBuilder.formGroup(new C),this.data&&this.data.id?this.obtenerRolAccesoById(this.data.id):(this.tituloForm="Registrar Rol de Acceso",this.obtenerPuntosControl(),this.obtenerPersonas()),this.obtenerAreas()}obtenerAreas(){this.caAreaService.obtenerAreasList().pipe(Object(u.a)(this.unsubscribe$)).subscribe(t=>{this.listArea=t})}settingTablePuntosControl(){this.dataSourcePuntoControl.paginator=this.paginator.toArray()[0],this.dataSourcePuntoControl.sort=this.sort.toArray()[0]}settingTablePersona(){this.dataSourcePersonas.paginator=this.paginator.toArray()[1],this.dataSourcePersonas.sort=this.sort.toArray()[1]}ngAfterViewInit(){this.settingTablePuntosControl(),this.settingTablePersona()}ngOnDestroy(){this.unsubscribe$.complete(),this.unsubscribe$.unsubscribe()}selectPuntoControl(t){this.puntoControlSelected=t||null}selectTrabajador(t){this.trabajadorSelected=t||null}addPuntosControl(t){if(t){const t=this.puntoControlSelected;if(!this.dataSourcePuntoControl.data.some(e=>e.id===t.id)){const e=[...this.dataSourcePuntoControl.data,v.a.formatRequestPuntoControlById(t)];this.rolAccessFormGroup.get("puntosControl").setValue(e.map(t=>({id:t.id}))),this.rolAccessFormGroup.get("lenghtPuntosControl").setValue(e.length),this.dataSourcePuntoControl.data=e,this.controlPuntoControl.setValue(null),this.puntoControlSelected=null}}}removePuntoControlItem(t){if(t){const e=this.dataSourcePuntoControl.data.filter(e=>e.id!==t),o=e.map(t=>({id:t.id}));this.dataSourcePuntoControl.data=e,this.rolAccessFormGroup.get("puntosControl").setValue(o),this.rolAccessFormGroup.get("lenghtPuntosControl").setValue(e.length)}}addPersonas(t){if(t){const t=new d(this.trabajadorSelected);if(!this.dataSourcePersonas.data.some(e=>e.trab_id===t.trab_id)){const e=[...this.dataSourcePersonas.data,t],o=e.map(t=>({set_id:t.set_id,trab_id:t.trab_id}));this.rolAccessFormGroup.get("trabajadores").setValue(o),this.rolAccessFormGroup.get("lenghtPersonas").setValue(e.length),this.dataSourcePersonas.data=e,this.controlTrabajdor.setValue(null),this.trabajadorSelected=null}}}removePersonaItem(t){if(t){const e=this.dataSourcePersonas.data.filter(e=>e.trab_id!==t),o=e.map(t=>({set_id:t.set_id,trab_id:t.trab_id}));this.dataSourcePersonas.data=e,this.rolAccessFormGroup.get("trabajadores").setValue(o),this.rolAccessFormGroup.get("lenghtPersonas").setValue(e.length)}}obtenerPuntosControl(){this.puntosControl=[],this.loadingPuntosControl=!0,this.caPuntoControlService.getListPuntoControlByUnidadProduccion().pipe(Object(u.a)(this.unsubscribe$)).subscribe(t=>{if(this.loadingPuntosControl=!1,t.length>0&&(this.puntosControl=v.a.formatRequestPuntoControlByIdList(t)),this.rolAccessFormGroup.get("id").value){const t=this.rolAccessFormGroup.get("puntosControl").value;this.dataSourcePuntoControl.data=this.puntosControl.filter(e=>t.some(t=>t.id===e.id))}})}obtenerPersonas(){this.personas=[];const t=this.rolAccessFormGroup.get("trabajadores").value.map(t=>t.LIB_ELEC);this.loadingPersonas=!0,this.caTrabajadorService.consultaMasivamenteDnisTrabajador(t,this.appSettings.isIntranet?"":this.appSettings.proveedorId).pipe(Object(u.a)(this.unsubscribe$)).subscribe(t=>{this.loadingPersonas=!1,t.length>0&&(this.dataSourcePersonas.data=t.map(t=>new d(t)))})}obtenerRolAccesoById(t){this.loadingPuntosControl=!0,this.loadingPersonas=!0,this.caRolAccesoService.obtenerRolesAccesoById(t).pipe(Object(u.a)(this.unsubscribe$)).subscribe(t=>{this.tituloForm="Modificar Rol de Acceso",this.rolAccessFormGroup=this.formBuilder.formGroup(new C(t)),this.obtenerPuntosControl(),this.obtenerPersonas()})}save(){this.loadingSave=!0,this.caRolAccesoService.upsertRolesAcceso(this.rolAccessFormGroup.value).pipe(Object(u.a)(this.unsubscribe$)).subscribe(t=>{this.loadingSave=!1,t&&(this.dialogRef.close(!0),this.alertModalService.alert(S.a.success,"Registro guardado"))})}trackByFn(t,e){return e.id}editarOrSavePuntoControl(t){if("save"===t.icon)t.loadingRow=!0,this.caPuntoControlService.editPuntoControl(t).pipe(Object(u.a)(this.unsubscribe$)).subscribe(e=>{t.loadingRow=!1,e&&(t.editable=!1,t.icon="edit",this.tempModelChanged={},this.alertModalService.alert(S.a.success,"Registro guardado"))});else{if(this.tempModelChanged&&this.tempModelChanged.id)return void this.alertModalService.alert(S.a.warning,`Termine de modificar el punto de control: "${this.tempModelChanged.nombre}"`);t.editable=!t.editable,t.editable?(Object.assign(this.tempModelChanged,t),t.icon="save"):t.icon="edit"}}cancelEditarPuntoControl(t){t.editable=!1,t.icon="edit",Object.assign(t,this.tempModelChanged),this.tempModelChanged={}}departamentoSelected(t,e){e.departamento=t}areaSelected(t,e){e.area=this.listArea.find(e=>e.id==t)}}return t.\u0275fac=function(e){return new(e||t)(c.Pb(g.a),c.Pb(i.g),c.Pb(I.a),c.Pb(i.a),c.Pb(A.a),c.Pb(P.a),c.Pb(R),c.Pb(V.a),c.Pb(w.a),c.Pb(U.a))},t.\u0275cmp=c.Jb({type:t,selectors:[["pca-rol-acceso-forms"]],viewQuery:function(t,e){var o;1&t&&(c.Nc(l.a,!0),c.Nc(b.a,!0)),2&t&&(c.wc(o=c.ec())&&(e.paginator=o),c.wc(o=c.ec())&&(e.sort=o))},decls:27,vars:5,consts:[["mat-dialog-title",""],["layout","row","align","start"],[1,"form-button-row"],["mat-flat-button","","matTooltip","GUARDAR","class","button-amarillo",3,"spinner","disabled","click",4,"ngIf"],["mat-flat-button","","mat-dialog-close","","matTooltip","CERRAR"],[1,"mat-typography",3,"formGroup"],["appearance","outline"],["matInput","","formControlName","nombre","name","nombre","placeholder","Nombre del rol"],["input",""],["mat-align-tabs","start"],["mat-tab-label",""],[4,"ngTemplateOutlet"],["blockPuntosControl",""],["blockPersonas",""],["mat-flat-button","","matTooltip","GUARDAR",1,"button-amarillo",3,"disabled","click"],["class","form-text text-danger",4,"ngIf"],[1,"form-text","text-danger"],[1,"row","my-3"],[1,"col-md-6"],[3,"formControl","errorMessage","puntoControlSelected"],[1,"col-md-5"],["mat-flat-button","",1,"button-amarillo","btn-flex-custom",3,"click"],[1,"mat-elevation-z8"],["matSort","",3,"dataSource"],["sortPuntoControl","matSort"],["matColumnDef","nombre"],["mat-sort-header","",4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","departamento.nombre"],["matColumnDef","area.nombre"],["mat-sort-header","",3,"ngClass",4,"matHeaderCellDef"],[3,"ngClass",4,"matCellDef"],["matColumnDef","estado"],["matColumnDef","action"],["class","text-center",3,"ngClass",4,"matCellDef"],[4,"matHeaderRowDef"],[3,"ngClass",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","",3,"pageSizeOptions"],["mat-sort-header",""],[4,"ngIf","ngIfElse"],["templateNombre",""],["matInput","",3,"ngModel","ngModelChange"],["templateDepartamento",""],[3,"required","label","ngModel","ngModelChange","departamentoSelected"],["mat-sort-header","",3,"ngClass"],[3,"ngClass"],["templateArea",""],[3,"ngModel","ngModelChange","valueChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"text-center",3,"ngClass"],[1,"table-btn-editar",3,"matTooltip","click"],["templateAction",""],["matTooltip","Eliminar",1,"table-btn-delete",3,"click"],["matTooltip","Cancelar",1,"table-btn-delete",3,"click"],[3,"formControl","errorMessage","trabajadorSelected"],["sortPersonas","matSort"],["matColumnDef","dni"],["matColumnDef","fullName"],["matColumnDef","Departamento"],["matColumnDef","FechaIngreso"],["matColumnDef","Estado"],[4,"matRowDef","matRowDefColumns"]],template:function(t,e){if(1&t&&(c.Vb(0,"h2",0),c.Ic(1),c.Ub(),c.Qb(2,"mat-divider"),c.Vb(3,"mat-dialog-actions",1),c.Vb(4,"div",2),c.Gc(5,q,3,3,"button",3),c.Vb(6,"button",4),c.Vb(7,"mat-icon"),c.Ic(8,"arrow_back"),c.Ub(),c.Ub(),c.Ub(),c.Ub(),c.Qb(9,"br"),c.Vb(10,"mat-dialog-content",5),c.Vb(11,"mat-form-field",6),c.Vb(12,"mat-label"),c.Ic(13,"Rol de acceso *"),c.Ub(),c.Qb(14,"input",7,8),c.Ub(),c.Vb(16,"mat-tab-group",9),c.Vb(17,"mat-tab"),c.Gc(18,K,2,1,"ng-template",10),c.Gc(19,z,1,0,"ng-container",11),c.Ub(),c.Vb(20,"mat-tab"),c.Gc(21,J,2,1,"ng-template",10),c.Gc(22,Q,1,0,"ng-container",11),c.Ub(),c.Ub(),c.Ub(),c.Gc(23,vt,27,7,"ng-template",null,12,c.Hc),c.Gc(25,Mt,31,7,"ng-template",null,13,c.Hc)),2&t){const t=c.xc(24),a=c.xc(26);var o;const n="Inactivo"!=(null==(o=e.rolAccessFormGroup.get("estado"))?null:o.value);c.Cb(1),c.Jc(e.tituloForm),c.Cb(4),c.nc("ngIf",n),c.Cb(5),c.nc("formGroup",e.rolAccessFormGroup),c.Cb(9),c.nc("ngTemplateOutlet",t),c.Cb(3),c.nc("ngTemplateOutlet",a)}},directives:[i.h,G.a,i.c,a.m,D.b,i.d,y.a,M.a,i.e,r.q,r.j,g.g,x.b,x.f,F.b,r.c,r.p,r.h,g.k,g.h,B.b,B.a,B.c,a.r,E.a,r.g,m.j,b.a,m.c,m.e,m.b,m.g,m.i,l.a,m.d,b.b,m.a,r.s,_.a,r.u,a.k,L.a,a.l,k.o,m.f,m.h,N.a],pipes:[a.e],styles:[".form-container[_ngcontent-%COMP%]   .mat-form-field[_ngcontent-%COMP%] + .mat-form-field[_ngcontent-%COMP%]{margin-left:8px}.form-button-row[_ngcontent-%COMP%]{display:table-cell;width:490px}.material-icons.md-10[_ngcontent-%COMP%]{font-size:16px;cursor:pointer!important;color:#d7a312}.mat-column-dni[_ngcontent-%COMP%]{max-width:75px}.mat-column-departamento[_ngcontent-%COMP%]{max-width:120px}.mat-column-fechaingreso[_ngcontent-%COMP%]{max-width:75px}.mat-column-estado[_ngcontent-%COMP%]{max-width:65px}.mat-column-area[_ngcontent-%COMP%]{max-width:100px}.mat-column-eliminar[_ngcontent-%COMP%]{max-width:65px}"]}),t})();const Ft=["nombre","estado","operadorCreador","fechaCreacion","action"];var Bt=o("lF1m"),Et=o("Xa2L");function _t(t,e){1&t&&(c.Vb(0,"mat-header-cell",16),c.Ic(1," Nombre "),c.Ub())}function Lt(t,e){if(1&t&&(c.Vb(0,"mat-cell"),c.Ic(1),c.Ub()),2&t){const t=e.$implicit;c.Cb(1),c.Kc(" ",t.nombre," ")}}function kt(t,e){1&t&&(c.Vb(0,"mat-header-cell",16),c.Ic(1," Estado "),c.Ub())}function Nt(t,e){if(1&t&&(c.Vb(0,"mat-cell"),c.Ic(1),c.Ub()),2&t){const t=e.$implicit;c.Cb(1),c.Kc(" ",t.estado," ")}}function qt(t,e){1&t&&(c.Vb(0,"mat-header-cell",16),c.Ic(1," Operador Creador "),c.Ub())}function Wt(t,e){if(1&t&&(c.Vb(0,"mat-cell"),c.Ic(1),c.Ub()),2&t){const t=e.$implicit;c.Cb(1),c.Kc(" ",t.operadorCreador," ")}}function Kt(t,e){1&t&&(c.Vb(0,"mat-header-cell",16),c.Ic(1," Fecha Creaci\xf3n "),c.Ub())}function zt(t,e){if(1&t&&(c.Vb(0,"mat-cell"),c.Ic(1),c.ic(2,"date"),c.Ub()),2&t){const t=e.$implicit;c.Cb(1),c.Kc(" ",c.kc(2,1,t.fechaCreacion,"dd/MM/yyyy")," ")}}function Ht(t,e){1&t&&(c.Vb(0,"mat-header-cell",16),c.Ic(1," Acci\xf3n "),c.Ub())}function Jt(t,e){if(1&t){const t=c.Wb();c.Vb(0,"mat-cell"),c.Vb(1,"mat-icon",17),c.dc("click",(function(){c.Ac(t);const o=e.$implicit;return c.hc().editarRolAcceso(o)})),c.Ic(2,"edit"),c.Ub(),c.Ic(3," \xa0\xa0\xa0\xa0 "),c.Vb(4,"mat-icon",18),c.dc("click",(function(){c.Ac(t);const o=e.$implicit;return c.hc().openConfirmDeleteRolAcceso(o)})),c.Ic(5,"loop"),c.Ub(),c.Ub()}}function Qt(t,e){1&t&&c.Qb(0,"mat-header-row")}function Zt(t,e){1&t&&c.Qb(0,"mat-row")}function Xt(t,e){1&t&&(c.Vb(0,"div",19),c.Qb(1,"mat-progress-spinner",20),c.Ub())}const Yt=function(){return[10,25,50,100]},te=[{path:"",component:(()=>{class t{constructor(t,e,o){this.dialog=t,this.alerModalService=e,this.caRolAccesoService=o,this.displayedColumns=Ft,this.dataSource=new m.k([]),this.loadingTable=!1,this.unsubscribe$=new s.a}ngOnInit(){this.obtenerRolAcceso()}settingTable(){this.dataSource.paginator=this.paginator,this.dataSource.sort=this.sort}ngAfterViewInit(){this.settingTable()}ngOnDestroy(){this.unsubscribe$.complete(),this.unsubscribe$.unsubscribe()}refreshTable(){this.obtenerRolAcceso()}openFormsLocation(){this.dialog.open(xt,{width:"900px",height:"80vh",disableClose:!0}).afterClosed().pipe(Object(u.a)(this.unsubscribe$)).subscribe(t=>{t&&this.refreshTable()})}obtenerRolAcceso(){this.dataSource.data=[],this.loadingTable=!0,this.caRolAccesoService.obtenerRolesAcceso().pipe(Object(u.a)(this.unsubscribe$)).subscribe(t=>{this.loadingTable=!1,t.length>0&&(this.dataSource.data=t.map(t=>new C(t)))})}editarRolAcceso(t){this.dialog.open(xt,{data:{id:t.id},width:"950px",height:"80vh",disableClose:!0}).afterClosed().pipe(Object(u.a)(this.unsubscribe$)).subscribe(t=>{t&&this.refreshTable()})}openConfirmDeleteRolAcceso(t){const e=["inactivar","activar","inactivado","activado"];this.dialog.open(Bt.a,{data:`\xbfEst\xe1 seguro que desea ${"Activo"===t.estado?e[0]:e[1]} el elemento ${t.nombre}?`}).afterClosed().pipe(Object(u.a)(this.unsubscribe$)).subscribe(o=>{o&&this.cambiarEstadoRolAcceso(t.id,!("Activo"===t.estado),`El elemento ${t.nombre} fue ${"Activo"===t.estado?e[2]:e[3]} con \xe9xito.`)})}cambiarEstadoRolAcceso(t,e,o){this.caRolAccesoService.cambiarEstado(t,e).pipe(Object(u.a)(this.unsubscribe$)).subscribe(t=>{t&&(this.alerModalService.alert(S.a.success,o),this.refreshTable())})}}return t.\u0275fac=function(e){return new(e||t)(c.Pb(i.b),c.Pb(I.a),c.Pb(R))},t.\u0275cmp=c.Jb({type:t,selectors:[["pca-rol-acceso-list"]],viewQuery:function(t,e){var o;1&t&&(c.Nc(l.a,!0),c.Ec(b.a,!0)),2&t&&(c.wc(o=c.ec())&&(e.paginator=o.first),c.wc(o=c.ec())&&(e.sort=o.first))},decls:32,vars:6,consts:[[1,"example-button-row"],["mat-flat-button","","matTooltip","AGREGAR",1,"button-amarillo",3,"click"],["mat-flat-button","","matTooltip","REFRESCAR",1,"button-amarillo",3,"click"],[1,"mat-elevation-z8"],["matSort","",3,"dataSource"],["matColumnDef","nombre"],["mat-sort-header","",4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","estado"],["matColumnDef","operadorCreador"],["matColumnDef","fechaCreacion"],["matColumnDef","action"],[4,"matHeaderRowDef"],[4,"matRowDef","matRowDefColumns"],["class","container-spinner-loading",4,"ngIf"],["showFirstLastButtons","",3,"pageSizeOptions"],["mat-sort-header",""],["matTooltip","Editar",1,"table-btn-editar",3,"click"],["matTooltip","Cambiar Estado",1,"table-btn-editar",3,"click"],[1,"container-spinner-loading"],["color","primary","mode","indeterminate"]],template:function(t,e){1&t&&(c.Vb(0,"h2"),c.Ic(1,"ROL DE ACCESO"),c.Ub(),c.Vb(2,"section"),c.Vb(3,"div",0),c.Vb(4,"button",1),c.dc("click",(function(){return e.openFormsLocation()})),c.Vb(5,"mat-icon"),c.Ic(6,"add"),c.Ub(),c.Ub(),c.Vb(7,"button",2),c.dc("click",(function(){return e.refreshTable()})),c.Vb(8,"mat-icon"),c.Ic(9,"refresh"),c.Ub(),c.Ub(),c.Ub(),c.Ub(),c.Qb(10,"br"),c.Vb(11,"div",3),c.Vb(12,"mat-table",4),c.Tb(13,5),c.Gc(14,_t,2,0,"mat-header-cell",6),c.Gc(15,Lt,2,1,"mat-cell",7),c.Sb(),c.Tb(16,8),c.Gc(17,kt,2,0,"mat-header-cell",6),c.Gc(18,Nt,2,1,"mat-cell",7),c.Sb(),c.Tb(19,9),c.Gc(20,qt,2,0,"mat-header-cell",6),c.Gc(21,Wt,2,1,"mat-cell",7),c.Sb(),c.Tb(22,10),c.Gc(23,Kt,2,0,"mat-header-cell",6),c.Gc(24,zt,3,4,"mat-cell",7),c.Sb(),c.Tb(25,11),c.Gc(26,Ht,2,0,"mat-header-cell",6),c.Gc(27,Jt,6,0,"mat-cell",7),c.Sb(),c.Gc(28,Qt,1,0,"mat-header-row",12),c.Gc(29,Zt,1,0,"mat-row",13),c.Ub(),c.Gc(30,Xt,2,0,"div",14),c.Qb(31,"mat-paginator",15),c.Ub()),2&t&&(c.Cb(12),c.nc("dataSource",e.dataSource),c.Cb(16),c.nc("matHeaderRowDef",e.displayedColumns),c.Cb(1),c.nc("matRowDefColumns",e.displayedColumns),c.Cb(1),c.nc("ngIf",e.loadingTable),c.Cb(1),c.nc("pageSizeOptions",c.qc(5,Yt)))},directives:[D.b,y.a,M.a,m.j,b.a,m.c,m.e,m.b,m.g,m.i,a.m,l.a,m.d,b.b,m.a,m.f,m.h,Et.a],pipes:[a.e],styles:[""]}),t})()}];let ee=(()=>{class t{}return t.\u0275mod=c.Nb({type:t}),t.\u0275inj=c.Mb({factory:function(e){return new(e||t)},imports:[[n.d.forChild(te)],n.d]}),t})();var oe=o("PCNd"),ae=o("xf9H"),ne=o("fawr");let re=(()=>{class t{}return t.\u0275mod=c.Nb({type:t}),t.\u0275inj=c.Mb({factory:function(e){return new(e||t)},imports:[[a.c,ne.a,ae.a,oe.a,ee,r.k,r.t,g.b]]}),t})()}}]);