scandit-react-native-datacapture-id 7.5.0 → 7.6.0-beta.1

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.
@@ -75,7 +75,7 @@ if (file( "${rootProject.projectDir}/build-test.gradle").exists()) {
75
75
  }
76
76
 
77
77
  dependencies {
78
- def sdk_version = "7.5.0"
78
+ def sdk_version = "7.6.0-beta.1"
79
79
 
80
80
  println("Version of the native sdk used in this build: ${safeExtGet("global_sdk_version", sdk_version)}")
81
81
  api project(path: ":scandit-react-native-datacapture-core")
@@ -10,6 +10,8 @@ import com.facebook.react.bridge.Promise
10
10
  import com.facebook.react.bridge.ReactApplicationContext
11
11
  import com.facebook.react.bridge.ReactContextBaseJavaModule
12
12
  import com.facebook.react.bridge.ReactMethod
13
+ import com.facebook.react.bridge.ReadableMap
14
+ import com.scandit.datacapture.frameworks.core.errors.ParameterNullError
13
15
  import com.scandit.datacapture.frameworks.id.IdCaptureModule
14
16
  import com.scandit.datacapture.reactnative.core.utils.ReactNativeResult
15
17
 
@@ -62,7 +64,10 @@ class ScanditDataCaptureIdModule(
62
64
  }
63
65
 
64
66
  @ReactMethod
65
- fun updateIdCaptureOverlay(overlayJson: String, promise: Promise) {
67
+ fun updateIdCaptureOverlay(readableMap: ReadableMap, promise: Promise) {
68
+ val overlayJson = readableMap.getString("overlayJson") ?: return promise.reject(
69
+ ParameterNullError("overlayJson")
70
+ )
66
71
  idCaptureModule.updateOverlay(overlayJson, ReactNativeResult(promise))
67
72
  }
68
73
 
@@ -1,4 +1,4 @@
1
- export { DateResult, IdAnonymizationMode, IdImageType, CapturedSides, TextHintPosition } from 'scandit-datacapture-frameworks-id';
1
+ export { DateResult, IdAnonymizationMode, IdImageType, CapturedSides, TextHintPosition, Duration } from 'scandit-datacapture-frameworks-id';
2
2
  export { AamvaBarcodeVerificationResult, AamvaBarcodeVerificationStatus, AamvaBarcodeVerifier } from 'scandit-datacapture-frameworks-id';
3
3
  export { CapturedId, BarcodeResult, MRZResult, ProfessionalDrivingPermit } from 'scandit-datacapture-frameworks-id';
4
4
  export { VehicleRestriction, VIZResult } from 'scandit-datacapture-frameworks-id';
@@ -7,6 +7,5 @@ export declare class NativeIdCaptureProxy implements IdCaptureProxy {
7
7
  setModeEnabledState(enabled: boolean): void;
8
8
  updateIdCaptureMode(modeJson: string): Promise<void>;
9
9
  applyIdCaptureModeSettings(newSettingsJson: string): Promise<void>;
10
- updateIdCaptureOverlay(overlayJson: string): Promise<void>;
11
10
  updateFeedback(feedbackJson: string): Promise<void>;
12
11
  }
package/dist/id.js CHANGED
@@ -1,4 +1,4 @@
1
- import { nameForSerialization, FactoryMaker, Feedback, CameraSettings, Color, BaseController, DefaultSerializeable, EventDataParser, ignoreFromSerialization, Brush } from 'scandit-react-native-datacapture-core/dist/core';
1
+ import { nameForSerialization, ignoreFromSerialization, DefaultSerializeable, FactoryMaker, Feedback, CameraSettings, Color, BaseController, EventDataParser, BaseNewController, Brush } from 'scandit-react-native-datacapture-core/dist/core';
2
2
 
3
3
  class DateResult {
4
4
  get day() { return this.json.day; }
@@ -393,6 +393,8 @@ var RegionSpecificSubtype;
393
393
  RegionSpecificSubtype["UsMunicipalId"] = "usMunicipalId";
394
394
  RegionSpecificSubtype["AustraliaAsicCard"] = "australiaAsicCard";
395
395
  RegionSpecificSubtype["UaeVehicleRegistrationCard"] = "uaeVehicleRegistrationCard";
396
+ RegionSpecificSubtype["UaeEsaadCard"] = "uaeEsaadCard";
397
+ RegionSpecificSubtype["UkMilitaryId"] = "ukMilitaryId";
396
398
  })(RegionSpecificSubtype || (RegionSpecificSubtype = {}));
397
399
 
398
400
  var IdSide;
@@ -434,6 +436,75 @@ class IdImages {
434
436
  }
435
437
  }
