import{a as k}from"./chunk-LSGUGXTS.js";import{a as j,b as O,c as D,d as E}from"./chunk-XZV2RKPZ.js";import{a as V}from"./chunk-I2IU2RIS.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 t,Pb as y,Ta as u,Ua as s,Xa as f,Y as h,Z as d,_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 N=(()=>{class e extends R{repairTypesFacade;repairTypeGroupsFacade;router;checkpointScanFrameService;class="abs-menu-option-variable-charges-frame";repairTypeCounts=[];repairTypeGroups=[];scannedItemInfo;destroySubject=new l;unsavedChanges=!1;constructor(r,a,i,n,A,U){super(r,a),this.repairTypesFacade=i,this.repairTypeGroupsFacade=n,this.router=A,this.checkpointScanFrameService=U}ngOnInit(){this.scannedItemInfo=this.checkpointScanFrameService.getCheckpointScannedItem(),this.repairTypeGroupsFacade.getServiceChargesRepairTypeGroups().pipe(d(this.destroySubject),h(r=>(this.repairTypeGroups=r,this.repairTypesFacade.getServiceChargeRepairTypeCounts(this.scannedItemInfo.customerID,this.scannedItemInfo.uniqueItemID,this.scannedItemInfo.distributionPointID)))).subscribe(r=>{this.repairTypeCounts=r})}ngOnDestroy(){this.destroySubject.next(),this.destroySubject.complete()}onVariableChargesConfirmed(r){r?this.checkpointScanFrameService.variableChargesRemoved():this.checkpointScanFrameService.variableChargesUpdated(),this.unsavedChanges=!1,this.router.navigate([p.MainPanel.path,p.Dialogs.CheckpointScan.path,G.Scan.path]).catch(I.EMPTY_REJECTION_HANDLER)}variableChargesChanged(){this.unsavedChanges=!0}isSomethingChanged(){return this.unsavedChanges}static \u0275fac=function(a){return new(a||e)(t(_),t(M),t(V),t(D),t(F),t(k))};static \u0275cmp=u({type:e,selectors:[["abs-menu-option-variable-charges-frame"]],hostVars:2,hostBindings:function(a,i){a&2&&y(i.class)},standalone:!1,features:[f],decls:1,vars:3,consts:[[3,"variableChargesConfirmed","variableChargesRemoved","variableChargesChanged","repairTypeGroups","variableCharges","scannedItemInfo"]],template:function(a,i){a&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()),a&2&&C("repairTypeGroups",i.repairTypeGroups)("variableCharges",i.repairTypeCounts)("scannedItemInfo",i.scannedItemInfo)},dependencies:[j],encapsulation:2})}return e})();var B=[{path:"",component:N,providers:[c],canDeactivate:[c]}],w=(()=>{class e{static \u0275fac=function(a){return new(a||e)};static \u0275mod=s({type:e});static \u0275inj=o({imports:[m.forChild(B),m]})}return e})();var be=(()=>{class e{static \u0275fac=function(a){return new(a||e)};static \u0275mod=s({type:e});static \u0275inj=o({imports:[S,T,w,E,O]})}return e})();export{be as MenuOptionVariableChargesModule};
