import{a as O,b as D,c as E,d as P}from"./chunk-XZV2RKPZ.js";import{a as V}from"./chunk-I2IU2RIS.js";import{a as j}from"./chunk-XBCFP7KI.js";import{a as G}from"./chunk-TC3S442Y.js";import"./chunk-OKK2V3LR.js";import"./chunk-Q2WCAKHJ.js";import{e as R,f as c}from"./chunk-RZX3K5HT.js";import"./chunk-3TM4PNYS.js";import"./chunk-QZHSUPXF.js";import"./chunk-MPIXEIKK.js";import"./chunk-YFLLMV2L.js";import"./chunk-J363ANGI.js";import"./chunk-RKWKUAWW.js";import"./chunk-YA55SA6Z.js";import"./chunk-EE2S3MYD.js";import"./chunk-7EAWKBIV.js";import"./chunk-V64RF3DS.js";import{$b as I,na as p,qd as _}from"./chunk-ATD4AEXQ.js";import{Kc as S,Oa as n,Pb as y,Ta as h,Ua as s,Xa as f,Y as d,Z as u,_c as M,bd as T,da as o,gd as F,id as m,k as l,nb as C,ob as g,pb as v,zb as b}from"./chunk-BXH3QC5E.js";var w=(()=>{class e extends R{repairTypesFacade;repairTypeGroupsFacade;router;cleanScanFrameService;class="abs-menu-option-variable-charges-frame";repairTypeCounts=[];repairTypeGroups=[];scannedItemInfo;destroySubject=new l;unsavedChanges=!1;constructor(a,r,i,t,U,B){super(a,r),this.repairTypesFacade=i,this.repairTypeGroupsFacade=t,this.router=U,this.cleanScanFrameService=B}ngOnInit(){this.scannedItemInfo=this.cleanScanFrameService.getCleanScannedItem(),this.repairTypeGroupsFacade.getServiceChargesRepairTypeGroups().pipe(u(this.destroySubject),d(a=>(this.repairTypeGroups=a,this.repairTypesFacade.getServiceChargeRepairTypeCounts(this.scannedItemInfo.customerID,this.scannedItemInfo.uniqueItemID,this.scannedItemInfo.distributionPointID)))).subscribe(a=>{this.repairTypeCounts=a})}ngOnDestroy(){this.destroySubject.next(),this.destroySubject.complete()}onVariableChargesConfirmed(a){a?this.cleanScanFrameService.variableChargesRemoved():this.cleanScanFrameService.variableChargesUpdated(),this.unsavedChanges=!1,this.router.navigate([p.MainPanel.path,p.Dialogs.CleanScan.path,G.Scan.path]).catch(I.EMPTY_REJECTION_HANDLER)}variableChargesChanged(){this.unsavedChanges=!0}isSomethingChanged(){return this.unsavedChanges}static \u0275fac=function(r){return new(r||e)(n(_),n(M),n(V),n(E),n(F),n(j))};static \u0275cmp=h({type:e,selectors:[["abs-menu-option-variable-charges-frame"]],hostVars:2,hostBindings:function(r,i){r&2&&y(i.class)},standalone:!1,features:[f],decls:1,vars:3,consts:[[3,"variableChargesConfirmed","variableChargesRemoved","variableChargesChanged","repairTypeGroups","variableCharges","scannedItemInfo"]],template:function(r,i){r&1&&(g(0,"abs-variable-charges-panel",0),b("variableChargesConfirmed",function(){return i.onVariableChargesConfirmed(!1)})("variableChargesRemoved",function(){return i.onVariableChargesConfirmed(!0)})("variableChargesChanged",function(){return i.variableChargesChanged()}),v()),r&2&&C("repairTypeGroups",i.repairTypeGroups)("variableCharges",i.repairTypeCounts)("scannedItemInfo",i.scannedItemInfo)},dependencies:[O],encapsulation:2})}return e})();var H=[{path:"",component:w,providers:[c],canDeactivate:[c]}],A=(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275mod=s({type:e});static \u0275inj=o({imports:[m.forChild(H),m]})}return e})();var be=(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275mod=s({type:e});static \u0275inj=o({imports:[S,T,A,P,D]})}return e})();export{be as MenuOptionVariableChargesModule};