436
438
 
439
+ /******************************************************************************
440
+ Copyright (c) Microsoft Corporation.
441
+
442
+ Permission to use, copy, modify, and/or distribute this software for any
443
+ purpose with or without fee is hereby granted.
444
+
445
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
446
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
447
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
448
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
449
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
450
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
451
+ PERFORMANCE OF THIS SOFTWARE.
452
+ ***************************************************************************** */
453
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
454
+
455
+
456
+ function __decorate(decorators, target, key, desc) {
457
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
458
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
459
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
460
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
461
+ }
462
+
463
+ function __awaiter(thisArg, _arguments, P, generator) {
464
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
465
+ return new (P || (P = Promise))(function (resolve, reject) {
466
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
467
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
468
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
469
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
470
+ });
471
+ }
472
+
473
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
474
+ var e = new Error(message);
475
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
476
+ };
477
+
478
+ class Duration extends DefaultSerializeable {
479
+ get days() {
480
+ return this._days;
481
+ }
482
+ get months() {
483
+ return this._months;
484
+ }
485
+ get years() {
486
+ return this._years;
487
+ }
488
+ constructor(days, months, years) {
489
+ super();
490
+ this._days = days;
491
+ this._months = months;
492
+ this._years = years;
493
+ }
494
+ static fromJSON(json) {
495
+ return new Duration(json.days, json.months, json.years);
496
+ }
497
+ }
498
+ __decorate([
499
+ nameForSerialization('days')
500
+ ], Duration.prototype, "_days", void 0);
501
+ __decorate([
502
+ nameForSerialization('months')
503
+ ], Duration.prototype, "_months", void 0);
504
+ __decorate([
505
+ nameForSerialization('years')
506
+ ], Duration.prototype, "_years", void 0);
507
+
437
508
  function getIdDefaults() {
438
509
  return FactoryMaker.getInstance('IdDefaults');
439
510
  }
@@ -473,6 +544,13 @@ function parseIdDefaults(jsonDefaults) {
473
544
  anonymizationMode: jsonDefaults.IdCaptureSettings.anonymizationMode,
474
545
  rejectVoidedIds: jsonDefaults.IdCaptureSettings.rejectVoidedIds,
475
546
  decodeBackOfEuropeanDrivingLicense: jsonDefaults.IdCaptureSettings.decodeBackOfEuropeanDrivingLicense,
547
+ rejectExpiredIds: jsonDefaults.IdCaptureSettings.rejectExpiredIds,
548
+ rejectIdsExpiringIn: jsonDefaults.IdCaptureSettings.rejectIdsExpiringIn ? Duration
549
+ .fromJSON(jsonDefaults.IdCaptureSettings.rejectIdsExpiringIn) : null,
550
+ rejectNotRealIdCompliant: jsonDefaults.IdCaptureSettings.rejectNotRealIdCompliant,
551
+ rejectForgedAamvaBarcodes: jsonDefaults.IdCaptureSettings.rejectForgedAamvaBarcodes,
552
+ rejectInconsistentData: jsonDefaults.IdCaptureSettings.rejectInconsistentData,
553
+ rejectHolderBelowAge: jsonDefaults.IdCaptureSettings.rejectHolderBelowAge,
476
554
  },
477
555
  },
478
556
  };
@@ -517,53 +595,13 @@ class AamvaBarcodeVerificationResult {
517
595
  }
518
596
  }
519
597
 
