1import{a as gt}from"./chunk-PCDIGETG.js";import{a as vt}from"./chunk-LMQLWP4J.js";import"./chunk-D7CSGGKA.js";import{E as N,Q as mt,R as pt,S as dt,T as ut,U as _t,V as ft,W as xt,X as bt,Y as Ct,Z as ht,_ as yt,ha as j}from"./chunk-XWCILSXL.js";import{b as B}from"./chunk-KMO2SKTA.js";import{G as H}from"./chunk-WMMRZPGK.js";import{Fb as rt,Ia as lt,Ja as G,Jb as ct,sc as st}from"./chunk-5BJ42Y74.js";import"./chunk-CARY4E7O.js";import{c as U}from"./chunk-7XPRGPV7.js";import"./chunk-EFW3BGGJ.js";import{$b as T,Cc as I,Db as Z,Dd as $,Ec as O,Ic as p,Ja as v,Jc as f,Ka as w,Kc as L,Lb as d,Lc as nt,Mb as tt,Nb as u,Tb as _,Va as Y,Vb as V,Wb as Q,Xb as A,Yb as c,Zb as r,_b as D,ac as M,bc as et,cc as S,f as X,fa as J,fc as g,hc as o,kc as it,pc as P,pd as k,qc as F,rc as R,sb as l,tb as x,tc as m,uc as b,vc as C,wd as at,xa as W,xd as ot,ya as E}from"./chunk-XMTQZB5P.js";import"./chunk-DLDOR3YA.js";var h=function(t){return t.text="text",t.date="date",t.time="time",t.amount="amount",t.button="button",t}(h||{}),K=function(t){return t.edit="ic-btn-edit",t.delete="ic-btn-delete",t.other="ic-btn-other",t}(K||{});var q=function(t){return t.edit="edit",t.delete="delete",t.default="action",t}(q||{});var Pt=t=>({"me-2":t});function Ft(t,s){if(t&1&&(c(0,"mat-header-cell"),m(1),p(2,"translate"),r()),t&2){let e=o().$index,i=o();l(),b(f(2,1,i.tableHeader[e].value))}}function Rt(t,s){if(t&1&&(c(0,"p",8),m(1),p(2,"date"),r()),t&2){let e=o().$implicit,i=o(),n=i.$implicit,a=i.$index;l(),C(" ",L(2,1,e[a][n],"shortDate")," ")}}function It(t,s){if(t&1&&(c(0,"p",8),m(1),p(2,"date"),r()),t&2){let e=o().$implicit,i=o(),n=i.$implicit,a=i.$index;l(),C(" ",L(2,1,e[a][n],"h:mm a")," ")}}function Ot(t,s){if(t&1&&(c(0,"p",8),m(1),p(2,"number"),r()),t&2){let e=o().$implicit,i=o(),n=i.$implicit,a=i.$index;l(),C(" $",nt(2,1,e[a][n],"1.0-0","en-US")," ")}}function kt(t,s){if(t&1&&(c(0,"mat-icon",12),m(1),r()),t&2){let e=o(2).$implicit;u("ngClass",O(2,Pt,e==null?null:e.text)),l(),b(e.icon)}}function $t(t,s){if(t&1){let e=S();c(0,"button",11),g("click",function(){v(e);let n=o().$implicit,a=o(4);return w(a.sendEvent(n==null?null:n.action,n==null?null:n.data))}),d(1,kt,2,4,"mat-icon",12),m(2),p(3,"translate"),r()}if(t&2){let e=o().$implicit;u("ngClass",e.class),l(),_(1,e!=null&&e.icon?1:-1),l(),C(" ",f(3,3,e==null?null:e.text)," ")}}function Ut(t,s){if(t&1&&d(0,$t,4,5,"button",10),t&2){let e=s.$implicit;_(0,e.displayButton?0:-1)}}function Bt(t,s){if(t&1&&(c(0,"div",9),Q(1,Ut,1,1,null,null,V),r()),t&2){let e=o().$implicit,i=o().$index;l(),A(e[i]==null?null:e[i].buttons)}}function Ht(t,s){if(t&1&&(c(0,"p",8),m(1),r()),t&2){let e=o().$implicit,i=o(),n=i.$implicit,a=i.$index;l(),C(" ",e[a][n]," ")}}function Nt(t,s){if(t&1&&(c(0,"mat-cell"),p(1,"translate"),d(2,Rt,3,4)(3,It,3,4)(4,Ot,3,5)(5,Bt,3,0)(6,Ht,2,1),r()),t&2){let e,i=s.$implicit,n=o().$index,a=o();tt("data-label",f(1,2,a.tableHeader[n].value)),l(2),_(2,(e=i[n].type)==="date"?2:e==="time"?3:e==="amount"?4:e==="button"?5:6)}}function jt(t,s){if(t&1&&(T(0,2),d(1,Ft,3,3,"mat-header-cell",6)(2,Nt,7,4,"mat-cell",7),M()),t&2){let e=s.$implicit;it("matColumnDef",e)}}function zt(t,s){t&1&&D(0,"mat-header-row")}function Vt(t,s){t&1&&D(0,"mat-row")}var wt=(()=>{class t{constructor(e){this.viewportScroll=e,this.tableData=[],this.tableHeader=[],this.tableKeys=[],this.buttonEvent=new Y,this.page_size=10,this.page_number=1,this.sendEvent=(i,n)=>this.buttonEvent.emit({type:i,data:n})}ngOnInit(){this.dataSource=new yt(this.tableData)}ngAfterViewInit(){this.dataSource.paginator=this.paginator}getHeader(e){return"test"}getPage(e){this.page_size=e.pageSize,this.page_number=e.pageIndex+1,this.viewportScroll.scrollToPosition([0,0])}pageEvent(e){this.viewportScroll.scrollToPosition([0,0])}static{this.\u0275fac=function(i){return new(i||t)(x($))}}static{this.\u0275cmp=E({type:t,selectors:[["app-dynamic-table"]],viewQuery:function(i,n){if(i&1&&P(N,5),i&2){let a;F(a=R())&&(n.paginator=a.first)}},inputs:{tableCols:[W.None,"tableColumns","tableCols"],tableData:"tableData",tableHeader:"tableHeader",tableKeys:"tableKeys",classButton:"classButton"},outputs:{buttonEvent:"buttonEvent"},standalone:!0,features:[I],decls:7,vars:6,consts:[[1,"mat-elevation-z8"],["matSort","",1,"mt-3","w-full",3,"dataSource"],[3,"matColumnDef"],[4,"matHeaderRowDef"],[4,"matRowDef","matRowDefColumns"],[3,"page","pageSize","hidePageSize","showFirstLastButtons"],[4,"matHeaderCellDef"],[4,"matCellDef"],[1,"mb-0"],[1,"td-buttons"],["type","button",3,"ngClass"],["type","button",3,"click","ngClass"],[3,"ngClass"]],template:function(i,n){i&1&&(c(0,"div",0)(1,"mat-table",1),Q(2,jt,3,1,"ng-container",2,V),d(4,zt,1,0,"mat-header-row",3)(5,Vt,1,0,"mat-row",4),r(),c(6,"mat-paginator",5),g("page",function(y){return n.pageEvent(y)}),r()()),i&2&&(l(),u("dataSource",n.dataSource),l(),A(n.tableCols),l(2),u("matHeaderRowDef",n.tableCols),l(),u("matRowDefColumns",n.tableCols),l(),u("pageSize",n.page_size)("hidePageSize",!0)("showFirstLastButtons",!0))},dependencies:[j,B,N,mt,dt,xt,ut,pt,bt,_t,ft,Ct,ht,H,k,U,ot,at],styles:[".td-buttons[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;
1gap:10px;border:none;align-items:center}.ic-btn-other[_ngcontent-%COMP%]{padding:5px;margin-top:5px;border:2px solid #5bc500;background:none;color:#000;width:auto;height:30px;border-radius:5px;display:flex;align-items:center;justify-content:center;cursor:pointer}@media screen and (max-width: 600px){.ic-btn-other[_ngcontent-%COMP%]{height:35px!important;font-size:80%;font-weight:600}}.ic-btn-delete[_ngcontent-%COMP%]{padding:5px;margin-top:5px;background:#dc3545;color:#fff;width:auto;height:30px;border-radius:5px;display:flex;align-items:center;justify-content:center;cursor:pointer}@media screen and (max-width: 600px){.ic-btn-delete[_ngcontent-%COMP%]{height:35px!important;font-size:80%;font-weight:600}}.ic-btn-edit[_ngcontent-%COMP%]{padding:5px;margin-top:5px;background:#ffc107;color:#fff;width:auto;height:30px;border-radius:5px;display:flex;align-items:center;justify-content:center;cursor:pointer}@media screen and (max-width: 600px){.ic-btn-edit[_ngcontent-%COMP%]{height:35px!important;font-size:80%;font-weight:600}}@media (width <= 600px){.mat-mdc-table[_ngcontent-%COMP%]{border:0;vertical-align:middle}.mat-mdc-table[_ngcontent-%COMP%] caption[_ngcontent-%COMP%]{font-size:1em}.mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row[_ngcontent-%COMP%]{border-bottom:5px solid #ddd;display:block}.mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]{border-bottom:1px solid #ddd;display:block;font-size:14px;text-align:right;margin-right:10px}.mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]:before{content:attr(data-label);float:left;font-weight:700;font-size:.85em}.mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]:last-child{border-bottom:0}.mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]:first-child{padding-top:4%;margin-bottom:4%}mat-cell[_ngcontent-%COMP%]:first-of-type{padding-left:0}mat-header-row[_ngcontent-%COMP%]{display:none}mat-row[_ngcontent-%COMP%]:after{display:inline}}"]})}}return t})();var Qt=["fileUploadContainer"],At=t=>({"flex-col":t});function Lt(t,s){t&1&&(c(0,"div",1),D(1,"img",4),r())}function Gt(t,s){if(t&1){let e=S();c(0,"app-dynamic-table",9),g("buttonEvent",function(n){v(e);let a=o(3);return w(a.getEvent(n))}),r()}if(t&2){let e=o(3);u("tableData",e.tableData)("tableColumns",e.tableCols)("tableHeader",e.tableHeader)}}function Kt(t,s){if(t&1&&(c(0,"div",5)(1,"div",6)(2,"h1",7),m(3),p(4,"translate"),r(),d(5,Gt,1,3,"app-dynamic-table",8),r()()),t&2){let e=o(2);l(3),b(f(4,2,"REFUND.title")),l(2),_(5,e.tableData.length?5:-1)}}function qt(t,s){t&1&&(c(0,"div",10)(1,"div",11)(2,"mat-icon",12),m(3,"payments"),r(),c(4,"p",13),m(5),p(6,"translate"),r()()()),t&2&&(l(5),C(" ",f(6,1,"REFUND.withoutPayments")," "))}function Xt(t,s){if(t&1&&d(0,qt,7,3,"div",10),t&2){let e=o(2);_(0,e.displayTable?0:-1)}}function Jt(t,s){if(t&1&&d(0,Kt,6,4,"div",5)(1,Xt,1,1),t&2){let e=o();_(0,e.displayTable&&e.paymentsFound?0:1)}}function Wt(t,s){if(t&1){let e=S();c(0,"p",14),g("click",function(){v(e);let n=o();return w(n.back())}),c(1,"mat-icon"),m(2,"chevron_left"),r(),m(3),p(4,"translate"),r(),c(5,"div",15)(6,"p"),m(7),p(8,"translate"),r(),c(9,"span",16),m(10),p(11,"translate"),r()()}t&2&&(l(3),b(f(4,3,"GENERALS.back")),l(4),b(f(8,5,"REFUND.description")),l(3),b(f(11,7,"GENERALS.typesDocuments")))}var De=(()=>{class t{constructor(e,i,n,a,y,z){this.utilsService=e,this.alertService=i,this.viewportScroll=n,this.breakpointObserver=a,this.auth=y,this.metaService=z,this.tableData=[],this.tableCols=["concept","typePayment","amount","status","button"],this.tableHeader=[{key:"concept",value:"REFUND.table.1"},{key:"typePayment",value:"REFUND.table.2"},{key:"amount",value:"REFUND.table.3"},{key:"amount",value:"REFUND.table.4"},{key:"button",value:""}],this.displayTable=!0,this.isMobileDevice=!0,this.payments=[],this.paymentsFound=!1,this.loading=!0,this.destroy$=new X,this.breakpointObserver.observe([G.XSmall]).subscribe(Dt=>{this.isMobileDevice=!!Dt.breakpoints[G.XSmall]})}ngOnInit(){this.metaService.updateRobots("noindex, nofollow"),this.utilsService.isBrowser&&setTimeout(()=>{window.scrollTo(0,0)},100),this.auth.isLoggedIn()&&(this.idUser=this.auth.userId()??"",this.userEmail=this.auth.userEmail()??"",this.getPayments(this.idUser))}getPayments(e){this.utilsService.getPayments(e).pipe(J(this.destroy$)).subscribe({next:i=>{if(this.loading=!1,i.code==200&&i.result&&i.result.conceptos_pago&&i.result.conceptos_pago.length){this.paymentsFound=!0;let n=a=>a===0?"--":a===1?"Pendiente":a===2?"Rechazado":a===3?"Pagado":"--";for(let a of i.result.conceptos_pago)this.tableData.push([{type:h.text,concept:a.id_payment},{type:h.text,typePayment:a.tipo_pago},{type:h.amount,amount:+a.amount},{type:h.text,status:n(a.reembolso)},{type:h.button,buttons:[{text:"REFUND.textButton",class:K.other,action:q.default,displayButton:a.reembolso!=3,data:{concept:a.id_concepto,payment:a.id_payment,isNewConcept:a.nuevo_concepto,idCar:a.id_car}}]}])}},error:()=>{this.loading=!1}})}getEvent(e){this.displayTable=!1,this.componentRef=this.containerFileUpload.createComponent(gt);let i=this.componentRef.instance;i.minFiles=2,i.idUser=this.idUser,i.width=this.isMobileDevice?"90":"50",i.displayMaxFiles=!1,i.textButton="GENERALS.textUploadDocuments",i.acceptTypes="image/*, application/pdf",i.typesFilesAllowed.push("pdf"),i.idConcepto=e.data.isNewConcept?e.data.concept:e.data.payment,i.typeDocument="reembolso",i.userEmail=this.userEmail,i.idCar=e.data.idCar??"",this.utilsService.isBrowser&&setTimeout(()=>{window.scrollTo(0,0)},100),i.isUploadValid.subscribe(n=>{n&&(i.disableButtonUpload=!1)}),i.uploadsComplete.subscribe(n=>{if(n){let a={id_concepto:e.data.concept??null,id_payment:e.data.payment??null,nuevo_concepto:e.data.isNewConcept,reembolso:1};this.utilsService.updatePaymentStatus(a).subscribe(y=>{y&&y.code===200?this.alertService.success("Datos enviados correctamente, espera una respuesta").then(z=>{z.isConfirmed&&(this.componentRef.destroy(),this.displayTable=!0,this.tableData=[],this.loading=!0,this.getPayments(this.idUser),this.viewportScroll.scrollToPosition([0,0]))}):this.alertService.error("Ocurri\xF3 un error al enviar la informaci\xF3n, intente nuevamente")})}})}back(){this.componentRef.destroy(),this.displayTable=!0}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||t)(x(rt),x(st),x($),x(lt),x(vt),x(ct))}}static{this.\u0275cmp=E({type:t,selectors:[["app-refunds"]],viewQuery:function(i,n){if(i&1&&P(Qt,5,Z),i&2){let a;F(a=R())&&(n.containerFileUpload=a.first)}},standalone:!0,features:[I],decls:8,vars:5,consts:[["fileUploadContainer",""],[1,"flex","items-center","justify-center","my-5","ic-load"],[1,"container","px-4","sm:px-0","mx-auto","ic-container-files","mt-24","md:mt-8"],[1,"flex","flex-col","md:flex-row","items-start","md:items-center",3,"ngClass"],["src","assets/img/load_car.gif","alt","load","width","200px",1,"pb-4"],[1,"container","mx-auto","ic-content-payment","mt-[20%]","lg:mt-[10%]"],[1,"flex","justify-center","flex-col","flex-wrap","w-full"],[1,"text-center"],[3,"tableData","tableColumns","tableHeader"],[3,"buttonEvent","tableData","tableColumns","tableHeader"],[1,"container","mx-auto","mt-[20%]","lg:mt-[10%]","ic-container-notfound","h-80","flex","items-center","justify-center"],[1,"flex","items-center","flex-wrap","flex-col","text-center"],[1,"text-caranty-gray-200","scale-125"],[1,"max-sm:!text-base","text-lg","text-caranty-gray-200","font-semibold"],[1,"flex","items-center","text-caranty-primary","!m-0","cursor-pointer",3,"click"],[1,"text-justify","sm:text-center","ic-content-desc"],[1,"block","mt-4"]],template:function(i,n){i&1&&(d(0,Lt,2,0,"div",1)(1,Jt,2,1),T(2),c(3,"div",2)(4,"div",3),d(5,Wt,12,9),r(),et(6,null,0),r(),M()),i&2&&(_(0,n.loading?0:1),l(4),u("ngClass",O(3,At,n.isMobileDevice)),l(),_(5,n.displayTable?-1:5))},dependencies:[wt,H,k,U,j,B]})}}return t})();export{De as RefundsComponent};
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.