import{a as W,d as J,e as d}from"./chunk-FPULQHGC.js";import{b as U}from"./chunk-YYVE3SN6.js";import{b as B}from"./chunk-SPNVV2KO.js";import{n as q}from"./chunk-ZTKV4AIV.js";import{Ea as O,cb as z}from"./chunk-JIDGXFMJ.js";import{j as I}from"./chunk-YJYOGSOO.js";import{h as G}from"./chunk-73IMXZSJ.js";import{X as H}from"./chunk-KVTHJWZA.js";import{Ab as u,Bc as y,Ec as k,Hb as b,Ic as v,Jb as $,Jc as x,Nc as M,O as T,Ob as C,Sb as p,Tb as a,Ub as f,Xc as j,aa as _,ha as E,hb as l,i as w,ic as A,jc as g,na as m,pa as D,qa as S,tb as P,uc as F,vc as c,wc as h,xc as N}from"./chunk-FWZCAEAJ.js";function Z(e,t){e&1&&(p(0,"div",2)(1,"span"),c(2),v(3,"tr"),a(),f(4,"bi",3),a()),e&2&&(l(2),h(x(3,1,"Bezahlt")))}function ee(e,t){e&1&&(p(0,"div",2)(1,"span"),c(2),v(3,"tr"),a(),f(4,"bi",4),a()),e&2&&(l(2),h(x(3,1,"Test")))}function te(e,t){if(e&1&&(p(0,"div"),c(1),a()),e&2){let s=g(3);l(),N("Grund: ",s.unpaidReason,"")}}function ne(e,t){if(e&1&&(p(0,"div",5)(1,"span"),c(2),v(3,"tr"),a(),f(4,"bi",6),a(),u(5,te,2,1,"ng-template",7,8,M)),e&2){let s=F(6),n=g(2);b("ngbPopover",n.unpaidReason?s:null),l(2),h(x(3,2,"Unbezahlt"))}}function ie(e,t){if(e&1&&u(0,ee,5,3)(1,ne,7,4),e&2){let s=g(),n;C(0,(n=s.unpaidReason)==="Test"?0:1)}}var oe=(e,t)=>({"text-bg-warning":e,"text-bg-success":t}),ce=(()=>{let t=class t{};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=S({type:t,selectors:[["app-bill-payment-state-badge"]],inputs:{unpaidReason:"unpaidReason"},standalone:!0,features:[y],decls:3,vars:5,consts:[[1,"badge","not-selectable",2,"width","min-content",3,"ngClass"],["class","d-flex gap-2 align-items-center"],[1,"d-flex","gap-2","align-items-center"],["name","check2-square"],["name","terminal-fill"],["placement","right","triggers","mouseenter:mouseleave","popoverTitle","Rechnungsdetails",1,"d-flex","gap-2","align-items-center",3,"ngbPopover"],["name","cone-striped"],["class","d-flex flex-column"],["popContent",""]],template:function(i,r){i&1&&(p(0,"div",0),u(1,Z,5,3,"div",1)(2,ie,2,1),a()),i&2&&(b("ngClass",k(2,oe,!!r.unpaidReason,!r.unpaidReason)),l(),C(1,r.unpaidReason?2:1))},dependencies:[H,B,I,O],encapsulation:2,changeDetection:0});let e=t;return e})();var L=(()=>{let t=class t{constructor(){this.url="/config/billing",this.httpClient=m(G),this.downloadService=m(J),this.selectedEventService=m(U),this.triggerRefresh=new w(!0)}getSingle$(n){return this.triggerRefresh.pipe(_(()=>this.httpClient.get(`${this.url}/${n}`)))}getAllPaginated(n,i,r,R,Q,V,X){let o=W(n);return o=d(o,"tableIds",i),o=d(o,"tableGroupIds",r),o=d(o,"productIds",R),o=d(o,"productGroupIds",Q),o=d(o,"waiterIds",V),o=d(o,"unpaidReasonId",X),this.triggerRefresh.pipe(_(()=>this.selectedEventService.selectedIdNotNull$),_(Y=>this.httpClient.get(`${this.url}`,{params:o.append("eventId",Y)})))}download$(){return this.selectedEventService.selectedIdNotNull$.pipe(T(1),_(n=>this.downloadService.download$(`${this.url}/export/${n}`,`bills_export_${q(100,9999)}.csv`)))}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=E({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();function ae(e,t){if(e&1&&(p(0,"span",3),c(1),a()),e&2){let s=g();l(),h(s.countdown)}}var De=(()=>{let t=class t{constructor(){this.billsService=m(L),this.loading=!1}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=S({type:t,selectors:[["app-bill-refresh-btn"]],inputs:{countdown:"countdown",loading:[D.HasDecoratorInputTransform,"loading","loading",j]},standalone:!0,features:[P,y],decls:4,vars:6,consts:[["type","button","placement","left",1,"btn","btn-outline-secondary","d-flex","align-items-center","gap-2",3,"ngbTooltip","click"],["name","arrow-clockwise"],["class","badge text-bg-secondary"],[1,"badge","text-bg-secondary"]],template:function(i,r){i&1&&(p(0,"button",0),A("click",function(){return r.billsService.triggerRefresh.next(!0)}),v(1,"tr"),f(2,"bi",1),u(3,ae,2,1,"span",2),a()),i&2&&($("spinner",r.loading),b("ngbTooltip",x(1,4,"HOME_ORDER_REFRESH_NOW")),l(3),C(3,r.countdown?3:-1))},dependencies:[I,z,B],encapsulation:2,changeDetection:0});let e=t;return e})();export{ce as a,L as b,De as c};