520
- /******************************************************************************
521
- Copyright (c) Microsoft Corporation.
522
-
523
- Permission to use, copy, modify, and/or distribute this software for any
524
- purpose with or without fee is hereby granted.
525
-
526
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
527
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
528
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
529
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
530
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
531
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
532
- PERFORMANCE OF THIS SOFTWARE.
533
- ***************************************************************************** */
534
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
535
-
536
-
537
- function __decorate(decorators, target, key, desc) {
538
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
539
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
540
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
541
- return c > 3 && r && Object.defineProperty(target, key, r), r;
542
- }
543
-
544
- function __awaiter(thisArg, _arguments, P, generator) {
545
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
546
- return new (P || (P = Promise))(function (resolve, reject) {
547
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
548
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
549
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
550
- step((generator = generator.apply(thisArg, _arguments || [])).next());
551
- });
552
- }
553
-
554
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
555
- var e = new Error(message);
556
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
557
- };
558
-
559
598
  class IdCaptureController extends BaseController {
560
- static forIdCapture(idCapture) {
561
- const controller = new IdCaptureController();
562
- controller.idCapture = idCapture;
563
- return controller;
564
- }
565
- constructor() {
599
+ // This is also accpeting null here because the AamvaBarcodeVerifier is using this controller.
600
+ // Once we remove the AamvaBarcodeVerifier, we can remove the null here.
601
+ constructor(idCapture = null) {
566
602
  super('IdCaptureProxy');
603
+ this.idCapture = null;
604
+ this.idCapture = idCapture;
567
605
  }
568
606
  reset() {
569
607
  return this._proxy.resetMode();
@@ -584,14 +622,14 @@ class IdCaptureController extends BaseController {
584
622
  this._proxy.setModeEnabledState(enabled);
585
623
  }
586
624
  updateIdCaptureMode() {
625
+ if (this.idCapture == null) {
626
+ throw new Error('IdCaptureController is not initialized with an IdCapture instance');
627
+ }
587
628
  return this._proxy.updateIdCaptureMode(JSON.stringify(this.idCapture.toJSON()));
588
629
  }
589
630
  applyIdCaptureModeSettings(newSettings) {
590
631
  return this._proxy.applyIdCaptureModeSettings(JSON.stringify(newSettings.toJSON()));
591
632
  }
592
- updateIdCaptureOverlay(overlay) {
593
- return this._proxy.updateIdCaptureOverlay(JSON.stringify(overlay.toJSON()));
594
- }
595
633
  updateFeedback(feedback) {
596
634
  return this._proxy.updateFeedback(JSON.stringify(feedback.toJSON()));
597
635
  }
@@ -599,7 +637,6 @@ class IdCaptureController extends BaseController {
599
637
 
600
638
  var IdCaptureListenerEvents;
601
639
  (function (IdCaptureListenerEvents) {
602
- IdCaptureListenerEvents["inCallback"] = "IdCaptureListener.inCallback";
603
640
  IdCaptureListenerEvents["didCapture"] = "IdCaptureListener.didCaptureId";
604
641
  IdCaptureListenerEvents["didReject"] = "IdCaptureListener.didRejectId";
605
642
  })(IdCaptureListenerEvents || (IdCaptureListenerEvents = {}));
@@ -607,8 +644,16 @@ var IdCaptureListenerEvents;
607
644
  class MRZResult {
608
645
  get documentCode() { return this.json.documentCode; }
609
646
  get namesAreTruncated() { return this.json.namesAreTruncated; }
647
+ /**
648
+ * @deprecated Use optionalDataInLine1 and optionalDataInLine2 instead. This property will be removed in SDK version 8.0.
649
+ */
610
650
  get optional() { return this.json.optional; }
651
+ /**
652
+ * @deprecated Use optionalDataInLine1 and optionalDataInLine2 instead. This property will be removed in SDK version 8.0.
653
+ */
611
654
  get optional1() { return this.json.optional1; }
655
+ get optionalDataInLine1() { return this.json.optionalDataInLine1; }
656
+ get optionalDataInLine2() { return this.json.optionalDataInLine2; }
612
657
  get capturedMrz() { return this.json.capturedMrz; }
613
658
  get personalIdNumber() { return this.json.personalIdNumber; }
614
659
  get renewalTimes() { return this.json.renewalTimes; }
@@ -1555,28 +1600,37 @@ class IdCaptureListenerController {
1555
1600
  get _proxy() {
1556
1601
  return FactoryMaker.getInstance('IdCaptureListenerProxy');
1557
1602
  }
1558
- static forIdCapture(idCapture) {
1559
- const controller = new IdCaptureListenerController();
1560
- controller.idCapture = idCapture;
1561
- controller._proxy.isModeEnabled = () => idCapture.isEnabled;
1562
- return controller;
1563
- }
1564
- constructor() {
1603
+ constructor(idCapture) {
1604
+ this.hasListeners = false;
1565
1605
  this.eventEmitter = FactoryMaker.getInstance('EventEmitter');
1606
+ this.idCapture = idCapture;
1607
+ this._proxy.isModeEnabled = () => idCapture.isEnabled;
1608
+ this.initialize();
1609
+ }
1610
+ initialize() {
1611
+ return __awaiter(this, void 0, void 0, function* () {
1612
+ if (this.idCapture.listeners.length > 0) {
1613
+ this.subscribeListener();
1614
+ }
1615
+ });
1566
1616
  }
1567
1617
  subscribeListener() {
1618
+ if (this.hasListeners) {
1619
+ return;
1620
+ }
1568
1621
  this._proxy.subscribeDidCaptureListener();
1569
1622
  this._proxy.subscribeDidRejectListener();
1570
- this.eventEmitter.on(IdCaptureListenerEvents.inCallback, (value) => {
1571
- this.idCapture.isInListenerCallback = value;
1572
- });
1573
1623
  this.eventEmitter.on(IdCaptureListenerEvents.didCapture, (data) => {
1574
1624
  const event = EventDataParser.parse(data);
1575
1625
  if (event === null) {
1576
1626
  console.error('IdCaptureListenerController didCapture payload is null');
1577
1627
  return;
1578
1628
  }
1579
- const captureId = CapturedId.fromJSON(JSON.parse(event.id));
1629
+ const capturedIdJson = JSON.parse(event.id);
1630
+ if (event.imageInfo) {
1631
+ capturedIdJson.imageInfo = event.imageInfo;
1632
+ }
1633
+ const captureId = CapturedId.fromJSON(capturedIdJson);
1580
1634
  this.notifyListenersOfDidCapture(captureId);
1581
1635
  this._proxy.finishDidCaptureCallback(this.idCapture.isEnabled);
1582
1636
  });
@@ -1593,32 +1647,48 @@ class IdCaptureListenerController {
1593
1647
  this.notifyListenersOfDidReject(rejectedId, event.rejectionReason);
1594
1648
  this._proxy.finishDidRejectCallback(this.idCapture.isEnabled);
1595
1649
  });
1650
+ this.hasListeners = true;
1596
1651
  }
1597
1652
  unsubscribeListener() {
1653
+ if (!this.hasListeners) {
1654
+ return;
1655
+ }
1598
1656
  this._proxy.unregisterListenerForEvents();
1599
- this.eventEmitter.removeAllListeners(IdCaptureListenerEvents.inCallback);
1600
1657
  this.eventEmitter.removeAllListeners(IdCaptureListenerEvents.didCapture);
1601
1658
  this.eventEmitter.removeAllListeners(IdCaptureListenerEvents.didReject);
1659
+ this.hasListeners = false;
1602
1660
  }
1603
1661
  notifyListenersOfDidCapture(captureId) {
1604
1662
  const mode = this.idCapture;
1605
- mode.isInListenerCallback = true;
1606
1663
  mode.listeners.forEach(listener => {
1607
1664
  if (listener.didCaptureId) {
1608
1665
  listener.didCaptureId(this.idCapture, captureId);
1609
1666
  }
1610
1667
  });
1611
- mode.isInListenerCallback = false;
1612
1668
  }
1613
1669
  notifyListenersOfDidReject(captureId, rejectionReason) {
1614
1670
  const mode = this.idCapture;
1615
- mode.isInListenerCallback = true;
1616
1671
  mode.listeners.forEach(listener => {
1617
1672
  if (listener.didRejectId) {
1618
1673
  listener.didRejectId(this.idCapture, captureId, rejectionReason);
1619
1674
  }
1620
1675
  });
1621
- mode.isInListenerCallback = false;
1676
+ }
1677
+ dispose() {
1678
+ this.unsubscribeListener();
1679
+ }
1680
+ }
1681
+
1682
+ class IdCaptureOverlayController extends BaseNewController {
1683
+ constructor(overlay) {
1684
+ super('IdCaptureOverlayProxy');
1685
+ this.overlay = overlay;
1686
+ }
1687
+ updateIdCaptureOverlay(overlay) {
1688
+ return this._proxy.$updateIdCaptureOverlay({ overlayJson: JSON.stringify(overlay.toJSON()) });
1689
+ }
1690
+ dispose() {
1691
+ this._proxy.dispose();
1622
1692
  }
1623
1693
  }
1624
1694
 
@@ -1693,42 +1763,61 @@ class IdCapture extends DefaultSerializeable {
1693
1763
  this._feedback.controller = this.controller;
1694
1764
  this.controller.updateFeedback(feedback);
1695
1765
  }
1696
- static get recommendedCameraSettings() {
1766
+ static createRecommendedCameraSettings() {
1697
1767
  return new CameraSettings(IdCapture.idCaptureDefaults.IdCapture.RecommendedCameraSettings);
1698
1768
  }
1769
+ /**
1770
+ * @deprecated Use createRecommendedCameraSettings() instead to get a new instance that can be safely modified.
1771
+ */
1772
+ static get recommendedCameraSettings() {
1773
+ if (IdCapture._recommendedCameraSettings === null) {
1774
+ IdCapture._recommendedCameraSettings = IdCapture.createRecommendedCameraSettings();
1775
+ }
1776
+ return IdCapture._recommendedCameraSettings;
1777
+ }
1699
1778
  get _context() {
1700
1779
  return this.privateContext;
1701
1780
  }
1702
1781
  set _context(newContext) {
1782
+ var _a, _b;
1703
1783
  if (newContext == null) {
1704
- this.listenerController.unsubscribeListener();
1705
- }
1706
- else if (this.privateContext == null) {
1707
- this.listenerController.subscribeListener();
1784
+ (_a = this.listenerController) === null || _a === void 0 ? void 0 : _a.dispose();
1785
+ this.listenerController = null;
1786
+ this.privateContext = null;
1787
+ return;
1708
1788
  }
1709
1789
  this.privateContext = newContext;
1790
+ (_b = this.listenerController) !== null && _b !== void 0 ? _b : (this.listenerController = new IdCaptureListenerController(this));
1710
1791
  }
1711
1792
  static get idCaptureDefaults() {
1712
1793
  return FactoryMaker.getInstance('IdDefaults');
1713
1794
  }
1795
+ /**
1796
+ * @deprecated Since 7.6. This factory will be removed in 8.0.
1797
+ * Use the public constructor instead and configure the instance manually:
1798
+ * ```ts
1799
+ * const idCapture = new IdCapture(settings);
1800
+ * context.setMode(idCapture);
1801
+ * ```
1802
+ */
1714
1803
  static forContext(context, settings) {
1715
- const idCapture = new IdCapture();
1716
- idCapture.settings = settings;
1804
+ const idCapture = new IdCapture(settings);
1717
1805
  if (context) {
1718
- context.addMode(idCapture);
1806
+ context.setMode(idCapture);
1719
1807
  }
1720
1808
  return idCapture;
1721
1809
  }
1722
- constructor() {
1810
+ constructor(settings) {
1723
1811
  super();
1724
1812
  this.type = 'idCapture';
1725
1813
  this._isEnabled = true;
1726
1814
  this._feedback = IdCaptureFeedback.defaultFeedback;
1727
1815
  this.privateContext = null;
1728
1816
  this.listeners = [];
1817
+ this.listenerController = null;
1729
1818
  this.isInListenerCallback = false;
1730
- this.controller = IdCaptureController.forIdCapture(this);
1731
- this.listenerController = IdCaptureListenerController.forIdCapture(this);
1819
+ this.settings = settings;
1820
+ this.controller = new IdCaptureController(this);
1732
1821
  this.feedback.controller = this.controller;
1733
1822
  }
1734
1823
  applySettings(settings) {
@@ -1736,21 +1825,30 @@ class IdCapture extends DefaultSerializeable {
1736
1825
  return this.controller.applyIdCaptureModeSettings(settings);
1737
1826
  }
1738
1827
  addListener(listener) {
1828
+ var _a;
1739
1829
  if (this.listeners.includes(listener)) {
1740
1830
  return;
1741
1831
  }
1832
+ if (this.listeners.length === 0) {
1833
+ (_a = this.listenerController) === null || _a === void 0 ? void 0 : _a.subscribeListener();
1834
+ }
1742
1835
  this.listeners.push(listener);
1743
1836
  }
1744
1837
  removeListener(listener) {
1838
+ var _a;
1745
1839
  if (!this.listeners.includes(listener)) {
1746
1840
  return;
1747
1841
  }
1748
1842
  this.listeners.splice(this.listeners.indexOf(listener), 1);
1843
+ if (this.listeners.length === 0) {
1844
+ (_a = this.listenerController) === null || _a === void 0 ? void 0 : _a.unsubscribeListener();
1845
+ }
1749
1846
  }
1750
1847
  reset() {
1751
1848
  return this.controller.reset();
1752
1849
  }
1753
1850
  }
1851
+ IdCapture._recommendedCameraSettings = null;
1754
1852
  __decorate([
1755
1853
  ignoreFromSerialization
1756
1854
  ], IdCapture.prototype, "_isEnabled", void 0);
@@ -1789,15 +1887,40 @@ var IdLayoutStyle;
1789
1887
  })(IdLayoutStyle || (IdLayoutStyle = {}));
1790
1888
 
1791
1889
  class IdCaptureOverlay extends DefaultSerializeable {
1890
+ get view() {
1891
+ return this._view;
1892
+ }
1893
+ set view(newView) {
1894
+ var _a, _b;
1895
+ if (newView === null) {
1896
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.dispose();
1897
+ this.controller = null;
1898
+ this._view = null;
1899
+ return;
1900
+ }
1901
+ this._view = newView;
1902
+ (_b = this.controller) !== null && _b !== void 0 ? _b : (this.controller = new IdCaptureOverlayController(this));
1903
+ }
1792
1904
  static get idCaptureDefaults() {
1793
1905
  return FactoryMaker.getInstance('IdDefaults');
1794
1906
  }
1907
+ /**
1908
+ * @deprecated Since 7.6. These factories will be removed in 8.0.
1909
+ * Use the public constructor instead and add the overlay to the view manually:
1910
+ * const overlay = new IdCaptureOverlay(idCapture);
1911
+ * view.addOverlay(overlay);
1912
+ */
1795
1913
  static withIdCapture(idCapture) {
1796
1914
  return IdCaptureOverlay.withIdCaptureForView(idCapture, null);
1797
1915
  }
1916
+ /**
1917
+ * @deprecated Since 7.6. These factories will be removed in 8.0.
1918
+ * Use the public constructor instead and add the overlay to the view manually:
1919
+ * const overlay = new IdCaptureOverlay(idCapture);
1920
+ * view.addOverlay(overlay);
1921
+ */
1798
1922
  static withIdCaptureForView(idCapture, view) {
1799
1923
  const overlay = new IdCaptureOverlay();
1800
- overlay.idCapture = idCapture;
1801
1924
  if (view) {
1802
1925
  view.addOverlay(overlay);
1803
1926
  }
@@ -1806,6 +1929,8 @@ class IdCaptureOverlay extends DefaultSerializeable {
1806
1929
  constructor() {
1807
1930
  super();
1808
1931
  this.type = 'idCapture';
1932
+ this.controller = null;
1933
+ this._view = null;
1809
1934
  this._idLayoutStyle = IdLayoutStyle.Rounded;
1810
1935
  this._idLayoutLineStyle = IdLayoutLineStyle.Light;
1811
1936
  this._textHintPosition = TextHintPosition.AboveViewfinder;
@@ -1820,47 +1945,54 @@ class IdCaptureOverlay extends DefaultSerializeable {
1820
1945
  this._backSideTextHint = null;
1821
1946
  }
1822
1947
  setFrontSideTextHint(text) {
1948
+ var _a;
1823
1949
  this._frontSideTextHint = text;
1824
- this.idCapture.controller.updateIdCaptureOverlay(this);
1950
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateIdCaptureOverlay(this);
1825
1951
  }
1826
1952
  setBackSideTextHint(text) {
1953
+ var _a;
1827
1954
  this._backSideTextHint = text;
1828
- this.idCapture.controller.updateIdCaptureOverlay(this);
1955
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateIdCaptureOverlay(this);
1829
1956
  }
1830
1957
  get idLayoutStyle() {
1831
1958
  return this._idLayoutStyle;
1832
1959
  }
1833
1960
  set idLayoutStyle(style) {
1961
+ var _a;
1834
1962
  this._idLayoutStyle = style;
1835
- this.idCapture.controller.updateIdCaptureOverlay(this);
1963
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateIdCaptureOverlay(this);
1836
1964
  }
1837
1965
  get idLayoutLineStyle() {
1838
1966
  return this._idLayoutLineStyle;
1839
1967
  }
1840
1968
  set idLayoutLineStyle(lineStyle) {
1969
+ var _a;
1841
1970
  this._idLayoutLineStyle = lineStyle;
1842
- this.idCapture.controller.updateIdCaptureOverlay(this);
1971
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateIdCaptureOverlay(this);
1843
1972
  }
1844
1973
  get capturedBrush() {
1845
1974
  return this._capturedBrush;
1846
1975
  }
1847
1976
  set capturedBrush(brush) {
1977
+ var _a;
1848
1978
  this._capturedBrush = brush;
1849
- this.idCapture.controller.updateIdCaptureOverlay(this);
1979
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateIdCaptureOverlay(this);
1850
1980
  }
1851
1981
  get localizedBrush() {
1852
1982
  return this._localizedBrush;
1853
1983
  }
1854
1984
  set localizedBrush(brush) {
1985
+ var _a;
1855
1986
  this._localizedBrush = brush;
1856
- this.idCapture.controller.updateIdCaptureOverlay(this);
1987
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateIdCaptureOverlay(this);
1857
1988
  }
1858
1989
  get rejectedBrush() {
1859
1990
  return this._rejectedBrush;
1860
1991
  }
1861
1992
  set rejectedBrush(brush) {
1993
+ var _a;
1862
1994
  this._rejectedBrush = brush;
1863
- this.idCapture.controller.updateIdCaptureOverlay(this);
1995
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateIdCaptureOverlay(this);
1864
1996
  }
1865
1997
  get defaultCapturedBrush() {
1866
1998
  return this._defaultCapturedBrush;
@@ -1875,23 +2007,25 @@ class IdCaptureOverlay extends DefaultSerializeable {
1875
2007
  return this._textHintPosition;
1876
2008
  }
1877
2009
  set textHintPosition(position) {
2010
+ var _a;
1878
2011
  this._textHintPosition = position;
1879
- this.idCapture.controller.updateIdCaptureOverlay(this);
2012
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateIdCaptureOverlay(this);
1880
2013
  }
1881
2014
  get showTextHints() {
1882
2015
  return this._showTextHints;
1883
2016
  }
1884
2017
  set showTextHints(enabled) {
2018
+ var _a;
1885
2019
  this._showTextHints = enabled;
1886
- this.idCapture.controller.updateIdCaptureOverlay(this);
2020
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateIdCaptureOverlay(this);
1887
2021
  }
1888
2022
  }
1889
2023
  __decorate([
1890
2024
  ignoreFromSerialization
1891
- ], IdCaptureOverlay.prototype, "idCapture", void 0);
2025
+ ], IdCaptureOverlay.prototype, "controller", void 0);
1892
2026
  __decorate([
1893
2027
  ignoreFromSerialization
1894
- ], IdCaptureOverlay.prototype, "view", void 0);
2028
+ ], IdCaptureOverlay.prototype, "_view", void 0);
1895
2029
  __decorate([
1896
2030
  nameForSerialization('idLayoutStyle')
1897
2031
  ], IdCaptureOverlay.prototype, "_idLayoutStyle", void 0);
@@ -1997,6 +2131,12 @@ class IdCaptureSettings extends DefaultSerializeable {
1997
2131
  this.acceptedDocuments = [];
1998
2132
  this.rejectedDocuments = [];
1999
2133
  this.scannerType = new SingleSideScanner(false, false, false);
2134
+ this.rejectExpiredIds = IdCaptureSettings.idCaptureDefaults.IdCapture.IdCaptureSettings.rejectExpiredIds;
2135
+ this.rejectIdsExpiringIn = IdCaptureSettings.idCaptureDefaults.IdCapture.IdCaptureSettings.rejectIdsExpiringIn;
2136
+ this.rejectNotRealIdCompliant = IdCaptureSettings.idCaptureDefaults.IdCapture.IdCaptureSettings.rejectNotRealIdCompliant;
2137
+ this.rejectForgedAamvaBarcodes = IdCaptureSettings.idCaptureDefaults.IdCapture.IdCaptureSettings.rejectForgedAamvaBarcodes;
2138
+ this.rejectInconsistentData = IdCaptureSettings.idCaptureDefaults.IdCapture.IdCaptureSettings.rejectInconsistentData;
2139
+ this.rejectHolderBelowAge = IdCaptureSettings.idCaptureDefaults.IdCapture.IdCaptureSettings.rejectHolderBelowAge;
2000
2140
  }
2001
2141
  static get idCaptureDefaults() {
2002
2142
  return FactoryMaker.getInstance('IdDefaults');
@@ -2018,9 +2158,12 @@ __decorate([
2018
2158
  ignoreFromSerialization
2019
2159
  ], IdCaptureSettings, "idCaptureDefaults", null);
2020
2160
 
2161
+ /**
2162
+ * @deprecated Replaced by IdCaptureSettings.rejectForgedAamvaBarcodes
2163
+ */
2021
2164
  class AamvaBarcodeVerifier {
2022
2165
  constructor() {
2023
- this.controller = new IdCaptureController();
2166
+ this.controller = new IdCaptureController(null);
2024
2167
  }
2025
2168
  static create(context) {
2026
2169
  const verifier = new AamvaBarcodeVerifier();
@@ -2059,4 +2202,4 @@ __decorate([
2059
2202
  ignoreFromSerialization
2060
2203
  ], AamvaBarcodeVerifier.prototype, "controller", void 0);
2061
2204
 
2062
- export { AamvaBarcodeVerificationResult, AamvaBarcodeVerificationStatus, AamvaBarcodeVerifier, BarcodeResult, CapturedId, CapturedSides, CommonCapturedIdFields, DateResult, DriverLicense, FullDocumentScanner, HealthInsuranceCard, IdAnonymizationMode, IdCapture, IdCaptureController, IdCaptureDocumentType, IdCaptureFeedback, IdCaptureListenerController, IdCaptureListenerEvents, IdCaptureOverlay, IdCaptureRegion, IdCaptureSettings, IdCard, IdImageType, IdImages, IdLayoutLineStyle, IdLayoutStyle, IdSide, MRZResult, Passport, ProfessionalDrivingPermit, RegionSpecific, RegionSpecificSubtype, RejectionReason, ResidencePermit, SingleSideScanner, TextHintPosition, UsRealIdStatus, VIZResult, VehicleRestriction, VisaIcao, getIdDefaults, loadIdDefaults, parseIdDefaults };
2205
+ export { AamvaBarcodeVerificationResult, AamvaBarcodeVerificationStatus, AamvaBarcodeVerifier, BarcodeResult, CapturedId, CapturedSides, CommonCapturedIdFields, DateResult, DriverLicense, Duration, FullDocumentScanner, HealthInsuranceCard, IdAnonymizationMode, IdCapture, IdCaptureController, IdCaptureDocumentType, IdCaptureFeedback, IdCaptureListenerController, IdCaptureListenerEvents, IdCaptureOverlay, IdCaptureOverlayController, IdCaptureRegion, IdCaptureSettings, IdCard, IdImageType, IdImages, IdLayoutLineStyle, IdLayoutStyle, IdSide, MRZResult, Passport, ProfessionalDrivingPermit, RegionSpecific, RegionSpecificSubtype, RejectionReason, ResidencePermit, SingleSideScanner, TextHintPosition, UsRealIdStatus, VIZResult, VehicleRestriction, VisaIcao, getIdDefaults, loadIdDefaults, parseIdDefaults };