1import{a as B}from"./chunk-BLCRQHO6.js";import{e as k,g as T}from"./chunk-SB5L2XE4.js";import{D as O,c as M,g as F,l as N}from"./chunk-ICJV4PL6.js";import{a as V}from"./chunk-RIRGXRXY.js";import"./chunk-3GN2FC7K.js";import"./chunk-47CSRN7C.js";import"./chunk-SKH2MXBC.js";import{j as E,k as I,v as A}from"./chunk-BQLJE42W.js";import{$b as R,Db as v,Ib as f,Jb as s,Tb as a,Ub as b,Vb as S,Xa as l,Ya as x,Zb as h,_b as y,bc as w,da as g,ib as _,mb as m,na as p,oa as u,xb as r,yb as n,zb as C}from"./chunk-YE3BF7DR.js";import"./chunk-4IDNTCH7.js";function $(i,e){if(i&1&&(r(0,"div"),a(1),n()),i&2){let t=s().$implicit;l(),S(" ",t.value," ")}}function H(i,e){i&1&&(r(0,"div",14)(1,"span"),a(2,"Debes ingresar un valor"),n()())}function L(i,e){if(i&1){let t=v();r(0,"div")(1,"textarea",12),R("ngModelChange",function(o){p(t);let d=s().$implicit;return y(d.editvalue,o)||(d.editvalue=o),u(o)}),n(),_(2,H,3,0,"div",13),n()}if(i&2){let t=s().$implicit;l(),h("ngModel",t.editvalue),l(),m("ngIf",t.error)}}function W(i,e){if(i&1){let t=v();r(0,"div")(1,"button",15),f("click",function(){p(t);let o=s().$implicit,d=s();return u(d.edit(o))}),a(2," Editar "),n()()}}function j(i,e){if(i&1){let t=v();r(0,"div")(1,"button",15),f("click",function(){p(t);let o=s().$implicit,d=s();return u(d.save(o))}),a(2," Guardar "),n(),r(3,"button",15),f("click",function(){p(t);let o=s().$implicit,d=s();return u(d.cancel(o))}),a(4," Cancelar "),n()()}}function P(i,e){if(i&1&&(r(0,"tr")(1,"td"),a(2),n(),r(3,"td"),_(4,$,2,1,"div",10)(5,L,3,2,"div",10),n(),r(6,"td",11),_(7,W,3,0,"div",10)(8,j,5,0,"div",10),n()()),i&2){let t=e.$implicit;l(2),b(t.name),l(2),m("ngIf",!t.edit),l(),m("ngIf",t.edit),l(2),m("ngIf",!t.edit),l(),m("ngIf",t.edit)}}var D=class i{constructor(e,t){this.resourceService=e;this.helperService=t}values=[];ngOnInit(){this.activate()}activate(){this.resourceService.get({pageSize:500}).subscribe({next:e=>this.setResources(e),error:e=>this.helperService.handlerException(e)})}edit(e){for(var t=this.values.filter(o=>o.edit),c=0;c<t.length;c++)t[c].edit=!1;e.edit=!e.edit,e.editvalue=e.value}save(e){e.editvalue!==""?(e.value=e.editvalue,e.error=!1,e.edit=!e.edit,this.resourceService.update(e).subscribe()):e.error=!0}cancel(e){e.editvalue=e.value,e.edit=!e.edit,e.error=!1}setResources(e){this.values=e.results}trackByIndex(e,t){return e}static \u0275fac=function(t){return new(t||i)(x(B),x(V))};static \u0275cmp=g({type:i,selectors:[["app-admin-resources"]],standalone:!0,features:[w],decls:17,vars:2,consts:[[1,"admin-content"],[1,"section-tit"],["routerLink","/administrador",1,"btn-close"],[1,"icon-close"],[1,"content-table"],[1,"table-admin"],["width","30%"],["width","40%"],["width","30%",2,"text-align","right"],[4,"ngFor","ngForOf","ngForTrackBy"],[4,"ngIf"],[2,"text-align","right"],["nosune-admin-auto-height","","type","text","name","desc",2,"width","100%","border","1px solid #e7e7e7",3,"ngModelChange","ngModel"],["class","error",4,"ngIf"],[1,"error"],[1,"btn-save",2,"display","inline-block",3,"click"]],template:function(t,c){t&1&&(r(0,"div",0)(1,"h2",1),a(2,"Recursos del sistema"),n(),r(3,"a",2),C(4,"span",3),n(),r(5,"div",4)(6,"table",5)(7,"thead")(8,"tr")(9,"th",6),a(10,"Nombre"),n(),r(11,"th",7),a(12,"Valor"),n(),r(13,"th",8),a(14,"Acciones"),n()()(),r(15,"tbody"),_(16,P,9,5,"tr",9),n()()()()),t&2&&(l(16),m("ngForOf",c.values)("ngForTrackBy",c.trackByIndex))},dependencies:[A,E,I,T,k,O,M,F,N]})};export{D as AdminResourcesComponent};
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.