import {a}from'./chunk-ZBWUSH2F.js';import {b}from'./chunk-OLJXVUYE.js';import {Brush}from'@scandit/web-datacapture-core';var h=(a=>(a.Frame="frame",a.Dot="dot",a))(h||{}),o=class c{constructor(){this.type="barcodeTrackingBasic";this._style=b.BarcodeBatch.BarcodeBatchBasicOverlay.defaultStyle;this._shouldShowScanAreaGuides=false;this._brushesForBarcodes=new Map;}get style(){return this._style}get listener(){return this._listener}set listener(e){this._listener=e;}get brush(){return this._brush}static async withBarcodeBatch(e){return c.withBarcodeBatchForView(e,null)}static async withBarcodeBatchForView(e,a){return c.withBarcodeBatchForViewWithStyle(e,a,b.BarcodeBatch.BarcodeBatchBasicOverlay.defaultStyle)}static async withBarcodeBatchForViewWithStyle(e,a$1,s){let r=new c;return r.barcodeBatch=e,r._style=s,r._brush=new Brush(b.BarcodeBatch.BarcodeBatchBasicOverlay.styles[r.style].DefaultBrush.fillColor,b.BarcodeBatch.BarcodeBatchBasicOverlay.styles[r.style].DefaultBrush.strokeColor,b.BarcodeBatch.BarcodeBatchBasicOverlay.styles[r.style].DefaultBrush.strokeWidth),a$1&&await a$1.addOverlay(r),r.privateListener=new a(r),e.addPrivateListener(r.privateListener),r}async setBrush(e){this._brush=e,await this.barcodeBatch.notifyContext();}shouldShowScanAreaGuides(){return this._shouldShowScanAreaGuides}async setShouldShowScanAreaGuides(e){this._shouldShowScanAreaGuides=e,await this.barcodeBatch.notifyContext();}async setBrushForTrackedBarcode(e,a){this._brushesForBarcodes.set(a.identifier,e),await this.barcodeBatch.notifyContext();}async clearTrackedBarcodeBrushes(){this._brushesForBarcodes.clear(),await this.barcodeBatch.notifyContext();}toJSONObject(){return {type:this.type,brush:this._brush.toJSONObject(),shouldShowScanAreaGuides:this._shouldShowScanAreaGuides,style:this._style,brushesForBarcodes:[...this._brushesForBarcodes.entries()].reduce((e,[a,s])=>(e[a]=s.toJSONObject(),e),{})}}};export{h as a,o as b};