scandit-capacitor-datacapture-barcode 7.5.1 → 7.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/barcode.js CHANGED
@@ -1,4 +1,4 @@
1
- import { nameForSerialization, serializationDefault, NoViewfinder, NoneLocationSelection, ignoreFromSerializationIfNull, DefaultSerializeable, ignoreFromSerialization, FactoryMaker, Feedback, Quadrilateral, BaseNewController, Brush, Observable, TextAlignment, FontFamily, EventDataParser, AimerViewfinder, CameraSettings, Color, ScanditIcon, CameraController } from 'scandit-capacitor-datacapture-core/dist/core';
1
+ import { nameForSerialization, ignoreFromSerialization, ignoreFromSerializationIfNull, serializationDefault, NoViewfinder, NoneLocationSelection, DefaultSerializeable, FactoryMaker, Feedback, CameraSettings, Quadrilateral, BaseNewController, Brush, Observable, TextAlignment, FontFamily, EventDataParser, AimerViewfinder, Color, ScanditIcon, CameraController } from 'scandit-capacitor-datacapture-core/dist/core';
2
2
 
3
3
  var Symbology;
4
4
  (function (Symbology) {
@@ -555,17 +555,6 @@ __decorate([
555
555
  ], BarcodeCountFeedback, "barcodeCountDefaults", null);
556
556
 
557
557
  class BarcodeCount extends DefaultSerializeable {
558
- constructor() {
559
- super(...arguments);
560
- this.type = 'barcodeCount';
561
- this._feedback = BarcodeCountFeedback.default;
562
- this._isEnabled = true;
563
- this._hasListeners = false;
564
- this.listeners = [];
565
- this._additionalBarcodes = [];
566
- this.privateContext = null;
567
- this._controller = null;
568
- }
569
558
  get isEnabled() {
570
559
  return this._isEnabled;
571
560
  }
@@ -599,11 +588,28 @@ class BarcodeCount extends DefaultSerializeable {
599
588
  this._controller = newController;
600
589
  this._feedback.controller = this.controller;
601
590
  }
591
+ /**
592
+ * @deprecated Since 7.6. This factory will be removed in 8.0.
593
+ * Prefer the public constructor.
594
+ */
602
595
  static forContext(context, settings) {
603
- const barcodeCount = new BarcodeCount();
604
- barcodeCount.settings = settings;
596
+ const barcodeCount = new BarcodeCount(settings);
597
+ // Preserve legacy factory semantics by attaching the mode to the provided context.
598
+ context.addMode(barcodeCount);
605
599
  return barcodeCount;
606
600
  }
601
+ constructor(settings) {
602
+ super();
603
+ this.type = 'barcodeCount';
604
+ this._feedback = BarcodeCountFeedback.default;
605
+ this._isEnabled = true;
606
+ this._hasListeners = false;
607
+ this.listeners = [];
608
+ this._additionalBarcodes = [];
609
+ this.privateContext = null;
610
+ this._controller = null;
611
+ this.settings = settings;
612
+ }
607
613
  static get barcodeCountDefaults() {
608
614
  return getBarcodeCountDefaults();
609
615
  }
@@ -663,8 +669,17 @@ class BarcodeCount extends DefaultSerializeable {
663
669
  this._additionalBarcodes = [];
664
670
  return this.didChange();
665
671
  }
672
+ static createRecommendedCameraSettings() {
673
+ return new CameraSettings(BarcodeCount.barcodeCountDefaults.RecommendedCameraSettings);
674
+ }
675
+ /**
676
+ * @deprecated Use createRecommendedCameraSettings() instead to get a new instance that can be safely modified.
677
+ */
666
678
  static get recommendedCameraSettings() {
667
- return BarcodeCount.barcodeCountDefaults.RecommendedCameraSettings;
679
+ if (BarcodeCount._recommendedCameraSettings === null) {
680
+ BarcodeCount._recommendedCameraSettings = BarcodeCount.createRecommendedCameraSettings();
681
+ }
682
+ return BarcodeCount._recommendedCameraSettings;
668
683
  }
669
684
  didChange() {
670
685
  var _a, _b;
@@ -675,6 +690,7 @@ class BarcodeCount extends DefaultSerializeable {
675
690
  (_a = this.controller) === null || _a === void 0 ? void 0 : _a.removeModeListener();
676
691
  }
677
692
  }
693
+ BarcodeCount._recommendedCameraSettings = null;
678
694
  __decorate([
679
695
  nameForSerialization('feedback')
680
696
  ], BarcodeCount.prototype, "_feedback", void 0);
@@ -3317,6 +3333,16 @@ function loadBarcodeFindDefaults(jsonDefaults) {
3317
3333
  FactoryMaker.bindInstanceIfNotExists('BarcodeFindDefaults', defaults);
3318
3334
  }
3319
3335
 
3336
+ class BarcodeCaptureFeedback extends DefaultSerializeable {
3337
+ constructor() {
3338
+ super(...arguments);
3339
+ this.success = Feedback.defaultFeedback;
3340
+ }
3341
+ static get default() {
3342
+ return new BarcodeCaptureFeedback();
3343
+ }
3344
+ }
3345
+
3320
3346
  class BarcodeCaptureSession {
3321
3347
  get newlyRecognizedBarcode() {
3322
3348
  return this._newlyRecognizedBarcode;
@@ -3351,12 +3377,7 @@ var BarcodeCaptureListenerEvents;
3351
3377
  BarcodeCaptureListenerEvents["didScan"] = "BarcodeCaptureListener.didScan";
3352
3378
  })(BarcodeCaptureListenerEvents || (BarcodeCaptureListenerEvents = {}));
3353
3379
  class BarcodeCaptureListenerController extends BaseNewController {
3354
- static forBarcodeCapture(barcodeCapture) {
3355
- const controller = new BarcodeCaptureListenerController();
3356
- controller.barcodeCapture = barcodeCapture;
3357
- return controller;
3358
- }
3359
- constructor() {
3380
+ constructor(barcodeCapture) {
3360
3381
  super('BarcodeCaptureListenerProxy');
3361
3382
  this.isListeningForEvents = false;
3362
3383
  this.handleDidUpdateSession = (ev) => __awaiter(this, void 0, void 0, function* () {
@@ -3365,9 +3386,12 @@ class BarcodeCaptureListenerController extends BaseNewController {
3365
3386
  console.error('BarcodeCaptureListenerController.subscribeListener: didUpdateSession payload is null');
3366
3387
  return;
3367
3388
  }
3389
+ if (payload.modeId !== this.modeId) {
3390
+ return;
3391
+ }
3368
3392
  const session = BarcodeCaptureSession.fromJSON(payload);
3369
3393
  yield this.notifyListenersOfDidUpdateSession(session);
3370
- this._proxy.$finishBarcodeCaptureDidUpdateSession({ enabled: this.barcodeCapture.isEnabled });
3394
+ this._proxy.$finishBarcodeCaptureDidUpdateSession({ modeId: this.modeId, enabled: this.mode.isEnabled });
3371
3395
  });
3372
3396
  this.handleDidScan = (ev) => __awaiter(this, void 0, void 0, function* () {
3373
3397
  const payload = EventDataParser.parse(ev.data);
@@ -3375,32 +3399,44 @@ class BarcodeCaptureListenerController extends BaseNewController {
3375
3399
  console.error('BarcodeCaptureListenerController.subscribeListener: didScan payload is null');
3376
3400
  return;
3377
3401
  }
3402
+ if (payload.modeId !== this.modeId) {
3403
+ return;
3404
+ }
3378
3405
  const session = BarcodeCaptureSession.fromJSON(payload);
3379
3406
  yield this.notifyListenersOfDidScan(session);
3380
- this._proxy.$finishBarcodeCaptureDidScan({ enabled: this.barcodeCapture.isEnabled });
3407
+ this._proxy.$finishBarcodeCaptureDidScan({ modeId: this.modeId, enabled: this.mode.isEnabled });
3408
+ });
3409
+ this.mode = barcodeCapture;
3410
+ this.initialize();
3411
+ }
3412
+ get modeId() {
3413
+ return this.mode.modeId;
3414
+ }
3415
+ initialize() {
3416
+ return __awaiter(this, void 0, void 0, function* () {
3417
+ if (this.mode.listeners.length > 0) {
3418
+ this.subscribeListener();
3419
+ }
3381
3420
  });
3382
3421
  }
3383
3422
  reset() {
3384
- return this._proxy.$resetBarcodeCaptureSession();
3423
+ return this._proxy.$resetBarcodeCaptureSession({ modeId: this.modeId });
3385
3424
  }
3386
3425
  setModeEnabledState(enabled) {
3387
- this._proxy.$setBarcodeCaptureModeEnabledState({ enabled: enabled });
3426
+ this._proxy.$setBarcodeCaptureModeEnabledState({ modeId: this.modeId, enabled });
3388
3427
  }
3389
3428
  updateBarcodeCaptureMode() {
3390
- return this._proxy.$updateBarcodeCaptureMode({ modeJson: JSON.stringify(this.barcodeCapture.toJSON()) });
3391
- }
3392
- applyBarcodeCaptureModeSettings(newSettings) {
3393
- return this._proxy.$applyBarcodeCaptureModeSettings({ modeSettingsJson: JSON.stringify(newSettings.toJSON()) });
3429
+ return this._proxy.$updateBarcodeCaptureMode({ modeJson: JSON.stringify(this.mode.toJSON()) });
3394
3430
  }
3395
- updateBarcodeCaptureOverlay(overlay) {
3396
- return this._proxy.$updateBarcodeCaptureOverlay({ overlayJson: JSON.stringify(overlay.toJSON()) });
3431
+ applyBarcodeCaptureModeSettings(modeSettings) {
3432
+ return this._proxy.$applyBarcodeCaptureModeSettings({ modeId: this.modeId, modeSettingsJson: JSON.stringify(modeSettings.toJSON()) });
3397
3433
  }
3398
3434
  subscribeListener() {
3399
3435
  if (this.isListeningForEvents) {
3400
3436
  return;
3401
3437
  }
3402
3438
  this._proxy.subscribeForEvents(Object.values(BarcodeCaptureListenerEvents));
3403
- this._proxy.$registerBarcodeCaptureListenerForEvents();
3439
+ this._proxy.$registerBarcodeCaptureListenerForEvents({ modeId: this.modeId });
3404
3440
  this._proxy.eventEmitter.on(BarcodeCaptureListenerEvents.didUpdateSession, this.handleDidUpdateSession);
3405
3441
  this._proxy.eventEmitter.on(BarcodeCaptureListenerEvents.didScan, this.handleDidScan);
3406
3442
  this.isListeningForEvents = true;
@@ -3409,7 +3445,7 @@ class BarcodeCaptureListenerController extends BaseNewController {
3409
3445
  if (!this.isListeningForEvents) {
3410
3446
  return;
3411
3447
  }
3412
- this._proxy.$unregisterBarcodeCaptureListenerForEvents();
3448
+ this._proxy.$unregisterBarcodeCaptureListenerForEvents({ modeId: this.modeId });
3413
3449
  this._proxy.unsubscribeFromEvents(Object.values(BarcodeCaptureListenerEvents));
3414
3450
  this._proxy.eventEmitter.off(BarcodeCaptureListenerEvents.didUpdateSession, this.handleDidUpdateSession);
3415
3451
  this._proxy.eventEmitter.off(BarcodeCaptureListenerEvents.didScan, this.handleDidScan);
@@ -3421,20 +3457,20 @@ class BarcodeCaptureListenerController extends BaseNewController {
3421
3457
  }
3422
3458
  notifyListenersOfDidUpdateSession(session) {
3423
3459
  return __awaiter(this, void 0, void 0, function* () {
3424
- const mode = this.barcodeCapture;
3460
+ const mode = this.mode;
3425
3461
  for (const listener of mode.listeners) {
3426
3462
  if (listener.didUpdateSession) {
3427
- listener.didUpdateSession(this.barcodeCapture, session, () => CameraController.getFrame(session.frameId));
3463
+ listener.didUpdateSession(this.mode, session, () => CameraController.getFrame(session.frameId));
3428
3464
  }
3429
3465
  }
3430
3466
  });
3431
3467
  }
3432
3468
  notifyListenersOfDidScan(session) {
3433
3469
  return __awaiter(this, void 0, void 0, function* () {
3434
- const mode = this.barcodeCapture;
3470
+ const mode = this.mode;
3435
3471
  for (const listener of mode.listeners) {
3436
3472
  if (listener.didScan) {
3437
- listener.didScan(this.barcodeCapture, session, () => CameraController.getFrame(session.frameId));
3473
+ listener.didScan(this.mode, session, () => CameraController.getFrame(session.frameId));
3438
3474
  }
3439
3475
  }
3440
3476
  });
@@ -3446,8 +3482,9 @@ class BarcodeCapture extends DefaultSerializeable {
3446
3482
  return this._isEnabled;
3447
3483
  }
3448
3484
  set isEnabled(isEnabled) {
3485
+ var _a;
3449
3486
  this._isEnabled = isEnabled;
3450
- this.controller.setModeEnabledState(isEnabled);
3487
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.setModeEnabledState(isEnabled);
3451
3488
  }
3452
3489
  get context() {
3453
3490
  return this._context;
@@ -3456,62 +3493,100 @@ class BarcodeCapture extends DefaultSerializeable {
3456
3493
  return this._feedback;
3457
3494
  }
3458
3495
  set feedback(feedback) {
3496
+ var _a;
3459
3497
  this._feedback = feedback;
3460
- this.controller.updateBarcodeCaptureMode();
3498
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBarcodeCaptureMode();
3499
+ }
3500
+ static createRecommendedCameraSettings() {
3501
+ return new CameraSettings(BarcodeCapture.barcodeCaptureDefaults.RecommendedCameraSettings);
3461
3502
  }
3503
+ /**
3504
+ * @deprecated Use createRecommendedCameraSettings() instead to get a new instance that can be safely modified.
3505
+ */
3462
3506
  static get recommendedCameraSettings() {
3463
- return BarcodeCapture.barcodeCaptureDefaults.RecommendedCameraSettings;
3507
+ if (BarcodeCapture._recommendedCameraSettings === null) {
3508
+ BarcodeCapture._recommendedCameraSettings = BarcodeCapture.createRecommendedCameraSettings();
3509
+ }
3510
+ return BarcodeCapture._recommendedCameraSettings;
3464
3511
  }
3465
3512
  get _context() {
3466
3513
  return this.privateContext;
3467
3514
  }
3468
3515
  set _context(newContext) {
3516
+ var _a, _b;
3469
3517
  if (newContext == null) {
3470
- this.controller.unsubscribeListener();
3471
- }
3472
- else if (this.privateContext == null) {
3473
- this.controller.subscribeListener();
3518
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.dispose();
3519
+ this.controller = null;
3520
+ this.privateContext = null;
3521
+ return;
3474
3522
  }
3475
3523
  this.privateContext = newContext;
3524
+ (_b = this.controller) !== null && _b !== void 0 ? _b : (this.controller = new BarcodeCaptureListenerController(this));
3476
3525
  }
3477
3526
  static get barcodeCaptureDefaults() {
3478
3527
  return getBarcodeCaptureDefaults();
3479
3528
  }
3529
+ /**
3530
+ * @deprecated Since 7.6. This factory will be removed in 8.0.
3531
+ * Use the public constructor instead and configure the instance manually:
3532
+ * ```ts
3533
+ * const barcodeCapture = new BarcodeCapture(settings);
3534
+ * context.addMode(barcodeCapture);
3535
+ * ```
3536
+ */
3480
3537
  static forContext(context, settings) {
3481
- const barcodeCapture = new BarcodeCapture();
3482
- barcodeCapture.settings = settings;
3538
+ const barcodeCapture = new BarcodeCapture(settings);
3483
3539
  if (context) {
3484
3540
  context.addMode(barcodeCapture);
3485
3541
  }
3486
3542
  return barcodeCapture;
3487
3543
  }
3488
- constructor() {
3544
+ constructor(settings) {
3489
3545
  super();
3546
+ this.modeId = Math.floor(Math.random() * 100000000);
3490
3547
  this.type = 'barcodeCapture';
3491
3548
  this._isEnabled = true;
3549
+ this._feedback = BarcodeCaptureFeedback.default;
3492
3550
  this.privateContext = null;
3551
+ this.parentId = null;
3493
3552
  this.listeners = [];
3494
- this.controller = BarcodeCaptureListenerController.forBarcodeCapture(this);
3553
+ this.hasListeners = false;
3554
+ this.controller = null;
3555
+ this.settings = settings;
3495
3556
  }
3496
3557
  applySettings(settings) {
3497
- this.settings = settings;
3498
- return this.controller.applyBarcodeCaptureModeSettings(settings);
3558
+ return __awaiter(this, void 0, void 0, function* () {
3559
+ var _a;
3560
+ this.settings = settings;
3561
+ return (_a = this.controller) === null || _a === void 0 ? void 0 : _a.applyBarcodeCaptureModeSettings(settings);
3562
+ });
3499
3563
  }
3500
3564
  addListener(listener) {
3565
+ var _a;
3501
3566
  if (this.listeners.includes(listener)) {
3502
3567
  return;
3503
3568
  }
3569
+ if (this.listeners.length === 0) {
3570
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.subscribeListener();
3571
+ }
3504
3572
  this.listeners.push(listener);
3573
+ this.hasListeners = this.listeners.length > 0;
3505
3574
  }
3506
3575
  removeListener(listener) {
3576
+ var _a;
3507
3577
  if (!this.listeners.includes(listener)) {
3508
3578
  return;
3509
3579
  }
3510
3580
  this.listeners.splice(this.listeners.indexOf(listener), 1);
3581
+ this.hasListeners = this.listeners.length > 0;
3582
+ if (!this.hasListeners) {
3583
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.unsubscribeListener();
3584
+ }
3511
3585
  }
3512
3586
  }
3587
+ BarcodeCapture._recommendedCameraSettings = null;
3513
3588
  __decorate([
3514
- ignoreFromSerialization
3589
+ nameForSerialization('enabled')
3515
3590
  ], BarcodeCapture.prototype, "_isEnabled", void 0);
3516
3591
  __decorate([
3517
3592
  nameForSerialization('feedback')
@@ -3519,6 +3594,10 @@ __decorate([
3519
3594
  __decorate([
3520
3595
  ignoreFromSerialization
3521
3596
  ], BarcodeCapture.prototype, "privateContext", void 0);
3597
+ __decorate([
3598
+ nameForSerialization('parentId'),
3599
+ ignoreFromSerializationIfNull
3600
+ ], BarcodeCapture.prototype, "parentId", void 0);
3522
3601
  __decorate([
3523
3602
  ignoreFromSerialization
3524
3603
  ], BarcodeCapture.prototype, "listeners", void 0);
@@ -3529,16 +3608,6 @@ __decorate([
3529
3608
  ignoreFromSerialization
3530
3609
  ], BarcodeCapture, "barcodeCaptureDefaults", null);
3531
3610
 
3532
- class BarcodeCaptureFeedback extends DefaultSerializeable {
3533
- constructor() {
3534
- super(...arguments);
3535
- this.success = Feedback.defaultFeedback;
3536
- }
3537
- static get default() {
3538
- return new BarcodeCaptureFeedback();
3539
- }
3540
- }
3541
-
3542
3611
  /**
3543
3612
  * @deprecated BarcodeCaptureOverlayStyle is deprecated and will be removed in a future release.
3544
3613
  */
@@ -3547,7 +3616,41 @@ var BarcodeCaptureOverlayStyle;
3547
3616
  BarcodeCaptureOverlayStyle["Frame"] = "frame";
3548
3617
  })(BarcodeCaptureOverlayStyle || (BarcodeCaptureOverlayStyle = {}));
3549
3618
 
3619
+ class BarcodeCaptureOverlayController extends BaseNewController {
3620
+ constructor(overlay) {
3621
+ super('BarcodeCaptureOverlayProxy');
3622
+ this.overlay = overlay;
3623
+ }
3624
+ updateBarcodeCaptureOverlay(overlay) {
3625
+ const view = this.overlay.view;
3626
+ if (view === null) {
3627
+ return Promise.resolve();
3628
+ }
3629
+ return this._proxy.$updateBarcodeCaptureOverlay({
3630
+ viewId: view.viewId,
3631
+ overlayJson: JSON.stringify(overlay.toJSON())
3632
+ });
3633
+ }
3634
+ dispose() {
3635
+ this._proxy.dispose();
3636
+ }
3637
+ }
3638
+
3550
3639
  class BarcodeCaptureOverlay extends DefaultSerializeable {
3640
+ get view() {
3641
+ return this._view;
3642
+ }
3643
+ set view(newView) {
3644
+ var _a, _b;
3645
+ if (newView === null) {
3646
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.dispose();
3647
+ this.controller = null;
3648
+ this._view = null;
3649
+ return;
3650
+ }
3651
+ this._view = newView;
3652
+ (_b = this.controller) !== null && _b !== void 0 ? _b : (this.controller = new BarcodeCaptureOverlayController(this));
3653
+ }
3551
3654
  static get barcodeCaptureDefaults() {
3552
3655
  return getBarcodeCaptureDefaults();
3553
3656
  }
@@ -3555,13 +3658,15 @@ class BarcodeCaptureOverlay extends DefaultSerializeable {
3555
3658
  return this._brush;
3556
3659
  }
3557
3660
  set brush(newBrush) {
3661
+ var _a;
3558
3662
  this._brush = newBrush;
3559
- this.barcodeCapture.controller.updateBarcodeCaptureOverlay(this);
3663
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBarcodeCaptureOverlay(this);
3560
3664
  }
3561
3665
  get viewfinder() {
3562
3666
  return this._viewfinder;
3563
3667
  }
3564
3668
  set viewfinder(newViewfinder) {
3669
+ var _a;
3565
3670
  this._viewfinder = newViewfinder;
3566
3671
  if (newViewfinder) {
3567
3672
  this.eventEmitter.on('viewfinder.update', this.handleViewFinderUpdate);
@@ -3569,14 +3674,15 @@ class BarcodeCaptureOverlay extends DefaultSerializeable {
3569
3674
  else {
3570
3675
  this.eventEmitter.off('viewfinder.update');
3571
3676
  }
3572
- this.barcodeCapture.controller.updateBarcodeCaptureOverlay(this);
3677
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBarcodeCaptureOverlay(this);
3573
3678
  }
3574
3679
  get shouldShowScanAreaGuides() {
3575
3680
  return this._shouldShowScanAreaGuides;
3576
3681
  }
3577
3682
  set shouldShowScanAreaGuides(shouldShow) {
3683
+ var _a;
3578
3684
  this._shouldShowScanAreaGuides = shouldShow;
3579
- this.barcodeCapture.controller.updateBarcodeCaptureOverlay(this);
3685
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBarcodeCaptureOverlay(this);
3580
3686
  }
3581
3687
  /**
3582
3688
  * @deprecated The style property is deprecated and will be removed in a future release.
@@ -3584,18 +3690,41 @@ class BarcodeCaptureOverlay extends DefaultSerializeable {
3584
3690
  get style() {
3585
3691
  return this._style;
3586
3692
  }
3693
+ /**
3694
+ * @deprecated Since 7.6. This factory will be removed in 8.0.
3695
+ * Use the public constructor instead and add the overlay to the view manually:
3696
+ * ```ts
3697
+ * const overlay = new BarcodeCaptureOverlay(barcodeCapture);
3698
+ * // optionally configure brush or viewfinder
3699
+ * view.addOverlay(overlay);
3700
+ * ```
3701
+ */
3587
3702
  static withBarcodeCapture(barcodeCapture) {
3588
3703
  return BarcodeCaptureOverlay.withBarcodeCaptureForView(barcodeCapture, null);
3589
3704
  }
3705
+ /**
3706
+ * @deprecated Since 7.6. This factory will be removed in 8.0.
3707
+ * Use the public constructor instead and add the overlay to the view manually:
3708
+ * ```ts
3709
+ * const overlay = new BarcodeCaptureOverlay(barcodeCapture);
3710
+ * // optionally configure brush or viewfinder
3711
+ * view.addOverlay(overlay);
3712
+ * ```
3713
+ */
3590
3714
  static withBarcodeCaptureForView(barcodeCapture, view) {
3591
3715
  return this.withBarcodeCaptureForViewWithStyle(barcodeCapture, view, BarcodeCaptureOverlayStyle.Frame);
3592
3716
  }
3593
3717
  /**
3594
- * @deprecated withBarcodeCaptureForViewWithStyle is deprecated and will be removed in a future release. Use the version without style parameter instead.
3718
+ * @deprecated Since 7.6. This factory will be removed in 8.0.
3719
+ * Create the overlay and add it to the view manually instead:
3720
+ * ```ts
3721
+ * const overlay = new BarcodeCaptureOverlay(barcodeCapture);
3722
+ * // apply style/brush manually as needed
3723
+ * view.addOverlay(overlay);
3724
+ * ```
3595
3725
  */
3596
3726
  static withBarcodeCaptureForViewWithStyle(barcodeCapture, view, style) {
3597
- const overlay = new BarcodeCaptureOverlay();
3598
- overlay.barcodeCapture = barcodeCapture;
3727
+ const overlay = new BarcodeCaptureOverlay(barcodeCapture);
3599
3728
  overlay._style = style;
3600
3729
  const barcodeCaptureOverlayDefaults = BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay;
3601
3730
  const styles = barcodeCaptureOverlayDefaults.styles ? barcodeCaptureOverlayDefaults.styles : barcodeCaptureOverlayDefaults.Brushes;
@@ -3605,25 +3734,29 @@ class BarcodeCaptureOverlay extends DefaultSerializeable {
3605
3734
  }
3606
3735
  return overlay;
3607
3736
  }
3608
- constructor() {
3737
+ constructor(mode) {
3609
3738
  super();
3610
3739
  this.type = 'barcodeCapture';
3740
+ this.controller = null;
3741
+ this._view = null;
3611
3742
  this._shouldShowScanAreaGuides = false;
3612
3743
  this._viewfinder = null;
3613
3744
  this._brush = BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay.DefaultBrush;
3745
+ this.modeId = mode.modeId;
3614
3746
  this.eventEmitter = FactoryMaker.getInstance('EventEmitter');
3615
3747
  this.handleViewFinderUpdate = this.handleViewFinderUpdate.bind(this);
3616
3748
  }
3617
3749
  handleViewFinderUpdate() {
3618
- this.barcodeCapture.controller.updateBarcodeCaptureOverlay(this);
3750
+ var _a;
3751
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBarcodeCaptureOverlay(this);
3619
3752
  }
3620
3753
  }
3621
3754
  __decorate([
3622
3755
  ignoreFromSerialization
3623
- ], BarcodeCaptureOverlay.prototype, "barcodeCapture", void 0);
3756
+ ], BarcodeCaptureOverlay.prototype, "controller", void 0);
3624
3757
  __decorate([
3625
3758
  ignoreFromSerialization
3626
- ], BarcodeCaptureOverlay.prototype, "view", void 0);
3759
+ ], BarcodeCaptureOverlay.prototype, "_view", void 0);
3627
3760
  __decorate([
3628
3761
  nameForSerialization('shouldShowScanAreaGuides')
3629
3762
  ], BarcodeCaptureOverlay.prototype, "_shouldShowScanAreaGuides", void 0);
@@ -3796,25 +3929,40 @@ class BarcodeAr extends DefaultSerializeable {
3796
3929
  static get barcodeArDefaults() {
3797
3930
  return getBarcodeArDefaults();
3798
3931
  }
3932
+ static createRecommendedCameraSettings() {
3933
+ return new CameraSettings(BarcodeAr.barcodeArDefaults.RecommendedCameraSettings);
3934
+ }
3935
+ /**
3936
+ * @deprecated Use createRecommendedCameraSettings() instead to get a new instance that can be safely modified.
3937
+ */
3799
3938
  static get recommendedCameraSettings() {
3800
- return BarcodeAr.barcodeArDefaults.RecommendedCameraSettings;
3939
+ if (BarcodeAr._recommendedCameraSettings === null) {
3940
+ BarcodeAr._recommendedCameraSettings = BarcodeAr.createRecommendedCameraSettings();
3941
+ }
3942
+ return BarcodeAr._recommendedCameraSettings;
3801
3943
  }
3944
+ /**
3945
+ * @deprecated Since 7.6. This factory will be removed in 8.0.
3946
+ * Use the constructor instead.
3947
+ */
3802
3948
  static forContext(context, settings) {
3803
- return new BarcodeAr(context, settings);
3949
+ return new BarcodeAr(settings);
3804
3950
  }
3805
- constructor(context, settings) {
3951
+ constructor(settings) {
3806
3952
  super();
3807
3953
  this.type = 'barcodeAr';
3808
3954
  this.privateContext = null;
3809
3955
  this._feedback = BarcodeArFeedback.defaultFeedback;
3810
3956
  this.listeners = [];
3811
3957
  this._controller = null;
3812
- this._context = context;
3813
3958
  this._settings = settings;
3814
3959
  }
3815
3960
  applySettings(settings) {
3816
- this._settings = settings;
3817
- return this.didChange();
3961
+ return __awaiter(this, void 0, void 0, function* () {
3962
+ var _a;
3963
+ this._settings = settings;
3964
+ return (_a = this._controller) === null || _a === void 0 ? void 0 : _a.applyNewSettings(settings);
3965
+ });
3818
3966
  }
3819
3967
  addListener(listener) {
3820
3968
  this.checkAndSubscribeListeners();
@@ -3872,6 +4020,7 @@ class BarcodeAr extends DefaultSerializeable {
3872
4020
  return json;
3873
4021
  }
3874
4022
  }
4023
+ BarcodeAr._recommendedCameraSettings = null;
3875
4024
  __decorate([
3876
4025
  ignoreFromSerialization
3877
4026
  ], BarcodeAr.prototype, "privateContext", void 0);
@@ -5321,7 +5470,13 @@ class BarcodeArViewController extends BaseNewController {
5321
5470
  }
5322
5471
  const barcodeAr = this.barcodeAr.toJSON();
5323
5472
  const json = JSON.stringify(barcodeAr);
5324
- return this._proxy.$updateBarcodeArMode({ viewId: this.baseView.viewId, barcodeArJson: json });
5473
+ return this._proxy.$updateBarcodeArMode({ viewId: this.baseView.viewId, modeJson: json });
5474
+ }
5475
+ applyNewSettings(settings) {
5476
+ if (!this.isViewCreated) {
5477
+ return Promise.resolve();
5478
+ }
5479
+ return this._proxy.$applyBarcodeArSettings({ viewId: this.baseView.viewId, settings: JSON.stringify(settings.toJSON()) });
5325
5480
  }
5326
5481
  resetMode() {
5327
5482
  if (!this.isViewCreated) {
@@ -5735,14 +5890,19 @@ var BarcodeSelectionListenerEvents;
5735
5890
  BarcodeSelectionListenerEvents["didUpdateSession"] = "BarcodeSelectionListener.didUpdateSession";
5736
5891
  })(BarcodeSelectionListenerEvents || (BarcodeSelectionListenerEvents = {}));
5737
5892
  class BarcodeSelectionListenerController extends BaseNewController {
5738
- static forBarcodeSelection(barcodeSelection) {
5739
- const controller = new BarcodeSelectionListenerController();
5740
- controller.barcodeSelection = barcodeSelection;
5741
- controller._proxy.$setBarcodeSelectionModeEnabledState = () => barcodeSelection.isEnabled;
5742
- return controller;
5743
- }
5744
- constructor() {
5893
+ constructor(barcodeSelection) {
5745
5894
  super('BarcodeSelectionListenerProxy');
5895
+ this.hasListeners = false;
5896
+ this.barcodeSelection = barcodeSelection;
5897
+ this._proxy.$setBarcodeSelectionModeEnabledState = () => barcodeSelection.isEnabled;
5898
+ this.initialize();
5899
+ }
5900
+ initialize() {
5901
+ return __awaiter(this, void 0, void 0, function* () {
5902
+ if (this.barcodeSelection.listeners.length > 0) {
5903
+ this.subscribeListener();
5904
+ }
5905
+ });
5746
5906
  }
5747
5907
  getCount(barcode) {
5748
5908
  return __awaiter(this, void 0, void 0, function* () {
@@ -5757,6 +5917,9 @@ class BarcodeSelectionListenerController extends BaseNewController {
5757
5917
  return this._proxy.$resetBarcodeSelectionSession();
5758
5918
  }
5759
5919
  subscribeListener() {
5920
+ if (this.hasListeners) {
5921
+ return;
5922
+ }
5760
5923
  this._proxy.$registerBarcodeSelectionListenerForEvents();
5761
5924
  this._proxy.on$didUpdateSelection = (ev) => __awaiter(this, void 0, void 0, function* () {
5762
5925
  const payload = EventDataParser.parse(ev.data);
@@ -5780,10 +5943,18 @@ class BarcodeSelectionListenerController extends BaseNewController {
5780
5943
  yield this.notifyListenersOfDidUpdateSession(session);
5781
5944
  this._proxy.$finishBarcodeSelectionDidUpdateSession({ enabled: this.barcodeSelection.isEnabled });
5782
5945
  });
5946
+ this.hasListeners = true;
5783
5947
  }
5784
5948
  unsubscribeListener() {
5949
+ if (!this.hasListeners) {
5950
+ return;
5951
+ }
5785
5952
  this._proxy.$unregisterBarcodeSelectionListenerForEvents();
5786
- this._proxy.dispose();
5953
+ this.hasListeners = false;
5954
+ }
5955
+ dispose() {
5956
+ this.unsubscribeListener();
5957
+ return this._proxy.dispose();
5787
5958
  }
5788
5959
  notifyListenersOfDidUpdateSelection(session) {
5789
5960
  return __awaiter(this, void 0, void 0, function* () {
@@ -5808,8 +5979,9 @@ class BarcodeSelectionListenerController extends BaseNewController {
5808
5979
  }
5809
5980
 
5810
5981
  class BarcodeSelectionController extends BaseNewController {
5811
- constructor() {
5982
+ constructor(barcodeSelection) {
5812
5983
  super('BarcodeSelectionProxy');
5984
+ this.barcodeSelection = barcodeSelection;
5813
5985
  }
5814
5986
  unfreezeCamera() {
5815
5987
  return this._proxy.$unfreezeCameraInBarcodeSelection();
@@ -5880,42 +6052,62 @@ class BarcodeSelection extends DefaultSerializeable {
5880
6052
  this._pointOfInterest = pointOfInterest;
5881
6053
  this.modeController.updateBarcodeSelectionMode(this);
5882
6054
  }
6055
+ static createRecommendedCameraSettings() {
6056
+ return new CameraSettings(BarcodeSelection.barcodeSelectionDefaults.RecommendedCameraSettings);
6057
+ }
6058
+ /**
6059
+ * @deprecated Use createRecommendedCameraSettings() instead to get a new instance that can be safely modified.
6060
+ */
5883
6061
  static get recommendedCameraSettings() {
5884
- return BarcodeSelection.barcodeSelectionDefaults.RecommendedCameraSettings;
6062
+ if (BarcodeSelection._recommendedCameraSettings === null) {
6063
+ BarcodeSelection._recommendedCameraSettings = BarcodeSelection.createRecommendedCameraSettings();
6064
+ }
6065
+ return BarcodeSelection._recommendedCameraSettings;
5885
6066
  }
5886
6067
  get _context() {
5887
6068
  return this.privateContext;
5888
6069
  }
5889
6070
  set _context(newContext) {
6071
+ var _a, _b;
5890
6072
  if (newContext == null) {
5891
- this.listenerController.unsubscribeListener();
5892
- }
5893
- else if (this.privateContext == null) {
5894
- this.listenerController.subscribeListener();
6073
+ (_a = this.listenerController) === null || _a === void 0 ? void 0 : _a.dispose();
6074
+ this.listenerController = null;
6075
+ this.privateContext = null;
6076
+ return;
5895
6077
  }
5896
6078
  this.privateContext = newContext;
6079
+ (_b = this.listenerController) !== null && _b !== void 0 ? _b : (this.listenerController = new BarcodeSelectionListenerController(this));
5897
6080
  }
5898
6081
  static get barcodeSelectionDefaults() {
5899
6082
  return getBarcodeSelectionDefaults();
5900
6083
  }
6084
+ /**
6085
+ * @deprecated Since 7.6. This factory will be removed in 8.0.
6086
+ * Use the public constructor instead and configure the instance manually:
6087
+ * ```ts
6088
+ * const barcodeSelection = new BarcodeSelection(settings);
6089
+ * context.addMode(barcodeSelection);
6090
+ * ```
6091
+ */
5901
6092
  static forContext(context, settings) {
5902
- const barcodeSelection = new BarcodeSelection();
5903
- barcodeSelection.settings = settings;
6093
+ const barcodeSelection = new BarcodeSelection(settings);
5904
6094
  if (context) {
5905
6095
  context.addMode(barcodeSelection);
5906
6096
  }
5907
6097
  return barcodeSelection;
5908
6098
  }
5909
- constructor() {
6099
+ constructor(settings) {
5910
6100
  super();
5911
6101
  this.type = 'barcodeSelection';
6102
+ this.modeId = Math.floor(Math.random() * 100000000);
5912
6103
  this._isEnabled = true;
5913
6104
  this._feedback = new BarcodeSelectionFeedback();
5914
6105
  this._pointOfInterest = null;
5915
6106
  this.privateContext = null;
5916
6107
  this.listeners = [];
5917
- this.listenerController = BarcodeSelectionListenerController.forBarcodeSelection(this);
5918
- this.modeController = new BarcodeSelectionController();
6108
+ this.listenerController = null;
6109
+ this.settings = settings;
6110
+ this.modeController = new BarcodeSelectionController(this);
5919
6111
  this._feedback.controller = this.modeController;
5920
6112
  }
5921
6113
  applySettings(settings) {
@@ -5923,19 +6115,27 @@ class BarcodeSelection extends DefaultSerializeable {
5923
6115
  return this.modeController.applyBarcodeSelectionModeSettings(settings);
5924
6116
  }
5925
6117
  addListener(listener) {
6118
+ var _a;
5926
6119
  if (listener == undefined) {
5927
6120
  return;
5928
6121
  }
5929
6122
  if (this.listeners.includes(listener)) {
5930
6123
  return;
5931
6124
  }
6125
+ if (this.listeners.length === 0) {
6126
+ (_a = this.listenerController) === null || _a === void 0 ? void 0 : _a.subscribeListener();
6127
+ }
5932
6128
  this.listeners.push(listener);
5933
6129
  }
5934
6130
  removeListener(listener) {
6131
+ var _a;
5935
6132
  if (!this.listeners.includes(listener)) {
5936
6133
  return;
5937
6134
  }
5938
6135
  this.listeners.splice(this.listeners.indexOf(listener), 1);
6136
+ if (this.listeners.length === 0) {
6137
+ (_a = this.listenerController) === null || _a === void 0 ? void 0 : _a.unsubscribeListener();
6138
+ }
5939
6139
  }
5940
6140
  reset() {
5941
6141
  return this.modeController.reset();
@@ -5956,6 +6156,7 @@ class BarcodeSelection extends DefaultSerializeable {
5956
6156
  return this.modeController.increaseCountForBarcodes(barcodes);
5957
6157
  }
5958
6158
  }
6159
+ BarcodeSelection._recommendedCameraSettings = null;
5959
6160
  __decorate([
5960
6161
  ignoreFromSerialization
5961
6162
  ], BarcodeSelection.prototype, "_isEnabled", void 0);
@@ -6017,8 +6218,20 @@ var BarcodeSelectionBrushProviderEvents;
6017
6218
  BarcodeSelectionBrushProviderEvents["brushForTrackedBarcode"] = "BarcodeSelectionTrackedBrushProvider.brushForBarcode";
6018
6219
  })(BarcodeSelectionBrushProviderEvents || (BarcodeSelectionBrushProviderEvents = {}));
6019
6220
  class BarcodeSelectionOverlayController extends BaseNewController {
6020
- constructor() {
6221
+ constructor(overlay) {
6021
6222
  super('BarcodeSelectionOverlayProxy');
6223
+ this.overlay = overlay;
6224
+ this.initialize();
6225
+ }
6226
+ initialize() {
6227
+ const aimedBrushProvider = this.overlay.aimedBrushProvider;
6228
+ const trackedBrushProvider = this.overlay.trackedBrushProvider;
6229
+ if (aimedBrushProvider) {
6230
+ this.setAimedBarcodeBrushProvider(aimedBrushProvider);
6231
+ }
6232
+ if (trackedBrushProvider) {
6233
+ this.setTrackedBarcodeBrushProvider(trackedBrushProvider);
6234
+ }
6022
6235
  }
6023
6236
  setTextForAimToSelectAutoHint(text) {
6024
6237
  return __awaiter(this, void 0, void 0, function* () {
@@ -6072,57 +6285,78 @@ class BarcodeSelectionOverlayController extends BaseNewController {
6072
6285
  updateBarcodeSelectionBasicOverlay(overlay) {
6073
6286
  return this._proxy.$updateBarcodeSelectionBasicOverlay({ overlayJson: JSON.stringify(overlay.toJSON()) });
6074
6287
  }
6075
- // TODO: We need to unsubscribe from the providers when the overlay is removed. Need spec.
6076
- // https://scandit.atlassian.net/browse/SDC-16608
6077
6288
  unsubscribeProviders() {
6078
6289
  this._proxy.$removeAimedBarcodeBrushProvider();
6079
6290
  this._proxy.$removeTrackedBarcodeBrushProvider();
6080
- this._proxy.dispose();
6291
+ }
6292
+ dispose() {
6293
+ this.unsubscribeProviders();
6294
+ return this._proxy.dispose();
6081
6295
  }
6082
6296
  }
6083
6297
 
6084
6298
  class BarcodeSelectionBasicOverlay extends DefaultSerializeable {
6299
+ get view() {
6300
+ return this._view;
6301
+ }
6302
+ set view(newView) {
6303
+ var _a, _b;
6304
+ if (newView === null) {
6305
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.dispose();
6306
+ this.controller = null;
6307
+ this._view = null;
6308
+ return;
6309
+ }
6310
+ this._view = newView;
6311
+ (_b = this.controller) !== null && _b !== void 0 ? _b : (this.controller = new BarcodeSelectionOverlayController(this));
6312
+ }
6085
6313
  get trackedBrush() {
6086
6314
  return this._trackedBrush;
6087
6315
  }
6088
6316
  set trackedBrush(newBrush) {
6317
+ var _a;
6089
6318
  this._trackedBrush = newBrush;
6090
- this.overlayController.updateBarcodeSelectionBasicOverlay(this);
6319
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBarcodeSelectionBasicOverlay(this);
6091
6320
  }
6092
6321
  get aimedBrush() {
6093
6322
  return this._aimedBrush;
6094
6323
  }
6095
6324
  set aimedBrush(newBrush) {
6325
+ var _a;
6096
6326
  this._aimedBrush = newBrush;
6097
- this.overlayController.updateBarcodeSelectionBasicOverlay(this);
6327
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBarcodeSelectionBasicOverlay(this);
6098
6328
  }
6099
6329
  get selectedBrush() {
6100
6330
  return this._selectedBrush;
6101
6331
  }
6102
6332
  set selectedBrush(newBrush) {
6333
+ var _a;
6103
6334
  this._selectedBrush = newBrush;
6104
- this.overlayController.updateBarcodeSelectionBasicOverlay(this);
6335
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBarcodeSelectionBasicOverlay(this);
6105
6336
  }
6106
6337
  get selectingBrush() {
6107
6338
  return this._selectingBrush;
6108
6339
  }
6109
6340
  set selectingBrush(newBrush) {
6341
+ var _a;
6110
6342
  this._selectingBrush = newBrush;
6111
- this.overlayController.updateBarcodeSelectionBasicOverlay(this);
6343
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBarcodeSelectionBasicOverlay(this);
6112
6344
  }
6113
6345
  get shouldShowScanAreaGuides() {
6114
6346
  return this._shouldShowScanAreaGuides;
6115
6347
  }
6116
6348
  set shouldShowScanAreaGuides(shouldShow) {
6349
+ var _a;
6117
6350
  this._shouldShowScanAreaGuides = shouldShow;
6118
- this.overlayController.updateBarcodeSelectionBasicOverlay(this);
6351
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBarcodeSelectionBasicOverlay(this);
6119
6352
  }
6120
6353
  get shouldShowHints() {
6121
6354
  return this._shouldShowHints;
6122
6355
  }
6123
6356
  set shouldShowHints(shouldShow) {
6357
+ var _a;
6124
6358
  this._shouldShowHints = shouldShow;
6125
- this.overlayController.updateBarcodeSelectionBasicOverlay(this);
6359
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBarcodeSelectionBasicOverlay(this);
6126
6360
  }
6127
6361
  get viewfinder() {
6128
6362
  return this._viewfinder;
@@ -6130,16 +6364,41 @@ class BarcodeSelectionBasicOverlay extends DefaultSerializeable {
6130
6364
  get style() {
6131
6365
  return this._style;
6132
6366
  }
6367
+ /**
6368
+ * @deprecated Since 7.6. This factory will be removed in 8.0.
6369
+ * Use the public constructor instead and add the overlay to the view manually:
6370
+ * ```ts
6371
+ * const overlay = new BarcodeSelectionBasicOverlay(barcodeSelection);
6372
+ * // configure brushes/viewfinder as needed
6373
+ * view.addOverlay(overlay);
6374
+ * ```
6375
+ */
6133
6376
  static withBarcodeSelection(barcodeSelection) {
6134
6377
  return BarcodeSelectionBasicOverlay.withBarcodeSelectionForView(barcodeSelection, null);
6135
6378
  }
6379
+ /**
6380
+ * @deprecated Since 7.6. This factory will be removed in 8.0.
6381
+ * Use the public constructor instead and add the overlay to the view manually:
6382
+ * ```ts
6383
+ * const overlay = new BarcodeSelectionBasicOverlay(barcodeSelection);
6384
+ * // configure brushes/viewfinder as needed
6385
+ * view.addOverlay(overlay);
6386
+ * ```
6387
+ */
6136
6388
  static withBarcodeSelectionForView(barcodeSelection, view) {
6137
6389
  return this.withBarcodeSelectionForViewWithStyle(barcodeSelection, view, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle);
6138
6390
  }
6391
+ /**
6392
+ * @deprecated Since 7.6. This factory will be removed in 8.0.
6393
+ * Create the overlay and add it to the view manually instead:
6394
+ * ```ts
6395
+ * const overlay = new BarcodeSelectionBasicOverlay(barcodeSelection);
6396
+ * overlay.style = desiredStyle;
6397
+ * view.addOverlay(overlay);
6398
+ * ```
6399
+ */
6139
6400
  static withBarcodeSelectionForViewWithStyle(barcodeSelection, view, style) {
6140
- const overlay = new BarcodeSelectionBasicOverlay();
6141
- overlay.barcodeSelection = barcodeSelection;
6142
- overlay._style = style;
6401
+ const overlay = new BarcodeSelectionBasicOverlay(barcodeSelection, style);
6143
6402
  overlay._trackedBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultTrackedBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultTrackedBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultTrackedBrush.strokeWidth);
6144
6403
  overlay._aimedBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultAimedBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultAimedBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultAimedBrush.strokeWidth);
6145
6404
  overlay._selectedBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultSelectedBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultSelectedBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultSelectedBrush.strokeWidth);
@@ -6152,10 +6411,11 @@ class BarcodeSelectionBasicOverlay extends DefaultSerializeable {
6152
6411
  static get barcodeSelectionDefaults() {
6153
6412
  return getBarcodeSelectionDefaults();
6154
6413
  }
6155
- constructor() {
6414
+ constructor(mode, style) {
6156
6415
  super();
6157
6416
  this.type = 'barcodeSelectionBasic';
6158
- this.overlayController = new BarcodeSelectionOverlayController();
6417
+ this.controller = null;
6418
+ this._view = null;
6159
6419
  this._shouldShowScanAreaGuides = false;
6160
6420
  this._shouldShowHints = true;
6161
6421
  this._viewfinder = new AimerViewfinder();
@@ -6163,26 +6423,38 @@ class BarcodeSelectionBasicOverlay extends DefaultSerializeable {
6163
6423
  this._aimedBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultAimedBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultAimedBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultAimedBrush.strokeWidth);
6164
6424
  this._selectedBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectedBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectedBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectedBrush.strokeWidth);
6165
6425
  this._selectingBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectingBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectingBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectingBrush.strokeWidth);
6426
+ this.aimedBrushProvider = null;
6427
+ this.trackedBrushProvider = null;
6428
+ this._style = style !== null && style !== void 0 ? style : BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle;
6429
+ this.modeId = mode.modeId;
6166
6430
  }
6167
6431
  setTextForAimToSelectAutoHint(text) {
6168
- return this.overlayController.setTextForAimToSelectAutoHint(text);
6432
+ return __awaiter(this, void 0, void 0, function* () {
6433
+ var _a;
6434
+ return (_a = this.controller) === null || _a === void 0 ? void 0 : _a.setTextForAimToSelectAutoHint(text);
6435
+ });
6169
6436
  }
6170
6437
  setAimedBarcodeBrushProvider(brushProvider) {
6171
- return this.overlayController.setAimedBarcodeBrushProvider(brushProvider);
6438
+ return __awaiter(this, void 0, void 0, function* () {
6439
+ var _a;
6440
+ this.aimedBrushProvider = brushProvider;
6441
+ return (_a = this.controller) === null || _a === void 0 ? void 0 : _a.setAimedBarcodeBrushProvider(brushProvider);
6442
+ });
6172
6443
  }
6173
6444
  setTrackedBarcodeBrushProvider(brushProvider) {
6174
- return this.overlayController.setTrackedBarcodeBrushProvider(brushProvider);
6445
+ return __awaiter(this, void 0, void 0, function* () {
6446
+ var _a;
6447
+ this.trackedBrushProvider = brushProvider;
6448
+ return (_a = this.controller) === null || _a === void 0 ? void 0 : _a.setTrackedBarcodeBrushProvider(brushProvider);
6449
+ });
6175
6450
  }
6176
6451
  }
6177
6452
  __decorate([
6178
6453
  ignoreFromSerialization
6179
- ], BarcodeSelectionBasicOverlay.prototype, "barcodeSelection", void 0);
6454
+ ], BarcodeSelectionBasicOverlay.prototype, "controller", void 0);
6180
6455
  __decorate([
6181
6456
  ignoreFromSerialization
6182
- ], BarcodeSelectionBasicOverlay.prototype, "overlayController", void 0);
6183
- __decorate([
6184
- ignoreFromSerialization
6185
- ], BarcodeSelectionBasicOverlay.prototype, "view", void 0);
6457
+ ], BarcodeSelectionBasicOverlay.prototype, "_view", void 0);
6186
6458
  __decorate([
6187
6459
  nameForSerialization('shouldShowScanAreaGuides')
6188
6460
  ], BarcodeSelectionBasicOverlay.prototype, "_shouldShowScanAreaGuides", void 0);
@@ -6207,6 +6479,12 @@ __decorate([
6207
6479
  __decorate([
6208
6480
  nameForSerialization('selectingBrush')
6209
6481
  ], BarcodeSelectionBasicOverlay.prototype, "_selectingBrush", void 0);
6482
+ __decorate([
6483
+ ignoreFromSerialization
6484
+ ], BarcodeSelectionBasicOverlay.prototype, "aimedBrushProvider", void 0);
6485
+ __decorate([
6486
+ ignoreFromSerialization
6487
+ ], BarcodeSelectionBasicOverlay.prototype, "trackedBrushProvider", void 0);
6210
6488
  __decorate([
6211
6489
  ignoreFromSerialization
6212
6490
  ], BarcodeSelectionBasicOverlay, "barcodeSelectionDefaults", null);
@@ -6426,15 +6704,19 @@ var BarcodeBatchListenerEvents;
6426
6704
  BarcodeBatchListenerEvents["didUpdateSession"] = "BarcodeBatchListener.didUpdateSession";
6427
6705
  })(BarcodeBatchListenerEvents || (BarcodeBatchListenerEvents = {}));
6428
6706
  class BarcodeBatchListenerController extends BaseNewController {
6429
- static forBarcodeBatch(barcodeBatch) {
6430
- const controller = new BarcodeBatchListenerController();
6431
- controller.mode = barcodeBatch;
6432
- controller._proxy.isModeEnabled = () => barcodeBatch.isEnabled;
6433
- return controller;
6434
- }
6435
- constructor() {
6707
+ constructor(barcodeBatch) {
6436
6708
  super('BarcodeBatchListenerProxy');
6437
6709
  this.boundHandleDidUpdateSessionEvent = null;
6710
+ this.mode = barcodeBatch;
6711
+ this._proxy.isModeEnabled = () => barcodeBatch.isEnabled;
6712
+ this.initialize();
6713
+ }
6714
+ initialize() {
6715
+ return __awaiter(this, void 0, void 0, function* () {
6716
+ if (this.mode.listeners.length > 0) {
6717
+ this.subscribeListener();
6718
+ }
6719
+ });
6438
6720
  }
6439
6721
  resetSession() {
6440
6722
  return this._proxy.$resetBarcodeBatchSession();
@@ -6502,39 +6784,55 @@ class BarcodeBatch extends DefaultSerializeable {
6502
6784
  return this._isEnabled;
6503
6785
  }
6504
6786
  set isEnabled(isEnabled) {
6787
+ var _a;
6505
6788
  this._isEnabled = isEnabled;
6506
- this.listenerController.setModeEnabledState(isEnabled);
6789
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.setModeEnabledState(isEnabled);
6507
6790
  }
6508
6791
  get context() {
6509
6792
  return this._context;
6510
6793
  }
6794
+ static createRecommendedCameraSettings() {
6795
+ return new CameraSettings(BarcodeBatch.barcodeBatchDefaults.RecommendedCameraSettings);
6796
+ }
6797
+ /**
6798
+ * @deprecated Use createRecommendedCameraSettings() instead to get a new instance that can be safely modified.
6799
+ */
6511
6800
  static get recommendedCameraSettings() {
6512
- return BarcodeBatch.barcodeBatchDefaults.RecommendedCameraSettings;
6801
+ if (BarcodeBatch._recommendedCameraSettings === null) {
6802
+ BarcodeBatch._recommendedCameraSettings = BarcodeBatch.createRecommendedCameraSettings();
6803
+ }
6804
+ return BarcodeBatch._recommendedCameraSettings;
6513
6805
  }
6514
6806
  get _context() {
6515
6807
  return this.privateContext;
6516
6808
  }
6517
6809
  set _context(newContext) {
6810
+ var _a, _b;
6518
6811
  if (newContext == null) {
6519
- this.listenerController.unsubscribeListener();
6520
- }
6521
- else if (this.privateContext == null) {
6522
- this.listenerController.subscribeListener();
6812
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.dispose();
6813
+ this.controller = null;
6814
+ this.privateContext = null;
6815
+ return;
6523
6816
  }
6524
6817
  this.privateContext = newContext;
6818
+ (_b = this.controller) !== null && _b !== void 0 ? _b : (this.controller = new BarcodeBatchListenerController(this));
6525
6819
  }
6526
6820
  static get barcodeBatchDefaults() {
6527
6821
  return getBarcodeBatchDefaults();
6528
6822
  }
6823
+ /**
6824
+ * @deprecated Since 7.6. This factory will be removed in 8.0.
6825
+ * Use the public constructor instead and configure the instance manually:
6826
+ * create a new BarcodeBatch with the settings, and set it to the context.
6827
+ */
6529
6828
  static forContext(context, settings) {
6530
- const barcodeBatch = new BarcodeBatch();
6531
- barcodeBatch.settings = settings;
6829
+ const barcodeBatch = new BarcodeBatch(settings);
6532
6830
  if (context) {
6533
6831
  context.addMode(barcodeBatch);
6534
6832
  }
6535
6833
  return barcodeBatch;
6536
6834
  }
6537
- constructor() {
6835
+ constructor(settings) {
6538
6836
  super();
6539
6837
  this.type = 'barcodeTracking';
6540
6838
  this.modeId = Math.floor(Math.random() * 1000000);
@@ -6543,32 +6841,47 @@ class BarcodeBatch extends DefaultSerializeable {
6543
6841
  this.parentId = null;
6544
6842
  this.listeners = [];
6545
6843
  this.hasListeners = false;
6844
+ this.controller = null;
6546
6845
  this.isInListenerCallback = false;
6547
- this.listenerController = BarcodeBatchListenerController.forBarcodeBatch(this);
6846
+ this.settings = settings;
6548
6847
  }
6549
6848
  applySettings(settings) {
6550
- this.settings = settings;
6551
- return this.listenerController.applyBarcodeBatchModeSettings(settings);
6849
+ return __awaiter(this, void 0, void 0, function* () {
6850
+ var _a;
6851
+ this.settings = settings;
6852
+ return (_a = this.controller) === null || _a === void 0 ? void 0 : _a.applyBarcodeBatchModeSettings(settings);
6853
+ });
6552
6854
  }
6553
6855
  addListener(listener) {
6856
+ var _a;
6554
6857
  if (this.listeners.includes(listener)) {
6555
6858
  return;
6556
6859
  }
6860
+ if (this.listeners.length === 0) {
6861
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.subscribeListener();
6862
+ }
6557
6863
  this.listeners.push(listener);
6558
6864
  this.hasListeners = this.listeners.length > 0;
6559
6865
  }
6560
6866
  removeListener(listener) {
6867
+ var _a;
6561
6868
  if (!this.listeners.includes(listener)) {
6562
6869
  return;
6563
6870
  }
6564
6871
  this.listeners.splice(this.listeners.indexOf(listener), 1);
6565
6872
  this.hasListeners = this.listeners.length > 0;
6873
+ if (!this.hasListeners) {
6874
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.unsubscribeListener();
6875
+ }
6566
6876
  }
6567
6877
  reset() {
6568
- var _a, _b;
6569
- return (_b = (_a = this.listenerController) === null || _a === void 0 ? void 0 : _a.resetSession()) !== null && _b !== void 0 ? _b : Promise.resolve();
6878
+ return __awaiter(this, void 0, void 0, function* () {
6879
+ var _a;
6880
+ return (_a = this.controller) === null || _a === void 0 ? void 0 : _a.resetSession();
6881
+ });
6570
6882
  }
6571
6883
  }
6884
+ BarcodeBatch._recommendedCameraSettings = null;
6572
6885
  __decorate([
6573
6886
  nameForSerialization('enabled')
6574
6887
  ], BarcodeBatch.prototype, "_isEnabled", void 0);
@@ -6584,7 +6897,7 @@ __decorate([
6584
6897
  ], BarcodeBatch.prototype, "listeners", void 0);
6585
6898
  __decorate([
6586
6899
  ignoreFromSerialization
6587
- ], BarcodeBatch.prototype, "listenerController", void 0);
6900
+ ], BarcodeBatch.prototype, "controller", void 0);
6588
6901
  __decorate([
6589
6902
  ignoreFromSerialization
6590
6903
  ], BarcodeBatch.prototype, "isInListenerCallback", void 0);
@@ -6600,10 +6913,6 @@ var BarcodeBatchAdvancedOverlayListenerEvents;
6600
6913
  BarcodeBatchAdvancedOverlayListenerEvents["offsetForTrackedBarcode"] = "BarcodeBatchAdvancedOverlayListener.offsetForTrackedBarcode";
6601
6914
  })(BarcodeBatchAdvancedOverlayListenerEvents || (BarcodeBatchAdvancedOverlayListenerEvents = {}));
6602
6915
  class BarcodeBatchAdvancedOverlayController extends BaseNewController {
6603
- static forOverlay(overlay) {
6604
- const controller = new BarcodeBatchAdvancedOverlayController(overlay);
6605
- return controller;
6606
- }
6607
6916
  constructor(overlay) {
6608
6917
  super('BarcodeBatchAdvancedOverlayProxy');
6609
6918
  // Bound event handlers - using nullable function references instead of boolean flags
@@ -6611,7 +6920,14 @@ class BarcodeBatchAdvancedOverlayController extends BaseNewController {
6611
6920
  this.boundHandleAnchorForTrackedBarcode = null;
6612
6921
  this.boundHandleOffsetForTrackedBarcode = null;
6613
6922
  this.boundHandleDidTapViewForTrackedBarcode = null;
6923
+ this.hasListeners = false;
6614
6924
  this.overlay = overlay;
6925
+ this.initialize();
6926
+ }
6927
+ initialize() {
6928
+ if (this.overlay.listener != null) {
6929
+ this.subscribeListener();
6930
+ }
6615
6931
  }
6616
6932
  setBrushForTrackedBarcode(brush, trackedBarcode) {
6617
6933
  return this._proxy.$setBrushForTrackedBarcode({
@@ -6712,21 +7028,20 @@ class BarcodeBatchAdvancedOverlayController extends BaseNewController {
6712
7028
  });
6713
7029
  }
6714
7030
  subscribeListener() {
6715
- if (this.boundHandleViewForTrackedBarcode !== null) {
7031
+ if (this.hasListeners && this.dataCaptureViewId !== -1) {
6716
7032
  return;
6717
7033
  }
6718
7034
  this.boundHandleViewForTrackedBarcode = this.handleViewForTrackedBarcode.bind(this);
6719
7035
  this.boundHandleAnchorForTrackedBarcode = this.handleAnchorForTrackedBarcode.bind(this);
6720
7036
  this.boundHandleOffsetForTrackedBarcode = this.handleOffsetForTrackedBarcode.bind(this);
6721
7037
  this.boundHandleDidTapViewForTrackedBarcode = this.handleDidTapViewForTrackedBarcode.bind(this);
6722
- if (this.dataCaptureViewId !== -1) {
6723
- this._proxy.$registerListenerForAdvancedOverlayEvents({ dataCaptureViewId: this.dataCaptureViewId });
6724
- }
7038
+ this._proxy.$registerListenerForAdvancedOverlayEvents({ dataCaptureViewId: this.dataCaptureViewId });
6725
7039
  this._proxy.subscribeForEvents(Object.values(BarcodeBatchAdvancedOverlayListenerEvents));
6726
7040
  this._proxy.eventEmitter.on(BarcodeBatchAdvancedOverlayListenerEvents.viewForTrackedBarcode, this.boundHandleViewForTrackedBarcode);
6727
7041
  this._proxy.eventEmitter.on(BarcodeBatchAdvancedOverlayListenerEvents.anchorForTrackedBarcode, this.boundHandleAnchorForTrackedBarcode);
6728
7042
  this._proxy.eventEmitter.on(BarcodeBatchAdvancedOverlayListenerEvents.offsetForTrackedBarcode, this.boundHandleOffsetForTrackedBarcode);
6729
7043
  this._proxy.eventEmitter.on(BarcodeBatchAdvancedOverlayListenerEvents.didTapViewForTrackedBarcode, this.boundHandleDidTapViewForTrackedBarcode);
7044
+ this.hasListeners = true;
6730
7045
  }
6731
7046
  handleViewForTrackedBarcode(ev) {
6732
7047
  return __awaiter(this, void 0, void 0, function* () {
@@ -6792,12 +7107,10 @@ class BarcodeBatchAdvancedOverlayController extends BaseNewController {
6792
7107
  });
6793
7108
  }
6794
7109
  unsubscribeListener() {
6795
- if (this.boundHandleViewForTrackedBarcode === null) {
7110
+ if (!this.hasListeners) {
6796
7111
  return;
6797
7112
  }
6798
- if (this.dataCaptureViewId !== -1) {
6799
- this._proxy.$unregisterListenerForAdvancedOverlayEvents({ dataCaptureViewId: this.dataCaptureViewId });
6800
- }
7113
+ this._proxy.$unregisterListenerForAdvancedOverlayEvents({ dataCaptureViewId: this.dataCaptureViewId });
6801
7114
  this._proxy.unsubscribeFromEvents(Object.values(BarcodeBatchAdvancedOverlayListenerEvents));
6802
7115
  // Remove event listeners using bound functions
6803
7116
  if (this.boundHandleViewForTrackedBarcode) {
@@ -6817,6 +7130,7 @@ class BarcodeBatchAdvancedOverlayController extends BaseNewController {
6817
7130
  this.boundHandleAnchorForTrackedBarcode = null;
6818
7131
  this.boundHandleOffsetForTrackedBarcode = null;
6819
7132
  this.boundHandleDidTapViewForTrackedBarcode = null;
7133
+ this.hasListeners = false;
6820
7134
  }
6821
7135
  get dataCaptureViewId() {
6822
7136
  var _a, _b;
@@ -6824,6 +7138,7 @@ class BarcodeBatchAdvancedOverlayController extends BaseNewController {
6824
7138
  }
6825
7139
  dispose() {
6826
7140
  this.unsubscribeListener();
7141
+ this._proxy.eventEmitter.removeAllListeners();
6827
7142
  this._proxy.dispose();
6828
7143
  }
6829
7144
  }
@@ -6834,15 +7149,18 @@ var BarcodeBatchBasicOverlayListenerEvents;
6834
7149
  BarcodeBatchBasicOverlayListenerEvents["didTapTrackedBarcode"] = "BarcodeBatchBasicOverlayListener.didTapTrackedBarcode";
6835
7150
  })(BarcodeBatchBasicOverlayListenerEvents || (BarcodeBatchBasicOverlayListenerEvents = {}));
6836
7151
  class BarcodeBatchBasicOverlayController extends BaseNewController {
6837
- static forOverlay(overlay) {
6838
- const controller = new BarcodeBatchBasicOverlayController();
6839
- controller.overlay = overlay;
6840
- return controller;
6841
- }
6842
- constructor() {
7152
+ constructor(overlay) {
6843
7153
  super('BarcodeBatchBasicOverlayProxy');
7154
+ this.hasListeners = false;
6844
7155
  this.boundHandleBrushForTrackedBarcode = null;
6845
7156
  this.boundHandleDidTapTrackedBarcode = null;
7157
+ this.overlay = overlay;
7158
+ this.initialize();
7159
+ }
7160
+ initialize() {
7161
+ if (this.overlay.listener != null) {
7162
+ this.subscribeListener();
7163
+ }
6846
7164
  }
6847
7165
  setBrushForTrackedBarcode(brush, trackedBarcode) {
6848
7166
  return this._proxy.$setBrushForTrackedBarcode({
@@ -6862,7 +7180,7 @@ class BarcodeBatchBasicOverlayController extends BaseNewController {
6862
7180
  });
6863
7181
  }
6864
7182
  subscribeListener() {
6865
- if (this.boundHandleBrushForTrackedBarcode) {
7183
+ if (this.hasListeners && this.dataCaptureViewId !== -1) {
6866
7184
  return;
6867
7185
  }
6868
7186
  this.boundHandleBrushForTrackedBarcode = this.handleBrushForTrackedBarcode.bind(this);
@@ -6873,6 +7191,7 @@ class BarcodeBatchBasicOverlayController extends BaseNewController {
6873
7191
  this._proxy.subscribeForEvents(Object.values(BarcodeBatchBasicOverlayListenerEvents));
6874
7192
  this._proxy.eventEmitter.on(BarcodeBatchBasicOverlayListenerEvents.brushForTrackedBarcode, this.boundHandleBrushForTrackedBarcode);
6875
7193
  this._proxy.eventEmitter.on(BarcodeBatchBasicOverlayListenerEvents.didTapTrackedBarcode, this.boundHandleDidTapTrackedBarcode);
7194
+ this.hasListeners = true;
6876
7195
  }
6877
7196
  handleBrushForTrackedBarcode(ev) {
6878
7197
  return __awaiter(this, void 0, void 0, function* () {
@@ -6903,12 +7222,10 @@ class BarcodeBatchBasicOverlayController extends BaseNewController {
6903
7222
  });
6904
7223
  }
6905
7224
  unsubscribeListener() {
6906
- if (!this.boundHandleBrushForTrackedBarcode) {
7225
+ if (!this.hasListeners) {
6907
7226
  return;
6908
7227
  }
6909
- if (this.dataCaptureViewId !== -1) {
6910
- this._proxy.$unregisterListenerForBasicOverlayEvents({ dataCaptureViewId: this.dataCaptureViewId });
6911
- }
7228
+ this._proxy.$unregisterListenerForBasicOverlayEvents({ dataCaptureViewId: this.dataCaptureViewId });
6912
7229
  this._proxy.unsubscribeFromEvents(Object.values(BarcodeBatchBasicOverlayListenerEvents));
6913
7230
  if (this.boundHandleBrushForTrackedBarcode) {
6914
7231
  this._proxy.eventEmitter.off(BarcodeBatchBasicOverlayListenerEvents.brushForTrackedBarcode, this.boundHandleBrushForTrackedBarcode);
@@ -6918,6 +7235,7 @@ class BarcodeBatchBasicOverlayController extends BaseNewController {
6918
7235
  }
6919
7236
  this.boundHandleBrushForTrackedBarcode = null;
6920
7237
  this.boundHandleDidTapTrackedBarcode = null;
7238
+ this.hasListeners = false;
6921
7239
  }
6922
7240
  get dataCaptureViewId() {
6923
7241
  var _a, _b;
@@ -6930,33 +7248,38 @@ class BarcodeBatchBasicOverlayController extends BaseNewController {
6930
7248
  }
6931
7249
 
6932
7250
  class BarcodeBatchBasicOverlay extends DefaultSerializeable {
7251
+ get view() {
7252
+ return this._view;
7253
+ }
7254
+ set view(newView) {
7255
+ var _a, _b;
7256
+ if (newView === null) {
7257
+ this._view = null;
7258
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.dispose();
7259
+ this.controller = null;
7260
+ return;
7261
+ }
7262
+ this._view = newView;
7263
+ (_b = this.controller) !== null && _b !== void 0 ? _b : (this.controller = new BarcodeBatchBasicOverlayController(this));
7264
+ }
7265
+ get _dataCaptureViewId() {
7266
+ var _a, _b;
7267
+ return (_b = (_a = this.view) === null || _a === void 0 ? void 0 : _a.viewId) !== null && _b !== void 0 ? _b : -1;
7268
+ }
6933
7269
  get listener() {
6934
7270
  return this._listener;
6935
7271
  }
6936
7272
  set listener(newListener) {
7273
+ var _a, _b;
6937
7274
  this._hasListener = newListener != null;
6938
7275
  this._listener = newListener;
6939
7276
  if (this._listener != null) {
6940
- this.controller.subscribeListener();
6941
- }
6942
- else {
6943
- this.controller.unsubscribeListener();
6944
- }
6945
- }
6946
- set view(newView) {
6947
- var _a;
6948
- this._view = newView;
6949
- this._dataCaptureViewId = (_a = newView === null || newView === void 0 ? void 0 : newView.viewId) !== null && _a !== void 0 ? _a : -1;
6950
- if (this._view != null && this._hasListener) {
6951
- this.controller.subscribeListener();
7277
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.subscribeListener();
6952
7278
  }
6953
7279
  else {
6954
- this.controller.unsubscribeListener();
7280
+ (_b = this.controller) === null || _b === void 0 ? void 0 : _b.unsubscribeListener();
6955
7281
  }
6956
7282
  }
6957
- get view() {
6958
- return this._view;
6959
- }
6960
7283
  get defaultBrush() {
6961
7284
  return this.brush;
6962
7285
  }
@@ -6967,29 +7290,53 @@ class BarcodeBatchBasicOverlay extends DefaultSerializeable {
6967
7290
  return this._brush;
6968
7291
  }
6969
7292
  set brush(newBrush) {
7293
+ var _a;
6970
7294
  this._brush = newBrush;
6971
- this.controller.updateBarcodeBatchBasicOverlay();
7295
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBarcodeBatchBasicOverlay();
6972
7296
  }
6973
7297
  get shouldShowScanAreaGuides() {
6974
7298
  return this._shouldShowScanAreaGuides;
6975
7299
  }
6976
7300
  set shouldShowScanAreaGuides(shouldShow) {
7301
+ var _a;
6977
7302
  this._shouldShowScanAreaGuides = shouldShow;
6978
- this.controller.updateBarcodeBatchBasicOverlay();
7303
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBarcodeBatchBasicOverlay();
6979
7304
  }
6980
7305
  get style() {
6981
7306
  return this._style;
6982
7307
  }
7308
+ /**
7309
+ * @deprecated Since 7.6. This factory will be removed in 8.0.
7310
+ * Create the overlay and add it to the view manually instead:
7311
+ * ```ts
7312
+ * const overlay = new BarcodeBatchBasicOverlay(desiredStyle);
7313
+ * view.addOverlay(overlay);
7314
+ * ```
7315
+ */
6983
7316
  static withBarcodeBatch(barcodeBatch) {
6984
7317
  return BarcodeBatchBasicOverlay.withBarcodeBatchForView(barcodeBatch, null);
6985
7318
  }
7319
+ /**
7320
+ * @deprecated Since 7.6. This factory will be removed in 8.0.
7321
+ * Create the overlay and add it to the view manually instead:
7322
+ * ```ts
7323
+ * const overlay = new BarcodeBatchBasicOverlay(desiredStyle);
7324
+ * view.addOverlay(overlay);
7325
+ * ```
7326
+ */
6986
7327
  static withBarcodeBatchForView(barcodeBatch, view) {
6987
7328
  return this.withBarcodeBatchForViewWithStyle(barcodeBatch, view, BarcodeBatchBasicOverlay.barcodeBatchDefaults.BarcodeBatchBasicOverlay.defaultStyle);
6988
7329
  }
7330
+ /**
7331
+ * @deprecated Since 7.6. This factory will be removed in 8.0.
7332
+ * Create the overlay and add it to the view manually instead:
7333
+ * ```ts
7334
+ * const overlay = new BarcodeBatchBasicOverlay(desiredStyle);
7335
+ * view.addOverlay(overlay);
7336
+ * ```
7337
+ */
6989
7338
  static withBarcodeBatchForViewWithStyle(barcodeBatch, view, style) {
6990
- const overlay = new BarcodeBatchBasicOverlay();
6991
- overlay.barcodeBatch = barcodeBatch;
6992
- overlay._style = style;
7339
+ const overlay = new BarcodeBatchBasicOverlay(barcodeBatch, style);
6993
7340
  overlay._brush = new Brush(BarcodeBatchBasicOverlay.barcodeBatchDefaults.BarcodeBatchBasicOverlay.styles[style].DefaultBrush.fillColor, BarcodeBatchBasicOverlay.barcodeBatchDefaults.BarcodeBatchBasicOverlay.styles[style].DefaultBrush.strokeColor, BarcodeBatchBasicOverlay.barcodeBatchDefaults.BarcodeBatchBasicOverlay.styles[style].DefaultBrush.strokeWidth);
6994
7341
  if (view) {
6995
7342
  view.addOverlay(overlay);
@@ -6999,27 +7346,31 @@ class BarcodeBatchBasicOverlay extends DefaultSerializeable {
6999
7346
  static get barcodeBatchDefaults() {
7000
7347
  return getBarcodeBatchDefaults();
7001
7348
  }
7002
- constructor() {
7349
+ constructor(mode, style) {
7003
7350
  super();
7004
7351
  this.type = 'barcodeTrackingBasic';
7005
7352
  this._view = null;
7006
7353
  this._hasListener = false;
7007
- this._dataCaptureViewId = -1;
7008
7354
  this._listener = null;
7009
7355
  this._brush = BarcodeBatchBasicOverlay.barcodeBatchDefaults.BarcodeBatchBasicOverlay.DefaultBrush;
7010
7356
  this._shouldShowScanAreaGuides = false;
7011
- this.controller = BarcodeBatchBasicOverlayController.forOverlay(this);
7357
+ this.controller = null;
7358
+ this._style = style;
7359
+ this.modeId = mode.modeId;
7012
7360
  }
7013
7361
  setBrushForTrackedBarcode(brush, trackedBarcode) {
7014
- return this.controller.setBrushForTrackedBarcode(brush, trackedBarcode);
7362
+ return __awaiter(this, void 0, void 0, function* () {
7363
+ var _a;
7364
+ return (_a = this.controller) === null || _a === void 0 ? void 0 : _a.setBrushForTrackedBarcode(brush, trackedBarcode);
7365
+ });
7015
7366
  }
7016
7367
  clearTrackedBarcodeBrushes() {
7017
- return this.controller.clearTrackedBarcodeBrushes();
7368
+ return __awaiter(this, void 0, void 0, function* () {
7369
+ var _a;
7370
+ return (_a = this.controller) === null || _a === void 0 ? void 0 : _a.clearTrackedBarcodeBrushes();
7371
+ });
7018
7372
  }
7019
7373
  }
7020
- __decorate([
7021
- ignoreFromSerialization
7022
- ], BarcodeBatchBasicOverlay.prototype, "barcodeBatch", void 0);
7023
7374
  __decorate([
7024
7375
  ignoreFromSerialization
7025
7376
  ], BarcodeBatchBasicOverlay.prototype, "_view", void 0);
@@ -7031,7 +7382,7 @@ __decorate([
7031
7382
  ], BarcodeBatchBasicOverlay.prototype, "_hasListener", void 0);
7032
7383
  __decorate([
7033
7384
  nameForSerialization('dataCaptureViewId')
7034
- ], BarcodeBatchBasicOverlay.prototype, "_dataCaptureViewId", void 0);
7385
+ ], BarcodeBatchBasicOverlay.prototype, "_dataCaptureViewId", null);
7035
7386
  __decorate([
7036
7387
  ignoreFromSerialization
7037
7388
  ], BarcodeBatchBasicOverlay.prototype, "_listener", void 0);
@@ -7107,93 +7458,105 @@ __decorate([
7107
7458
  ], BarcodeBatchSettings, "barcodeDefaults", null);
7108
7459
 
7109
7460
  class BaseBarcodeBatchAdvancedOverlay extends DefaultSerializeable {
7461
+ get view() {
7462
+ return this._view;
7463
+ }
7464
+ set view(newView) {
7465
+ var _a, _b;
7466
+ if (newView === null) {
7467
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.dispose();
7468
+ this.controller = null;
7469
+ this._view = null;
7470
+ return;
7471
+ }
7472
+ this._view = newView;
7473
+ (_b = this.controller) !== null && _b !== void 0 ? _b : (this.controller = new BarcodeBatchAdvancedOverlayController(this));
7474
+ }
7110
7475
  get shouldShowScanAreaGuides() {
7111
7476
  return this._shouldShowScanAreaGuides;
7112
7477
  }
7113
7478
  set shouldShowScanAreaGuides(shouldShow) {
7479
+ var _a;
7114
7480
  this._shouldShowScanAreaGuides = shouldShow;
7115
- this.controller.updateBarcodeBatchAdvancedOverlay();
7481
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBarcodeBatchAdvancedOverlay();
7482
+ }
7483
+ get _dataCaptureViewId() {
7484
+ var _a, _b;
7485
+ return (_b = (_a = this.view) === null || _a === void 0 ? void 0 : _a.viewId) !== null && _b !== void 0 ? _b : -1;
7116
7486
  }
7117
7487
  get listener() {
7118
7488
  return this._listener;
7119
7489
  }
7120
7490
  set listener(newListener) {
7491
+ var _a, _b;
7121
7492
  this._hasListener = newListener != null;
7122
7493
  this._listener = newListener;
7123
7494
  if (this._listener != null) {
7124
- this.controller.subscribeListener();
7125
- }
7126
- else {
7127
- this.controller.unsubscribeListener();
7128
- }
7129
- }
7130
- set view(newView) {
7131
- var _a;
7132
- this._view = newView;
7133
- this.dataCaptureViewId = (_a = newView === null || newView === void 0 ? void 0 : newView.viewId) !== null && _a !== void 0 ? _a : -1;
7134
- if (this._view != null && this._hasListener) {
7135
- this.controller.subscribeListener();
7495
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.subscribeListener();
7136
7496
  }
7137
7497
  else {
7138
- this.controller.unsubscribeListener();
7498
+ (_b = this.controller) === null || _b === void 0 ? void 0 : _b.unsubscribeListener();
7139
7499
  }
7140
7500
  }
7141
- get view() {
7142
- return this._view;
7143
- }
7144
- initialize(barcodeBatch, view) {
7145
- this.barcodeBatch = barcodeBatch;
7146
- if (view) {
7147
- view.addOverlay(this);
7148
- }
7149
- }
7150
- constructor() {
7501
+ constructor(mode) {
7151
7502
  super();
7152
7503
  this.type = 'barcodeTrackingAdvanced';
7504
+ this.controller = null;
7505
+ this._view = null;
7153
7506
  this._shouldShowScanAreaGuides = false;
7154
7507
  this._hasListener = false;
7155
- this.dataCaptureViewId = -1;
7156
7508
  this._listener = null;
7157
- this._view = null;
7158
- this.controller = BarcodeBatchAdvancedOverlayController.forOverlay(this);
7509
+ this.modeId = mode.modeId;
7159
7510
  }
7160
7511
  setViewForTrackedBarcode(view, trackedBarcode) {
7161
- return this.controller.setViewForTrackedBarcode(view, trackedBarcode);
7512
+ return __awaiter(this, void 0, void 0, function* () {
7513
+ var _a;
7514
+ return (_a = this.controller) === null || _a === void 0 ? void 0 : _a.setViewForTrackedBarcode(view, trackedBarcode);
7515
+ });
7162
7516
  }
7163
7517
  setAnchorForTrackedBarcode(anchor, trackedBarcode) {
7164
- return this.controller.setAnchorForTrackedBarcode(anchor, trackedBarcode);
7518
+ return __awaiter(this, void 0, void 0, function* () {
7519
+ var _a;
7520
+ return (_a = this.controller) === null || _a === void 0 ? void 0 : _a.setAnchorForTrackedBarcode(anchor, trackedBarcode);
7521
+ });
7165
7522
  }
7166
7523
  setOffsetForTrackedBarcode(offset, trackedBarcode) {
7167
- return this.controller.setOffsetForTrackedBarcode(offset, trackedBarcode);
7524
+ return __awaiter(this, void 0, void 0, function* () {
7525
+ var _a;
7526
+ return (_a = this.controller) === null || _a === void 0 ? void 0 : _a.setOffsetForTrackedBarcode(offset, trackedBarcode);
7527
+ });
7168
7528
  }
7169
7529
  clearTrackedBarcodeViews() {
7170
- return this.controller.clearTrackedBarcodeViews();
7530
+ return __awaiter(this, void 0, void 0, function* () {
7531
+ var _a;
7532
+ return (_a = this.controller) === null || _a === void 0 ? void 0 : _a.clearTrackedBarcodeViews();
7533
+ });
7171
7534
  }
7172
7535
  updateSizeOfTrackedBarcodeView(trackedBarcodeIdentifier, width, height) {
7173
- return this.controller.updateSizeOfTrackedBarcodeView(trackedBarcodeIdentifier, width, height);
7536
+ return __awaiter(this, void 0, void 0, function* () {
7537
+ var _a;
7538
+ return (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateSizeOfTrackedBarcodeView(trackedBarcodeIdentifier, width, height);
7539
+ });
7174
7540
  }
7175
7541
  }
7176
7542
  __decorate([
7177
- nameForSerialization('shouldShowScanAreaGuides')
7178
- ], BaseBarcodeBatchAdvancedOverlay.prototype, "_shouldShowScanAreaGuides", void 0);
7543
+ ignoreFromSerialization
7544
+ ], BaseBarcodeBatchAdvancedOverlay.prototype, "controller", void 0);
7179
7545
  __decorate([
7180
7546
  ignoreFromSerialization
7181
- ], BaseBarcodeBatchAdvancedOverlay.prototype, "barcodeBatch", void 0);
7547
+ ], BaseBarcodeBatchAdvancedOverlay.prototype, "_view", void 0);
7548
+ __decorate([
7549
+ nameForSerialization('shouldShowScanAreaGuides')
7550
+ ], BaseBarcodeBatchAdvancedOverlay.prototype, "_shouldShowScanAreaGuides", void 0);
7182
7551
  __decorate([
7183
7552
  nameForSerialization('hasListener')
7184
7553
  ], BaseBarcodeBatchAdvancedOverlay.prototype, "_hasListener", void 0);
7185
7554
  __decorate([
7186
7555
  nameForSerialization('dataCaptureViewId')
7187
- ], BaseBarcodeBatchAdvancedOverlay.prototype, "dataCaptureViewId", void 0);
7556
+ ], BaseBarcodeBatchAdvancedOverlay.prototype, "_dataCaptureViewId", null);
7188
7557
  __decorate([
7189
7558
  ignoreFromSerialization
7190
7559
  ], BaseBarcodeBatchAdvancedOverlay.prototype, "_listener", void 0);
7191
- __decorate([
7192
- ignoreFromSerialization
7193
- ], BaseBarcodeBatchAdvancedOverlay.prototype, "controller", void 0);
7194
- __decorate([
7195
- ignoreFromSerialization
7196
- ], BaseBarcodeBatchAdvancedOverlay.prototype, "_view", void 0);
7197
7560
 
7198
7561
  class SparkScan extends DefaultSerializeable {
7199
7562
  get isEnabled() {
@@ -7213,12 +7576,18 @@ class SparkScan extends DefaultSerializeable {
7213
7576
  set _context(newContext) {
7214
7577
  this.privateContext = newContext;
7215
7578
  }
7579
+ /**
7580
+ * @deprecated Since 7.6. This factory will be removed in 8.0.
7581
+ * Use the public constructor instead and configure the instance manually:
7582
+ * ```ts
7583
+ * const sparkScan = new SparkScan(settings);
7584
+ * ```
7585
+ */
7216
7586
  static forSettings(settings) {
7217
- const sparkScan = new SparkScan();
7218
- sparkScan.settings = settings;
7587
+ const sparkScan = new SparkScan(settings);
7219
7588
  return sparkScan;
7220
7589
  }
7221
- constructor() {
7590
+ constructor(settings) {
7222
7591
  super();
7223
7592
  this.type = 'sparkScan';
7224
7593
  this._isEnabled = true;
@@ -7227,6 +7596,7 @@ class SparkScan extends DefaultSerializeable {
7227
7596
  this.listeners = [];
7228
7597
  this.controller = null;
7229
7598
  this.isInListenerCallback = false;
7599
+ this.applySettings(settings);
7230
7600
  }
7231
7601
  applySettings(settings) {
7232
7602
  this.settings = settings;
@@ -7989,6 +8359,13 @@ class BaseSparkScanView {
7989
8359
  this._controller.unsubscribeViewListeners();
7990
8360
  }
7991
8361
  }
8362
+ /**
8363
+ * @deprecated Since 7.6. This factory will be removed in 8.0.
8364
+ * Use the constructor directly:
8365
+ * ```ts
8366
+ * new BaseSparkScanView({ context, sparkScan, settings })
8367
+ * ```
8368
+ */
7992
8369
  static forContext(context, sparkScan, settings) {
7993
8370
  const view = new BaseSparkScanView({ context, sparkScan, settings });
7994
8371
  return view;
@@ -8587,14 +8964,20 @@ class BarcodePick extends DefaultSerializeable {
8587
8964
  set controller(newController) {
8588
8965
  this._controller = newController;
8589
8966
  }
8590
- static createRecommendedCameraSettings() {
8591
- return BarcodePick.barcodePickDefaults.RecommendedCameraSettings;
8592
- }
8593
8967
  static get barcodePickDefaults() {
8594
8968
  return getBarcodePickDefaults();
8595
8969
  }
8970
+ static createRecommendedCameraSettings() {
8971
+ return new CameraSettings(BarcodePick.barcodePickDefaults.RecommendedCameraSettings);
8972
+ }
8973
+ /**
8974
+ * @deprecated Use createRecommendedCameraSettings() instead to get a new instance that can be safely modified.
8975
+ */
8596
8976
  static get recommendedCameraSettings() {
8597
- return BarcodePick.barcodePickDefaults.RecommendedCameraSettings;
8977
+ if (BarcodePick._recommendedCameraSettings === null) {
8978
+ BarcodePick._recommendedCameraSettings = BarcodePick.createRecommendedCameraSettings();
8979
+ }
8980
+ return BarcodePick._recommendedCameraSettings;
8598
8981
  }
8599
8982
  constructor(dataCaptureContext, settings, productProvider) {
8600
8983
  super();
@@ -8666,6 +9049,7 @@ class BarcodePick extends DefaultSerializeable {
8666
9049
  }
8667
9050
  }
8668
9051
  }
9052
+ BarcodePick._recommendedCameraSettings = null;
8669
9053
  __decorate([
8670
9054
  ignoreFromSerialization
8671
9055
  ], BarcodePick.prototype, "privateContext", void 0);
@@ -10065,7 +10449,7 @@ __decorate([
10065
10449
  ], BarcodeFindFeedback.prototype, "_itemListUpdated", void 0);
10066
10450
 
10067
10451
  class BarcodeFind extends DefaultSerializeable {
10068
- constructor(dataCaptureContext, settings) {
10452
+ constructor(settings) {
10069
10453
  super();
10070
10454
  this.type = 'barcodeFind';
10071
10455
  this._feedback = BarcodeFindFeedback.defaultFeedback;
@@ -10076,20 +10460,33 @@ class BarcodeFind extends DefaultSerializeable {
10076
10460
  this._hasListeners = false;
10077
10461
  this.listeners = [];
10078
10462
  this._controller = null;
10463
+ this._dataCaptureContext = null;
10079
10464
  this.barcodeTransformer = null;
10080
10465
  this._settings = settings;
10081
- this._dataCaptureContext = dataCaptureContext;
10082
10466
  this._feedback.controller = this._controller;
10083
- // No need to add the mode to the context
10084
10467
  }
10468
+ /**
10469
+ * @deprecated Use the constructor instead.
10470
+ */
10085
10471
  static forContext(dataCaptureContext, settings) {
10086
- return new BarcodeFind(dataCaptureContext, settings);
10472
+ const mode = new BarcodeFind(settings);
10473
+ mode._dataCaptureContext = dataCaptureContext;
10474
+ return mode;
10087
10475
  }
10088
10476
  static get barcodeFindDefaults() {
10089
10477
  return getBarcodeFindDefaults();
10090
10478
  }
10479
+ static createRecommendedCameraSettings() {
10480
+ return new CameraSettings(BarcodeFind.barcodeFindDefaults.RecommendedCameraSettings);
10481
+ }
10482
+ /**
10483
+ * @deprecated Use createRecommendedCameraSettings() instead to get a new instance that can be safely modified.
10484
+ */
10091
10485
  static get recommendedCameraSettings() {
10092
- return BarcodeFind.barcodeFindDefaults.RecommendedCameraSettings;
10486
+ if (BarcodeFind._recommendedCameraSettings === null) {
10487
+ BarcodeFind._recommendedCameraSettings = BarcodeFind.createRecommendedCameraSettings();
10488
+ }
10489
+ return BarcodeFind._recommendedCameraSettings;
10093
10490
  }
10094
10491
  get context() {
10095
10492
  return this._dataCaptureContext;
@@ -10184,6 +10581,7 @@ class BarcodeFind extends DefaultSerializeable {
10184
10581
  this._feedback.controller = this._controller;
10185
10582
  }
10186
10583
  }
10584
+ BarcodeFind._recommendedCameraSettings = null;
10187
10585
  __decorate([
10188
10586
  nameForSerialization('feedback')
10189
10587
  ], BarcodeFind.prototype, "_feedback", void 0);
@@ -10745,28 +11143,19 @@ class BaseBarcodeFindView {
10745
11143
  get context() {
10746
11144
  return this._dataCaptureContext;
10747
11145
  }
10748
- constructor(context, barcodeFind, barcodeFindViewSettings, cameraSettings) {
11146
+ constructor(props) {
10749
11147
  this.isViewCreated = false;
10750
11148
  this._startSearching = false;
10751
11149
  this._isInitialized = false;
10752
11150
  this._viewId = -1; // -1 means the view is not created yet
10753
11151
  this._barcodeFindViewUiListener = null;
10754
- this._dataCaptureContext = context;
10755
- this._barcodeFind = barcodeFind;
10756
- this._barcodeFindViewSettings = barcodeFindViewSettings;
10757
- this._cameraSettings = cameraSettings;
11152
+ this._dataCaptureContext = props.context;
11153
+ this._barcodeFind = props.barcodeFind;
11154
+ this._barcodeFindViewSettings = props.viewSettings;
11155
+ this._cameraSettings = props.cameraSettings;
10758
11156
  this.controller = BarcodeFindViewController.forBarcodeFindView(this);
10759
11157
  this._barcodeFind.controller = this.controller;
10760
11158
  }
10761
- static forMode(dataCaptureContext, barcodeFind) {
10762
- return new BaseBarcodeFindView(dataCaptureContext, barcodeFind);
10763
- }
10764
- static forModeWithViewSettings(dataCaptureContext, barcodeFind, viewSettings) {
10765
- return new BaseBarcodeFindView(dataCaptureContext, barcodeFind, viewSettings);
10766
- }
10767
- static forModeWithViewSettingsAndCameraSettings(dataCaptureContext, barcodeFind, viewSettings, cameraSettings) {
10768
- return new BaseBarcodeFindView(dataCaptureContext, barcodeFind, viewSettings, cameraSettings);
10769
- }
10770
11159
  static get barcodeFindViewDefaults() {
10771
11160
  return getBarcodeFindDefaults().BarcodeFindView;
10772
11161
  }
@@ -11202,4 +11591,4 @@ var QrCodeErrorCorrectionLevel;
11202
11591
  QrCodeErrorCorrectionLevel["High"] = "high";
11203
11592
  })(QrCodeErrorCorrectionLevel || (QrCodeErrorCorrectionLevel = {}));
11204
11593
 
11205
- export { ArucoDictionary, ArucoDictionaryPreset, ArucoMarker, AztecBarcodeGeneratorBuilder, Barcode, BarcodeAr, BarcodeArAnnotationProviderEvents, BarcodeArAnnotationTrigger, BarcodeArCircleHighlight, BarcodeArCircleHighlightPreset, BarcodeArEvents, BarcodeArFeedback, BarcodeArHighlightProviderEvents, BarcodeArInfoAnnotation, BarcodeArInfoAnnotationAnchor, BarcodeArInfoAnnotationBodyComponent, BarcodeArInfoAnnotationFooter, BarcodeArInfoAnnotationHeader, BarcodeArInfoAnnotationWidthPreset, BarcodeArPopoverAnnotation, BarcodeArPopoverAnnotationButton, BarcodeArRectangleHighlight, BarcodeArSession, BarcodeArSessionController, BarcodeArSettings, BarcodeArStatusIconAnnotation, BarcodeArViewController, BarcodeArViewEvents, BarcodeArViewSettings, BarcodeBatch, BarcodeBatchAdvancedOverlayController, BarcodeBatchAdvancedOverlayListenerEvents, BarcodeBatchBasicOverlay, BarcodeBatchBasicOverlayController, BarcodeBatchBasicOverlayListenerEvents, BarcodeBatchBasicOverlayStyle, BarcodeBatchListenerController, BarcodeBatchListenerEvents, BarcodeBatchScenario, BarcodeBatchSession, BarcodeBatchSettings, BarcodeCapture, BarcodeCaptureFeedback, BarcodeCaptureListenerController, BarcodeCaptureListenerEvents, BarcodeCaptureOverlay, BarcodeCaptureOverlayStyle, BarcodeCaptureSession, BarcodeCaptureSettings, BarcodeCount, BarcodeCountCaptureList, BarcodeCountCaptureListSession, BarcodeCountFeedback, BarcodeCountNotInListActionSettings, BarcodeCountSession, BarcodeCountSessionController, BarcodeCountSettings, BarcodeCountToolbarSettings, BarcodeCountViewController, BarcodeCountViewEvents, BarcodeCountViewStyle, BarcodeFilterHighlightSettingsBrush, BarcodeFilterHighlightType, BarcodeFilterSettings, BarcodeFind, BarcodeFindFeedback, BarcodeFindItem, BarcodeFindItemContent, BarcodeFindItemSearchOptions, BarcodeFindListenerEvents, BarcodeFindSession, BarcodeFindSettings, BarcodeFindViewController, BarcodeFindViewEvents, BarcodeFindViewSettings, BarcodeGenerator, BarcodeGeneratorBuilder, BarcodeGeneratorController, BarcodePick, BarcodePickActionCallback, BarcodePickActionEvents, BarcodePickAsyncMapperProductProvider, BarcodePickAsyncMapperProductProviderEvents, BarcodePickListenerEvents, BarcodePickProduct, BarcodePickProductProviderCallback, BarcodePickProductProviderCallbackItem, BarcodePickScanningEvents, BarcodePickScanningSession, BarcodePickSession, BarcodePickSettings, BarcodePickState, BarcodePickStatusIconSettings, BarcodePickViewController, BarcodePickViewEventHandlers, BarcodePickViewEvents, BarcodePickViewSettings, BarcodePickViewUiEvents, BarcodeSelection, BarcodeSelectionAimerSelection, BarcodeSelectionAutoSelectionStrategy, BarcodeSelectionBasicOverlay, BarcodeSelectionBasicOverlayStyle, BarcodeSelectionBrushProviderEvents, BarcodeSelectionController, BarcodeSelectionFeedback, BarcodeSelectionFreezeBehavior, BarcodeSelectionListenerController, BarcodeSelectionListenerEvents, BarcodeSelectionManualSelectionStrategy, BarcodeSelectionOverlayController, BarcodeSelectionSession, BarcodeSelectionSettings, BarcodeSelectionStrategyType, BarcodeSelectionTapBehavior, BarcodeSelectionTapSelection, BarcodeSelectionTypeName, BarcodeSpatialGrid, BaseBarcodeArView, BaseBarcodeBatchAdvancedOverlay, BaseBarcodeCountView, BaseBarcodeFindView, BaseBarcodePickView, BaseSparkScanView, BatterySavingMode, BrushForStateObject, Checksum, Code128BarcodeGeneratorBuilder, Code39BarcodeGeneratorBuilder, CompositeFlag, CompositeType, DataMatrixBarcodeGeneratorBuilder, Dot, DotWithIcons, Ean13BarcodeGeneratorBuilder, Ean13UpcaClassification, EncodingRange, InterleavedTwoOfFiveBarcodeGeneratorBuilder, LocalizedOnlyBarcode, PrivateBarcodeSelectionStrategy, PrivateBarcodeSelectionType, QrCodeBarcodeGeneratorBuilder, QrCodeErrorCorrectionLevel, Range, Rectangular, RectangularWithIcons, SparkScan, SparkScanBarcodeErrorFeedback, SparkScanBarcodeFeedback, SparkScanBarcodeSuccessFeedback, SparkScanMiniPreviewSize, SparkScanPreviewBehavior, SparkScanScanningBehavior, SparkScanScanningModeDefault, SparkScanScanningModeTarget, SparkScanSession, SparkScanSettings, SparkScanToastSettings, SparkScanViewController, SparkScanViewEvents, SparkScanViewSettings, SparkScanViewState, StructuredAppendData, Symbology, SymbologyDescription, SymbologySettings, TargetBarcode, TrackedBarcode, UpcaBarcodeGeneratorBuilder, getBarcodeArDefaults, getBarcodeBatchDefaults, getBarcodeCaptureDefaults, getBarcodeCountDefaults, getBarcodeDefaults, getBarcodeFindDefaults, getBarcodePickDefaults, getBarcodeSelectionDefaults, getSparkScanDefaults, loadBarcodeArDefaults, loadBarcodeBatchDefaults, loadBarcodeCaptureDefaults, loadBarcodeCountDefaults, loadBarcodeDefaults, loadBarcodeFindDefaults, loadBarcodePickDefaults, loadBarcodeSelectionDefaults, loadSparkScanDefaults };
11594
+ export { ArucoDictionary, ArucoDictionaryPreset, ArucoMarker, AztecBarcodeGeneratorBuilder, Barcode, BarcodeAr, BarcodeArAnnotationProviderEvents, BarcodeArAnnotationTrigger, BarcodeArCircleHighlight, BarcodeArCircleHighlightPreset, BarcodeArEvents, BarcodeArFeedback, BarcodeArHighlightProviderEvents, BarcodeArInfoAnnotation, BarcodeArInfoAnnotationAnchor, BarcodeArInfoAnnotationBodyComponent, BarcodeArInfoAnnotationFooter, BarcodeArInfoAnnotationHeader, BarcodeArInfoAnnotationWidthPreset, BarcodeArPopoverAnnotation, BarcodeArPopoverAnnotationButton, BarcodeArRectangleHighlight, BarcodeArSession, BarcodeArSessionController, BarcodeArSettings, BarcodeArStatusIconAnnotation, BarcodeArViewController, BarcodeArViewEvents, BarcodeArViewSettings, BarcodeBatch, BarcodeBatchAdvancedOverlayController, BarcodeBatchAdvancedOverlayListenerEvents, BarcodeBatchBasicOverlay, BarcodeBatchBasicOverlayController, BarcodeBatchBasicOverlayListenerEvents, BarcodeBatchBasicOverlayStyle, BarcodeBatchListenerController, BarcodeBatchListenerEvents, BarcodeBatchScenario, BarcodeBatchSession, BarcodeBatchSettings, BarcodeCapture, BarcodeCaptureFeedback, BarcodeCaptureListenerController, BarcodeCaptureListenerEvents, BarcodeCaptureOverlay, BarcodeCaptureOverlayController, BarcodeCaptureOverlayStyle, BarcodeCaptureSession, BarcodeCaptureSettings, BarcodeCount, BarcodeCountCaptureList, BarcodeCountCaptureListSession, BarcodeCountFeedback, BarcodeCountNotInListActionSettings, BarcodeCountSession, BarcodeCountSessionController, BarcodeCountSettings, BarcodeCountToolbarSettings, BarcodeCountViewController, BarcodeCountViewEvents, BarcodeCountViewStyle, BarcodeFilterHighlightSettingsBrush, BarcodeFilterHighlightType, BarcodeFilterSettings, BarcodeFind, BarcodeFindFeedback, BarcodeFindItem, BarcodeFindItemContent, BarcodeFindItemSearchOptions, BarcodeFindListenerEvents, BarcodeFindSession, BarcodeFindSettings, BarcodeFindViewController, BarcodeFindViewEvents, BarcodeFindViewSettings, BarcodeGenerator, BarcodeGeneratorBuilder, BarcodeGeneratorController, BarcodePick, BarcodePickActionCallback, BarcodePickActionEvents, BarcodePickAsyncMapperProductProvider, BarcodePickAsyncMapperProductProviderEvents, BarcodePickListenerEvents, BarcodePickProduct, BarcodePickProductProviderCallback, BarcodePickProductProviderCallbackItem, BarcodePickScanningEvents, BarcodePickScanningSession, BarcodePickSession, BarcodePickSettings, BarcodePickState, BarcodePickStatusIconSettings, BarcodePickViewController, BarcodePickViewEventHandlers, BarcodePickViewEvents, BarcodePickViewSettings, BarcodePickViewUiEvents, BarcodeSelection, BarcodeSelectionAimerSelection, BarcodeSelectionAutoSelectionStrategy, BarcodeSelectionBasicOverlay, BarcodeSelectionBasicOverlayStyle, BarcodeSelectionBrushProviderEvents, BarcodeSelectionController, BarcodeSelectionFeedback, BarcodeSelectionFreezeBehavior, BarcodeSelectionListenerController, BarcodeSelectionListenerEvents, BarcodeSelectionManualSelectionStrategy, BarcodeSelectionOverlayController, BarcodeSelectionSession, BarcodeSelectionSettings, BarcodeSelectionStrategyType, BarcodeSelectionTapBehavior, BarcodeSelectionTapSelection, BarcodeSelectionTypeName, BarcodeSpatialGrid, BaseBarcodeArView, BaseBarcodeBatchAdvancedOverlay, BaseBarcodeCountView, BaseBarcodeFindView, BaseBarcodePickView, BaseSparkScanView, BatterySavingMode, BrushForStateObject, Checksum, Code128BarcodeGeneratorBuilder, Code39BarcodeGeneratorBuilder, CompositeFlag, CompositeType, DataMatrixBarcodeGeneratorBuilder, Dot, DotWithIcons, Ean13BarcodeGeneratorBuilder, Ean13UpcaClassification, EncodingRange, InterleavedTwoOfFiveBarcodeGeneratorBuilder, LocalizedOnlyBarcode, PrivateBarcodeSelectionStrategy, PrivateBarcodeSelectionType, QrCodeBarcodeGeneratorBuilder, QrCodeErrorCorrectionLevel, Range, Rectangular, RectangularWithIcons, SparkScan, SparkScanBarcodeErrorFeedback, SparkScanBarcodeFeedback, SparkScanBarcodeSuccessFeedback, SparkScanMiniPreviewSize, SparkScanPreviewBehavior, SparkScanScanningBehavior, SparkScanScanningModeDefault, SparkScanScanningModeTarget, SparkScanSession, SparkScanSettings, SparkScanToastSettings, SparkScanViewController, SparkScanViewEvents, SparkScanViewSettings, SparkScanViewState, StructuredAppendData, Symbology, SymbologyDescription, SymbologySettings, TargetBarcode, TrackedBarcode, UpcaBarcodeGeneratorBuilder, getBarcodeArDefaults, getBarcodeBatchDefaults, getBarcodeCaptureDefaults, getBarcodeCountDefaults, getBarcodeDefaults, getBarcodeFindDefaults, getBarcodePickDefaults, getBarcodeSelectionDefaults, getSparkScanDefaults, loadBarcodeArDefaults, loadBarcodeBatchDefaults, loadBarcodeCaptureDefaults, loadBarcodeCountDefaults, loadBarcodeDefaults, loadBarcodeFindDefaults, loadBarcodePickDefaults, loadBarcodeSelectionDefaults, loadSparkScanDefaults };