import{a as w,b as R}from"./chunk-URGH7HUK.js";import{a as N}from"./chunk-XBCFP7KI.js";import{a as y,e as b}from"./chunk-TC3S442Y.js";import{e as j,f as p}from"./chunk-RZX3K5HT.js";import"./chunk-3TM4PNYS.js";import"./chunk-QZHSUPXF.js";import"./chunk-MPIXEIKK.js";import"./chunk-YBGMN6OR.js";import"./chunk-VN3CQEPZ.js";import"./chunk-WQGDHA2L.js";import"./chunk-RELVBEUI.js";import"./chunk-2QUP3RQX.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 l,na as s,p as A,qd as O}from"./chunk-ATD4AEXQ.js";import{Kc as v,Oa as i,Pb as M,Ta as f,Ua as r,Xa as F,Z as g,_c as _,bd as D,da as o,gd as E,id as c,k as u,nb as S,ob as C,pb as h,zb as I}from"./chunk-BXH3QC5E.js";var q=(()=>{class e extends j{cleanScanFrameService;router;class="abs-menu-option-add-flag-frame";dialogCode=A.CLEAN_SCAN_SINGLE_READ;uniqueItemID;selectedFlagID=-1;destroySubject=new u;constructor(n,t,a,d){super(n,t),this.cleanScanFrameService=a,this.router=d}ngOnInit(){this.uniqueItemID=this.cleanScanFrameService.getCleanScannedItem()?.uniqueItemID,this.cleanScanFrameService.cleanScannedItem$.pipe(g(this.destroySubject)).subscribe(()=>{this.uniqueItemID=this.cleanScanFrameService.getCleanScannedItem()?.uniqueItemID})}ngOnDestroy(){this.destroySubject.next(),this.destroySubject.complete()}onAddFlag(n){if(!l.isNullOrUndefined(n)){let t=new b(n,!1,!0);this.cleanScanFrameService.addNewFlag(t),this.cleanScanFrameService.removeExistingFlag(n)}this.cleanScanFrameService.newFlagAdded(),this.selectedFlagID=-1,this.router.navigate([s.MainPanel.path,s.Dialogs.CleanScan.path,y.Scan.path]).catch(l.EMPTY_REJECTION_HANDLER)}isSomethingChanged(){return this.selectedFlagID>0}selectedFlagChanged(n){this.selectedFlagID=n}static \u0275fac=function(t){return new(t||e)(i(O),i(_),i(N),i(E))};static \u0275cmp=f({type:e,selectors:[["abs-menu-option-add-flag-frame"]],hostVars:2,hostBindings:function(t,a){t&2&&M(a.class)},standalone:!1,features:[F],decls:1,vars:2,consts:[[3,"addFlag","selectedFlagChanged","dialogCode","uniqueItemID"]],template:function(t,a){t&1&&(C(0,"abs-add-flag-card",0),I("addFlag",function(m){return a.onAddFlag(m)})("selectedFlagChanged",function(m){return a.selectedFlagChanged(m)}),h()),t&2&&S("dialogCode",a.dialogCode)("uniqueItemID",a.uniqueItemID)},dependencies:[w],encapsulation:2})}return e})();var G=[{path:"",component:q,providers:[p],canDeactivate:[p]}],U=(()=>{class e{static \u0275fac=function(t){return new(t||e)};static \u0275mod=r({type:e});static \u0275inj=o({imports:[c.forChild(G),c]})}return e})();var se=(()=>{class e{static \u0275fac=function(t){return new(t||e)};static \u0275mod=r({type:e});static \u0275inj=o({imports:[v,D,U,R]})}return e})();export{se as MenuOptionAddFlagModule};
