import{a as B,f as q}from"./chunk-HJIKGOFS.js";import{C as V,T as j,b as z,g as $,h as s,i as R,p,s as N}from"./chunk-J2K6XPCC.js";import{d as S,e as T,f as D,q as k,r as A,u as E,v as L}from"./chunk-ISCRPPFS.js";import{$b as a,Ad as I,Bd as _,Cd as M,Hc as v,Ic as y,Jc as x,Kb as b,Nd as O,Qa as u,Qb as g,Td as P,Yc as h,Zc as w,ic as r,jc as l,kc as d,od as F,tc as f,xb as o,yb as C}from"./chunk-EBMUBP7P.js";F();R();A();P();D();F();L();P();D();function G(t,m){if(t&1&&(r(0,"div",13),d(1,"paw-input-field",14),l()),t&2){let n=m.$implicit,e=f();a("ngClass",n.styleClass),o(),a("field",n.field)("model",e.totals)("onChangeDebounced",e.onFieldValueChanged)}}function H(t,m){t&1&&d(0,"div",15)}function J(t,m){if(t&1&&(r(0,"span"),v(1),h(2,"pawFormatCurrency"),l()),t&2){let n=f();o(),x(" ",w(2,1,n.totals.forPay)," ")}}var ue=(()=>{class t{constructor(n){this.api=n,this.statementChange=new u,this.totalsChanged=new u,this.totals=null,this.inputFields={statement:{id:"statements",label:"TextMessage",options:[],searchable:!0,multiselect:!0,type:"material",matOptions:{appearance:"outline"},apiRequest:e=>this.api.get(k.general.docTextLookup(e)),component:N,valueMapper:e=>e.statement,labelMapper:e=>e.name,valueSetter:e=>e.option,onChange:e=>{this.statementChange.emit(e)}},discount:s.number({id:"discount",label:"Discount",disabled:!0,component:p,type:"material",matOptions:{appearance:"outline"}}),discountPercent:s.number({id:"discountPercent",label:"DiscountPercent",disabled:!0,component:p,type:"material",matOptions:{appearance:"outline"}}),value:s.number({id:"value",label:"Value",disabled:!0,component:p,type:"material",matOptions:{appearance:"outline"}}),tax:s.number({id:"tax",label:"TotalTax",disabled:!0,component:p,type:"material",matOptions:{appearance:"outline"}})},this.presetSlots=[{styleClass:"paw-col-8",field:this.inputFields.statement}],this.slots=[{styleClass:"paw-col-1",field:this.inputFields.discountPercent},{styleClass:"paw-col-1",field:this.inputFields.discount},{styleClass:"paw-col-1",field:this.inputFields.value},{styleClass:"paw-col-1",field:this.inputFields.tax}],this.onFieldValueChanged=(e,i)=>{this.totals&&this.totalsChanged.emit(this.totals)},this.loadingIndication=!0}ngOnInit(){this.handleTotalsChange()}ngOnDestroy(){this.totalsS?.unsubscribe()}handleTotalsChange(){this.totalsS=this.totals$?.subscribe(n=>{this.totals=n,this.loadingIndication=!1})}static{this.\u0275fac=function(e){return new(e||t)(C(E))}}static{this.\u0275cmp=b({type:t,selectors:[["paw-invoice-footer"]],inputs:{totals$:"totals$",statementModel:"statementModel",form:"form"},outputs:{statementChange:"statementChange",totalsChanged:"totalsChanged"},decls:15,vars:10,consts:[[1,"invoice-footer"],[1,""],[1,"paw-area-h","paw-nooverflow"],[1,"paw-col","paw-col-10","paw-nooverflow","paw-area-h","invoice-footer-items","paw-noselect","paw-padding-s",3,"pawDragScroll"],[1,"paw-col","paw-padding-xs","paw-col-8"],[1,"paw-label-width-m",3,"field","model","form"],["class","paw-col paw-padding-xs",3,"ngClass",4,"ngFor","ngForOf"],[1,"paw-col","paw-col-2"],[1,"sum-cell"],[1,"sum-cell-label"],[1,"sum-cell-value"],["class","paw-mock-skeleton paw-mock-text",4,"ngIf"],[4,"ngIf"],[1,"paw-col","paw-padding-xs",3,"ngClass"],[1,"paw-label-width-s",3,"field","model","onChangeDebounced"],[1,"paw-mock-skeleton","paw-mock-text"]],template:function(e,i){if(e&1&&(r(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),d(5,"paw-input-field",5),l(),g(6,G,2,4,"div",6),l(),r(7,"div",7)(8,"div",8)(9,"div",9),v(10),h(11,"translate"),l(),r(12,"div",10),g(13,H,1,0,"div",11)(14,J,3,3,"span",12),l()()()()()()),e&2){let c;o(3),a("pawDragScroll","x"),o(2),a("field",i.inputFields.statement)("model",(c=i.statementModel)!==null&&c!==void 0?c:null)("form",i.form),o(),a("ngForOf",i.slots),o(4),y(w(11,8,"ForPayment")),o(3),a("ngIf",i.loadingIndication),o(),a("ngIf",!i.loadingIndication&&i.totals)}},dependencies:[O,I,_,M,j,$,T,S,V,z,q,B],styles:[".invoice-footer[_ngcontent-%COMP%]{background:var(--paw-color-content-bg);border-top:1px solid var(--paw-color-divider);justify-content:space-between;align-items:center}.invoice-footer-items[_ngcontent-%COMP%]{background:var(--paw-color-content-bg)}.sum-cell[_ngcontent-%COMP%]{background-color:var(--paw-color-primary);color:var(--paw-color-content-bg);text-align:right;height:100%;padding-top:5px;padding-right:10px}.sum-cell[_ngcontent-%COMP%]   .sum-cell-label[_ngcontent-%COMP%]{color:var(--paw-contrast-color-primary);font-size:var(--paw-font-size-s);text-align:right;margin-bottom:4px}.sum-cell[_ngcontent-%COMP%]   .sum-cell-value[_ngcontent-%COMP%]{color:var(--paw-contrast-color-primary);font-size:var(--paw-font-size-xl);font-weight:700;text-align:right}.paw-sum-col[_ngcontent-%COMP%]{padding-left:30px}"]})}}return t})();export{ue as a};
