@scandit/web-datacapture-id 7.1.1 → 7.1.3
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/build/js/index.js +2 -2
- package/package.json +2 -2
- package/sdc-lib/scandit-datacapture-sdk-id-pthreads.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-id-pthreads.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-id-simd-pthreads.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-id-simd-pthreads.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-id-simd.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-id-simd.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-id.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-id.wasm +0 -0
- /package/sdc-lib/resources/models/{barcode_classification_default_model.0e0f78dcf2b31abc9b4fc5c1b7c5cb342a7d5e63.model → barcode_classification_default.0e0f78dcf2b3.model} +0 -0
- /package/sdc-lib/resources/models/{barcode_localization_default_model.47d1f96d10ccb378344a3009cded24a85c22a5f9.model → barcode_localization_default.47d1f96d10cc.model} +0 -0
- /package/sdc-lib/resources/models/{barcode_localization_dpm_default_model.866e3546778825d3a9bc1f2070c892de9c525092.model → barcode_localization_dpm_default.866e35467788.model} +0 -0
- /package/sdc-lib/resources/models/{barcode_localization_french_post_default_model.8843b5d5d2eb71ebeab43204fbb9574c76f94fe7.model → barcode_localization_french_post_default.8843b5d5d2eb.model} +0 -0
- /package/sdc-lib/resources/models/{barcode_localization_generic_postal_code_default_model.48b44ea31495024d80a11e1ca3ecde3d958eaf2d.model → barcode_localization_generic_postal_code_default.48b44ea31495.model} +0 -0
- /package/sdc-lib/resources/models/{barcode_localization_oned_default_model.5f2c85a7773b298068deecb49059c7a477c280c4.model → barcode_localization_oned_default.5f2c85a7773b.model} +0 -0
- /package/sdc-lib/resources/models/{barcode_localization_twod_default_model.795c17cef2bf529a00a9e0d235c1b8ddfca66cf5.model → barcode_localization_twod_default.795c17cef2bf.model} +0 -0
- /package/sdc-lib/resources/models/{barcode_localization_upu_enhanced_orange.da67055d9aa866fe157514a4d55c2c504ec68306.model → barcode_localization_upu_enhanced_orange.da67055d9aa8.model} +0 -0
- /package/sdc-lib/resources/models/{eu_dl_localization_model.e440ae4acaf7c7a2f42814ddc46c0920423eb372.model → eu_dl_localization.e440ae4acaf7.model} +0 -0
- /package/sdc-lib/resources/models/{id_ocr_model.f42a207632c0e54aed010bff4b40df1264e3f304.model → id_ocr.f42a207632c0.model} +0 -0
- /package/sdc-lib/resources/models/{invalidated_id_classification_default.a055873831c99a035fa94bbf7a8568b1e8e004e5.model → invalidated_id_classification_default.a055873831c9.model} +0 -0
- /package/sdc-lib/resources/models/{mrz_line_localization_model.4573c5a05b53d7f5cfac0f0fda2ead609011df50.model → mrz_line_localization.4573c5a05b53.model} +0 -0
- /package/sdc-lib/resources/models/{mrz_localization_model.c6b469e57923be136dfd2b6d3fef354eadda3e04.model → mrz_localization.c6b469e57923.model} +0 -0
- /package/sdc-lib/resources/models/{ocr_mrz_default_model.050ddaa9b8339897a9c7bc8b7dea02f2c6f11856.model → ocr_mrz_default.050ddaa9b833.model} +0 -0
- /package/sdc-lib/resources/models/{uk_dl_code_localization_model.e440ae4acaf7c7a2f42814ddc46c0920423eb372.model → uk_dl_code_localization.e440ae4acaf7.model} +0 -0
package/build/js/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {CameraSettings,Color,Feedback,Sound,Logger,Quadrilateral,DataCaptureError,Brush,Localization,assertUnreachable,OverrideState,DataCaptureContext,DataCaptureLoader,BrowserHelper,Point}from'@scandit/web-datacapture-core';import {isObject}from'@scandit/web-datacapture-core/build/js/private/utils/isObject.js';import {match}from'@scandit/web-datacapture-core/build/js/private/utils/match.js';import {ViewClassNames}from'@scandit/web-datacapture-core/build/js/private/ViewClassNames.js';import {ShutterButton}from'@scandit/web-datacapture-core/build/js/private/ui/atoms/ShutterButton.js';var p={"scandit-datacapture-sdk-id-pthreads.wasm":{bytes:8234748},"scandit-datacapture-sdk-id-simd.wasm":{bytes:8121044},"scandit-datacapture-sdk-id.wasm":{bytes:8182686},"scandit-datacapture-sdk-id-simd-pthreads.wasm":{bytes:8173878}};var da=e=>({IdCapture:{RecommendedCameraSettings:CameraSettings.fromJSON(e.IdCapture.RecommendedCameraSettings),IdCaptureOverlayDefaults:{defaultCapturedBrush:{fillColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.fillColor),strokeColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.strokeColor),strokeWidth:e.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.strokeWidth},defaultLocalizedBrush:{fillColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.fillColor),strokeColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.strokeColor),strokeWidth:e.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.strokeWidth},defaultRejectedBrush:{fillColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.fillColor),strokeColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.strokeColor),strokeWidth:e.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.strokeWidth}}}}),_=da({IdCapture:{RecommendedCameraSettings:{zoomFactor:1,zoomGestureZoomFactor:2,focusGestureStrategy:"manualUntilCapture",preferredResolution:"fullHd"},IdCaptureOverlayDefaults:{defaultCapturedBrush:{fillColor:"#00000000",strokeColor:"#FFFFFFFF",strokeWidth:3},defaultLocalizedBrush:{fillColor:"#FFFFFF80",strokeColor:"#FFFFFF00",strokeWidth:0},defaultRejectedBrush:{fillColor:"#00000000",strokeColor:"#FFFFFFFF",strokeWidth:3}}}});var de=(o=>(o.Undefined="Undefined",o.RecoveredAfterFailure="RecoveredAfterFailure",o.InvalidLicenseKeyForVIZProcessing="InvalidLicenseKeyForVIZProcessing",o.InvalidSettingsForVIZProcessing="InvalidSettingsForVIZProcessing",o.InvalidLicenseKeyForParser="InvalidLicenseKeyForParser",o))(de||{}),O=class e extends Error{constructor(){super(...arguments);this._type="Undefined";this._message="";}get type(){return this._type}get message(){return this._message}static create(a){let r=new e;return a&&(r.name=a.type,r._type=a.type,r._message=a.message),r}static fromJSON(a){let r=new e;return r._type=a.type,r._message=a.message,r}};var mt="data:audio/mpeg;base64,SUQzBAAAAAACGFRFTkMAAAALAAADUHJvIFRvb2xzAFRYWFgAAAAjAAADb3JpZ2luYXRvcl9yZWZlcmVuY2UAYWE0RVFOcW9VQk9rAFRJVDIAAAAeAAADMDdfU2NhbmRpdF9TY2FubmVkLVdyb25nSXRlbQBUWFhYAAAASQAAA3VtaWQAMHgwNjBBMkIzNDAxMDEwMTA1MDEwMTBGMTAxMzAwMDAwMDg2RUUzOTA5RUE3QjgwMDBGNjZGQzVERDdBNzc5ODE0AFRYWFgAAAAYAAADdGltZV9yZWZlcmVuY2UAMjY3MDU5MABURFJDAAAADAAAAzIwMjMtMDMtMjQAVFNTRQAAAA8AAANMYXZmNTkuMTcuMTAxAAAAAAAAAAAAAAD/+1QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABJbmZvAAAADwAAABQAAAhAACIiIiIuLi4uLjo6Ojo6RUVFRUVRUVFRUV1dXV1daGhoaGh0dHR0dICAgICAi4uLi4uXl5eXl6KioqKirq6urq66urq6usXFxcXF0dHR0dHd3d3d3ejo6Ojo9PT09PT//////wAAAABMYXZjNTkuMjAAAAAAAAAAAAAAAAAkAsAAAAAAAAAIQBl5jwn/+xRkAAAAVgDUjQBgAAAADSCgAAEDiBduGIGACAAANIMAAAAgP8plFgg7znL+Q4k4B5uo2Rk9c+LQuOexRB4iCTT6t24x+9f7f/ve/OAAwiE0lTn2XHl6PVZxCA5GsdT/+xRkCoPwcwJexxhAAAAADSDgAAEBiAl0oJxAEAAANIAAAAQLpHM6PLpQzOOJP9g5lhihlyb2dlebf8JCDTyRW9i0P7qaz/+QAFBoW4NDEqQuutHr41//tAlwcSVBnm3/+xRkGwPwdwHbgCsQAAAADSAAAAEBlAd5AIhAAAAANIAAAATHiGz+Vc+PkABIAc4KvoFaqtnriqAiChQ15lfsMNqJ+6pCWSiwWiCplZ48GhwdztADJY5zm8nAqeDYITz/+xRkKwPweAReQCYQAAAADSAAAAEB5BF+gYhgKAAANIAAAARCDP8WxCCX+BeBTH3/iEEQWPLf/j9xbSKUgEEVL1p+0zaZlevKU5jbmwnBfkrWVYFOA8ttpVTjnZNQTAj/+xRkOYHwcAJeQCIYAAAADSAAAAEBwAd1AJhAAAAANIAAAAQh4cpNFFitO6uKSSRkaPEOmFCjhCufYvSYAMRykUrsTqSNnkFv2JqLbTWsOJFsnYRXo/r1z8r/7+mDiwH/+xRkSYAAdwLcJSQACAAADSCgAAEEeJFKGKUACAAANIMAAABxOtc6Jp53xlXP35AAcoV0pquMq1q/64ds9sxEh5Gt1gF6lGuqIWmtoDBY0qSi+FDRUEFIX0BPlJEDhYT/+xRkTgPxAxRZhzDAAAAADSDgAAEBlAl5AJhAAAAANIAAAATqelYAwIlAy0/IoV/EKh5Gw6UEDpn9pqpMQU1FqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkVYPweQJfIMkQCAAADSAAAAEBzAlyAJwAAAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkZIPwdAdgoEEYigAADSAAAAEB1AuEgQhAKAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkc4PwcAdewMEQoAAADSAAAAEBrAmCgQhgKAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkg4fwcgHcIMYICgAADSAAAAEBcA8wrGHgKAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRklI/wTgLEAwkACgAADSAAAAEBWBTkBIxiaAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkqA/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkxg/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo=";var pe=class e{constructor(){this.idCaptured=Feedback.defaultFeedback;this.idRejected=new Feedback(null,null);}static get defaultFeedback(){return new e}static get defaultSuccessSound(){return Sound.defaultSound}static get defaultFailureSound(){return new Sound(mt)}toJSONObject(){return {idCaptured:this.idCaptured.toJSONObject(),idRejected:this.idRejected.toJSONObject()}}};var P=(u=>(u.Passport="passport",u.IdCard="idCard",u.DriverLicense="driverLicense",u.VisaIcao="visaIcao",u.ResidencePermit="residencePermit",u.HealthInsuranceCard="healthInsuranceCard",u.RegionSpecific="regionSpecific",u))(P||{}),f=class{constructor(t){this._region=t;}get region(){return this._region}isPassport(){return this.documentType==="passport"}isIdCard(){return this.documentType==="idCard"}isDriverLicense(){return this.documentType==="driverLicense"}isVisaIcao(){return this.documentType==="visaIcao"}isHealthInsuranceCard(){return this.documentType==="healthInsuranceCard"}isResidencePermit(){return this.documentType==="residencePermit"}isRegionSpecific(){return this.documentType==="regionSpecific"}};var Ae=class e{constructor(){this.json={};}get errorCorrection(){return this.json.errorCorrection}get moduleCountX(){return this.json.moduleCountX}get moduleCountY(){return this.json.moduleCountY}static fromJSON(t){if(t==null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {errorCorrection:this.errorCorrection,moduleCountX:this.moduleCountX,moduleCountY:this.moduleCountY}}};var I=class e{constructor(){this.json={};}get day(){return this.json.day}get month(){return this.json.month}get year(){return this.json.year}static fromJSON(t){if(t==null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {day:this.day,month:this.month,year:this.year}}};var he=class e{get dateOfExpiry(){var t;return (t=I.fromJSON(this.json.dateOfExpiry))!=null?t:new I}get codes(){return this.json.codes}static fromJSON(t){if(t===null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {codes:[...this.codes],dateOfExpiry:this.dateOfExpiry.toJSONObject()}}};var me=class e{get vehicleCode(){return this.json.vehicleCode}get vehicleRestriction(){return this.json.vehicleRestriction}get dateOfIssue(){var t;return (t=I.fromJSON(this.json.dateOfIssue))!=null?t:new I}static fromJSON(t){if(t===null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {dateOfIssue:this.dateOfIssue.toJSONObject(),vehicleCode:this.vehicleCode,vehicleRestriction:this.vehicleRestriction}}};var Ie=class e{get aamvaVersion(){return this.json.aamvaVersion}get aliasFamilyName(){return this.json.aliasFamilyName}get aliasGivenName(){return this.json.aliasGivenName}get aliasSuffixName(){return this.json.aliasSuffixName}get bloodType(){return this.json.bloodType}get branchOfService(){return this.json.branchOfService}get cardInstanceIdentifier(){return this.json.cardInstanceIdentifier}get cardRevisionDate(){return I.fromJSON(this.json.cardRevisionDate)}get categories(){return this.json.categories!=null?this.json.categories:[]}get champusEffectiveDate(){return I.fromJSON(this.json.champusEffectiveDate)}get champusExpiryDate(){return I.fromJSON(this.json.champusExpiryDate)}get citizenshipStatus(){return this.json.citizenshipStatus}get civilianHealthCareFlagCode(){return this.json.civilianHealthCareFlagCode}get civilianHealthCareFlagDescription(){return this.json.civilianHealthCareFlagDescription}get commissaryFlagCode(){return this.json.commissaryFlagCode}get commissaryFlagDescription(){return this.json.commissaryFlagDescription}get countryOfBirth(){return this.json.countryOfBirth}get countryOfBirthIso(){return this.json.countryOfBirthIso}get deersDependentSuffixCode(){return this.json.deersDependentSuffixCode}get deersDependentSuffixDescription(){return this.json.deersDependentSuffixDescription}get directCareFlagCode(){return this.json.directCareFlagCode}get directCareFlagDescription(){return this.json.directCareFlagDescription}get documentCopy(){return this.json.documentCopy}get documentDiscriminatorNumber(){return this.json.documentDiscriminatorNumber}get driverNamePrefix(){return this.json.driverNamePrefix}get driverNameSuffix(){return this.json.driverNameSuffix}get driverRestrictionCodes(){return this.json.driverRestrictionCodes!=null?this.json.driverRestrictionCodes:[]}get ediPersonIdentifier(){return this.json.ediPersonIdentifier}get endorsementsCode(){return this.json.endorsementsCode}get exchangeFlagCode(){return this.json.exchangeFlagCode}get exchangeFlagDescription(){return this.json.exchangeFlagDescription}get eyeColor(){return this.json.eyeColor}get familySequenceNumber(){return this.json.familySequenceNumber}get firstNameTruncation(){return this.json.firstNameTruncation}get firstNameWithoutMiddleName(){return this.json.firstNameWithoutMiddleName}get formNumber(){return this.json.formNumber}get genevaConventionCategory(){return this.json.genevaConventionCategory}get hairColor(){return this.json.hairColor}get heightCm(){return this.json.heightCm}get heightInch(){return this.json.heightInch}get IIN(){return this.json.iin}get identificationType(){return this.json.identificationType}get issuingJurisdiction(){return this.json.issuingJurisdiction}get issuingJurisdictionIso(){return this.json.issuingJurisdictionIso}get barcodeMetadata(){return Ae.fromJSON(this.json.barcodeMetadata)}get jpegData(){return this.json.jpegData}get jurisdictionVersion(){return this.json.jurisdictionVersion}get lastNameTruncation(){return this.json.lastNameTruncation}get licenseCountryOfIssue(){return this.json.licenseCountryOfIssue}get middleName(){return this.json.middleName}get middleNameTruncation(){return this.json.middleNameTruncation}get mwrFlagCode(){return this.json.mwrFlagCode}get mwrFlagDescription(){return this.json.mwrFlagDescription}get payGrade(){return this.json.payGrade}get payPlanCode(){return this.json.payPlanCode}get payPlanGradeCode(){return this.json.payPlanGradeCode}get personDesignatorDocument(){return this.json.personDesignatorDocument}get personDesignatorTypeCode(){return this.json.personDesignatorTypeCode}get personMiddleInitial(){return this.json.personMiddleInitial}get personalIdNumber(){return this.json.personalIdNumber}get personalIdNumberType(){return this.json.personalIdNumberType}get personnelCategoryCode(){return this.json.personnelCategoryCode}get personnelEntitlementConditionType(){return this.json.personnelEntitlementConditionType}get placeOfBirth(){return this.json.placeOfBirth}get professionalDrivingPermit(){return this.json.professionalDrivingPermit!=null?he.fromJSON(this.json.professionalDrivingPermit):null}get race(){return this.json.race}get rank(){return this.json.rank}get rawData(){return this.json.rawData}get relationshipCode(){return this.json.relationshipCode}get relationshipDescription(){return this.json.relationshipDescription}get restrictionsCode(){return this.json.restrictionsCode}get securityCode(){return this.json.securityCode}get serviceCode(){return this.json.serviceCode}get sponsorFlag(){return this.json.sponsorFlag}get sponsorName(){return this.json.sponsorName}get sponsorPersonDesignatorIdentifier(){return this.json.sponsorPersonDesignatorIdentifier}get statusCode(){return this.json.statusCode}get statusCodeDescription(){return this.json.statusCodeDescription}get vehicleClass(){return this.json.vehicleClass}get vehicleRestrictions(){return this.json.vehicleRestrictions!=null?this.json.vehicleRestrictions.map(t=>me.fromJSON(t)).filter(t=>t!=null):[]}get version(){return this.json.version}get weightKg(){return this.json.weightKg}get weightLbs(){return this.json.weightLbs}get isRealId(){return this.json.isRealId}get barcodeDataElements(){return this.json.dictionary}static fromJSON(t){let a=new e;return a.json=t,a}toJSONObject(){var t,a,r,s,o,c;return {firstName:this.json.firstName,lastName:this.json.lastName,secondaryLastName:this.json.secondaryLastName,fullName:this.json.fullName,sex:this.json.sex,nationality:this.json.nationality,address:this.json.address,issuingCountry:this.json.issuingCountry,issuingCountryIso:this.json.issuingCountryIso,barcodeMetadata:this.barcodeMetadata?this.barcodeMetadata.toJSONObject():null,documentNumber:this.json.documentNumber,documentType:this.json.documentType,documentSubtype:this.json.documentSubtype,documentAdditionalNumber:this.json.documentAdditionalNumber,dateOfBirth:(a=(t=I.fromJSON(this.json.dateOfBirth))==null?void 0:t.toJSONObject())!=null?a:null,dateOfExpiry:(s=(r=I.fromJSON(this.json.dateOfExpiry))==null?void 0:r.toJSONObject())!=null?s:null,dateOfIssue:(c=(o=I.fromJSON(this.json.dateOfIssue))==null?void 0:o.toJSONObject())!=null?c:null,aamvaVersion:this.aamvaVersion,aliasFamilyName:this.aliasFamilyName,aliasGivenName:this.aliasGivenName,aliasSuffixName:this.aliasSuffixName,bloodType:this.bloodType,branchOfService:this.branchOfService,cardInstanceIdentifier:this.cardInstanceIdentifier,cardRevisionDate:this.cardRevisionDate?this.cardRevisionDate.toJSONObject():null,categories:[...this.categories],champusEffectiveDate:this.champusEffectiveDate?this.champusEffectiveDate.toJSONObject():null,champusExpiryDate:this.champusExpiryDate?this.champusExpiryDate.toJSONObject():null,citizenshipStatus:this.citizenshipStatus,civilianHealthCareFlagCode:this.civilianHealthCareFlagCode,civilianHealthCareFlagDescription:this.civilianHealthCareFlagDescription,commissaryFlagCode:this.commissaryFlagCode,commissaryFlagDescription:this.commissaryFlagDescription,countryOfBirth:this.countryOfBirth,countryOfBirthIso:this.countryOfBirthIso,deersDependentSuffixCode:this.deersDependentSuffixCode,deersDependentSuffixDescription:this.deersDependentSuffixDescription,directCareFlagCode:this.directCareFlagCode,directCareFlagDescription:this.directCareFlagDescription,documentCopy:this.documentCopy,documentDiscriminatorNumber:this.documentDiscriminatorNumber,driverNamePrefix:this.driverNamePrefix,driverNameSuffix:this.driverNameSuffix,driverRestrictionCodes:[...this.driverRestrictionCodes],ediPersonIdentifier:this.ediPersonIdentifier,endorsementsCode:this.endorsementsCode,exchangeFlagCode:this.exchangeFlagCode,exchangeFlagDescription:this.exchangeFlagDescription,eyeColor:this.eyeColor,familySequenceNumber:this.familySequenceNumber,firstNameTruncation:this.firstNameTruncation,firstNameWithoutMiddleName:this.firstNameWithoutMiddleName,formNumber:this.formNumber,genevaConventionCategory:this.genevaConventionCategory,hairColor:this.hairColor,heightCm:this.heightCm,heightInch:this.heightInch,iin:this.IIN,identificationType:this.identificationType,issuingJurisdiction:this.issuingJurisdiction,issuingJurisdictionIso:this.issuingJurisdictionIso,jpegData:this.jpegData,jurisdictionVersion:this.jurisdictionVersion,lastNameTruncation:this.lastNameTruncation,licenseCountryOfIssue:this.licenseCountryOfIssue,middleName:this.middleName,middleNameTruncation:this.middleNameTruncation,mwrFlagCode:this.mwrFlagCode,mwrFlagDescription:this.mwrFlagDescription,payGrade:this.payGrade,payPlanCode:this.payPlanCode,payPlanGradeCode:this.payPlanGradeCode,personDesignatorDocument:this.personDesignatorDocument,personDesignatorTypeCode:this.personDesignatorTypeCode,personMiddleInitial:this.personMiddleInitial,personalIdNumber:this.personalIdNumber,personalIdNumberType:this.personalIdNumberType,personnelCategoryCode:this.personnelCategoryCode,personnelEntitlementConditionType:this.personnelEntitlementConditionType,placeOfBirth:this.placeOfBirth,professionalDrivingPermit:this.professionalDrivingPermit?this.professionalDrivingPermit.toJSONObject():null,race:this.race,rank:this.rank,rawData:this.rawData,relationshipCode:this.relationshipCode,relationshipDescription:this.relationshipDescription,restrictionsCode:this.restrictionsCode,securityCode:this.securityCode,serviceCode:this.serviceCode,sponsorFlag:this.sponsorFlag,sponsorName:this.sponsorName,sponsorPersonDesignatorIdentifier:this.sponsorPersonDesignatorIdentifier,statusCode:this.statusCode,statusCodeDescription:this.statusCodeDescription,vehicleClass:this.vehicleClass,vehicleRestrictions:this.vehicleRestrictions.map(u=>u.toJSONObject()),version:this.version,weightKg:this.weightKg,weightLbs:this.weightLbs,isRealId:this.isRealId,dictionary:{...this.barcodeDataElements}}}};var Nt=(a=>(a.FrontOnly="frontOnly",a.FrontAndBack="frontAndBack",a))(Nt||{}),et=(r=>(r.Face="face",r.CroppedDocument="croppedDocument",r.Frame="frame",r))(et||{}),pa=(a=>(a.Front="front",a.Back="back",a))(pa||{}),Ct=(s=>(s.None="none",s.FieldsOnly="fieldsOnly",s.ImagesOnly="imagesOnly",s.FieldsAndImages="fieldsAndImages",s))(Ct||{}),gt=(a=>(a.Auto="auto",a.ButtonTap="buttonTap",a))(gt||{}),Aa=(a=>(a.Rounded="rounded",a.Square="square",a))(Aa||{}),ha=(a=>(a.Light="light",a.Bold="bold",a))(ha||{}),ma=(r=>(r.NotAvailable="notAvailable",r.NotRealIdCompliant="notRealIdCompliant",r.RealIdCompliant="realIdCompliant",r))(ma||{}),Ia=(r=>(r.Female="female",r.Male="male",r.Unspecified="unspecified",r))(Ia||{});var Se=class e{constructor(){this.json=null;}get face(){var t,a;return (a=(t=this.json)==null?void 0:t.front.face)!=null?a:null}get frame(){var t,a,r,s;return (s=(r=(t=this.json)==null?void 0:t.front.frame)!=null?r:(a=this.json)==null?void 0:a.back.frame)!=null?s:null}static fromJSON(t){let a=new e;return t!=null&&(a.json=t),a}getFrame(t){var a,r,s,o;switch(t){case"front":return (r=(a=this.json)==null?void 0:a.front.frame)!=null?r:null;case"back":return (o=(s=this.json)==null?void 0:s.back.frame)!=null?o:null}return null}getCroppedDocument(t){var a,r,s,o;switch(t){case"front":return (r=(a=this.json)==null?void 0:a.front.croppedDocument)!=null?r:null;case"back":return (o=(s=this.json)==null?void 0:s.back.croppedDocument)!=null?o:null}return null}toJSONObject(){return {front:{face:this.face,croppedDocument:this.getCroppedDocument("front"),frame:this.getFrame("front")},back:{face:null,croppedDocument:this.getCroppedDocument("back"),frame:this.getFrame("back")}}}};var Ne=class e{get documentCode(){return this.json.documentCode}get namesAreTruncated(){return this.json.namesAreTruncated}get optional(){return this.json.optional}get optional1(){return this.json.optional1}get capturedMrz(){return this.json.capturedMrz}get personalIdNumber(){return this.json.personalIdNumber}get renewalTimes(){return this.json.renewalTimes}get fullNameSimplifiedChinese(){return this.json.fullNameSimplifiedChinese}get omittedCharacterCountInGbkName(){return this.json.omittedCharacterCountInGbkName}get omittedNameCount(){return this.json.omittedNameCount}get issuingAuthorityCode(){return this.json.issuingAuthorityCode}get passportIssuerIso(){return this.json.passportIssuerIso}get passportNumber(){return this.json.passportNumber}get passportDateOfExpiry(){return I.fromJSON(this.json.passportDateOfExpiry)}static fromJSON(t){let a=new e;return a.json=t,a}toJSONObject(){return {...this.json,documentCode:this.documentCode,namesAreTruncated:this.namesAreTruncated,optional:this.optional,optional1:this.optional1,capturedMrz:this.capturedMrz,personalIdNumber:this.personalIdNumber,renewalTimes:this.renewalTimes,fullNameSimplifiedChinese:this.fullNameSimplifiedChinese,omittedCharacterCountInGbkName:this.omittedCharacterCountInGbkName,omittedNameCount:this.omittedNameCount,issuingAuthorityCode:this.issuingAuthorityCode,passportIssuerIso:this.passportIssuerIso,passportNumber:this.passportNumber,passportDateOfExpiry:this.passportDateOfExpiry?this.passportDateOfExpiry.toJSONObject():null}}};var Ce=class e{constructor(){this.json={};}get code(){return this.json.code}get dateOfIssue(){return I.fromJSON(this.json.dateOfIssue)}get dateOfExpiry(){return I.fromJSON(this.json.dateOfExpiry)}static fromJSON(t){if(t==null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {code:this.code,dateOfIssue:this.dateOfIssue?this.dateOfIssue.toJSONObject():null,dateOfExpiry:this.dateOfExpiry?this.dateOfExpiry.toJSONObject():null}}};var j=class e{constructor(){this.json={};}get drivingLicenseCategories(){return this.json.drivingLicenseCategories.map(t=>Ce.fromJSON(t)).filter(t=>t!=null)}get restrictions(){return this.json.restrictions}get endorsements(){return this.json.endorsements}static fromJSON(t){if(t==null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {drivingLicenseCategories:this.drivingLicenseCategories.map(t=>t.toJSONObject()),restrictions:this.restrictions,endorsements:this.endorsements}}};var ge=class e{get firstName(){return this.json.firstName}get lastName(){return this.json.lastName}get secondaryLastName(){return this.json.secondaryLastName}get fullName(){return this.json.fullName}get additionalAddressInformation(){return this.json.additionalAddressInformation}get additionalNameInformation(){return this.json.additionalNameInformation}get documentAdditionalNumber(){return this.json.documentAdditionalNumber}get employer(){return this.json.employer}get issuingAuthority(){return this.json.issuingAuthority}get issuingJurisdiction(){return this.json.issuingJurisdiction}get issuingJurisdictionIso(){return this.json.issuingJurisdictionIso}get maritalStatus(){return this.json.maritalStatus}get personalIdNumber(){return this.json.personalIdNumber}get placeOfBirth(){return this.json.placeOfBirth}get profession(){return this.json.profession}get race(){return this.json.race}get religion(){return this.json.religion}get residentialStatus(){return this.json.residentialStatus}get mothersName(){return this.json.mothersName}get fathersName(){return this.json.fathersName}get capturedSides(){return this.json.capturedSides}get isBackSideCaptureSupported(){return this.json.isBackSideCaptureSupported}get drivingLicenseDetails(){return j.fromJSON(this.json.drivingLicenseDetails)}get bloodType(){return this.json.bloodType}get sponsor(){return this.json.sponsor}get visaNumber(){return this.json.visaNumber}get passportNumber(){return this.json.passportNumber}static fromJSON(t){let a=new e;return a.json=t,a}toJSONObject(){return {...this.json,firstName:this.firstName,lastName:this.lastName,secondaryLastName:this.secondaryLastName,fullName:this.fullName,additionalAddressInformation:this.additionalAddressInformation,additionalNameInformation:this.additionalNameInformation,documentAdditionalNumber:this.documentAdditionalNumber,employer:this.employer,issuingAuthority:this.issuingAuthority,issuingJurisdiction:this.issuingJurisdiction,issuingJurisdictionIso:this.issuingJurisdictionIso,maritalStatus:this.maritalStatus,personalIdNumber:this.personalIdNumber,placeOfBirth:this.placeOfBirth,profession:this.profession,race:this.race,religion:this.religion,residentialStatus:this.residentialStatus,mothersName:this.mothersName,fathersName:this.fathersName,capturedSides:this.capturedSides,isBackSideCaptureSupported:this.isBackSideCaptureSupported,drivingLicenseDetails:this.drivingLicenseDetails?this.drivingLicenseDetails.toJSONObject():null,bloodType:this.bloodType,sponsor:this.sponsor,passportNumber:this.passportNumber,visaNumber:this.visaNumber}}};var J=class e{constructor(){this.json={};}get allChecksPassed(){return this.json.allChecksPassed}get failedChecks(){return this.json.failedChecks}get skippedChecks(){return this.json.skippedChecks}get passedChecks(){return this.json.passedChecks}static fromJSON(t){let a=new e;return a.json=t,a}async frontReviewImage(){let t=this.json.frontFieldLocations,a=t!=null&&Object.keys(t).length>0;if(!this.allChecksPassed){let r=this.json.frontImage;if(r!=null)try{if(a)return await this.highlightImage(r,t)}catch(s){Logger.log(Logger.Level.Warn,"Failed to create image with mismatching fields.",s);}}return ""}toJSONObject(){return {...this.json}}pushQuadForKey(t,a,r){let s=t[r];return s!=null?(a.push(Quadrilateral.fromJSON(s)),!0):!1}pushQuadsForKeys(t,a,r,s=[]){if(!this.pushQuadForKey(t,a,r))for(let o of s)this.pushQuadForKey(t,a,o);}getMismatchedQuads(t){let a=[];return t!=null&&(this.failedChecks.includes("documentNumberComparison")&&this.pushQuadsForKeys(t,a,"documentNumber"),this.failedChecks.includes("fullNameComparison")&&this.pushQuadsForKeys(t,a,"fullName",["firstName","lastName"]),this.failedChecks.includes("dateOfBirthComparison")&&this.pushQuadsForKeys(t,a,"dateOfBirth"),this.failedChecks.includes("dateOfExpiryComparison")&&this.pushQuadsForKeys(t,a,"dateOfExpiry"),this.failedChecks.includes("dateOfIssueComparison")&&this.pushQuadsForKeys(t,a,"dateOfIssue")),a}async highlightImage(t,a){let r=new Image;r.src=`data:image/png;base64,${t}`,await r.decode();let s=document.createElement("canvas");s.width=r.width,s.height=r.height;let o=s.getContext("2d");o.drawImage(r,0,0);let c=this.getMismatchedQuads(a);if(c.length===0)return "";o.beginPath(),o.rect(0,0,r.width,r.height);for(let u of c)o.moveTo(u.topLeft.x,u.topLeft.y),o.lineTo(u.topLeft.x,u.bottomRight.y),o.lineTo(u.bottomRight.x,u.bottomRight.y),o.lineTo(u.bottomRight.x,u.topLeft.y),o.lineTo(u.topLeft.x,u.topLeft.y);o.fillStyle="rgba(0, 0, 0, 0.30)",o.fill(),o.lineWidth=3,o.strokeStyle="red",o.beginPath();for(let u of c)o.rect(u.topLeft.x,u.topLeft.y,u.bottomRight.x-u.topLeft.x,u.bottomRight.y-u.topLeft.y);return o.stroke(),s.toDataURL("image/jpeg",1)}};var se=class e{get dataConsistency(){let t=this.json.rejectsInconsistentData;return this.json.dataConsistencyResult!=null&&t?J.fromJSON(this.json.dataConsistencyResult):null}static fromJSON(t){let a=new e;return a.json=t,a}toJSONObject(){return {...this.json}}};var K=class extends f{constructor(a){super(a);this.documentType="driverLicense";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var Z=class extends f{constructor(a){super(a);this.documentType="healthInsuranceCard";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var Y=class extends f{constructor(a){super(a);this.documentType="idCard";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var Q=class extends f{constructor(a){super(a);this.documentType="passport";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var Na=(i=>(i.Any="any",i.EuAndSchengen="euAndSchengen",i.Aruba="aruba",i.Afghanistan="afghanistan",i.Angola="angola",i.Anguilla="anguilla",i.AlandIslands="alandIslands",i.Albania="albania",i.Andorra="andorra",i.Uae="uae",i.Argentina="argentina",i.Armenia="armenia",i.AmericanSamoa="americanSamoa",i.Antarctica="antarctica",i.FrenchSouthernTerritories="frenchSouthernTerritories",i.AntiguaAndBarbuda="antiguaAndBarbuda",i.Australia="australia",i.Austria="austria",i.Azerbaijan="azerbaijan",i.Burundi="burundi",i.Belgium="belgium",i.Benin="benin",i.BonaireSintEustatiusAndSaba="bonaireSintEustatiusAndSaba",i.BurkinaFaso="burkinaFaso",i.Bangladesh="bangladesh",i.Bulgaria="bulgaria",i.Bahrain="bahrain",i.Bahamas="bahamas",i.BosniaHerzegovina="bosniaHerzegovina",i.SaintBarthelemy="saintBarthelemy",i.Belarus="belarus",i.Belize="belize",i.Bermuda="bermuda",i.Bolivia="bolivia",i.Brazil="brazil",i.Barbados="barbados",i.BruneiDarussalam="bruneiDarussalam",i.Bhutan="bhutan",i.BouvetIsland="bouvetIsland",i.Botswana="botswana",i.Car="car",i.Canada="canada",i.CocosIslands="cocosIslands",i.Switzerland="switzerland",i.Chile="chile",i.China="china",i.CoteIvoire="coteIvoire",i.Cameroon="cameroon",i.DemocraticRepublicOfCongo="democraticRepublicOfCongo",i.Congo="congo",i.CookIslands="cookIslands",i.Colombia="colombia",i.Comoros="comoros",i.CaboVerde="caboVerde",i.CostaRica="costaRica",i.Cuba="cuba",i.Curacao="curacao",i.ChristmasIsland="christmasIsland",i.CaymanIslands="caymanIslands",i.Cyprus="cyprus",i.Czechia="czechia",i.Germany="germany",i.Djibouti="djibouti",i.Dominica="dominica",i.Denmark="denmark",i.DominicanRepublic="dominicanRepublic",i.Algeria="algeria",i.Ecuador="ecuador",i.Egypt="egypt",i.Eritrea="eritrea",i.WesternSahara="westernSahara",i.Spain="spain",i.Estonia="estonia",i.Ethiopia="ethiopia",i.Finland="finland",i.Fiji="fiji",i.FalklandIslands="falklandIslands",i.France="france",i.FaroeIslands="faroeIslands",i.Micronesia="micronesia",i.Gabon="gabon",i.Uk="uk",i.Georgia="georgia",i.Guernsey="guernsey",i.Ghana="ghana",i.Gibraltar="gibraltar",i.Guinea="guinea",i.Guadeloupe="guadeloupe",i.Gambia="gambia",i.GuineaBissau="guineaBissau",i.EquatorialGuinea="equatorialGuinea",i.Greece="greece",i.Grenada="grenada",i.Greenland="greenland",i.Guatemala="guatemala",i.FrenchGuiana="frenchGuiana",i.Guam="guam",i.Guyana="guyana",i.HongKong="hongKong",i.HeardIslandAndMcDonaldIslands="heardIslandAndMcDonaldIslands",i.Honduras="honduras",i.Croatia="croatia",i.Haiti="haiti",i.Hungary="hungary",i.Indonesia="indonesia",i.IsleOfMan="isleOfMan",i.India="india",i.BritishIndianOceanTerritory="britishIndianOceanTerritory",i.Ireland="ireland",i.Iran="iran",i.Iraq="iraq",i.Iceland="iceland",i.Israel="israel",i.Italy="italy",i.Jamaica="jamaica",i.Jersey="jersey",i.Jordan="jordan",i.Japan="japan",i.Kazakhstan="kazakhstan",i.Kenya="kenya",i.Kyrgyzstan="kyrgyzstan",i.Cambodia="cambodia",i.Kiribati="kiribati",i.SaintKittsAndNevis="saintKittsAndNevis",i.SouthKorea="southKorea",i.Kuwait="kuwait",i.Lao="lao",i.Lebanon="lebanon",i.Liberia="liberia",i.Libya="libya",i.SaintLucia="saintLucia",i.Liechtenstein="liechtenstein",i.SriLanka="sriLanka",i.Lesotho="lesotho",i.Lithuania="lithuania",i.Luxembourg="luxembourg",i.Latvia="latvia",i.Macao="macao",i.FrenchSaintMartin="frenchSaintMartin",i.Morocco="morocco",i.Monaco="monaco",i.Moldova="moldova",i.Madagascar="madagascar",i.Maldives="maldives",i.Mexico="mexico",i.MarshallIslands="marshallIslands",i.NorthMacedonia="northMacedonia",i.Mali="mali",i.Malta="malta",i.Myanmar="myanmar",i.Montenegro="montenegro",i.Mongolia="mongolia",i.NorthernMarianaIslands="northernMarianaIslands",i.Mozambique="mozambique",i.Mauritania="mauritania",i.Montserrat="montserrat",i.Martinique="martinique",i.Mauritius="mauritius",i.Malawi="malawi",i.Malaysia="malaysia",i.Mayotte="mayotte",i.Namibia="namibia",i.NewCaledonia="newCaledonia",i.Niger="niger",i.NorfolkIsland="norfolkIsland",i.Nigeria="nigeria",i.Nicaragua="nicaragua",i.Niue="niue",i.Netherlands="netherlands",i.Norway="norway",i.Nepal="nepal",i.Nauru="nauru",i.NewZealand="newZealand",i.Oman="oman",i.Pakistan="pakistan",i.Panama="panama",i.Pitcairn="pitcairn",i.Peru="peru",i.Philippines="philippines",i.Palau="palau",i.PapuaNewGuinea="papuaNewGuinea",i.Poland="poland",i.PuertoRico="puertoRico",i.NorthKorea="northKorea",i.Portugal="portugal",i.Paraguay="paraguay",i.Palestine="palestine",i.FrenchPolynesia="frenchPolynesia",i.Qatar="qatar",i.Reunion="reunion",i.Romania="romania",i.Russia="russia",i.Rwanda="rwanda",i.SaudiArabia="saudiArabia",i.Sudan="sudan",i.Senegal="senegal",i.Singapore="singapore",i.SouthGeorgiaAndTheSouthSandwichIslands="southGeorgiaAndTheSouthSandwichIslands",i.SaintHelena="saintHelena",i.SvalbardAndJanMayen="svalbardAndJanMayen",i.SolomonIslands="solomonIslands",i.SierraLeone="sierraLeone",i.ElSalvador="elSalvador",i.SanMarino="sanMarino",i.Somalia="somalia",i.SaintPierreAndMiquelon="saintPierreAndMiquelon",i.Serbia="serbia",i.SouthSudan="southSudan",i.SaoTomeAndPrincipe="saoTomeAndPrincipe",i.Suriname="suriname",i.Slovakia="slovakia",i.Slovenia="slovenia",i.Sweden="sweden",i.Eswatini="eswatini",i.DutchSintMaarten="dutchSintMaarten",i.Seychelles="seychelles",i.Syria="syria",i.TurksAndCaicosIslands="turksAndCaicosIslands",i.Chad="chad",i.Togo="togo",i.Thailand="thailand",i.Tajikistan="tajikistan",i.Tokelau="tokelau",i.Turkmenistan="turkmenistan",i.TimorLeste="timorLeste",i.Tonga="tonga",i.TrinidadAndTobago="trinidadAndTobago",i.Tunisia="tunisia",i.Turkey="turkey",i.Tuvalu="tuvalu",i.Taiwan="taiwan",i.Tanzania="tanzania",i.Uganda="uganda",i.Ukraine="ukraine",i.UsMinorOutlyingIslands="usMinorOutlyingIslands",i.Uruguay="uruguay",i.Us="us",i.Uzbekistan="uzbekistan",i.HolySee="holySee",i.SaintVincentAndTheGrenadines="saintVincentAndTheGrenadines",i.Venezuela="venezuela",i.BritishVirginIslands="britishVirginIslands",i.UsVirginIslands="usVirginIslands",i.Vietnam="vietnam",i.Vanuatu="vanuatu",i.WallisAndFutuna="wallisAndFutuna",i.Samoa="samoa",i.Kosovo="kosovo",i.Yemen="yemen",i.SouthAfrica="southAfrica",i.Zambia="zambia",i.Zimbabwe="zimbabwe",i))(Na||{});var X=class extends f{constructor(a){super("any");this.documentType="regionSpecific";this.subtype=a;}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType,documentSubtype:this.subtype}}};var $=class extends f{constructor(a){super(a);this.documentType="residencePermit";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var ee=class extends f{constructor(a){super(a);this.documentType="visaIcao";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var ne=class e{get firstName(){return this.json.firstName}get lastName(){return this.json.lastName}get secondaryLastName(){return this.json.secondaryLastName}get fullName(){return this.json.fullName}get sexType(){return this.json.sex}get sex(){return this.json.sex}get dateOfBirth(){return I.fromJSON(this.json.dateOfBirth)}get age(){return this.json.age}get nationality(){return this.json.nationality}get address(){return this.json.address}get document(){if(this.json.documentType!=null){let t=this.json.documentType,a=this.json.documentSubtype,r=this.issuingCountry;switch(t){case"passport":return new Q(r);case"idCard":return new Y(r);case"driverLicense":return new K(r);case"visaIcao":return new ee(r);case"residencePermit":return new $(r);case"healthInsuranceCard":return new Z(r);case"regionSpecific":return new X(a);}}return null}get issuingCountryIso(){return this.json.issuingCountryIso}get issuingCountry(){return this.json.issuingCountry}get documentNumber(){return this.json.documentNumber}get documentAdditionalNumber(){return this.json.documentAdditionalNumber}get dateOfExpiry(){return I.fromJSON(this.json.dateOfExpiry)}get isExpired(){return this.json.isExpired}get dateOfIssue(){return I.fromJSON(this.json.dateOfIssue)}get usRealIdStatus(){var t,a;if(((t=this.json.vizResult)==null?void 0:t.usRealIdStatus)!=null&&this.json.vizResult.usRealIdStatus!=="notAvailable")return this.json.vizResult.usRealIdStatus;switch((a=this.barcode)==null?void 0:a.isRealId){case!0:return "realIdCompliant";case!1:return "notRealIdCompliant";default:return "notAvailable"}}get barcode(){var t;return this._barcodeResult==null&&this.json.barcodeResult!=null&&(this._barcodeResult=Ie.fromJSON(this.json.barcodeResult)),(t=this._barcodeResult)!=null?t:null}get mrzResult(){var t;return this._mrzResult==null&&this.json.mrzResult!=null&&(this._mrzResult=Ne.fromJSON(this.json.mrzResult)),(t=this._mrzResult)!=null?t:null}get vizResult(){var t;return this._vizResult==null&&this.json.vizResult!=null&&(this._vizResult=ge.fromJSON(this.json.vizResult)),(t=this._vizResult)!=null?t:null}get verificationResult(){var t;return this._verificationResult==null&&this.json.verificationResult!=null&&(this._verificationResult=se.fromJSON(this.json.verificationResult)),(t=this._verificationResult)!=null?t:new se}get images(){return Se.fromJSON(this.json.imageInfo)}get barcodeResultsJSON(){var t,a;return {barcodeResult:(a=(t=this.barcode)==null?void 0:t.toJSONObject())!=null?a:null}}get mrzResultsJSON(){return {mrzResult:this.mrzResult?this.mrzResult.toJSONObject():null}}static fromJSON(t){let a=new e;return a.json=t,a}isIdCard(){var t,a;return (a=(t=this.document)==null?void 0:t.isIdCard())!=null?a:!1}isDriverLicense(){var t,a;return (a=(t=this.document)==null?void 0:t.isDriverLicense())!=null?a:!1}isPassport(){var t,a;return (a=(t=this.document)==null?void 0:t.isPassport())!=null?a:!1}isVisaIcao(){var t,a;return (a=(t=this.document)==null?void 0:t.isVisaIcao())!=null?a:!1}isRegionSpecific(t){return this.document?this.document.isRegionSpecific()&&this.document.subtype===t:!1}isResidencePermit(){var t,a;return (a=(t=this.document)==null?void 0:t.isResidencePermit())!=null?a:!1}isHealthInsuranceCard(){var t,a;return (a=(t=this.document)==null?void 0:t.isHealthInsuranceCard())!=null?a:!1}toJSONObject(){var t;return {firstName:this.firstName,lastName:this.lastName,secondaryLastName:this.secondaryLastName,fullName:this.fullName,sex:this.sex,nationality:this.nationality,address:this.address,issuingCountry:this.issuingCountry,issuingCountryIso:this.issuingCountryIso,documentNumber:this.documentNumber,documentAdditionalNumber:this.documentAdditionalNumber,dateOfBirth:this.dateOfBirth?this.dateOfBirth.toJSONObject():null,age:this.age,dateOfExpiry:this.dateOfExpiry?this.dateOfExpiry.toJSONObject():null,isExpired:this.isExpired,dateOfIssue:this.dateOfIssue?this.dateOfIssue.toJSONObject():null,documentType:this.document?this.document.documentType:null,documentSubtype:((t=this.document)==null?void 0:t.isRegionSpecific())==null?null:this.document.subtype,imageInfo:this.images.toJSONObject(),verificationResult:this.verificationResult?this.verificationResult.toJSONObject():null,vizResult:this.vizResult?this.vizResult.toJSONObject():null,idVerificationDataComparisonAvailable:this.json.idVerificationDataComparisonAvailable,usRealIdStatus:this.usRealIdStatus,...this.barcodeResultsJSON,...this.mrzResultsJSON}}};var tt=0;function Ca(){let e=tt;return tt=tt+1,e}var E=class{constructor(t){this.action=t,this.messageID=Ca();}},fe=class e extends E{constructor(t,a){super(e.action),this.wasmModuleName=t.wasmModuleName,this.licenseKey=t.licenseKey,this.userId=a,this.registerLoadCallback=t.loadProgressCallback!==null,this.allowHelloMessage=t.allowHelloMessage,this.engineLocation=t.engineLocation,this.wasmType=t.wasmType,this.initialMemory=t.initialMemory,this.blinkIDVariant=t.blinkIdVariant,this.numberOfWorkers=t.numberOfWorkers;}};fe.action="init";var te;(function(e){e[e.Any=0]="Any",e[e.Recognizer=1]="Recognizer",e[e.RecognizerSettings=2]="RecognizerSettings",e[e.Callback=3]="Callback";})(te||(te={}));var Re=class e extends E{constructor(t,a){super(e.action),this.className=t,this.params=a;}};Re.action="createNewNativeObject";var Ee=class e extends E{constructor(t,a,r){super(e.action),this.recognizerHandles=t,this.allowMultipleResults=a,this.registeredMetadataCallbacks=r;}};Ee.action="createRecognizerRunner";var De=class e extends E{constructor(t,a){super(e.action),this.recognizerHandles=t,this.allowMultipleResults=a;}};De.action="reconfigureRecognizerRunner";var Oe=class e extends E{constructor(){super(e.action);}};Oe.action="deleteRecognizerRunner";var q=class e extends E{constructor(t,a,r){super(e.action),this.objectHandle=t,this.methodName=a,this.params=r;}};q.action="invokeObject";var be=class e extends E{constructor(t){super(e.action),this.frame=t;}getTransferrables(){return [this.frame.imageData.data.buffer]}};be.action="processImage";var _e=class e extends E{constructor(t){super(e.action),this.hardReset=t;}};_e.action="resetRecognizers";var at=class{constructor(){this.onDebugText=!1,this.onDetectionFailed=!1,this.onQuadDetection=!1,this.onPointsDetection=!1,this.onFirstSideResult=!1;}},Te=class e extends E{constructor(t){super(e.action),this.registeredMetadataCallbacks=t;}};Te.action="registerMetadataCallbacks";var Le=class e extends E{constructor(t){super(e.action),this.detectionOnlyMode=t;}};Le.action="setDetectionOnly";var ve=class e extends E{constructor(t){super(e.action),this.cameraPreviewMirrored=t;}};ve.action="setCameraPreviewMirrored";var Me=class e extends E{constructor(t){super(e.action),this.userId=t;}};Me.action="getProductIntegrationInfo";var we=class e extends E{constructor(t){super(e.action),this.pingProxyUrl=t;}};we.action="setPingProxyUrl";var Pe=class e extends E{constructor(t){super(e.action),this.data=t;}};Pe.action="setPingData";var v;(function(e){e[e.onDebugText=0]="onDebugText",e[e.onDetectionFailed=1]="onDetectionFailed",e[e.onQuadDetection=2]="onQuadDetection",e[e.onPointsDetection=3]="onPointsDetection",e[e.onFirstSideResult=4]="onFirstSideResult",e[e.recognizerCallback=5]="recognizerCallback";})(v||(v={}));var U;(function(e){e.Basic="BASIC",e.Advanced="ADVANCED",e.AdvancedWithThreads="ADVANCED_WITH_THREADS";})(U||(U={}));var ga=atob("Q2VudGF1cnVz"),R=class extends Error{constructor(t,a){if(super(),!t.code||!t.message)throw new Error("Instance of SDKError is required to have code and message.");if(this.message=t.message,this.code=t.code,"details"in t){if("message"in t.details){let r=new Error(t.details.message);"stack"in t.details&&(r.stack=t.details.stack),this.details=r;}}else this.details=a;}};function fa(e){return /^https:\/\/[^\/]+(?::\d+)?\/?$/.test(e)}var A;(function(e){e.WORKER_WASM_LOAD_FAILURE="WORKER_WASM_LOAD_FAILURE",e.WORKER_WASM_INIT_MISSING="WORKER_WASM_INIT_MISSING",e.WORKER_FUNCTION_INVOKE_FAILURE="WORKER_FUNCTION_INVOKE_FAILURE",e.WORKER_RECOGNIZER_CREATION_FAILURE="WORKER_RECOGNIZER_CREATION_FAILURE",e.WORKER_RUNNER_EXISTS="WORKER_RUNNER_EXISTS",e.WORKER_RUNNER_CREATION_FAILURE="WORKER_RUNNER_CREATION_FAILURE",e.WORKER_RUNNER_MISSING="WORKER_RUNNER_MISSING",e.WORKER_RUNNER_RECONFIGURE_FAILURE="WORKER_RUNNER_RECONFIGURE_FAILURE",e.WORKER_RUNNER_DELETED="WORKER_RUNNER_DELETED",e.WORKER_RUNNER_DELETE_FAILURE="WORKER_RUNNER_DELETE_FAILURE",e.WORKER_OBJECT_INVOKE_FAILURE="WORKER_OBJECT_INVOKE_FAILURE",e.WORKER_IMAGE_PROCESS_FAILURE="WORKER_IMAGE_PROCESS_FAILURE",e.WORKER_HANDLE_UNDEFINED="WORKER_HANDLE_UNDEFINED",e.WORKER_MESSAGE_ACTION_UNKNOWN="WORKER_MESSAGE_ACTION_UNKNOWN",e.WORKER_LICENSE_UNLOCK_ERROR="WORKER_LICENSE_UNLOCK_ERROR",e.WORKER_INTEGRATION_INFO_FAILURE="WORKER_INTEGRATION_INFO_FAILURE",e.LOCAL_SDK_RUNNER_MISSING="LOCAL_SDK_RUNNER_MISSING",e.LOCAL_SDK_RUNNER_EMPTY="LOCAL_SDK_RUNNER_EMPTY",e.LICENSE_UNLOCK_ERROR="LICENSE_UNLOCK_ERROR",e.FRAME_CAPTURE_SVG_UNSUPPORTED="FRAME_CAPTURE_SVG_UNSUPPORTED",e.FRAME_CAPTURE_CANVAS_MISSING="FRAME_CAPTURE_CANVAS_MISSING",e.SDK_WASM_SETTINGS_MISSING="SDK_WASM_SETTINGS_MISSING",e.SDK_LICENSE_KEY_MISSING="SDK_LICENSE_KEY_MISSING",e.SDK_WASM_MODULE_NAME_MISSING="SDK_WASM_MODULE_NAME_MISSING",e.SDK_ENGINE_LOCATION_INVALID="SDK_ENGINE_LOCATION_INVALID",e.SDK_WORKER_LOCATION_INVALID="SDK_WORKER_LOCATION_INVALID",e.SDK_MISSING="SDK_MISSING",e.SDK_RECOGNIZERS_MISSING="SDK_RECOGNIZERS_MISSING",e.VIDEO_RECOGNIZER_ELEMENT_MISSING="VIDEO_RECOGNIZER_ELEMENT_MISSING",e.VIDEO_RECOGNIZER_CAMERA_MISSING="VIDEO_RECOGNIZER_CAMERA_MISSING",e.VIDEO_RECOGNIZER_CAMERA_NOT_ALLOWED="VIDEO_RECOGNIZER_CAMERA_NOT_ALLOWED",e.VIDEO_RECOGNIZER_CAMERA_UNAVAILABLE="VIDEO_RECOGNIZER_CAMERA_UNAVAILABLE",e.VIDEO_RECOGNIZER_CAMERA_IN_USE="VIDEO_RECOGNIZER_CAMERA_IN_USE",e.VIDEO_RECOGNIZER_MEDIA_DEVICES_UNSUPPORTED="VIDEO_RECOGNIZER_MEDIA_DEVICES_UNSUPPORTED",e.VIDEO_RECOGNIZER_FEED_RELEASED="VIDEO_RECOGNIZER_FEED_RELEASED",e.VIDEO_RECOGNIZER_FEED_NOT_PAUSED="VIDEO_RECOGNIZER_FEED_NOT_PAUSED",e.VIDEO_RECOGNIZER_PLAY_REQUEST_INTERRUPTED="VIDEO_RECOGNIZER_PLAY_REQUEST_INTERRUPTED",e.VIDEO_RECOGNIZER_FEED_PAUSED="VIDEO_RECOGNIZER_FEED_PAUSED",e.VIDEO_RECOGNIZER_RECOGNIZERS_RESET_FAILURE="VIDEO_RECOGNIZER_RECOGNIZERS_RESET_FAILURE",e.VIDEO_RECOGNIZER_FEED_MISSING="VIDEO_RECOGNIZER_FEED_MISSING",e.INVALID_PING_PROXY_URL="INVALID_PROXY_URL",e.PING_PROXY_PERMISSION_NOT_GRANTED="PING_PROXY_PERMISSION_NOT_GRANTED",e.PING_DATA_KEYS_AMOUNT_EXCEEDED="PING_DATA_KEYS_AMOUNT_EXCEEDED",e.PING_DATA_KEY_LENGTH_EXCEEDED="PING_DATA_KEY_LENGTH_EXCEEDED",e.PING_DATA_VALUE_LENGTH_EXCEEDED="PING_DATA_VALUE_LENGTH_EXCEEDED";})(A||(A={}));var h;(function(e){e.WORKER_HANDLE_UNDEFINED="Cannot find object with handle: undefined",e.WORKER_WASM_LOAD_FAILURE="Failed to load WASM in web worker!",e.WORKER_WASM_INIT_MISSING="WASM module is not initialized!",e.WORKER_FUNCTION_INVOKE_FAILURE="Failed to invoke function!",e.WORKER_RECOGNIZER_CREATION_FAILURE="Failed to create new recognizer!",e.WORKER_RUNNER_EXISTS="Recognizer runner is already created! Multiple instances are not allowed!",e.WORKER_RUNNER_CREATION_FAILURE="Failed to create new recognizer runner!",e.WORKER_RUNNER_MISSING="Recognizer runner is not created! There is nothing to reconfigure!",e.WORKER_RUNNER_RECONFIGURE_FAILURE="Failed to reconfigure recognizer runner!",e.WORKER_RUNNER_DELETED="Recognizer runner is already deleted!",e.WORKER_RUNNER_DELETE_FAILURE="Failed to delete recognizer runner!",e.WORKER_OBJECT_INVOKE_FAILURE="Failed to invoke object!",e.WORKER_IMAGE_PROCESS_FAILURE="Recognizer runner is not initialized! Cannot process image!",e.WORKER_INTEGRATION_INFO_FAILURE="Failed to get product integration info!",e.LOCAL_SDK_RUNNER_MISSING="Property nativeRecognizerRunner is not available!",e.LOCAL_SDK_RUNNER_EMPTY="Native RecognizerRunner cannot be empty!",e.LICENSE_TOKEN_STATE_INCORRECT="Internal error (Incorrect token state)",e.LICENSE_PAYLOAD_VERIFICATION_FAILED="Failed to verify server permission's digital signature!",e.LICENSE_PAYLOAD_CORRUPTED="Server permission payload is corrupted!",e.LICENSE_PERMISSION_EXPIRED="Internal error (server permission expired)",e.LICENSE_REMOTE_LOCKED="Provided license key has been remotely locked. Please contact support for more information!",e.FRAME_CAPTURE_SVG_UNSUPPORTED="Recognition of SVG elements not supported!",e.FRAME_CAPTURE_CANVAS_MISSING="Could not get canvas 2d context!",e.SDK_WASM_SETTINGS_MISSING="Missing WASM load settings!",e.SDK_LICENSE_KEY_MISSING="Missing license key!",e.SDK_WASM_MODULE_NAME_MISSING="Missing WASM module name!",e.SDK_ENGINE_LOCATION_INVALID="Setting property 'engineLocation' must be a string!",e.SDK_WORKER_LOCATION_INVALID="Setting property 'workerLocation' must be a string!",e.SDK_MISSING="SDK is not provided!",e.SDK_RECOGNIZERS_MISSING="To create RecognizerRunner at least 1 recognizer is required.",e.VIDEO_RECOGNIZER_ELEMENT_MISSING="Video element, i.e. camera feed is not provided!",e.VIDEO_RECOGNIZER_CAMERA_MISSING="Camera not found!",e.VIDEO_RECOGNIZER_CAMERA_NOT_ALLOWED="Camera not allowed!",e.VIDEO_RECOGNIZER_CAMERA_UNAVAILABLE="Camera not available!",e.VIDEO_RECOGNIZER_CAMERA_IN_USE="Camera in use!",e.VIDEO_RECOGNIZER_MEDIA_DEVICES_UNSUPPORTED="Media devices not supported by browser.",e.VIDEO_RECOGNIZER_FEED_RELEASED="The associated video feed has been released!",e.VIDEO_RECOGNIZER_FEED_NOT_PAUSED="The associated video feed is not paused. Use resumeRecognition instead!",e.VIDEO_RECOGNIZER_PLAY_REQUEST_INTERRUPTED="The play() request was interrupted or prevented by browser security rules!",e.VIDEO_RECOGNIZER_FEED_PAUSED="Cannot resume recognition while video feed is paused! Use recognize or startRecognition",e.VIDEO_RECOGNIZER_RECOGNIZERS_RESET_FAILURE="Could not reset recognizers!",e.VIDEO_RECOGNIZER_FEED_MISSING="Missing video feed!",e.INVALID_PING_PROXY_URL="Provided ping proxy URL is not a valid secure URL in format 'https://{host}:{port?}'.",e.PING_PROXY_PERMISSION_NOT_GRANTED="Allow ping proxy permission not found in license.",e.PING_DATA_KEYS_AMOUNT_EXCEEDED="Maximum number of ping data keys exceeded.",e.PING_DATA_KEY_LENGTH_EXCEEDED="Ping data key is too long.",e.PING_DATA_VALUE_LENGTH_EXCEEDED="Ping data value is too long.";})(h||(h={}));var y={wasmSettingsMissing:{message:h.SDK_WASM_SETTINGS_MISSING,code:A.SDK_WASM_SETTINGS_MISSING},licenseKeyMissing:{message:h.SDK_LICENSE_KEY_MISSING,code:A.SDK_LICENSE_KEY_MISSING},wasmModuleNameMissing:{message:h.SDK_WASM_MODULE_NAME_MISSING,code:A.SDK_WASM_MODULE_NAME_MISSING},engineLocationInvalid:{message:h.SDK_ENGINE_LOCATION_INVALID,code:A.SDK_ENGINE_LOCATION_INVALID},workerLocationInvalid:{message:h.SDK_WORKER_LOCATION_INVALID,code:A.SDK_WORKER_LOCATION_INVALID},missing:{message:h.SDK_MISSING,code:A.SDK_MISSING},recognizersMissing:{message:h.SDK_RECOGNIZERS_MISSING,code:A.SDK_RECOGNIZERS_MISSING}},Ra={invalidProxyUrl:{message:h.INVALID_PING_PROXY_URL,code:A.INVALID_PING_PROXY_URL},permissionNotGranted:{message:h.PING_PROXY_PERMISSION_NOT_GRANTED,code:A.PING_PROXY_PERMISSION_NOT_GRANTED},dataKeysAmountExceeded:{message:h.PING_DATA_KEYS_AMOUNT_EXCEEDED,code:A.PING_DATA_KEYS_AMOUNT_EXCEEDED},dataKeyLengthExceeded:{message:h.PING_DATA_KEY_LENGTH_EXCEEDED,code:A.PING_DATA_KEY_LENGTH_EXCEEDED},dataValueLengthExceeded:{message:h.PING_DATA_VALUE_LENGTH_EXCEEDED,code:A.PING_DATA_VALUE_LENGTH_EXCEEDED}};function L(e,t){return a=>{let r=a;r.success?e():typeof r.error=="string"||r.error===null?t(r.error):t(new R(r.error));}}function G(e,t){return a=>{let r=a;r.success?e(a):typeof r.error=="string"||r.error===null?t(r.error):t(new R(r.error));}}function Ea(e){let t=[];for(let a of e){let r=te.Any;a instanceof qe&&(r=te.Recognizer,a=a.getRemoteObjectHandle()),t.push({parameter:a,type:r});}return t}var qe=class{constructor(t,a,r){this.wasmSDKWorker=t,this.objectHandle=r,this.recognizerName=a,this.callbacks=new Map;}getRemoteObjectHandle(){return this.objectHandle}currentSettings(){return new Promise((t,a)=>{if(this.objectHandle<0){a("Invalid object handle: "+this.objectHandle.toString());return}let r=new q(this.objectHandle,"currentSettings",[]),s=G(o=>{t(o.result);},a);this.wasmSDKWorker.postMessage(r,s);})}toSignedJSON(){return new Promise((t,a)=>{if(this.objectHandle<0){a("Invalid object handle: "+this.objectHandle.toString());return}let r=new q(this.objectHandle,"toSignedJSON",[]),s=G(o=>{t(o.result);},a);this.wasmSDKWorker.postMessage(r,s);})}clearAllCallbacks(){this.callbacks.clear(),this.wasmSDKWorker.unregisterRecognizerCallbacks(this.objectHandle);}removeFunctions(t){this.clearAllCallbacks();let a=Object.keys(t),r=!1;for(let s of a){let o=t[s];if(typeof o=="function"){this.callbacks.set(s,o);let c={parameter:{recognizerHandle:this.objectHandle,callbackName:s},type:te.Callback};t[s]=c,r=!0;}}return r&&this.wasmSDKWorker.registerRecognizerCallbacks(this.objectHandle,this),t}updateSettings(t){return new Promise((a,r)=>{if(this.objectHandle<0){r("Invalid object handle: "+this.objectHandle.toString());return}let s=new q(this.objectHandle,"updateSettings",[{parameter:this.removeFunctions(t),type:te.RecognizerSettings}]),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}invokeCallback(t,a){let r=this.callbacks.get(t);r!==void 0?r(...a):console.warn("Cannot find callback",t);}getResult(){return new Promise((t,a)=>{if(this.objectHandle<0){a("Invalid object handle: "+this.objectHandle.toString());return}let r=new q(this.objectHandle,"getResult",[]),s=G(o=>{t(o.result);},a);this.wasmSDKWorker.postMessage(r,s);})}delete(){return new Promise((t,a)=>{if(this.objectHandle<0){a("Invalid object handle: "+this.objectHandle.toString());return}this.clearAllCallbacks();let r=new q(this.objectHandle,"delete",[]),s=L(()=>{this.objectHandle=-1,t();},a);this.wasmSDKWorker.postMessage(r,s);})}};function Gt(e){let t=new at;return t.onDebugText=!!e.onDebugText,t.onDetectionFailed=!!e.onDetectionFailed,t.onPointsDetection=!!e.onPointsDetection,t.onQuadDetection=!!e.onQuadDetection,t.onFirstSideResult=!!e.onFirstSideResult,t}var rt=class{constructor(t,a){this.deleted=!1,this.wasmSDKWorker=t,this.recognizers=a;}processImage(t){return new Promise((a,r)=>{if(this.deleted){r("Recognizer runner is deleted. It cannot be used anymore!");return}let s=new be(t),o=G(c=>{let u=c.recognitionState;a(u);},r);this.wasmSDKWorker.postTransferrableMessage(s,o);})}reconfigureRecognizers(t,a){return new Promise((r,s)=>{if(this.deleted){s("Recognizer runner is deleted. It cannot be used anymore!");return}let o=Wt(t),c=new De(o,a),u=L(r,s);this.wasmSDKWorker.postMessage(c,u),this.recognizers=t;})}setMetadataCallbacks(t){return new Promise((a,r)=>{let s=new Te(Gt(t)),o=L(a,r);this.wasmSDKWorker.postMessageAndRegisterCallbacks(s,t,o);})}resetRecognizers(t){return new Promise((a,r)=>{let s=new _e(t),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}setDetectionOnlyMode(t){return new Promise((a,r)=>{let s=new Le(t),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}setPingProxyUrl(t){if(!fa(t))throw new R(Ra.invalidProxyUrl);return new Promise((a,r)=>{let s=new we(t),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}setPingData(t){return new Promise((a,r)=>{let s=new Pe(t),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}setCameraPreviewMirrored(t){return new Promise((a,r)=>{let s=new ve(t),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}delete(){return this.deleted?Promise.reject("Recognizer runner is already deleted."):new Promise((t,a)=>{let r=new Oe,s=L(()=>{this.deleted=!0,t();},a);this.wasmSDKWorker.postMessage(r,s);})}};function Wt(e){let t=[];for(let a of e)t.push(a.getRemoteObjectHandle());return t}var it=class{constructor(t){this.wasmSDKWorker=t;}createRecognizerRunner(t,a=!1,r={}){return new Promise((s,o)=>{let c=Wt(t),u=new Ee(c,a,Gt(r)),m=L(()=>{s(new rt(this.wasmSDKWorker,t));},o);this.wasmSDKWorker.postMessageAndRegisterCallbacks(u,r,m);})}newRecognizer(t,...a){return new Promise((r,s)=>{let o=new Re(t,Ea(a)),c=G(u=>{let m=new qe(this.wasmSDKWorker,t,u.objectHandle);r(m);},s);this.wasmSDKWorker.postMessage(o,c);})}},st=class e{constructor(t,a,r,s){this.eventHandlers={},this.metadataCallbacks={},this.loadedWasmType=U.Basic,this.mbWasmWorker=t,this.mbWasmWorker.onmessage=o=>{this.handleWorkerEvent(o);},this.mbWasmWorker.onerror=()=>{s("Problem during initialization of worker file!");},this.mbWasmModule=new it(this),this.loadCallback=a,this.recognizersWithCallbacks=new Map,this.userId=r,this.showOverlay=!1;}postMessage(t,a){this.eventHandlers[t.messageID]=a,this.mbWasmWorker.postMessage(t);}postTransferrableMessage(t,a){this.eventHandlers[t.messageID]=a,this.mbWasmWorker.postMessage(t,t.getTransferrables());}postMessageAndRegisterCallbacks(t,a,r){this.eventHandlers[t.messageID]=r,this.metadataCallbacks=a,this.mbWasmWorker.postMessage(t);}registerRecognizerCallbacks(t,a){this.recognizersWithCallbacks.set(t,a);}unregisterRecognizerCallbacks(t){this.recognizersWithCallbacks.delete(t);}delete(){this.mbWasmWorker.terminate();}getProductIntegrationInfo(){return new Promise((t,a)=>{let r=new Me(this.userId),s=G(o=>{t(o.result);},a);this.postMessage(r,s);})}handleWorkerEvent(t){if("isCallbackMessage"in t.data){let a=t.data;switch(a.callbackType){case v.onDebugText:typeof this.metadataCallbacks.onDebugText=="function"&&this.metadataCallbacks.onDebugText(a.callbackParameters[0]);break;case v.onDetectionFailed:typeof this.metadataCallbacks.onDetectionFailed=="function"&&this.metadataCallbacks.onDetectionFailed();break;case v.onPointsDetection:typeof this.metadataCallbacks.onPointsDetection=="function"&&this.metadataCallbacks.onPointsDetection(a.callbackParameters[0]);break;case v.onQuadDetection:typeof this.metadataCallbacks.onQuadDetection=="function"&&this.metadataCallbacks.onQuadDetection(a.callbackParameters[0]);break;case v.onFirstSideResult:typeof this.metadataCallbacks.onFirstSideResult=="function"&&this.metadataCallbacks.onFirstSideResult();break;case v.recognizerCallback:{let r=a.callbackParameters.shift(),s=this.recognizersWithCallbacks.get(r.recognizerHandle);s!==void 0?s.invokeCallback(r.callbackName,a.callbackParameters):console.warn("Cannot find recognizer to deliver callback message. Maybe it's destroyed?",r);break}default:throw new Error(`Unknown callback type: ${v[a.callbackType]}`)}}else if("isLoadProgressMessage"in t.data){let a=t.data;typeof this.loadCallback=="function"&&this.loadCallback(a.progress);}else {let a=t.data,r=this.eventHandlers[a.messageID];delete this.eventHandlers[a.messageID],r(a);}}static async createWasmWorker(t,a,r){return new Promise((s,o)=>{let c=new e(t,a.loadProgressCallback,r,o),u=new fe(a,r),m=G(S=>{let g=S;c.showOverlay=g.showOverlay,c.loadedWasmType=g.wasmType,s(c);},S=>{c&&typeof c.delete=="function"&&c.delete(),o(S);});c.postMessage(u,m);})}},Rt;(function(e){e[e.BackFacingCamera=0]="BackFacingCamera",e[e.FrontFacingCamera=1]="FrontFacingCamera";})(Rt||(Rt={}));var ye;(function(e){e[e.RotatedLeft90=0]="RotatedLeft90",e[e.NoRotation=1]="NoRotation",e[e.RotatedRight90=2]="RotatedRight90",e[e.Rotated180=3]="Rotated180";})(ye||(ye={}));var b;(function(e){e[e.Empty=0]="Empty",e[e.Uncertain=1]="Uncertain",e[e.Valid=2]="Valid",e[e.StageValid=3]="StageValid";})(b||(b={}));var Et;(function(e){e[e.Front=0]="Front",e[e.Back=1]="Back";})(Et||(Et={}));var Ue=class{constructor(t,a,r){let s={data:t.data,width:t.width,height:t.height,colorSpace:t.colorSpace};this.imageData=s,this.orientation=a,this.videoFrame=r;}};var Dt;(function(e){e[e.Invalid=0]="Invalid",e[e.RequiresServerPermission=1]="RequiresServerPermission",e[e.Valid=2]="Valid";})(Dt||(Dt={}));var Ot;(function(e){e.LicenseTokenStateInvalid="LICENSE_TOKEN_STATE_INVALID",e.NetworkError="NETWORK_ERROR",e.RemoteLock="REMOTE_LOCK",e.PermissionExpired="PERMISSION_EXPIRED",e.PayloadCorrupted="PAYLOAD_CORRUPTED",e.PayloadSignatureVerificationFailed="PAYLOAD_SIGNATURE_VERIFICATION_FAILED",e.IncorrectTokenState="INCORRECT_TOKEN_STATE";})(Ot||(Ot={}));var bt;(function(e){e[e.Ok=0]="Ok",e[e.NetworkError=1]="NetworkError",e[e.RemoteLock=2]="RemoteLock",e[e.PermissionExpired=3]="PermissionExpired",e[e.PayloadCorrupted=4]="PayloadCorrupted",e[e.PayloadSignatureVerificationFailed=5]="PayloadSignatureVerificationFailed",e[e.IncorrectTokenState=6]="IncorrectTokenState";})(bt||(bt={}));var M;(function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success",e[e.CameraTooFar=2]="CameraTooFar",e[e.CameraTooClose=3]="CameraTooClose",e[e.CameraAngleTooSteep=4]="CameraAngleTooSteep",e[e.DocumentTooCloseToCameraEdge=5]="DocumentTooCloseToCameraEdge",e[e.DocumentPartiallyVisible=6]="DocumentPartiallyVisible",e[e.FallbackSuccess=7]="FallbackSuccess";})(M||(M={}));var nt=class extends Error{constructor(){super("Throttled function aborted"),this.name="AbortError";}};function Da({limit:e,interval:t,strict:a}){if(!Number.isFinite(e))throw new TypeError("Expected `limit` to be a finite number");if(!Number.isFinite(t))throw new TypeError("Expected `interval` to be a finite number");let r=new Map,s=0,o=0;function c(){let g=Date.now();return g-s>t?(o=1,s=g,0):(o<e?o++:(s+=t,o=1),s-g)}let u=[];function m(){let g=Date.now();if(u.length<e)return u.push(g),0;let N=u.shift()+t;return g>=N?(u.push(g),0):(u.push(N),N-g)}let S=a?m:c;return g=>{let N=function(...w){if(!N.isEnabled)return (async()=>g.apply(this,w))();let H;return new Promise((ue,ce)=>{H=setTimeout(()=>{ue(g.apply(this,w)),r.delete(H);},S()),r.set(H,ce);})};return N.abort=()=>{for(let w of r.keys())clearTimeout(w),r.get(w)(new nt);r.clear(),u.splice(0,u.length);},N.isEnabled=!0,Object.defineProperty(N,"queueSize",{get(){return r.size}}),N}}var Oa=15;Da({limit:1,interval:Math.round(1/Oa*1e3),strict:!0});var _t;(function(e){e[e.Recognition=0]="Recognition",e[e.RecognitionTest=1]="RecognitionTest",e[e.DetectionTest=2]="DetectionTest";})(_t||(_t={}));var ke=class{constructor(t){if(this.allowHelloMessage=!0,this.engineLocation="",this.workerLocation="",this.wasmType=null,this.numberOfWorkers=null,this.loadProgressCallback=null,this.wasmModuleName=ga,!t)throw new R(y.licenseKeyMissing);this.licenseKey=t;}};function Tt(){return ("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function ba(){try{let e=localStorage.getItem("mb-user-id");return e===null&&(e=Tt(),localStorage.setItem("mb-user-id",e)),e}catch(e){return Tt()}}async function Bt(e){return new Promise((t,a)=>{if(!e||typeof e!="object"){a(new R(y.wasmSettingsMissing));return}if(typeof e.licenseKey!="string"){a(new R(y.licenseKeyMissing));return}if(!e.wasmModuleName){a(new R(y.wasmModuleNameMissing));return}if(typeof e.engineLocation!="string"){a(new R(y.engineLocationInvalid));return}if(typeof e.workerLocation!="string"){a(new R(y.workerLocationInvalid));return}let r=ba();try{let s=`/resources/${e.wasmModuleName}.worker.min.js`,o=window.location.origin+s,c=e.workerLocation||o;e.allowHelloMessage&&console.log("Worker location is:",c);let u=new Worker(c);st.createWasmWorker(u,e,r).then(m=>{t(m);},a);}catch(s){a(s);}})}async function Vt(e,t,a=!1,r={}){if(typeof e!="object")throw new R(y.missing);if(typeof t!="object"||t.length<1)throw new R(y.recognizersMissing);return e.mbWasmModule.createRecognizerRunner(t,a,r)}var Lt;(function(e){e[e.NONE=0]="NONE",e[e.QR_CODE=1]="QR_CODE",e[e.DATA_MATRIX=2]="DATA_MATRIX",e[e.UPC_E=3]="UPC_E",e[e.UPC_A=4]="UPC_A",e[e.EAN_8=5]="EAN_8",e[e.EAN_13=6]="EAN_13",e[e.CODE_128=7]="CODE_128",e[e.CODE_39=8]="CODE_39",e[e.ITF=9]="ITF",e[e.AZTEC_BARCODE=10]="AZTEC_BARCODE",e[e.PDF417_BARCODE=11]="PDF417_BARCODE";})(Lt||(Lt={}));var W;(function(e){e[e.None=0]="None",e[e.ImageOnly=1]="ImageOnly",e[e.ResultFieldsOnly=2]="ResultFieldsOnly",e[e.FullResult=3]="FullResult";})(W||(W={}));var Fe=class{constructor(){this.enableMrzId=!0,this.enableMrzPassport=!0,this.enableMrzVisa=!0,this.enablePhotoId=!0,this.enableBarcodeId=!0,this.enableFullDocumentRecognition=!0;}},vt;(function(e){e[e.Strict=0]="Strict",e[e.Normal=1]="Normal",e[e.Relaxed=2]="Relaxed";})(vt||(vt={}));var Mt;(function(e){e[e.Latin=0]="Latin",e[e.Arabic=1]="Arabic",e[e.Cyrillic=2]="Cyrillic",e[e.Greek=3]="Greek",e[e.Count=4]="Count";})(Mt||(Mt={}));var wt;(function(e){e[e.DocumentType=0]="DocumentType",e[e.StandardVersionNumber=1]="StandardVersionNumber",e[e.CustomerFamilyName=2]="CustomerFamilyName",e[e.CustomerFirstName=3]="CustomerFirstName",e[e.CustomerFullName=4]="CustomerFullName",e[e.DateOfBirth=5]="DateOfBirth",e[e.Sex=6]="Sex",e[e.EyeColor=7]="EyeColor",e[e.AddressStreet=8]="AddressStreet",e[e.AddressCity=9]="AddressCity",e[e.AddressJurisdictionCode=10]="AddressJurisdictionCode",e[e.AddressPostalCode=11]="AddressPostalCode",e[e.FullAddress=12]="FullAddress",e[e.Height=13]="Height",e[e.HeightIn=14]="HeightIn",e[e.HeightCm=15]="HeightCm",e[e.CustomerMiddleName=16]="CustomerMiddleName",e[e.HairColor=17]="HairColor",e[e.NameSuffix=18]="NameSuffix",e[e.AKAFullName=19]="AKAFullName",e[e.AKAFamilyName=20]="AKAFamilyName",e[e.AKAGivenName=21]="AKAGivenName",e[e.AKASuffixName=22]="AKASuffixName",e[e.WeightRange=23]="WeightRange",e[e.WeightPounds=24]="WeightPounds",e[e.WeightKilograms=25]="WeightKilograms",e[e.CustomerIdNumber=26]="CustomerIdNumber",e[e.FamilyNameTruncation=27]="FamilyNameTruncation",e[e.FirstNameTruncation=28]="FirstNameTruncation",e[e.MiddleNameTruncation=29]="MiddleNameTruncation",e[e.PlaceOfBirth=30]="PlaceOfBirth",e[e.AddressStreet2=31]="AddressStreet2",e[e.RaceEthnicity=32]="RaceEthnicity",e[e.NamePrefix=33]="NamePrefix",e[e.CountryIdentification=34]="CountryIdentification",e[e.ResidenceStreetAddress=35]="ResidenceStreetAddress",e[e.ResidenceStreetAddress2=36]="ResidenceStreetAddress2",e[e.ResidenceCity=37]="ResidenceCity",e[e.ResidenceJurisdictionCode=38]="ResidenceJurisdictionCode",e[e.ResidencePostalCode=39]="ResidencePostalCode",e[e.ResidenceFullAddress=40]="ResidenceFullAddress",e[e.Under18=41]="Under18",e[e.Under19=42]="Under19",e[e.Under21=43]="Under21",e[e.SocialSecurityNumber=44]="SocialSecurityNumber",e[e.AKASocialSecurityNumber=45]="AKASocialSecurityNumber",e[e.AKAMiddleName=46]="AKAMiddleName",e[e.AKAPrefixName=47]="AKAPrefixName",e[e.OrganDonor=48]="OrganDonor",e[e.Veteran=49]="Veteran",e[e.AKADateOfBirth=50]="AKADateOfBirth",e[e.IssuerIdentificationNumber=51]="IssuerIdentificationNumber",e[e.DocumentExpirationDate=52]="DocumentExpirationDate",e[e.JurisdictionVersionNumber=53]="JurisdictionVersionNumber",e[e.JurisdictionVehicleClass=54]="JurisdictionVehicleClass",e[e.JurisdictionRestrictionCodes=55]="JurisdictionRestrictionCodes",e[e.JurisdictionEndorsementCodes=56]="JurisdictionEndorsementCodes",e[e.DocumentIssueDate=57]="DocumentIssueDate",e[e.FederalCommercialVehicleCodes=58]="FederalCommercialVehicleCodes",e[e.IssuingJurisdiction=59]="IssuingJurisdiction",e[e.StandardVehicleClassification=60]="StandardVehicleClassification",e[e.IssuingJurisdictionName=61]="IssuingJurisdictionName",e[e.StandardEndorsementCode=62]="StandardEndorsementCode",e[e.StandardRestrictionCode=63]="StandardRestrictionCode",e[e.JurisdictionVehicleClassificationDescription=64]="JurisdictionVehicleClassificationDescription",e[e.JurisdictionEndorsmentCodeDescription=65]="JurisdictionEndorsmentCodeDescription",e[e.JurisdictionRestrictionCodeDescription=66]="JurisdictionRestrictionCodeDescription",e[e.InventoryControlNumber=67]="InventoryControlNumber",e[e.CardRevisionDate=68]="CardRevisionDate",e[e.DocumentDiscriminator=69]="DocumentDiscriminator",e[e.LimitedDurationDocument=70]="LimitedDurationDocument",e[e.AuditInformation=71]="AuditInformation",e[e.ComplianceType=72]="ComplianceType",e[e.IssueTimestamp=73]="IssueTimestamp",e[e.PermitExpirationDate=74]="PermitExpirationDate",e[e.PermitIdentifier=75]="PermitIdentifier",e[e.PermitIssueDate=76]="PermitIssueDate",e[e.NumberOfDuplicates=77]="NumberOfDuplicates",e[e.HAZMATExpirationDate=78]="HAZMATExpirationDate",e[e.MedicalIndicator=79]="MedicalIndicator",e[e.NonResident=80]="NonResident",e[e.UniqueCustomerId=81]="UniqueCustomerId",e[e.DataDiscriminator=82]="DataDiscriminator",e[e.DocumentExpirationMonth=83]="DocumentExpirationMonth",e[e.DocumentNonexpiring=84]="DocumentNonexpiring",e[e.SecurityVersion=85]="SecurityVersion",e[e.Count=86]="Count";})(wt||(wt={}));var C;(function(e){e[e.NONE=0]="NONE",e[e.ALBANIA=1]="ALBANIA",e[e.ALGERIA=2]="ALGERIA",e[e.ARGENTINA=3]="ARGENTINA",e[e.AUSTRALIA=4]="AUSTRALIA",e[e.AUSTRIA=5]="AUSTRIA",e[e.AZERBAIJAN=6]="AZERBAIJAN",e[e.BAHRAIN=7]="BAHRAIN",e[e.BANGLADESH=8]="BANGLADESH",e[e.BELGIUM=9]="BELGIUM",e[e.BOSNIA_AND_HERZEGOVINA=10]="BOSNIA_AND_HERZEGOVINA",e[e.BRUNEI=11]="BRUNEI",e[e.BULGARIA=12]="BULGARIA",e[e.CAMBODIA=13]="CAMBODIA",e[e.CANADA=14]="CANADA",e[e.CHILE=15]="CHILE",e[e.COLOMBIA=16]="COLOMBIA",e[e.COSTA_RICA=17]="COSTA_RICA",e[e.CROATIA=18]="CROATIA",e[e.CYPRUS=19]="CYPRUS",e[e.CZECHIA=20]="CZECHIA",e[e.DENMARK=21]="DENMARK",e[e.DOMINICAN_REPUBLIC=22]="DOMINICAN_REPUBLIC",e[e.EGYPT=23]="EGYPT",e[e.ESTONIA=24]="ESTONIA",e[e.FINLAND=25]="FINLAND",e[e.FRANCE=26]="FRANCE",e[e.GEORGIA=27]="GEORGIA",e[e.GERMANY=28]="GERMANY",e[e.GHANA=29]="GHANA",e[e.GREECE=30]="GREECE",e[e.GUATEMALA=31]="GUATEMALA",e[e.HONG_KONG=32]="HONG_KONG",e[e.HUNGARY=33]="HUNGARY",e[e.INDIA=34]="INDIA",e[e.INDONESIA=35]="INDONESIA",e[e.IRELAND=36]="IRELAND",e[e.ISRAEL=37]="ISRAEL",e[e.ITALY=38]="ITALY",e[e.JORDAN=39]="JORDAN",e[e.KAZAKHSTAN=40]="KAZAKHSTAN",e[e.KENYA=41]="KENYA",e[e.KOSOVO=42]="KOSOVO",e[e.KUWAIT=43]="KUWAIT",e[e.LATVIA=44]="LATVIA",e[e.LITHUANIA=45]="LITHUANIA",e[e.MALAYSIA=46]="MALAYSIA",e[e.MALDIVES=47]="MALDIVES",e[e.MALTA=48]="MALTA",e[e.MAURITIUS=49]="MAURITIUS",e[e.MEXICO=50]="MEXICO",e[e.MOROCCO=51]="MOROCCO",e[e.NETHERLANDS=52]="NETHERLANDS",e[e.NEW_ZEALAND=53]="NEW_ZEALAND",e[e.NIGERIA=54]="NIGERIA",e[e.PAKISTAN=55]="PAKISTAN",e[e.PANAMA=56]="PANAMA",e[e.PARAGUAY=57]="PARAGUAY",e[e.PHILIPPINES=58]="PHILIPPINES",e[e.POLAND=59]="POLAND",e[e.PORTUGAL=60]="PORTUGAL",e[e.PUERTO_RICO=61]="PUERTO_RICO",e[e.QATAR=62]="QATAR",e[e.ROMANIA=63]="ROMANIA",e[e.RUSSIA=64]="RUSSIA",e[e.SAUDI_ARABIA=65]="SAUDI_ARABIA",e[e.SERBIA=66]="SERBIA",e[e.SINGAPORE=67]="SINGAPORE",e[e.SLOVAKIA=68]="SLOVAKIA",e[e.SLOVENIA=69]="SLOVENIA",e[e.SOUTH_AFRICA=70]="SOUTH_AFRICA",e[e.SPAIN=71]="SPAIN",e[e.SWEDEN=72]="SWEDEN",e[e.SWITZERLAND=73]="SWITZERLAND",e[e.TAIWAN=74]="TAIWAN",e[e.THAILAND=75]="THAILAND",e[e.TUNISIA=76]="TUNISIA",e[e.TURKEY=77]="TURKEY",e[e.UAE=78]="UAE",e[e.UGANDA=79]="UGANDA",e[e.UK=80]="UK",e[e.UKRAINE=81]="UKRAINE",e[e.USA=82]="USA",e[e.VIETNAM=83]="VIETNAM",e[e.BRAZIL=84]="BRAZIL",e[e.NORWAY=85]="NORWAY",e[e.OMAN=86]="OMAN",e[e.ECUADOR=87]="ECUADOR",e[e.EL_SALVADOR=88]="EL_SALVADOR",e[e.SRI_LANKA=89]="SRI_LANKA",e[e.PERU=90]="PERU",e[e.URUGUAY=91]="URUGUAY",e[e.BAHAMAS=92]="BAHAMAS",e[e.BERMUDA=93]="BERMUDA",e[e.BOLIVIA=94]="BOLIVIA",e[e.CHINA=95]="CHINA",e[e.EUROPEAN_UNION=96]="EUROPEAN_UNION",e[e.HAITI=97]="HAITI",e[e.HONDURAS=98]="HONDURAS",e[e.ICELAND=99]="ICELAND",e[e.JAPAN=100]="JAPAN",e[e.LUXEMBOURG=101]="LUXEMBOURG",e[e.MONTENEGRO=102]="MONTENEGRO",e[e.NICARAGUA=103]="NICARAGUA",e[e.SOUTH_KOREA=104]="SOUTH_KOREA",e[e.VENEZUELA=105]="VENEZUELA",e[e.AFGHANISTAN=106]="AFGHANISTAN",e[e.ALAND_ISLANDS=107]="ALAND_ISLANDS",e[e.AMERICAN_SAMOA=108]="AMERICAN_SAMOA",e[e.ANDORRA=109]="ANDORRA",e[e.ANGOLA=110]="ANGOLA",e[e.ANGUILLA=111]="ANGUILLA",e[e.ANTARCTICA=112]="ANTARCTICA",e[e.ANTIGUA_AND_BARBUDA=113]="ANTIGUA_AND_BARBUDA",e[e.ARMENIA=114]="ARMENIA",e[e.ARUBA=115]="ARUBA",e[e.BAILIWICK_OF_GUERNSEY=116]="BAILIWICK_OF_GUERNSEY",e[e.BAILIWICK_OF_JERSEY=117]="BAILIWICK_OF_JERSEY",e[e.BARBADOS=118]="BARBADOS",e[e.BELARUS=119]="BELARUS",e[e.BELIZE=120]="BELIZE",e[e.BENIN=121]="BENIN",e[e.BHUTAN=122]="BHUTAN",e[e.BONAIRE_SAINT_EUSTATIUS_AND_SABA=123]="BONAIRE_SAINT_EUSTATIUS_AND_SABA",e[e.BOTSWANA=124]="BOTSWANA",e[e.BOUVET_ISLAND=125]="BOUVET_ISLAND",e[e.BRITISH_INDIAN_OCEAN_TERRITORY=126]="BRITISH_INDIAN_OCEAN_TERRITORY",e[e.BURKINA_FASO=127]="BURKINA_FASO",e[e.BURUNDI=128]="BURUNDI",e[e.CAMEROON=129]="CAMEROON",e[e.CAPE_VERDE=130]="CAPE_VERDE",e[e.CARIBBEAN_NETHERLANDS=131]="CARIBBEAN_NETHERLANDS",e[e.CAYMAN_ISLANDS=132]="CAYMAN_ISLANDS",e[e.CENTRAL_AFRICAN_REPUBLIC=133]="CENTRAL_AFRICAN_REPUBLIC",e[e.CHAD=134]="CHAD",e[e.CHRISTMAS_ISLAND=135]="CHRISTMAS_ISLAND",e[e.COCOS_ISLANDS=136]="COCOS_ISLANDS",e[e.COMOROS=137]="COMOROS",e[e.CONGO=138]="CONGO",e[e.COOK_ISLANDS=139]="COOK_ISLANDS",e[e.CUBA=140]="CUBA",e[e.CURACAO=141]="CURACAO",e[e.DEMOCRATIC_REPUBLIC_OF_THE_CONGO=142]="DEMOCRATIC_REPUBLIC_OF_THE_CONGO",e[e.DJIBOUTI=143]="DJIBOUTI",e[e.DOMINICA=144]="DOMINICA",e[e.EAST_TIMOR=145]="EAST_TIMOR",e[e.EQUATORIAL_GUINEA=146]="EQUATORIAL_GUINEA",e[e.ERITREA=147]="ERITREA",e[e.ETHIOPIA=148]="ETHIOPIA",e[e.FALKLAND_ISLANDS=149]="FALKLAND_ISLANDS",e[e.FAROE_ISLANDS=150]="FAROE_ISLANDS",e[e.FEDERATED_STATES_OF_MICRONESIA=151]="FEDERATED_STATES_OF_MICRONESIA",e[e.FIJI=152]="FIJI",e[e.FRENCH_GUIANA=153]="FRENCH_GUIANA",e[e.FRENCH_POLYNESIA=154]="FRENCH_POLYNESIA",e[e.FRENCH_SOUTHERN_TERRITORIES=155]="FRENCH_SOUTHERN_TERRITORIES",e[e.GABON=156]="GABON",e[e.GAMBIA=157]="GAMBIA",e[e.GIBRALTAR=158]="GIBRALTAR",e[e.GREENLAND=159]="GREENLAND",e[e.GRENADA=160]="GRENADA",e[e.GUADELOUPE=161]="GUADELOUPE",e[e.GUAM=162]="GUAM",e[e.GUINEA=163]="GUINEA",e[e.GUINEA_BISSAU=164]="GUINEA_BISSAU",e[e.GUYANA=165]="GUYANA",e[e.HEARD_ISLAND_AND_MCDONALD_ISLANDS=166]="HEARD_ISLAND_AND_MCDONALD_ISLANDS",e[e.IRAN=167]="IRAN",e[e.IRAQ=168]="IRAQ",e[e.ISLE_OF_MAN=169]="ISLE_OF_MAN",e[e.IVORY_COAST=170]="IVORY_COAST",e[e.JAMAICA=171]="JAMAICA",e[e.KIRIBATI=172]="KIRIBATI",e[e.KYRGYZSTAN=173]="KYRGYZSTAN",e[e.LAOS=174]="LAOS",e[e.LEBANON=175]="LEBANON",e[e.LESOTHO=176]="LESOTHO",e[e.LIBERIA=177]="LIBERIA",e[e.LIBYA=178]="LIBYA",e[e.LIECHTENSTEIN=179]="LIECHTENSTEIN",e[e.MACAU=180]="MACAU",e[e.MADAGASCAR=181]="MADAGASCAR",e[e.MALAWI=182]="MALAWI",e[e.MALI=183]="MALI",e[e.MARSHALL_ISLANDS=184]="MARSHALL_ISLANDS",e[e.MARTINIQUE=185]="MARTINIQUE",e[e.MAURITANIA=186]="MAURITANIA",e[e.MAYOTTE=187]="MAYOTTE",e[e.MOLDOVA=188]="MOLDOVA",e[e.MONACO=189]="MONACO",e[e.MONGOLIA=190]="MONGOLIA",e[e.MONTSERRAT=191]="MONTSERRAT",e[e.MOZAMBIQUE=192]="MOZAMBIQUE",e[e.MYANMAR=193]="MYANMAR",e[e.NAMIBIA=194]="NAMIBIA",e[e.NAURU=195]="NAURU",e[e.NEPAL=196]="NEPAL",e[e.NEW_CALEDONIA=197]="NEW_CALEDONIA",e[e.NIGER=198]="NIGER",e[e.NIUE=199]="NIUE",e[e.NORFOLK_ISLAND=200]="NORFOLK_ISLAND",e[e.NORTHERN_CYPRUS=201]="NORTHERN_CYPRUS",e[e.NORTHERN_MARIANA_ISLANDS=202]="NORTHERN_MARIANA_ISLANDS",e[e.NORTH_KOREA=203]="NORTH_KOREA",e[e.NORTH_MACEDONIA=204]="NORTH_MACEDONIA",e[e.PALAU=205]="PALAU",e[e.PALESTINE=206]="PALESTINE",e[e.PAPUA_NEW_GUINEA=207]="PAPUA_NEW_GUINEA",e[e.PITCAIRN=208]="PITCAIRN",e[e.REUNION=209]="REUNION",e[e.RWANDA=210]="RWANDA",e[e.SAINT_BARTHELEMY=211]="SAINT_BARTHELEMY",e[e.SAINT_HELENA_ASCENSION_AND_TRISTIAN_DA_CUNHA=212]="SAINT_HELENA_ASCENSION_AND_TRISTIAN_DA_CUNHA",e[e.SAINT_KITTS_AND_NEVIS=213]="SAINT_KITTS_AND_NEVIS",e[e.SAINT_LUCIA=214]="SAINT_LUCIA",e[e.SAINT_MARTIN=215]="SAINT_MARTIN",e[e.SAINT_PIERRE_AND_MIQUELON=216]="SAINT_PIERRE_AND_MIQUELON",e[e.SAINT_VINCENT_AND_THE_GRENADINES=217]="SAINT_VINCENT_AND_THE_GRENADINES",e[e.SAMOA=218]="SAMOA",e[e.SAN_MARINO=219]="SAN_MARINO",e[e.SAO_TOME_AND_PRINCIPE=220]="SAO_TOME_AND_PRINCIPE",e[e.SENEGAL=221]="SENEGAL",e[e.SEYCHELLES=222]="SEYCHELLES",e[e.SIERRA_LEONE=223]="SIERRA_LEONE",e[e.SINT_MAARTEN=224]="SINT_MAARTEN",e[e.SOLOMON_ISLANDS=225]="SOLOMON_ISLANDS",e[e.SOMALIA=226]="SOMALIA",e[e.SOUTH_GEORGIA_AND_THE_SOUTH_SANDWICH_ISLANDS=227]="SOUTH_GEORGIA_AND_THE_SOUTH_SANDWICH_ISLANDS",e[e.SOUTH_SUDAN=228]="SOUTH_SUDAN",e[e.SUDAN=229]="SUDAN",e[e.SURINAME=230]="SURINAME",e[e.SVALBARD_AND_JAN_MAYEN=231]="SVALBARD_AND_JAN_MAYEN",e[e.ESWATINI=232]="ESWATINI",e[e.SYRIA=233]="SYRIA",e[e.TAJIKISTAN=234]="TAJIKISTAN",e[e.TANZANIA=235]="TANZANIA",e[e.TOGO=236]="TOGO",e[e.TOKELAU=237]="TOKELAU",e[e.TONGA=238]="TONGA",e[e.TRINIDAD_AND_TOBAGO=239]="TRINIDAD_AND_TOBAGO",e[e.TURKMENISTAN=240]="TURKMENISTAN",e[e.TURKS_AND_CAICOS_ISLANDS=241]="TURKS_AND_CAICOS_ISLANDS",e[e.TUVALU=242]="TUVALU",e[e.UNITED_STATES_MINOR_OUTLYING_ISLANDS=243]="UNITED_STATES_MINOR_OUTLYING_ISLANDS",e[e.UZBEKISTAN=244]="UZBEKISTAN",e[e.VANUATU=245]="VANUATU",e[e.VATICAN_CITY=246]="VATICAN_CITY",e[e.VIRGIN_ISLANDS_BRITISH=247]="VIRGIN_ISLANDS_BRITISH",e[e.VIRGIN_ISLANDS_US=248]="VIRGIN_ISLANDS_US",e[e.WALLIS_AND_FUTUNA=249]="WALLIS_AND_FUTUNA",e[e.WESTERN_SAHARA=250]="WESTERN_SAHARA",e[e.YEMEN=251]="YEMEN",e[e.YUGOSLAVIA=252]="YUGOSLAVIA",e[e.ZAMBIA=253]="ZAMBIA",e[e.ZIMBABWE=254]="ZIMBABWE",e[e.SCHENGEN_AREA=255]="SCHENGEN_AREA",e[e.COUNT=256]="COUNT";})(C||(C={}));var n;(function(e){e[e.NONE=0]="NONE",e[e.ALABAMA=1]="ALABAMA",e[e.ALASKA=2]="ALASKA",e[e.ALBERTA=3]="ALBERTA",e[e.ARIZONA=4]="ARIZONA",e[e.ARKANSAS=5]="ARKANSAS",e[e.AUSTRALIAN_CAPITAL_TERRITORY=6]="AUSTRALIAN_CAPITAL_TERRITORY",e[e.BRITISH_COLUMBIA=7]="BRITISH_COLUMBIA",e[e.CALIFORNIA=8]="CALIFORNIA",e[e.COLORADO=9]="COLORADO",e[e.CONNECTICUT=10]="CONNECTICUT",e[e.DELAWARE=11]="DELAWARE",e[e.DISTRICT_OF_COLUMBIA=12]="DISTRICT_OF_COLUMBIA",e[e.FLORIDA=13]="FLORIDA",e[e.GEORGIA=14]="GEORGIA",e[e.HAWAII=15]="HAWAII",e[e.IDAHO=16]="IDAHO",e[e.ILLINOIS=17]="ILLINOIS",e[e.INDIANA=18]="INDIANA",e[e.IOWA=19]="IOWA",e[e.KANSAS=20]="KANSAS",e[e.KENTUCKY=21]="KENTUCKY",e[e.LOUISIANA=22]="LOUISIANA",e[e.MAINE=23]="MAINE",e[e.MANITOBA=24]="MANITOBA",e[e.MARYLAND=25]="MARYLAND",e[e.MASSACHUSETTS=26]="MASSACHUSETTS",e[e.MICHIGAN=27]="MICHIGAN",e[e.MINNESOTA=28]="MINNESOTA",e[e.MISSISSIPPI=29]="MISSISSIPPI",e[e.MISSOURI=30]="MISSOURI",e[e.MONTANA=31]="MONTANA",e[e.NEBRASKA=32]="NEBRASKA",e[e.NEVADA=33]="NEVADA",e[e.NEW_BRUNSWICK=34]="NEW_BRUNSWICK",e[e.NEW_HAMPSHIRE=35]="NEW_HAMPSHIRE",e[e.NEW_JERSEY=36]="NEW_JERSEY",e[e.NEW_MEXICO=37]="NEW_MEXICO",e[e.NEW_SOUTH_WALES=38]="NEW_SOUTH_WALES",e[e.NEW_YORK=39]="NEW_YORK",e[e.NORTHERN_TERRITORY=40]="NORTHERN_TERRITORY",e[e.NORTH_CAROLINA=41]="NORTH_CAROLINA",e[e.NORTH_DAKOTA=42]="NORTH_DAKOTA",e[e.NOVA_SCOTIA=43]="NOVA_SCOTIA",e[e.OHIO=44]="OHIO",e[e.OKLAHOMA=45]="OKLAHOMA",e[e.ONTARIO=46]="ONTARIO",e[e.OREGON=47]="OREGON",e[e.PENNSYLVANIA=48]="PENNSYLVANIA",e[e.QUEBEC=49]="QUEBEC",e[e.QUEENSLAND=50]="QUEENSLAND",e[e.RHODE_ISLAND=51]="RHODE_ISLAND",e[e.SASKATCHEWAN=52]="SASKATCHEWAN",e[e.SOUTH_AUSTRALIA=53]="SOUTH_AUSTRALIA",e[e.SOUTH_CAROLINA=54]="SOUTH_CAROLINA",e[e.SOUTH_DAKOTA=55]="SOUTH_DAKOTA",e[e.TASMANIA=56]="TASMANIA",e[e.TENNESSEE=57]="TENNESSEE",e[e.TEXAS=58]="TEXAS",e[e.UTAH=59]="UTAH",e[e.VERMONT=60]="VERMONT",e[e.VICTORIA=61]="VICTORIA",e[e.VIRGINIA=62]="VIRGINIA",e[e.WASHINGTON=63]="WASHINGTON",e[e.WESTERN_AUSTRALIA=64]="WESTERN_AUSTRALIA",e[e.WEST_VIRGINIA=65]="WEST_VIRGINIA",e[e.WISCONSIN=66]="WISCONSIN",e[e.WYOMING=67]="WYOMING",e[e.YUKON=68]="YUKON",e[e.CIUDAD_DE_MEXICO=69]="CIUDAD_DE_MEXICO",e[e.JALISCO=70]="JALISCO",e[e.NEWFOUNDLAND_AND_LABRADOR=71]="NEWFOUNDLAND_AND_LABRADOR",e[e.NUEVO_LEON=72]="NUEVO_LEON",e[e.BAJA_CALIFORNIA=73]="BAJA_CALIFORNIA",e[e.CHIHUAHUA=74]="CHIHUAHUA",e[e.GUANAJUATO=75]="GUANAJUATO",e[e.GUERRERO=76]="GUERRERO",e[e.MEXICO=77]="MEXICO",e[e.MICHOACAN=78]="MICHOACAN",e[e.NEW_YORK_CITY=79]="NEW_YORK_CITY",e[e.TAMAULIPAS=80]="TAMAULIPAS",e[e.VERACRUZ=81]="VERACRUZ",e[e.CHIAPAS=82]="CHIAPAS",e[e.COAHUILA=83]="COAHUILA",e[e.DURANGO=84]="DURANGO",e[e.GUERRERO_COCULA=85]="GUERRERO_COCULA",e[e.GUERRERO_JUCHITAN=86]="GUERRERO_JUCHITAN",e[e.GUERRERO_TEPECOACUILCO=87]="GUERRERO_TEPECOACUILCO",e[e.GUERRERO_TLACOAPA=88]="GUERRERO_TLACOAPA",e[e.GUJARAT=89]="GUJARAT",e[e.HIDALGO=90]="HIDALGO",e[e.KARNATAKA=91]="KARNATAKA",e[e.KERALA=92]="KERALA",e[e.KHYBER_PAKHTUNKHWA=93]="KHYBER_PAKHTUNKHWA",e[e.MADHYA_PRADESH=94]="MADHYA_PRADESH",e[e.MAHARASHTRA=95]="MAHARASHTRA",e[e.MORELOS=96]="MORELOS",e[e.NAYARIT=97]="NAYARIT",e[e.OAXACA=98]="OAXACA",e[e.PUEBLA=99]="PUEBLA",e[e.PUNJAB=100]="PUNJAB",e[e.QUERETARO=101]="QUERETARO",e[e.SAN_LUIS_POTOSI=102]="SAN_LUIS_POTOSI",e[e.SINALOA=103]="SINALOA",e[e.SONORA=104]="SONORA",e[e.TABASCO=105]="TABASCO",e[e.TAMIL_NADU=106]="TAMIL_NADU",e[e.YUCATAN=107]="YUCATAN",e[e.ZACATECAS=108]="ZACATECAS",e[e.AGUASCALIENTES=109]="AGUASCALIENTES",e[e.BAJA_CALIFORNIA_SUR=110]="BAJA_CALIFORNIA_SUR",e[e.CAMPECHE=111]="CAMPECHE",e[e.COLIMA=112]="COLIMA",e[e.QUINTANA_ROO_BENITO_JUAREZ=113]="QUINTANA_ROO_BENITO_JUAREZ",e[e.UINTANA_ROO=114]="UINTANA_ROO",e[e.QUINTANA_ROO_SOLIDARIDAD=115]="QUINTANA_ROO_SOLIDARIDAD",e[e.TLAXCALA=116]="TLAXCALA",e[e.QUINTANA_ROO_COZUMEL=117]="QUINTANA_ROO_COZUMEL",e[e.SAO_PAOLO=118]="SAO_PAOLO",e[e.RIO_DE_JANEIRO=119]="RIO_DE_JANEIRO",e[e.RIO_GRANDE_DO_SUL=120]="RIO_GRANDE_DO_SUL",e[e.NORTHWEST_TERRITORIES=121]="NORTHWEST_TERRITORIES",e[e.NUNAVUT=122]="NUNAVUT",e[e.PRINCE_EDWARD_ISLAND=123]="PRINCE_EDWARD_ISLAND",e[e.DISTRITO_FEDERAL=124]="DISTRITO_FEDERAL",e[e.MARANHAO=125]="MARANHAO",e[e.MATO_GROSSO=126]="MATO_GROSSO",e[e.MINAS_GERAIS=127]="MINAS_GERAIS",e[e.PARA=128]="PARA",e[e.PARANA=129]="PARANA",e[e.PERNAMBUCO=130]="PERNAMBUCO",e[e.SANTA_CATARINA=131]="SANTA_CATARINA",e[e.ANDHRA_PRADESH=132]="ANDHRA_PRADESH",e[e.CEARA=133]="CEARA",e[e.GOIAS=134]="GOIAS",e[e.GUERRERO_ACAPULCO_DE_JUAREZ=135]="GUERRERO_ACAPULCO_DE_JUAREZ",e[e.HARYANA=136]="HARYANA",e[e.SERGIPE=137]="SERGIPE",e[e.ALAGOAS=138]="ALAGOAS",e[e.BANGSAMORO=139]="BANGSAMORO",e[e.COUNT=140]="COUNT";})(n||(n={}));var l;(function(e){e[e.NONE=0]="NONE",e[e.CONSULAR_ID=1]="CONSULAR_ID",e[e.DL=2]="DL",e[e.DL_PUBLIC_SERVICES_CARD=3]="DL_PUBLIC_SERVICES_CARD",e[e.EMPLOYMENT_PASS=4]="EMPLOYMENT_PASS",e[e.FIN_CARD=5]="FIN_CARD",e[e.ID=6]="ID",e[e.MULTIPURPOSE_ID=7]="MULTIPURPOSE_ID",e[e.MYKAD=8]="MYKAD",e[e.MYKID=9]="MYKID",e[e.MYPR=10]="MYPR",e[e.MYTENTERA=11]="MYTENTERA",e[e.PAN_CARD=12]="PAN_CARD",e[e.PROFESSIONAL_ID=13]="PROFESSIONAL_ID",e[e.PUBLIC_SERVICES_CARD=14]="PUBLIC_SERVICES_CARD",e[e.RESIDENCE_PERMIT=15]="RESIDENCE_PERMIT",e[e.RESIDENT_ID=16]="RESIDENT_ID",e[e.TEMPORARY_RESIDENCE_PERMIT=17]="TEMPORARY_RESIDENCE_PERMIT",e[e.VOTER_ID=18]="VOTER_ID",e[e.WORK_PERMIT=19]="WORK_PERMIT",e[e.IKAD=20]="IKAD",e[e.MILITARY_ID=21]="MILITARY_ID",e[e.MYKAS=22]="MYKAS",e[e.SOCIAL_SECURITY_CARD=23]="SOCIAL_SECURITY_CARD",e[e.HEALTH_INSURANCE_CARD=24]="HEALTH_INSURANCE_CARD",e[e.PASSPORT=25]="PASSPORT",e[e.S_PASS=26]="S_PASS",e[e.ADDRESS_CARD=27]="ADDRESS_CARD",e[e.ALIEN_ID=28]="ALIEN_ID",e[e.ALIEN_PASSPORT=29]="ALIEN_PASSPORT",e[e.GREEN_CARD=30]="GREEN_CARD",e[e.MINORS_ID=31]="MINORS_ID",e[e.POSTAL_ID=32]="POSTAL_ID",e[e.PROFESSIONAL_DL=33]="PROFESSIONAL_DL",e[e.TAX_ID=34]="TAX_ID",e[e.WEAPON_PERMIT=35]="WEAPON_PERMIT",e[e.VISA=36]="VISA",e[e.BORDER_CROSSING_CARD=37]="BORDER_CROSSING_CARD",e[e.DRIVER_CARD=38]="DRIVER_CARD",e[e.GLOBAL_ENTRY_CARD=39]="GLOBAL_ENTRY_CARD",e[e.MYPOLIS=40]="MYPOLIS",e[e.NEXUS_CARD=41]="NEXUS_CARD",e[e.PASSPORT_CARD=42]="PASSPORT_CARD",e[e.PROOF_OF_AGE_CARD=43]="PROOF_OF_AGE_CARD",e[e.REFUGEE_ID=44]="REFUGEE_ID",e[e.TRIBAL_ID=45]="TRIBAL_ID",e[e.VETERAN_ID=46]="VETERAN_ID",e[e.CITIZENSHIP_CERTIFICATE=47]="CITIZENSHIP_CERTIFICATE",e[e.MY_NUMBER_CARD=48]="MY_NUMBER_CARD",e[e.CONSULAR_PASSPORT=49]="CONSULAR_PASSPORT",e[e.MINORS_PASSPORT=50]="MINORS_PASSPORT",e[e.MINORS_PUBLIC_SERVICES_CARD=51]="MINORS_PUBLIC_SERVICES_CARD",e[e.DRIVING_PRIVILEGE_CARD=52]="DRIVING_PRIVILEGE_CARD",e[e.ASYLUM_REQUEST=53]="ASYLUM_REQUEST",e[e.DRIVER_QUALIFICATION_CARD=54]="DRIVER_QUALIFICATION_CARD",e[e.PROVISIONAL_DL=55]="PROVISIONAL_DL",e[e.REFUGEE_PASSPORT=56]="REFUGEE_PASSPORT",e[e.SPECIAL_ID=57]="SPECIAL_ID",e[e.UNIFORMED_SERVICES_ID=58]="UNIFORMED_SERVICES_ID",e[e.IMMIGRANT_VISA=59]="IMMIGRANT_VISA",e[e.CONSULAR_VOTER_ID=60]="CONSULAR_VOTER_ID",e[e.TWIC_CARD=61]="TWIC_CARD",e[e.EXIT_ENTRY_PERMIT=62]="EXIT_ENTRY_PERMIT",e[e.MAINLAND_TRAVEL_PERMIT_TAIWAN=63]="MAINLAND_TRAVEL_PERMIT_TAIWAN",e[e.NBI_CLEARANCE=64]="NBI_CLEARANCE",e[e.PROOF_OF_REGISTRATION=65]="PROOF_OF_REGISTRATION",e[e.TEMPORARY_PROTECTION_PERMIT=66]="TEMPORARY_PROTECTION_PERMIT",e[e.AFGHAN_CITIZEN_CARD=67]="AFGHAN_CITIZEN_CARD",e[e.EID=68]="EID",e[e.PASS=69]="PASS",e[e.SIS_ID=70]="SIS_ID",e[e.ASIC_CARD=71]="ASIC_CARD",e[e.BIDOON_CARD=72]="BIDOON_CARD",e[e.INTERIM_HEALTH_INSURANCE_CARD=73]="INTERIM_HEALTH_INSURANCE_CARD",e[e.NON_VOTER_ID=74]="NON_VOTER_ID",e[e.RECIPROCAL_HEALTH_INSURANCE_CARD=75]="RECIPROCAL_HEALTH_INSURANCE_CARD",e[e.VEHICLE_REGISTRATION=76]="VEHICLE_REGISTRATION",e[e.COUNT=77]="COUNT";})(l||(l={}));var Pt;(function(e){e[e.AdditionalAddressInformation=0]="AdditionalAddressInformation",e[e.AdditionalNameInformation=1]="AdditionalNameInformation",e[e.AdditionalOptionalAddressInformation=2]="AdditionalOptionalAddressInformation",e[e.AdditionalPersonalIdNumber=3]="AdditionalPersonalIdNumber",e[e.Address=4]="Address",e[e.ClassEffectiveDate=5]="ClassEffectiveDate",e[e.ClassExpiryDate=6]="ClassExpiryDate",e[e.Conditions=7]="Conditions",e[e.DateOfBirth=8]="DateOfBirth",e[e.DateOfExpiry=9]="DateOfExpiry",e[e.DateOfIssue=10]="DateOfIssue",e[e.DocumentAdditionalNumber=11]="DocumentAdditionalNumber",e[e.DocumentOptionalAdditionalNumber=12]="DocumentOptionalAdditionalNumber",e[e.DocumentNumber=13]="DocumentNumber",e[e.Employer=14]="Employer",e[e.Endorsements=15]="Endorsements",e[e.FathersName=16]="FathersName",e[e.FirstName=17]="FirstName",e[e.FullName=18]="FullName",e[e.IssuingAuthority=19]="IssuingAuthority",e[e.LastName=20]="LastName",e[e.LicenceType=21]="LicenceType",e[e.LocalizedName=22]="LocalizedName",e[e.MaritalStatus=23]="MaritalStatus",e[e.MothersName=24]="MothersName",e[e.Mrz=25]="Mrz",e[e.Nationality=26]="Nationality",e[e.PersonalIdNumber=27]="PersonalIdNumber",e[e.PlaceOfBirth=28]="PlaceOfBirth",e[e.Profession=29]="Profession",e[e.Race=30]="Race",e[e.Religion=31]="Religion",e[e.ResidentialStatus=32]="ResidentialStatus",e[e.Restrictions=33]="Restrictions",e[e.Sex=34]="Sex",e[e.VehicleClass=35]="VehicleClass",e[e.BloodType=36]="BloodType",e[e.Sponsor=37]="Sponsor",e[e.VisaType=38]="VisaType",e[e.DocumentSubtype=39]="DocumentSubtype",e[e.Remarks=40]="Remarks",e[e.ResidencePermitType=41]="ResidencePermitType",e[e.ManufacturingYear=42]="ManufacturingYear",e[e.VehicleType=43]="VehicleType",e[e.DependentDateOfBirth=44]="DependentDateOfBirth",e[e.DependentSex=45]="DependentSex",e[e.DependentDocumentNumber=46]="DependentDocumentNumber",e[e.DependentFullName=47]="DependentFullName",e[e.EligibilityCategory=48]="EligibilityCategory",e[e.SpecificDocumentValidity=49]="SpecificDocumentValidity",e[e.Count=50]="Count";})(Pt||(Pt={}));var qt;(function(e){e[e.FullDocument=0]="FullDocument",e[e.Face=1]="Face",e[e.Signature=2]="Signature";})(qt||(qt={}));var yt;(function(e){e[e.NotAvailable=0]="NotAvailable",e[e.BlackAndWhite=1]="BlackAndWhite",e[e.Color=2]="Color";})(yt||(yt={}));var ae;(function(e){e[e.NotAvailable=0]="NotAvailable",e[e.NotDetected=1]="NotDetected",e[e.Detected=2]="Detected";})(ae||(ae={}));var Ut;(function(e){e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e[e.NotAvailable=2]="NotAvailable";})(Ut||(Ut={}));var kt;(function(e){e[e.None=0]="None",e[e.Clockwise90=1]="Clockwise90",e[e.CounterClockwise90=2]="CounterClockwise90",e[e.UpsideDown=3]="UpsideDown";})(kt||(kt={}));var xe;(function(e){e[e.Success=0]="Success",e[e.DetectionFailed=1]="DetectionFailed",e[e.ImagePreprocessingFailed=2]="ImagePreprocessingFailed",e[e.StabilityTestFailed=3]="StabilityTestFailed",e[e.ScanningWrongSide=4]="ScanningWrongSide",e[e.FieldIdentificationFailed=5]="FieldIdentificationFailed",e[e.MandatoryFieldMissing=6]="MandatoryFieldMissing",e[e.InvalidCharactersFound=7]="InvalidCharactersFound",e[e.ImageReturnFailed=8]="ImageReturnFailed",e[e.BarcodeRecognitionFailed=9]="BarcodeRecognitionFailed",e[e.MrzParsingFailed=10]="MrzParsingFailed",e[e.ClassFiltered=11]="ClassFiltered",e[e.UnsupportedClass=12]="UnsupportedClass",e[e.UnsupportedByLicense=13]="UnsupportedByLicense",e[e.AwaitingOtherSide=14]="AwaitingOtherSide",e[e.NotScanned=15]="NotScanned",e[e.BarcodeDetectionFailed=16]="BarcodeDetectionFailed",e[e.Count=17]="Count";})(xe||(xe={}));var Ft;(function(e){e[e.None=0]="None",e[e.MrzId=1]="MrzId",e[e.MrzVisa=2]="MrzVisa",e[e.MrzPassport=3]="MrzPassport",e[e.PhotoId=4]="PhotoId",e[e.FullRecognition=5]="FullRecognition",e[e.BarcodeId=6]="BarcodeId",e[e.Count=7]="Count";})(Ft||(Ft={}));async function Ht(e){return e.mbWasmModule.newRecognizer(atob("QmxpbmtJZFNpbmdsZVNpZGVSZWNvZ25pemVy"))}async function zt(e){return e.mbWasmModule.newRecognizer(atob("QmxpbmtJZE11bHRpU2lkZVJlY29nbml6ZXI="))}var xt;(function(e){e[e.None=0]="None",e[e.AAMVACompliant=1]="AAMVACompliant",e[e.ArgentinaID=2]="ArgentinaID",e[e.ArgentinaAlienID=3]="ArgentinaAlienID",e[e.ArgentinaDL=4]="ArgentinaDL",e[e.ColombiaID=5]="ColombiaID",e[e.ColombiaDL=6]="ColombiaDL",e[e.NigeriaVoterID=7]="NigeriaVoterID",e[e.NigeriaDL=8]="NigeriaDL",e[e.PanamaID=9]="PanamaID",e[e.SouthAfricaID=10]="SouthAfricaID";})(xt||(xt={}));var Ge=class e{get location(){return this._location}static fromJSON(t){let a=new e;return t.location!=null&&(a._location=Quadrilateral.fromJSON(t.location)),a}toJSONObject(){return {location:this.location.toJSONObject()}}};var Ta={[n.NONE]:null,[n.COUNT]:null,[n.AUSTRALIAN_CAPITAL_TERRITORY]:"Australian Capital Territory",[n.NEW_SOUTH_WALES]:"New South Wales",[n.NORTHERN_TERRITORY]:"Northern Territory",[n.QUEENSLAND]:"Queensland",[n.SOUTH_AUSTRALIA]:"South Australia",[n.TASMANIA]:"Tasmania",[n.WESTERN_AUSTRALIA]:"Western Australia",[n.VICTORIA]:"Victoria",[n.ALBERTA]:"Alberta",[n.BRITISH_COLUMBIA]:"British Columbia",[n.MANITOBA]:"Manitoba",[n.NEW_BRUNSWICK]:"New Brunswick",[n.NEWFOUNDLAND_AND_LABRADOR]:"Newfoundland and Labrador",[n.NORTHWEST_TERRITORIES]:"Northwest Territories",[n.NOVA_SCOTIA]:"Nova Scotia",[n.NUNAVUT]:"Nunavut",[n.PRINCE_EDWARD_ISLAND]:"Prince Edward Island",[n.QUEBEC]:"Quebec",[n.SASKATCHEWAN]:"Saskatchewan",[n.ANDHRA_PRADESH]:"Andhra Pradesh",[n.GUJARAT]:"Gujarat",[n.HARYANA]:"Haryana",[n.KARNATAKA]:"Karnataka",[n.KERALA]:"Kerala",[n.MADHYA_PRADESH]:"Madhya Pradesh",[n.MAHARASHTRA]:"Maharashtra",[n.PUNJAB]:"Punjab",[n.TAMIL_NADU]:"Tamil Nadu",[n.AGUASCALIENTES]:"Aguascalientes",[n.BAJA_CALIFORNIA]:"Baja California",[n.BAJA_CALIFORNIA_SUR]:"Baja California Sur",[n.CAMPECHE]:"Campeche",[n.CHIAPAS]:"Chiapas",[n.CHIHUAHUA]:"Chihuahua",[n.CIUDAD_DE_MEXICO]:"Mexico City",[n.COAHUILA]:"Coahuila",[n.COLIMA]:"Colima",[n.DURANGO]:"Durango",[n.GUANAJUATO]:"Guanajuato",[n.GUERRERO]:"Guerrero",[n.GUERRERO_ACAPULCO_DE_JUAREZ]:"Acapulco de Ju\xE1rez, Guerrero",[n.GUERRERO_COCULA]:"Cocula, Guerrero",[n.GUERRERO_JUCHITAN]:"Juchit\xE1n, Guerrero",[n.GUERRERO_TEPECOACUILCO]:"Tepecoacuilco de Trujano, Guerrero",[n.GUERRERO_TLACOAPA]:"Tlacoapa, Guerrero",[n.HIDALGO]:"Hidalgo",[n.JALISCO]:"Jalisco",[n.MEXICO]:"M\xE9xico",[n.MICHOACAN]:"Michoac\xE1n",[n.MORELOS]:"Morelos",[n.NAYARIT]:"Nayarit",[n.NUEVO_LEON]:"Nuevo Le\xF3n",[n.OAXACA]:"Oaxaca",[n.PUEBLA]:"Puebla",[n.UINTANA_ROO]:"Quintana Roo",[n.QUINTANA_ROO_BENITO_JUAREZ]:"Benito Ju\xE1rez, Quintana Roo",[n.QUINTANA_ROO_SOLIDARIDAD]:"Solidaridad, Quintana Roo",[n.QUINTANA_ROO_COZUMEL]:"Cozumel, Quintana Roo",[n.QUERETARO]:"Quer\xE9taro",[n.SAN_LUIS_POTOSI]:"San Luis Potos\xED",[n.SINALOA]:"Sinaloa",[n.SONORA]:"Sonora",[n.TABASCO]:"Tabasco",[n.TAMAULIPAS]:"Tamaulipas",[n.TLAXCALA]:"Tlaxcala",[n.VERACRUZ]:"Veracruz",[n.YUCATAN]:"Yucatan",[n.ZACATECAS]:"Zacatecas",[n.KHYBER_PAKHTUNKHWA]:"Khyber Pakhtunkhwa",[n.ALABAMA]:"Alabama",[n.ALASKA]:"Alaska",[n.ARIZONA]:"Arizona",[n.ARKANSAS]:"Arkansas",[n.CALIFORNIA]:"California",[n.COLORADO]:"Colorado",[n.CONNECTICUT]:"Connecticut",[n.DELAWARE]:"Delaware",[n.DISTRICT_OF_COLUMBIA]:"District of Columbia",[n.FLORIDA]:"Florida",[n.GEORGIA]:"Georgia",[n.HAWAII]:"Hawaii",[n.IDAHO]:"Idaho",[n.ILLINOIS]:"Illinois",[n.INDIANA]:"Indiana",[n.IOWA]:"Iowa",[n.KANSAS]:"Kansas",[n.KENTUCKY]:"Kentucky",[n.LOUISIANA]:"Louisiana",[n.MAINE]:"Maine",[n.MARYLAND]:"Maryland",[n.MASSACHUSETTS]:"Massachusetts",[n.MICHIGAN]:"Michigan",[n.MINNESOTA]:"Minnesota",[n.MISSISSIPPI]:"Mississippi",[n.MISSOURI]:"Missouri",[n.MONTANA]:"Montana",[n.NEBRASKA]:"Nebraska",[n.NEVADA]:"Nevada",[n.NEW_HAMPSHIRE]:"New Hampshire",[n.NEW_JERSEY]:"New Jersey",[n.NEW_MEXICO]:"New Mexico",[n.NEW_YORK]:"New York",[n.NEW_YORK_CITY]:"New York City",[n.NORTH_CAROLINA]:"North Carolina",[n.NORTH_DAKOTA]:"North Dakota",[n.OHIO]:"Ohio",[n.OKLAHOMA]:"Oklahoma",[n.ONTARIO]:"Ontario",[n.OREGON]:"Oregon",[n.PENNSYLVANIA]:"Pennsylvania",[n.RHODE_ISLAND]:"Rhode Island",[n.SOUTH_CAROLINA]:"South Carolina",[n.SOUTH_DAKOTA]:"South Dakota",[n.TENNESSEE]:"Tennessee",[n.TEXAS]:"Texas",[n.UTAH]:"Utah",[n.VERMONT]:"Vermont",[n.VIRGINIA]:"Virginia",[n.WASHINGTON]:"Washington",[n.WEST_VIRGINIA]:"West Virginia",[n.WISCONSIN]:"Wisconsin",[n.WYOMING]:"Wyoming",[n.YUKON]:"Yukon",[n.CEARA]:"Cear\xE1",[n.DISTRITO_FEDERAL]:"Federal District",[n.GOIAS]:"Goi\xE1s",[n.MARANHAO]:"Maranh\xE3o",[n.MATO_GROSSO]:"Mato Grosso",[n.MINAS_GERAIS]:"Minas Gerais",[n.PARA]:"Par\xE1",[n.PARANA]:"Paran\xE1",[n.PERNAMBUCO]:"Pernambuco",[n.RIO_DE_JANEIRO]:"Rio de Janeiro",[n.RIO_GRANDE_DO_SUL]:"Rio Grand do Sul",[n.SANTA_CATARINA]:"Santa Catarina",[n.SAO_PAOLO]:"Sao Paolo",[n.SERGIPE]:"Sergipe",[n.ALAGOAS]:"Alagoas",[n.BANGSAMORO]:"Bangsamoro"};function jt(e){return Ta[e]}var We=class e{constructor(t){this.workerCall=t;}static create(t){return new e(t)}async createDrivingLicenseDetailsFromBlinkIdData(t,a,r){let s=await this.workerCall("idCaptureDrivingLicenseDetailsCreateWithBlinkIdData",{details:{vehicleClass:t,restrictions:a,endorsements:r}});return j.fromJSON(s.result)}};var Jt={ABW:"aruba",AFG:"afghanistan",AGO:"angola",AIA:"anguilla",ALA:"alandIslands",ALB:"albania",AND:"andorra",ARE:"uae",ARG:"argentina",ARM:"armenia",ASM:"americanSamoa",ATA:"antarctica",ATF:"frenchSouthernTerritories",ATG:"antiguaAndBarbuda",AUS:"australia",AUT:"austria",AZE:"azerbaijan",BDI:"burundi",BEL:"belgium",BEN:"benin",BES:"bonaireSintEustatiusAndSaba",BFA:"burkinaFaso",BGD:"bangladesh",BGR:"bulgaria",BHR:"bahrain",BHS:"bahamas",BIH:"bosniaHerzegovina",BLM:"saintBarthelemy",BLR:"belarus",BLZ:"belize",BMU:"bermuda",BOL:"bolivia",BRA:"brazil",BRB:"barbados",BRN:"bruneiDarussalam",BTN:"bhutan",BVT:"bouvetIsland",BWA:"botswana",CAF:"car",CAN:"canada",CCK:"cocosIslands",CHE:"switzerland",CHL:"chile",CHN:"china",CIV:"coteIvoire",CMR:"cameroon",COD:"democraticRepublicOfCongo",COG:"congo",COK:"cookIslands",COL:"colombia",COM:"comoros",CPV:"caboVerde",CRI:"costaRica",CUB:"cuba",CUW:"curacao",CXR:"christmasIsland",CYM:"caymanIslands",CYP:"cyprus",CZE:"czechia",DEU:"germany",DJI:"djibouti",DMA:"dominica",DNK:"denmark",DOM:"dominicanRepublic",DZA:"algeria",ECU:"ecuador",EGY:"egypt",ERI:"eritrea",ESH:"westernSahara",ESP:"spain",EST:"estonia",ETH:"ethiopia",FIN:"finland",FJI:"fiji",FLK:"falklandIslands",FRA:"france",FRO:"faroeIslands",FSM:"micronesia",GAB:"gabon",GBR:"uk",GEO:"georgia",GGY:"guernsey",GHA:"ghana",GIB:"gibraltar",GIN:"guinea",GLP:"guadeloupe",GMB:"gambia",GNB:"guineaBissau",GNQ:"equatorialGuinea",GRC:"greece",GRD:"grenada",GRL:"greenland",GTM:"guatemala",GUF:"frenchGuiana",GUM:"guam",GUY:"guyana",HKG:"hongKong",HMD:"heardIslandAndMcDonaldIslands",HND:"honduras",HRV:"croatia",HTI:"haiti",HUN:"hungary",IDN:"indonesia",IMN:"isleOfMan",IND:"india",IOT:"britishIndianOceanTerritory",IRL:"ireland",IRN:"iran",IRQ:"iraq",ISL:"iceland",ISR:"israel",ITA:"italy",JAM:"jamaica",JEY:"jersey",JOR:"jordan",JPN:"japan",KAZ:"kazakhstan",KEN:"kenya",KGZ:"kyrgyzstan",KHM:"cambodia",KIR:"kiribati",KNA:"saintKittsAndNevis",KOR:"southKorea",KWT:"kuwait",LAO:"lao",LBN:"lebanon",LBR:"liberia",LBY:"libya",LCA:"saintLucia",LIE:"liechtenstein",LKA:"sriLanka",LSO:"lesotho",LTU:"lithuania",LUX:"luxembourg",LVA:"latvia",MAC:"macao",MAF:"frenchSaintMartin",MAR:"morocco",MCO:"monaco",MDA:"moldova",MDG:"madagascar",MDV:"maldives",MEX:"mexico",MHL:"marshallIslands",MKD:"northMacedonia",MLI:"mali",MLT:"malta",MMR:"myanmar",MNE:"montenegro",MNG:"mongolia",MNP:"northernMarianaIslands",MOZ:"mozambique",MRT:"mauritania",MSR:"montserrat",MTQ:"martinique",MUS:"mauritius",MWI:"malawi",MYS:"malaysia",MYT:"mayotte",NAM:"namibia",NCL:"newCaledonia",NER:"niger",NFK:"norfolkIsland",NGA:"nigeria",NIC:"nicaragua",NIU:"niue",NLD:"netherlands",NOR:"norway",NPL:"nepal",NRU:"nauru",NZL:"newZealand",OMN:"oman",PAK:"pakistan",PAN:"panama",PCN:"pitcairn",PER:"peru",PHL:"philippines",PLW:"palau",PNG:"papuaNewGuinea",POL:"poland",PRI:"puertoRico",PRK:"northKorea",PRT:"portugal",PRY:"paraguay",PSE:"palestine",PYF:"frenchPolynesia",QAT:"qatar",REU:"reunion",ROU:"romania",RUS:"russia",RWA:"rwanda",SAU:"saudiArabia",SDN:"sudan",SEN:"senegal",SGP:"singapore",SGS:"southGeorgiaAndTheSouthSandwichIslands",SHN:"saintHelena",SJM:"svalbardAndJanMayen",SLB:"solomonIslands",SLE:"sierraLeone",SLV:"elSalvador",SMR:"sanMarino",SOM:"somalia",SPM:"saintPierreAndMiquelon",SRB:"serbia",SSD:"southSudan",STP:"saoTomeAndPrincipe",SUR:"suriname",SVK:"slovakia",SVN:"slovenia",SWE:"sweden",SWZ:"eswatini",SXM:"dutchSintMaarten",SYC:"seychelles",SYR:"syria",TCA:"turksAndCaicosIslands",TCD:"chad",TGO:"togo",THA:"thailand",TJK:"tajikistan",TKL:"tokelau",TKM:"turkmenistan",TLS:"timorLeste",TON:"tonga",TTO:"trinidadAndTobago",TUN:"tunisia",TUR:"turkey",TUV:"tuvalu",TWN:"taiwan",TZA:"tanzania",UGA:"uganda",UKR:"ukraine",UMI:"usMinorOutlyingIslands",URY:"uruguay",USA:"us",UZB:"uzbekistan",VAT:"holySee",VCT:"saintVincentAndTheGrenadines",VEN:"venezuela",VGB:"britishVirginIslands",VIR:"usVirginIslands",VNM:"vietnam",VUT:"vanuatu",WLF:"wallisAndFutuna",WSM:"samoa",XKX:"kosovo",YEM:"yemen",ZAF:"southAfrica",ZMB:"zambia",ZWE:"zimbabwe"};var La=(d=>(d.UsBorderCrossingCard="usBorderCrossingCard",d.ChinaExitEntryPermit="chinaExitEntryPermit",d.UsGlobalEntryCard="usGlobalEntryCard",d.ChinaMainlandTravelPermitTaiwan="chinaMainlandTravelPermitTaiwan",d.UsNexusCard="usNexusCard",d.ChinaMainlandTravelPermitHongKongMacau="chinaMainlandTravelPermitHongKongMacau",d.ApecBusinessTravelCard="apecBusinessTravelCard",d.PakistanAfghanCitizenCard="pakistanAfghanCitizenCard",d.SingaporeFinCard="singaporeFinCard",d.UsGreenCard="usGreenCard",d.MalaysiaIkad="malaysiaIkad",d.MalaysiaMykad="malaysiaMykad",d.MalaysiaMypr="malaysiaMypr",d.MexicoConsularVoterId="mexicoConsularVoterId",d.GermanyEid="germanyEid",d.UsCommonAccessCard="usCommonAccessCard",d.PhilippinesMultipurposeId="philippinesMultipurposeId",d.MalaysiaMykas="malaysiaMykas",d.MalaysiaMykid="malaysiaMykid",d.MalaysiaMytentera="malaysiaMytentera",d.MexicoProfessionalId="mexicoProfessionalId",d.MalaysiaRefugeeId="malaysiaRefugeeId",d.CanadaTribalId="canadaTribalId",d.UsUniformedServicesId="usUniformedServicesId",d.UsVeteranId="usVeteranId",d.PhilippinesWorkPermit="philippinesWorkPermit",d.SingaporeWorkPermit="singaporeWorkPermit",d.UsWorkPermit="usWorkPermit",d.PhilippinesSocialSecurityCard="philippinesSocialSecurityCard",d.SwedenSocialSecurityCard="swedenSocialSecurityCard",d.CanadaSocialSecurityCard="canadaSocialSecurityCard",d.UsSocialSecurityCard="usSocialSecurityCard",d.BelgiumMinorsId="belgiumMinorsId",d.ColombiaMinorsId="colombiaMinorsId",d.PeruMinorsId="peruMinorsId",d.BoliviaMinorsId="boliviaMinorsId",d.HungaryAddressCard="hungaryAddressCard",d.UkAsylumRequest="ukAsylumRequest",d.CanadaCitizenshipCertificate="canadaCitizenshipCertificate",d.SingaporeEmploymentPass="singaporeEmploymentPass",d.CanadaMinorsPublicServicesCard="canadaMinorsPublicServicesCard",d.MalaysiaMypolis="malaysiaMypolis",d.PhilippinesNbiClearance="philippinesNbiClearance",d.IndiaPanCard="indiaPanCard",d.PhilippinesPostalId="philippinesPostalId",d.PakistanProofOfRegistration="pakistanProofOfRegistration",d.SingaporeSPass="singaporeSPass",d.SwedenSisId="swedenSisId",d.ColombiaTemporaryProtectionPermit="colombiaTemporaryProtectionPermit",d.UsTwicCard="usTwicCard",d.UsWeaponPermit="usWeaponPermit",d.CanadaWeaponPermit="canadaWeaponPermit",d.IrelandPublicServicesCard="irelandPublicServicesCard",d.CanadaPublicServicesCard="canadaPublicServicesCard",d.PakistanConsularId="pakistanConsularId",d.GuatemalaConsularId="guatemalaConsularId",d.MexicoConsularId="mexicoConsularId",d.PhilippinesTaxId="philippinesTaxId",d.MexicoTaxId="mexicoTaxId",d.ChinaOneWayPermit="chinaOneWayPermit",d.UsMedicalMarijuanaCard="usMedicalMarijuanaCard",d.UsMunicipalId="usMunicipalId",d.AustraliaAsicCard="australiaAsicCard",d.UaeVehicleRegistrationCard="uaeVehicleRegistrationCard",d))(La||{});function Zt(e){return e.state===b.StageValid&&e.scanningFirstSideDone||!e.backViz.empty}function Ma(e){return Zt(e)||e.backProcessingStatus===xe.Success?e.state===b.Valid&&e.scanningFirstSideDone?"frontAndBack":"frontOnly":"frontOnly"}function wa(e){return "backViz"in e&&!e.backViz.empty}function Pa(e){switch(e){case C.PAKISTAN:return ["regionSpecific","pakistanConsularId"];case C.GUATEMALA:return ["regionSpecific","guatemalaConsularId"];case C.MEXICO:return ["regionSpecific","mexicoConsularId"];default:return ["regionSpecific",null]}}function qa(e){switch(e){case C.IRELAND:return ["regionSpecific","irelandPublicServicesCard"];case C.CANADA:return ["regionSpecific","canadaPublicServicesCard"];default:return ["regionSpecific",null]}}function ya(e){switch(e){case C.PHILIPPINES:return ["regionSpecific","philippinesWorkPermit"];case C.SINGAPORE:return ["regionSpecific","singaporeWorkPermit"];case C.USA:return ["regionSpecific","usWorkPermit"];default:return ["regionSpecific",null]}}function Ua(e){switch(e){case C.PHILIPPINES:return ["regionSpecific","philippinesSocialSecurityCard"];case C.SWEDEN:return ["regionSpecific","swedenSocialSecurityCard"];case C.CANADA:return ["regionSpecific","canadaSocialSecurityCard"];case C.USA:return ["regionSpecific","usSocialSecurityCard"];default:return ["regionSpecific",null]}}function ka(e){switch(e){case C.BELGIUM:return ["regionSpecific","belgiumMinorsId"];case C.COLOMBIA:return ["regionSpecific","colombiaMinorsId"];case C.PERU:return ["regionSpecific","peruMinorsId"];case C.BOLIVIA:return ["regionSpecific","boliviaMinorsId"];default:return ["regionSpecific",null]}}function Fa(e){switch(e){case C.PHILIPPINES:return ["regionSpecific","philippinesTaxId"];case C.MEXICO:return ["regionSpecific","mexicoTaxId"];default:return ["regionSpecific",null]}}function xa(e){switch(e){case C.USA:return ["regionSpecific","usWeaponPermit"];case C.CANADA:return ["regionSpecific","canadaWeaponPermit"];default:return ["regionSpecific",null]}}var oe=class e{constructor(t,a,r){this.alreadyReturnedStageValid=!1;this.recognizer=t,this.workerCallProvider=a,this.capturedSides=r;}reset(){this.alreadyReturnedStageValid=!1;}static concatenateReducer(t,a){return t+String.fromCodePoint(a)}static stringFromMultiScriptResult(t){return typeof t.latin=="string"&&t.latin.length>0?t.latin:typeof t.arabic=="string"&&t.arabic.length>0?t.arabic:typeof t.cyrillic=="string"&&t.cyrillic.length>0?t.cyrillic:""}static isCentaurusDateResult(t){return Object.prototype.hasOwnProperty.call(t,"originalString")}static isCentaurusStringResult(t){return !e.isCentaurusDateResult(t)}async processResult(t){var r,s;if(t===b.Uncertain)return {result:null,requiresReset:this.capturedSides==="frontOnly"?"hard":"soft"};let a=this.capturedSides==="frontOnly"?await this.processSingleSideResult(t):await this.processDoubleSideResult(t);return ((r=a.result)==null?void 0:r.vizResult.documentType)==null?{result:null,requiresReset:(s=a.requiresReset)!=null?s:"soft"}:a}centaurusDocumentTypeToIdCaptureDocumentType(t,a){switch(t){case l.NONE:case l.COUNT:return null;case l.ID:case l.VOTER_ID:case l.PASSPORT_CARD:case l.PROOF_OF_REGISTRATION:case l.NON_VOTER_ID:case l.PROOF_OF_AGE_CARD:return ["idCard",null];case l.DL:case l.DL_PUBLIC_SERVICES_CARD:case l.PROFESSIONAL_DL:case l.DRIVER_CARD:case l.DRIVING_PRIVILEGE_CARD:case l.DRIVER_QUALIFICATION_CARD:case l.PROVISIONAL_DL:return ["driverLicense",null];case l.PASSPORT:case l.ALIEN_PASSPORT:case l.CONSULAR_PASSPORT:case l.MINORS_PASSPORT:case l.REFUGEE_PASSPORT:return ["passport",null];case l.RESIDENCE_PERMIT:case l.RESIDENT_ID:case l.TEMPORARY_RESIDENCE_PERMIT:case l.ALIEN_ID:case l.SPECIAL_ID:return ["residencePermit",null];case l.VISA:case l.IMMIGRANT_VISA:return ["visaIcao",null];case l.HEALTH_INSURANCE_CARD:case l.INTERIM_HEALTH_INSURANCE_CARD:case l.RECIPROCAL_HEALTH_INSURANCE_CARD:return ["healthInsuranceCard",null];case l.CONSULAR_ID:return Pa(a);case l.EMPLOYMENT_PASS:return ["regionSpecific","singaporeEmploymentPass"];case l.FIN_CARD:return ["regionSpecific","singaporeFinCard"];case l.MULTIPURPOSE_ID:return ["regionSpecific","philippinesMultipurposeId"];case l.MYKAD:return ["regionSpecific","malaysiaMykad"];case l.MYKID:return ["regionSpecific","malaysiaMykid"];case l.MYPR:return ["regionSpecific","malaysiaMypr"];case l.MYTENTERA:return ["regionSpecific","malaysiaMytentera"];case l.PAN_CARD:return ["regionSpecific","indiaPanCard"];case l.PROFESSIONAL_ID:return ["regionSpecific","mexicoProfessionalId"];case l.PUBLIC_SERVICES_CARD:return qa(a);case l.WORK_PERMIT:return ya(a);case l.IKAD:return ["regionSpecific","malaysiaIkad"];case l.MILITARY_ID:return ["regionSpecific","usCommonAccessCard"];case l.MYKAS:return ["regionSpecific","malaysiaMykas"];case l.SOCIAL_SECURITY_CARD:return Ua(a);case l.S_PASS:return ["regionSpecific","singaporeSPass"];case l.ADDRESS_CARD:return ["regionSpecific","hungaryAddressCard"];case l.GREEN_CARD:return ["regionSpecific","usGreenCard"];case l.MINORS_ID:return ka(a);case l.POSTAL_ID:return ["regionSpecific","philippinesPostalId"];case l.TAX_ID:return Fa(a);case l.WEAPON_PERMIT:return xa(a);case l.BORDER_CROSSING_CARD:return ["regionSpecific","usBorderCrossingCard"];case l.GLOBAL_ENTRY_CARD:return ["regionSpecific","usGlobalEntryCard"];case l.MYPOLIS:return ["regionSpecific","malaysiaMypolis"];case l.NEXUS_CARD:return ["regionSpecific","usNexusCard"];case l.REFUGEE_ID:return ["regionSpecific","malaysiaRefugeeId"];case l.TRIBAL_ID:return ["regionSpecific","canadaTribalId"];case l.VETERAN_ID:return ["regionSpecific","usVeteranId"];case l.CITIZENSHIP_CERTIFICATE:return ["regionSpecific","canadaCitizenshipCertificate"];case l.MINORS_PUBLIC_SERVICES_CARD:return ["regionSpecific","canadaMinorsPublicServicesCard"];case l.ASYLUM_REQUEST:return ["regionSpecific","ukAsylumRequest"];case l.UNIFORMED_SERVICES_ID:return ["regionSpecific","usUniformedServicesId"];case l.CONSULAR_VOTER_ID:return ["regionSpecific","mexicoConsularVoterId"];case l.TWIC_CARD:return ["regionSpecific","usTwicCard"];case l.NBI_CLEARANCE:return ["regionSpecific","philippinesNbiClearance"];case l.TEMPORARY_PROTECTION_PERMIT:return ["regionSpecific","colombiaTemporaryProtectionPermit"];case l.AFGHAN_CITIZEN_CARD:return ["regionSpecific","pakistanAfghanCitizenCard"];case l.EID:return ["regionSpecific","germanyEid"];case l.SIS_ID:return ["regionSpecific","swedenSisId"];case l.ASIC_CARD:return ["regionSpecific","australiaAsicCard"];case l.VEHICLE_REGISTRATION:return ["regionSpecific","uaeVehicleRegistrationCard"];case l.EXIT_ENTRY_PERMIT:case l.MAINLAND_TRAVEL_PERMIT_TAIWAN:case l.BIDOON_CARD:case l.PASS:case l.MY_NUMBER_CARD:return null;default:assertUnreachable(t);}return null}convertDate(t){if(t.successfullyParsed===!0&&t.empty===!1){let a=t;return {day:a.day,month:a.month,year:a.year}}return null}async convertResult(t){if(t.state===b.Empty)return {result:null};if(this.isSingleSideResult(t)){if(t.viz.empty)return !t.barcode.empty||t.mrz.rawMRZString.length>0?{result:null,requiresReset:"hard"}:{result:null}}else if(t.frontViz.empty&&t.backViz.empty)return {result:null,requiresReset:"hard"};return this.alreadyReturnedStageValid=t.state===b.StageValid,{result:{mrzResult:null,vizResult:await this.getVizData(t),barcodeResult:null,imageInfo:this.getImageData(t),verificationResult:null}}}async extractVizData(t,a,r){var w,H,ue,ce;let s=e.stringFromMultiScriptResult,o=s(a.vehicleClass),c=s(a.restrictions),u=s(a.endorsements),m=this.workerCallProvider(),S=null;m&&(o.length>0||c.length>0||u.length>0)&&(S=await We.create(m).createDrivingLicenseDetailsFromBlinkIdData(o,c,u));let[g,N]=(w=this.centaurusDocumentTypeToIdCaptureDocumentType(t.documentType,t.country))!=null?w:[null,null];return {firstName:s(r.firstName),lastName:s(r.lastName),secondaryLastName:null,fullName:s(r.fullName),sex:s(r.sex),dateOfBirth:this.convertDate(r.dateOfBirth),nationality:s(r.nationality),address:s(r.address),documentType:g,documentSubtype:N,issuingCountryIso:(H=t.isoAlpha3CountryCode)!=null?H:null,issuingCountry:(ce=Jt[(ue=t.isoAlpha3CountryCode)!=null?ue:""])!=null?ce:null,documentNumber:s(r.documentNumber),dateOfExpiry:this.convertDate(r.dateOfExpiry),dateOfIssue:this.convertDate(r.dateOfIssue),additionalAddressInformation:s(r.additionalAddressInformation),additionalNameInformation:s(r.additionalNameInformation),documentAdditionalNumber:s(r.documentAdditionalNumber),employer:s(r.employer),issuingAuthority:s(r.issuingAuthority),maritalStatus:s(r.maritalStatus),personalIdNumber:s(r.personalIdNumber),placeOfBirth:s(r.placeOfBirth),profession:s(r.profession),race:s(r.race),religion:s(r.religion),residentialStatus:s(r.residentialStatus),mothersName:s(r.mothersName),fathersName:s(r.fathersName),issuingJurisdiction:jt(t.region),issuingJurisdictionIso:null,drivingLicenseDetails:S?S.toJSONObject():null,bloodType:s(r.bloodType),sponsor:s(r.sponsor),passportNumber:null,visaNumber:null}}getFieldLocations(t){var r,s;let a={};for(let o of Object.keys(t)){let c=o,u=t[c];if(typeof u=="object"){if(u.hasOwnProperty("latinLocation")&&((r=u.latinLocation)==null?void 0:r.topLeft)!=null){let{topLeft:m,bottomRight:S}=u.latinLocation;a[c]=new Quadrilateral(new Point(m.x,m.y),new Point(S.x,m.y),new Point(S.x,S.y),new Point(m.x,S.y)).toJSONObject();}else if(u.hasOwnProperty("originalString")){let m=u;if(((s=m.originalString)==null?void 0:s.hasOwnProperty("latinLocation"))===!0&&m.originalString.latinLocation!==void 0){let{topLeft:S,bottomRight:g}=m.originalString.latinLocation;a[c]=new Quadrilateral(new Point(S.x,S.y),new Point(g.x,S.y),new Point(g.x,g.y),new Point(S.x,g.y)).toJSONObject();}}}}return a}getImageBase64String(t){return t?btoa(t.reduce((a,r)=>e.concatenateReducer(a,r),"")):null}getImageData(t){let a={face:this.getImageBase64String(t.faceImage.encodedImage)};return this.isSingleSideResult(t)?{front:{...a,croppedDocument:this.getImageBase64String(t.fullDocumentImage.encodedImage),frame:null},back:{face:null,croppedDocument:null,frame:null}}:{front:{...a,croppedDocument:this.getImageBase64String(t.fullDocumentFrontImage.encodedImage),frame:null},back:{face:null,croppedDocument:this.getImageBase64String(t.fullDocumentBackImage.encodedImage),frame:null}}}getRealIdStatus(t){switch(this.isSingleSideResult(t)?t.imageAnalysisResult.realIDDetectionStatus:t.frontImageAnalysisResult.realIDDetectionStatus){case ae.NotAvailable:return "notAvailable";case ae.NotDetected:return "notRealIdCompliant";case ae.Detected:return "realIdCompliant";default:return "notAvailable"}}async getVizData(t){let a=this.getRealIdStatus(t);if(this.isSingleSideResult(t))return {...await this.extractVizData(t.classInfo,t.driverLicenseDetailedInfo,t.viz),usRealIdStatus:a,capturedSides:"frontOnly",isBackSideCaptureSupported:!1,frontFieldLocations:this.getFieldLocations(t.viz)};let r=Ma(t),s={...await this.extractVizData(t.classInfo,t.driverLicenseDetailedInfo,t.frontViz),usRealIdStatus:a,capturedSides:r,isBackSideCaptureSupported:Zt(t),frontFieldLocations:this.getFieldLocations(t.frontViz)};if(!wa(t))return s;let o=["address","dateOfBirth","dateOfExpiry","dateOfIssue","documentNumber","firstName","fullName","lastName","nationality","sex","additionalAddressInformation","additionalNameInformation","documentAdditionalNumber","employer","issuingAuthority","maritalStatus","personalIdNumber","placeOfBirth","profession","race","religion","residentialStatus","mothersName","fathersName"],{backViz:c}=t;for(let u of o)if(s[u]==null||s[u]===""){let S=c[u];this.handleEmptyFrontValue(s,u,S);}return s}handleEmptyFrontValue(t,a,r){if(e.isCentaurusStringResult(r)){let s=e.stringFromMultiScriptResult(r);s.length>0&&(t[a]=s);}else if(e.isCentaurusDateResult(r)){let s=this.convertDate(r);s&&(t[a]=s);}}isSingleSideResult(t){return this.capturedSides==="frontOnly"}hasResult(t){return t===b.Valid||t===b.StageValid&&!this.alreadyReturnedStageValid}async processDoubleSideResult(t){if(this.hasResult(t)){let a=await this.recognizer.getResult();return this.convertResult(a)}return {result:null}}async processSingleSideResult(t){if(t===b.Valid){let a=await this.recognizer.getResult();return this.convertResult(a)}return {result:null}}};var T=class{static isSingleSideScanner(t){return !t._isFull}static isFullDocumentScanner(t){return t._isFull}};var Ve=class e{constructor(t,a,r){this._settingsCapturedSides=null;this.isProcessing=!1;this._lastError=null;this._lastResult=null;this._lastLocalization=null;this._currentDetectionOnlyMode=!1;this.idCapture=t,this.centaurusWasmSDK=a,this._workerCallProvider=r;}static hasRecognizerRunnerCrashed(t){return t instanceof R&&t.code===A.WORKER_IMAGE_PROCESS_FAILURE}static updatePassedRecognizerSettings(t,a,r={}){a.returnFullDocumentImage=t.getShouldPassImageTypeToResult("croppedDocument"),a.returnEncodedFullDocumentImage=t.getShouldPassImageTypeToResult("croppedDocument"),a.returnFaceImage=t.getShouldPassImageTypeToResult("face"),a.returnEncodedFaceImage=t.getShouldPassImageTypeToResult("face");let s=new Fe;switch(s.enableMrzId=!0,s.enableMrzPassport=!0,s.enableMrzVisa=!0,s.enableBarcodeId=!0,s.enablePhotoId=!1,s.enableFullDocumentRecognition=!0,a.recognitionModeFilter=s,t.getProperty("anonymizeCapturedData")===!1&&(t.anonymizationMode="none"),t.anonymizationMode){case"none":{a.anonymizationMode=W.None;break}case"fieldsOnly":{a.anonymizationMode=W.None;break}case"imagesOnly":{a.anonymizationMode=W.ImageOnly;break}case"fieldsAndImages":{a.anonymizationMode=W.ImageOnly;break}}a.scanCroppedDocumentImage=typeof r.scanCroppedDocumentImage=="boolean"?r.scanCroppedDocumentImage:!1;}async init(t){if(e.recognizerRunner!=null)throw new DataCaptureError({name:"MULTIPLE_RECOGNIZER_RUNNER",message:"A RecognizerRunner already exists, but it must be a singleton"});this.idCaptureSettings=t;let{scannerType:a}=t;this._settingsCapturedSides=T.isSingleSideScanner(a)?"frontOnly":"frontAndBack";let r=await this.getConfiguredRecognizer(this.idCaptureSettings);if(!r)throw new DataCaptureError({name:"RECOGNIZER_CREATION_FAILURE",message:"Recognizer instance could not be created."});this.recognizer=r,await this.createRunner(),await this.setDetectionOnlyMode(t.captureTrigger==="buttonTap"),this.resultProcessor=new oe(this.recognizer,this._workerCallProvider,this._settingsCapturedSides);}async applySettings(t){let a=T.isSingleSideScanner(t.scannerType)?"frontOnly":"frontAndBack",r=this._settingsCapturedSides!==a;if(this.idCaptureSettings=t,this._settingsCapturedSides=a,r&&e.recognizerRunner){await e.recognizerRunner.reconfigureRecognizers([],!1),await this.recognizer.delete();let s=await this.getConfiguredRecognizer(this.idCaptureSettings);if(s==null)throw new DataCaptureError({name:"RECOGNIZER_CREATION_FAILURE",message:"applySettings: recognizer instance could not be created."});this.recognizer=s,await e.recognizerRunner.reconfigureRecognizers([this.recognizer],!1),this.resultProcessor=new oe(this.recognizer,this._workerCallProvider,this._settingsCapturedSides);}else await this.reconfigureRecognizer(t);}async processFrame(t,a){if(this.isProcessing||e.recognizerRunner==null)return !1;this.isProcessing=!0,await this.configuringRecognizersPromise,(a==null?void 0:a.scanCroppedDocumentImage)===!0&&await this.reconfigureRecognizer(this.idCaptureSettings,{scanCroppedDocumentImage:!0});try{await this.recognize(t);}finally{(a==null?void 0:a.scanCroppedDocumentImage)===!0&&await this.reconfigureRecognizer(this.idCaptureSettings,{scanCroppedDocumentImage:!1}),this.isProcessing=!1;}return this.getLastResult()!=null}onQuadDetection(t){this._lastLocalization=t.detectionStatus===M.Success?Quadrilateral.fromJSON(t):null,this.reportLastLocalizedDocument(this._lastLocalization),this.reportLastDetectionIssue(t);}async dispose(){var t;await((t=e.recognizerRunner)==null?void 0:t.delete()),e.recognizerRunner=void 0,await this.recognizer.delete();}async reset(t=!0){var a;await((a=e.recognizerRunner)==null?void 0:a.resetRecognizers(t)),this._lastResult=null,this._lastError=null,t&&this.resultProcessor.reset();}async setDetectionOnlyMode(t){if(this._currentDetectionOnlyMode!==t){if(e.recognizerRunner==null)throw new O("Cannot set detection mode, IdCapture has not initialized yet.");this._currentDetectionOnlyMode=t,await e.recognizerRunner.setDetectionOnlyMode(t);}}displayDetectionStatusInUI(t){let a=window,r=a.centaurusDetectionStatus;r==null&&(r=document.createElement("div"),r.className="centaurusDetectionStatus",r.style.position="absolute",r.style.zIndex="1000",r.style.top="10px",r.style.left="10px",r.style.padding="0 1rem",r.style.backgroundColor="white",document.body.append(r),a.centaurusDetectionStatus=r),r.textContent=`LocalizedStatus: ${M[t.detectionStatus]}`;}reportLastLocalizedDocument(t){if(t==null)this.idCapture.reportLastLocalizedId(null);else {let a=Ge.fromJSON({location:t});this.idCapture.reportLastLocalizedId(a);}}reportLastDetectionIssue(t){let a=null;switch(t.detectionStatus){case M.CameraTooFar:{a="DocumentTooFar";break}case M.CameraTooClose:case M.DocumentTooCloseToCameraEdge:case M.DocumentPartiallyVisible:{a="DocumentTooClose";break}default:a=null;}this.idCapture.reportLastDetectionIssue(a);}getLastResult(){return this._lastResult}async setLastResult(t){return this._lastResult=t,this.idCapture.reportLastResult(t)}getLastError(){return this._lastError}async setLastError(t){if(t!==this._lastError)return this.idCapture.reportLastError(t);this._lastError=t;}async createRunner(){e.recognizerRunner=await Vt(this.centaurusWasmSDK,[this.recognizer],!1,this);}async getConfiguredRecognizer(t){let{centaurusWasmSDK:a}=this,r=T.isFullDocumentScanner(t.scannerType),s;try{if(r){s=await zt(a);let o=await s.currentSettings();e.updatePassedRecognizerSettings(t,o),await s.updateSettings(o);}else {s=await Ht(a);let o=await s.currentSettings();e.updatePassedRecognizerSettings(t,o),await s.updateSettings(o);}}catch(o){Logger.log(Logger.Level.Warn,"Error while applying new settings on recognizer object, some features might not work.",o);}return s}getRecognizerErrorMessage(t){return t instanceof R?`Processing frame failed: ${t.message} (code=${t.code})`:`Processing frame failed: ${t instanceof Error?t.message:"unknown error"}`}async recognize(t){let a=new Ue({...t,colorSpace:"srgb"},ye.NoRotation,!1),r;try{await this.setLastResult(null),await this.setLastError(null),r=await e.recognizerRunner.processImage(a);}catch(c){if(e.hasRecognizerRunnerCrashed(c)){await this.resetRecognizerRunner(),this.notifyRecoveryAfterError();return}let u=this.getRecognizerErrorMessage(c);throw await this.setLastError({type:"Undefined",message:u}),O.create({type:"Undefined",message:u})}let{result:s,requiresReset:o}=await this.resultProcessor.processResult(r);typeof o=="string"&&await this.reset(o==="hard"),!(s!=null&&!this.checkImagesPresence(s,r))&&(s!=null&&this._lastLocalization!=null&&this.addLocationInformationToResult(s,this._lastLocalization),await this.setLastResult(s));}checkImagesPresence(t,a){if(!(t.vizResult.capturedSides==="frontAndBack")||a!==b.Valid)return !0;let s=Object.values(et).filter(c=>c!=="frame");return !s.some(c=>this.isImageRequiredButEmpty(t.imageInfo,c))}addLocationInformationToResult(t,a){let r=["barcodeResult","mrzResult","vizResult"];for(let s of r)t[s]!=null&&(t[s].location=a.toJSONObject());}async reconfigureRecognizer(t,a={}){if(e.recognizerRunner){await e.recognizerRunner.reconfigureRecognizers([],!1);let r=await this.recognizer.currentSettings();e.updatePassedRecognizerSettings(t,r,a),await this.recognizer.updateSettings(r),await e.recognizerRunner.reconfigureRecognizers([this.recognizer],!1);}}async resetRecognizerRunner(){var t;return await((t=e.recognizerRunner)==null?void 0:t.delete()),await this.recognizer.delete(),e.recognizerRunner=void 0,Logger.log(Logger.Level.Debug,"Recreating Centaurus recognizer"),this.init(this.idCaptureSettings)}notifyRecoveryAfterError(){this.idCapture.notifyRecoveryAfterCrash();}isImageRequiredButEmpty(t,a){var s,o,c;return this.idCaptureSettings.getShouldPassImageTypeToResult(a)?a==="face"?((s=t==null?void 0:t.front.face)!=null?s:"")==="":a==="croppedDocument"?((o=t==null?void 0:t.front.croppedDocument)!=null?o:"")===""||((c=t==null?void 0:t.back.croppedDocument)!=null?c:"")==="":!1:!1}};var Wa=(N=>(N.NotAcceptedDocumentType="notAcceptedDocumentType",N.InvalidFormat="invalidFormat",N.DocumentVoided="documentVoided",N.Timeout="timeout",N.SingleImageNotRecognized="singleImageNotRecognized",N.DocumentExpired="documentExpired",N.DocumentExpiresSoon="documentExpiresSoon",N.NotRealIdCompliant="notRealIdCompliant",N.HolderUnderage="holderUnderage",N.ForgedAamvaBarcode="forgedAamvaBarcode",N.InconsistentData="inconsistentData",N))(Wa||{});var D={Available:"Available",ProcessingFrame:"ProcessingFrame",ProcessingQueue:"ProcessingQueue"},He=class e{constructor(){this.type="idCapture";this._synchronousFrameFlow=!0;this.state=D.Available;this._isEnabled=!0;this._context=null;this.listeners=[];this.overlayListeners=new Set;this._endOfCycleTasks=[];this._feedback=pe.defaultFeedback;this._onProcessFrameListener=this.onProcessFrame.bind(this);this.workerMessageListener=this.onWorkerMessage.bind(this);e._centaurusLoader!=null&&(this._centaurusConnector=new Ve(this,e._centaurusLoader.wasmSDK,()=>{var t;return (t=this.privateContext)==null?void 0:t.workerCommand})),this.contextListener={didChangeFrameSource:this.didChangeFrameSource.bind(this)};}static get recommendedCameraSettings(){return new CameraSettings(_.IdCapture.RecommendedCameraSettings)}get context(){return this._context}get feedback(){return this._feedback}get privateContext(){return this.context}static setCentaurusLoader(t){e._centaurusLoader=t;}static async forContext(t,a){let r=new e;if(r.settings=a,r._centaurusConnector)try{await r._centaurusConnector.init(r.settings);}catch(s){throw s instanceof DataCaptureError&&s.name==="MULTIPLE_RECOGNIZER_RUNNER"&&Logger.log(Logger.Level.Error,"The newly created IdCapture mode is invalid, an existing IdCapture mode is still attached to the context and must be removed first."),s}else r.checkCaptureSettingsAgainstSDKConfiguration(a);return t&&await t.addMode(r),r}async setFeedback(t){return this._feedback=t,this.didChange()}addListener(t){this.listeners.includes(t)||this.listeners.push(t);}removeListener(t){this.listeners.includes(t)&&this.listeners.splice(this.listeners.indexOf(t),1);}isEnabled(){return this._isEnabled}async setEnabled(t){this._isEnabled!==t&&(this._isEnabled=t,this.enqueueTask(async()=>this.didChange([{type:"modeEnabled",newValue:t}])),this.state===D.Available&&this.moveToState(D.ProcessingQueue));}async reset(){this.enqueueTask(async()=>this.doReset()),this.state===D.Available&&this.moveToState(D.ProcessingQueue);}async applySettings(t){this.enqueueTask(async()=>this.doApplySettings(t)),this.state===D.Available&&this.moveToState(D.ProcessingQueue);}async parse(t){if(this.context){let a=await this.context.workerCommand("idCaptureParse",{code:t});if((a==null?void 0:a.result)!=null){let r=a.result;if((r==null?void 0:r.status)==="error")throw O.create({type:"InvalidLicenseKeyForParser",message:r.error});if((r==null?void 0:r.status)==="success"){let s=this.convertRawImagesToBase64(r.capturedId.rawImageInfo);return ne.fromJSON({...r.capturedId,imageInfo:s})}}}return null}toJSONObject(){var t,a;return {enabled:this._isEnabled,type:this.type,settings:{...this.settings.toJSONObject(),licensee:"",licenseKey:(a=(t=e._centaurusLoader)==null?void 0:t.licenseKey)!=null?a:""}}}didChangeFrameSource(){this.moveToState(D.ProcessingQueue);}moveToState(t){this.state=t,t===D.ProcessingQueue&&this.processQueue();}async doReset(){var t;await((t=this.privateContext)==null?void 0:t.workerCommand("idCaptureReset",{}));}async doApplySettings(t){var a,r,s;this.context&&(this.settings=t,this.checkCaptureSettingsAgainstSDKConfiguration(t),await Promise.all([this.settingsIncludeVIZDocuments(t)?(a=this._centaurusConnector)==null?void 0:a.applySettings(t):Promise.resolve(),(r=this.privateContext)==null?void 0:r.workerCommand("idCaptureApplySettings",{settings:t.toJSONObject()}),(s=this.privateContext)==null?void 0:s.update()]));}addOverlayListener(t){this.overlayListeners.add(t);}removeOverlayListener(t){this.overlayListeners.delete(t);}checkCaptureSettingsAgainstSDKConfiguration(t){if(!this._centaurusConnector&&this.settingsIncludeVIZDocuments(t))throw O.create({type:"InvalidSettingsForVIZProcessing",message:"Invalid IdCapture configuration or settings: supported documents contain some VIZ documents, but VIZ scanning is disabled."})}async onProcessFrame(t){var a,r;return this.state!==D.Available?"skip":((a=this.privateContext)==null||a.performanceMark("processFrameBeforeCentaurus"),this.moveToState(D.ProcessingFrame),await this.doProcessFrame(t),(r=this.privateContext)==null||r.performanceMark("processFrameAfterCentaurus"),"continue")}async doProcessFrame(t){var a;if(this._isEnabled&&this.settingsIncludeVIZDocuments(this.settings)){let r=new Uint8ClampedArray(t.data),s=(a=this.context)==null?void 0:a.frameSource;!await this.processFrameWithCentaurus({data:r,width:t.width,height:t.height})&&(s==null?void 0:s.type)==="singleImageUploader"&&(r=new Uint8ClampedArray(t.data),await this.processFrameWithCentaurus({data:r,width:t.width,height:t.height},{scanCroppedDocumentImage:!0}));}}async onAfterProcessFrame(){this.moveToState(D.ProcessingQueue);}logPerformance(){let t=performance.getEntriesByName("processFrameBeforeCentaurus").length>0?performance.measure("Centaurus","processFrameBeforeCentaurus","processFrameAfterCentaurus").duration:0,a=performance.measure("SDC","processFrameBeforeSDC","processFrameAfterSDC").duration,r=`${(t+a).toFixed(2)}ms`;console.log(`centaurus: ${t.toFixed(2)}`,`sdc: ${a.toFixed(2)}`,`total: ${r}`),performance.clearMarks();}enqueueTask(t){this._endOfCycleTasks.push(t);}async processQueue(){if(this._endOfCycleTasks.length===0){this.moveToState(D.Available);return}for(;this._endOfCycleTasks.length>0;){let t=this._endOfCycleTasks.shift();await(t==null?void 0:t());}this.moveToState(D.Available);}settingsIncludeVIZDocuments(t){let{scannerType:a}=t;return T.isFullDocumentScanner(a)?!0:a.visualInspectionZone}attachedToContext(t){this._context=t,this._context.subscribeToWorkerMessages(this.workerMessageListener),this._context.registerFrameHandler(this._onProcessFrameListener),this._context.addListener(this.contextListener);}async detachedFromContext(){var t,a,r;return (t=this._context)==null||t.unsubscribeToWorkerMessages(this.workerMessageListener),(a=this._context)==null||a.unregisterFrameHandler(this._onProcessFrameListener),(r=this._context)==null||r.removeListener(this.contextListener),this._context=null,this.dispose()}async dispose(){var t;this.listeners=[],await((t=this._centaurusConnector)==null?void 0:t.dispose()),this._centaurusConnector=void 0;}async didChange(t){if(this.context)return this.context.update(t)}async onWorkerMessage(t){switch(t.type){case"idCaptureDidCaptureId":{this.triggerListenersForResult("didCaptureId",t.payload);break}case"idCaptureDidRejectId":{await this.triggerListenersForResult("didRejectId",t.payload),t.payload.rejectionReason==="singleImageNotRecognized"&&await this.reset();break}case"idCaptureDidShutterButtonPositionChanged":{for(let a of this.overlayListeners)a.onShutterPositionUpdate(t.payload.position);break}case"idCaptureDidShutterButtonStateChanged":{for(let a of this.overlayListeners)a.onShutterButtonStateChanged(t.payload.state);break}case"idCaptureIdCapturedFeedback":{this._feedback.idCaptured.emit();break}case"idCaptureIdRejectedFeedback":{this._feedback.idRejected.emit();break}case"idCaptureBackendReset":{this.enqueueTask(async()=>{var a;return (a=this._centaurusConnector)==null?void 0:a.reset()});break}case"idCaptureDetectionOnlyMode":{this.enqueueTask(async()=>{var a;return (a=this._centaurusConnector)==null?void 0:a.setDetectionOnlyMode(t.payload.detectionOnlyMode)}),this.state===D.Available&&this.moveToState(D.ProcessingQueue);break}case"onFrameProcessingStarted":break;case"onFrameProcessingFinished":{this.onAfterProcessFrame();break}case"onFrameSkipped":{this.onAfterProcessFrame();break}}}async processFrameWithCentaurus(t,a){try{return await this._centaurusConnector.processFrame(t,a)}catch(r){return r instanceof O?(Logger.log(Logger.Level.Debug,r.message),this.triggerErrorListener(r)):(Logger.log(Logger.Level.Debug,"Error while processing incoming frame from SDC",r),this.triggerErrorListener(O.create({type:"Undefined",message:"Error while processing a frame"}))),!1}}uint8ArrayImageToBase64(t,a,r){let s=document.createElement("canvas");s.width=a,s.height=r;let o=s.getContext("2d");if(!o)throw new Error("Could not get 2d context from an HTMLCanvasElement");o.putImageData(new ImageData(t,a,r,{colorSpace:"srgb"}),0,0);let c=o.canvas.toDataURL("image/png",1).replace("data:image/png;base64,","");return o=null,s=null,c}convertRawImagesToBase64(t){return {front:{...t.front,frame:t.front.frame.data==null?null:this.uint8ArrayImageToBase64(t.front.frame.data,t.front.frame.width,t.front.frame.height)},back:{...t.back,frame:t.back.frame.data==null?null:this.uint8ArrayImageToBase64(t.back.frame.data,t.back.frame.width,t.back.frame.height)}}}async triggerListenersForResult(t,a){if(!this.context||!this._isEnabled)return;let r=null;if(a.capturedId){let s=this.convertRawImagesToBase64(a.capturedId.rawImageInfo);r=ne.fromJSON({...a.capturedId,imageInfo:s});}for(let s of this.listeners)if(typeof s[t]=="function"){let o=[r];t==="didRejectId"&&typeof a.rejectionReason=="string"&&o.push(a.rejectionReason);let c=s[t].apply(null,o);c instanceof Promise&&await c;}}notifyRecoveryAfterCrash(){if(!this._isEnabled)return;let t=!1;for(let a of this.listeners)typeof a.didFailWithError=="function"&&(a.didFailWithError(this,O.create({type:"RecoveredAfterFailure",message:"Last image processing failed but SDK could recover. Please reset scanning process."})),t=!0);!t&&this.settings.scannerType._isFull&&Logger.log(Logger.Level.Warn,`A process responsible to scan images malfunctioned and was restarted. No listener for "didFailWithError" was
|
|
1
|
+
import {CameraSettings,Color,Feedback,Sound,Logger,Quadrilateral,DataCaptureError,Brush,Localization,assertUnreachable,OverrideState,DataCaptureContext,DataCaptureLoader,BrowserHelper,Point}from'@scandit/web-datacapture-core';import {isObject}from'@scandit/web-datacapture-core/build/js/private/utils/isObject.js';import {match}from'@scandit/web-datacapture-core/build/js/private/utils/match.js';import {ViewClassNames}from'@scandit/web-datacapture-core/build/js/private/ViewClassNames.js';import {ShutterButton}from'@scandit/web-datacapture-core/build/js/private/ui/atoms/ShutterButton.js';var p={"scandit-datacapture-sdk-id-pthreads.wasm":{bytes:8237286},"scandit-datacapture-sdk-id.wasm":{bytes:8185237},"scandit-datacapture-sdk-id-simd-pthreads.wasm":{bytes:8176551},"scandit-datacapture-sdk-id-simd.wasm":{bytes:8123730}};var da=e=>({IdCapture:{RecommendedCameraSettings:CameraSettings.fromJSON(e.IdCapture.RecommendedCameraSettings),IdCaptureOverlayDefaults:{defaultCapturedBrush:{fillColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.fillColor),strokeColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.strokeColor),strokeWidth:e.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.strokeWidth},defaultLocalizedBrush:{fillColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.fillColor),strokeColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.strokeColor),strokeWidth:e.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.strokeWidth},defaultRejectedBrush:{fillColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.fillColor),strokeColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.strokeColor),strokeWidth:e.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.strokeWidth}}}}),_=da({IdCapture:{RecommendedCameraSettings:{zoomFactor:1,zoomGestureZoomFactor:2,focusGestureStrategy:"manualUntilCapture",preferredResolution:"fullHd"},IdCaptureOverlayDefaults:{defaultCapturedBrush:{fillColor:"#00000000",strokeColor:"#FFFFFFFF",strokeWidth:3},defaultLocalizedBrush:{fillColor:"#FFFFFF80",strokeColor:"#FFFFFF00",strokeWidth:0},defaultRejectedBrush:{fillColor:"#00000000",strokeColor:"#FFFFFFFF",strokeWidth:3}}}});var de=(o=>(o.Undefined="Undefined",o.RecoveredAfterFailure="RecoveredAfterFailure",o.InvalidLicenseKeyForVIZProcessing="InvalidLicenseKeyForVIZProcessing",o.InvalidSettingsForVIZProcessing="InvalidSettingsForVIZProcessing",o.InvalidLicenseKeyForParser="InvalidLicenseKeyForParser",o))(de||{}),O=class e extends Error{constructor(){super(...arguments);this._type="Undefined";this._message="";}get type(){return this._type}get message(){return this._message}static create(a){let r=new e;return a&&(r.name=a.type,r._type=a.type,r._message=a.message),r}static fromJSON(a){let r=new e;return r._type=a.type,r._message=a.message,r}};var mt="data:audio/mpeg;base64,SUQzBAAAAAACGFRFTkMAAAALAAADUHJvIFRvb2xzAFRYWFgAAAAjAAADb3JpZ2luYXRvcl9yZWZlcmVuY2UAYWE0RVFOcW9VQk9rAFRJVDIAAAAeAAADMDdfU2NhbmRpdF9TY2FubmVkLVdyb25nSXRlbQBUWFhYAAAASQAAA3VtaWQAMHgwNjBBMkIzNDAxMDEwMTA1MDEwMTBGMTAxMzAwMDAwMDg2RUUzOTA5RUE3QjgwMDBGNjZGQzVERDdBNzc5ODE0AFRYWFgAAAAYAAADdGltZV9yZWZlcmVuY2UAMjY3MDU5MABURFJDAAAADAAAAzIwMjMtMDMtMjQAVFNTRQAAAA8AAANMYXZmNTkuMTcuMTAxAAAAAAAAAAAAAAD/+1QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABJbmZvAAAADwAAABQAAAhAACIiIiIuLi4uLjo6Ojo6RUVFRUVRUVFRUV1dXV1daGhoaGh0dHR0dICAgICAi4uLi4uXl5eXl6KioqKirq6urq66urq6usXFxcXF0dHR0dHd3d3d3ejo6Ojo9PT09PT//////wAAAABMYXZjNTkuMjAAAAAAAAAAAAAAAAAkAsAAAAAAAAAIQBl5jwn/+xRkAAAAVgDUjQBgAAAADSCgAAEDiBduGIGACAAANIMAAAAgP8plFgg7znL+Q4k4B5uo2Rk9c+LQuOexRB4iCTT6t24x+9f7f/ve/OAAwiE0lTn2XHl6PVZxCA5GsdT/+xRkCoPwcwJexxhAAAAADSDgAAEBiAl0oJxAEAAANIAAAAQLpHM6PLpQzOOJP9g5lhihlyb2dlebf8JCDTyRW9i0P7qaz/+QAFBoW4NDEqQuutHr41//tAlwcSVBnm3/+xRkGwPwdwHbgCsQAAAADSAAAAEBlAd5AIhAAAAANIAAAATHiGz+Vc+PkABIAc4KvoFaqtnriqAiChQ15lfsMNqJ+6pCWSiwWiCplZ48GhwdztADJY5zm8nAqeDYITz/+xRkKwPweAReQCYQAAAADSAAAAEB5BF+gYhgKAAANIAAAARCDP8WxCCX+BeBTH3/iEEQWPLf/j9xbSKUgEEVL1p+0zaZlevKU5jbmwnBfkrWVYFOA8ttpVTjnZNQTAj/+xRkOYHwcAJeQCIYAAAADSAAAAEBwAd1AJhAAAAANIAAAAQh4cpNFFitO6uKSSRkaPEOmFCjhCufYvSYAMRykUrsTqSNnkFv2JqLbTWsOJFsnYRXo/r1z8r/7+mDiwH/+xRkSYAAdwLcJSQACAAADSCgAAEEeJFKGKUACAAANIMAAABxOtc6Jp53xlXP35AAcoV0pquMq1q/64ds9sxEh5Gt1gF6lGuqIWmtoDBY0qSi+FDRUEFIX0BPlJEDhYT/+xRkTgPxAxRZhzDAAAAADSDgAAEBlAl5AJhAAAAANIAAAATqelYAwIlAy0/IoV/EKh5Gw6UEDpn9pqpMQU1FqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkVYPweQJfIMkQCAAADSAAAAEBzAlyAJwAAAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkZIPwdAdgoEEYigAADSAAAAEB1AuEgQhAKAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkc4PwcAdewMEQoAAADSAAAAEBrAmCgQhgKAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkg4fwcgHcIMYICgAADSAAAAEBcA8wrGHgKAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRklI/wTgLEAwkACgAADSAAAAEBWBTkBIxiaAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkqA/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkxg/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo=";var pe=class e{constructor(){this.idCaptured=Feedback.defaultFeedback;this.idRejected=new Feedback(null,null);}static get defaultFeedback(){return new e}static get defaultSuccessSound(){return Sound.defaultSound}static get defaultFailureSound(){return new Sound(mt)}toJSONObject(){return {idCaptured:this.idCaptured.toJSONObject(),idRejected:this.idRejected.toJSONObject()}}};var P=(u=>(u.Passport="passport",u.IdCard="idCard",u.DriverLicense="driverLicense",u.VisaIcao="visaIcao",u.ResidencePermit="residencePermit",u.HealthInsuranceCard="healthInsuranceCard",u.RegionSpecific="regionSpecific",u))(P||{}),f=class{constructor(t){this._region=t;}get region(){return this._region}isPassport(){return this.documentType==="passport"}isIdCard(){return this.documentType==="idCard"}isDriverLicense(){return this.documentType==="driverLicense"}isVisaIcao(){return this.documentType==="visaIcao"}isHealthInsuranceCard(){return this.documentType==="healthInsuranceCard"}isResidencePermit(){return this.documentType==="residencePermit"}isRegionSpecific(){return this.documentType==="regionSpecific"}};var Ae=class e{constructor(){this.json={};}get errorCorrection(){return this.json.errorCorrection}get moduleCountX(){return this.json.moduleCountX}get moduleCountY(){return this.json.moduleCountY}static fromJSON(t){if(t==null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {errorCorrection:this.errorCorrection,moduleCountX:this.moduleCountX,moduleCountY:this.moduleCountY}}};var I=class e{constructor(){this.json={};}get day(){return this.json.day}get month(){return this.json.month}get year(){return this.json.year}static fromJSON(t){if(t==null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {day:this.day,month:this.month,year:this.year}}};var he=class e{get dateOfExpiry(){var t;return (t=I.fromJSON(this.json.dateOfExpiry))!=null?t:new I}get codes(){return this.json.codes}static fromJSON(t){if(t===null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {codes:[...this.codes],dateOfExpiry:this.dateOfExpiry.toJSONObject()}}};var me=class e{get vehicleCode(){return this.json.vehicleCode}get vehicleRestriction(){return this.json.vehicleRestriction}get dateOfIssue(){var t;return (t=I.fromJSON(this.json.dateOfIssue))!=null?t:new I}static fromJSON(t){if(t===null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {dateOfIssue:this.dateOfIssue.toJSONObject(),vehicleCode:this.vehicleCode,vehicleRestriction:this.vehicleRestriction}}};var Ie=class e{get aamvaVersion(){return this.json.aamvaVersion}get aliasFamilyName(){return this.json.aliasFamilyName}get aliasGivenName(){return this.json.aliasGivenName}get aliasSuffixName(){return this.json.aliasSuffixName}get bloodType(){return this.json.bloodType}get branchOfService(){return this.json.branchOfService}get cardInstanceIdentifier(){return this.json.cardInstanceIdentifier}get cardRevisionDate(){return I.fromJSON(this.json.cardRevisionDate)}get categories(){return this.json.categories!=null?this.json.categories:[]}get champusEffectiveDate(){return I.fromJSON(this.json.champusEffectiveDate)}get champusExpiryDate(){return I.fromJSON(this.json.champusExpiryDate)}get citizenshipStatus(){return this.json.citizenshipStatus}get civilianHealthCareFlagCode(){return this.json.civilianHealthCareFlagCode}get civilianHealthCareFlagDescription(){return this.json.civilianHealthCareFlagDescription}get commissaryFlagCode(){return this.json.commissaryFlagCode}get commissaryFlagDescription(){return this.json.commissaryFlagDescription}get countryOfBirth(){return this.json.countryOfBirth}get countryOfBirthIso(){return this.json.countryOfBirthIso}get deersDependentSuffixCode(){return this.json.deersDependentSuffixCode}get deersDependentSuffixDescription(){return this.json.deersDependentSuffixDescription}get directCareFlagCode(){return this.json.directCareFlagCode}get directCareFlagDescription(){return this.json.directCareFlagDescription}get documentCopy(){return this.json.documentCopy}get documentDiscriminatorNumber(){return this.json.documentDiscriminatorNumber}get driverNamePrefix(){return this.json.driverNamePrefix}get driverNameSuffix(){return this.json.driverNameSuffix}get driverRestrictionCodes(){return this.json.driverRestrictionCodes!=null?this.json.driverRestrictionCodes:[]}get ediPersonIdentifier(){return this.json.ediPersonIdentifier}get endorsementsCode(){return this.json.endorsementsCode}get exchangeFlagCode(){return this.json.exchangeFlagCode}get exchangeFlagDescription(){return this.json.exchangeFlagDescription}get eyeColor(){return this.json.eyeColor}get familySequenceNumber(){return this.json.familySequenceNumber}get firstNameTruncation(){return this.json.firstNameTruncation}get firstNameWithoutMiddleName(){return this.json.firstNameWithoutMiddleName}get formNumber(){return this.json.formNumber}get genevaConventionCategory(){return this.json.genevaConventionCategory}get hairColor(){return this.json.hairColor}get heightCm(){return this.json.heightCm}get heightInch(){return this.json.heightInch}get IIN(){return this.json.iin}get identificationType(){return this.json.identificationType}get issuingJurisdiction(){return this.json.issuingJurisdiction}get issuingJurisdictionIso(){return this.json.issuingJurisdictionIso}get barcodeMetadata(){return Ae.fromJSON(this.json.barcodeMetadata)}get jpegData(){return this.json.jpegData}get jurisdictionVersion(){return this.json.jurisdictionVersion}get lastNameTruncation(){return this.json.lastNameTruncation}get licenseCountryOfIssue(){return this.json.licenseCountryOfIssue}get middleName(){return this.json.middleName}get middleNameTruncation(){return this.json.middleNameTruncation}get mwrFlagCode(){return this.json.mwrFlagCode}get mwrFlagDescription(){return this.json.mwrFlagDescription}get payGrade(){return this.json.payGrade}get payPlanCode(){return this.json.payPlanCode}get payPlanGradeCode(){return this.json.payPlanGradeCode}get personDesignatorDocument(){return this.json.personDesignatorDocument}get personDesignatorTypeCode(){return this.json.personDesignatorTypeCode}get personMiddleInitial(){return this.json.personMiddleInitial}get personalIdNumber(){return this.json.personalIdNumber}get personalIdNumberType(){return this.json.personalIdNumberType}get personnelCategoryCode(){return this.json.personnelCategoryCode}get personnelEntitlementConditionType(){return this.json.personnelEntitlementConditionType}get placeOfBirth(){return this.json.placeOfBirth}get professionalDrivingPermit(){return this.json.professionalDrivingPermit!=null?he.fromJSON(this.json.professionalDrivingPermit):null}get race(){return this.json.race}get rank(){return this.json.rank}get rawData(){return this.json.rawData}get relationshipCode(){return this.json.relationshipCode}get relationshipDescription(){return this.json.relationshipDescription}get restrictionsCode(){return this.json.restrictionsCode}get securityCode(){return this.json.securityCode}get serviceCode(){return this.json.serviceCode}get sponsorFlag(){return this.json.sponsorFlag}get sponsorName(){return this.json.sponsorName}get sponsorPersonDesignatorIdentifier(){return this.json.sponsorPersonDesignatorIdentifier}get statusCode(){return this.json.statusCode}get statusCodeDescription(){return this.json.statusCodeDescription}get vehicleClass(){return this.json.vehicleClass}get vehicleRestrictions(){return this.json.vehicleRestrictions!=null?this.json.vehicleRestrictions.map(t=>me.fromJSON(t)).filter(t=>t!=null):[]}get version(){return this.json.version}get weightKg(){return this.json.weightKg}get weightLbs(){return this.json.weightLbs}get isRealId(){return this.json.isRealId}get barcodeDataElements(){return this.json.dictionary}static fromJSON(t){let a=new e;return a.json=t,a}toJSONObject(){var t,a,r,s,o,c;return {firstName:this.json.firstName,lastName:this.json.lastName,secondaryLastName:this.json.secondaryLastName,fullName:this.json.fullName,sex:this.json.sex,nationality:this.json.nationality,address:this.json.address,issuingCountry:this.json.issuingCountry,issuingCountryIso:this.json.issuingCountryIso,barcodeMetadata:this.barcodeMetadata?this.barcodeMetadata.toJSONObject():null,documentNumber:this.json.documentNumber,documentType:this.json.documentType,documentSubtype:this.json.documentSubtype,documentAdditionalNumber:this.json.documentAdditionalNumber,dateOfBirth:(a=(t=I.fromJSON(this.json.dateOfBirth))==null?void 0:t.toJSONObject())!=null?a:null,dateOfExpiry:(s=(r=I.fromJSON(this.json.dateOfExpiry))==null?void 0:r.toJSONObject())!=null?s:null,dateOfIssue:(c=(o=I.fromJSON(this.json.dateOfIssue))==null?void 0:o.toJSONObject())!=null?c:null,aamvaVersion:this.aamvaVersion,aliasFamilyName:this.aliasFamilyName,aliasGivenName:this.aliasGivenName,aliasSuffixName:this.aliasSuffixName,bloodType:this.bloodType,branchOfService:this.branchOfService,cardInstanceIdentifier:this.cardInstanceIdentifier,cardRevisionDate:this.cardRevisionDate?this.cardRevisionDate.toJSONObject():null,categories:[...this.categories],champusEffectiveDate:this.champusEffectiveDate?this.champusEffectiveDate.toJSONObject():null,champusExpiryDate:this.champusExpiryDate?this.champusExpiryDate.toJSONObject():null,citizenshipStatus:this.citizenshipStatus,civilianHealthCareFlagCode:this.civilianHealthCareFlagCode,civilianHealthCareFlagDescription:this.civilianHealthCareFlagDescription,commissaryFlagCode:this.commissaryFlagCode,commissaryFlagDescription:this.commissaryFlagDescription,countryOfBirth:this.countryOfBirth,countryOfBirthIso:this.countryOfBirthIso,deersDependentSuffixCode:this.deersDependentSuffixCode,deersDependentSuffixDescription:this.deersDependentSuffixDescription,directCareFlagCode:this.directCareFlagCode,directCareFlagDescription:this.directCareFlagDescription,documentCopy:this.documentCopy,documentDiscriminatorNumber:this.documentDiscriminatorNumber,driverNamePrefix:this.driverNamePrefix,driverNameSuffix:this.driverNameSuffix,driverRestrictionCodes:[...this.driverRestrictionCodes],ediPersonIdentifier:this.ediPersonIdentifier,endorsementsCode:this.endorsementsCode,exchangeFlagCode:this.exchangeFlagCode,exchangeFlagDescription:this.exchangeFlagDescription,eyeColor:this.eyeColor,familySequenceNumber:this.familySequenceNumber,firstNameTruncation:this.firstNameTruncation,firstNameWithoutMiddleName:this.firstNameWithoutMiddleName,formNumber:this.formNumber,genevaConventionCategory:this.genevaConventionCategory,hairColor:this.hairColor,heightCm:this.heightCm,heightInch:this.heightInch,iin:this.IIN,identificationType:this.identificationType,issuingJurisdiction:this.issuingJurisdiction,issuingJurisdictionIso:this.issuingJurisdictionIso,jpegData:this.jpegData,jurisdictionVersion:this.jurisdictionVersion,lastNameTruncation:this.lastNameTruncation,licenseCountryOfIssue:this.licenseCountryOfIssue,middleName:this.middleName,middleNameTruncation:this.middleNameTruncation,mwrFlagCode:this.mwrFlagCode,mwrFlagDescription:this.mwrFlagDescription,payGrade:this.payGrade,payPlanCode:this.payPlanCode,payPlanGradeCode:this.payPlanGradeCode,personDesignatorDocument:this.personDesignatorDocument,personDesignatorTypeCode:this.personDesignatorTypeCode,personMiddleInitial:this.personMiddleInitial,personalIdNumber:this.personalIdNumber,personalIdNumberType:this.personalIdNumberType,personnelCategoryCode:this.personnelCategoryCode,personnelEntitlementConditionType:this.personnelEntitlementConditionType,placeOfBirth:this.placeOfBirth,professionalDrivingPermit:this.professionalDrivingPermit?this.professionalDrivingPermit.toJSONObject():null,race:this.race,rank:this.rank,rawData:this.rawData,relationshipCode:this.relationshipCode,relationshipDescription:this.relationshipDescription,restrictionsCode:this.restrictionsCode,securityCode:this.securityCode,serviceCode:this.serviceCode,sponsorFlag:this.sponsorFlag,sponsorName:this.sponsorName,sponsorPersonDesignatorIdentifier:this.sponsorPersonDesignatorIdentifier,statusCode:this.statusCode,statusCodeDescription:this.statusCodeDescription,vehicleClass:this.vehicleClass,vehicleRestrictions:this.vehicleRestrictions.map(u=>u.toJSONObject()),version:this.version,weightKg:this.weightKg,weightLbs:this.weightLbs,isRealId:this.isRealId,dictionary:{...this.barcodeDataElements}}}};var Nt=(a=>(a.FrontOnly="frontOnly",a.FrontAndBack="frontAndBack",a))(Nt||{}),et=(r=>(r.Face="face",r.CroppedDocument="croppedDocument",r.Frame="frame",r))(et||{}),pa=(a=>(a.Front="front",a.Back="back",a))(pa||{}),Ct=(s=>(s.None="none",s.FieldsOnly="fieldsOnly",s.ImagesOnly="imagesOnly",s.FieldsAndImages="fieldsAndImages",s))(Ct||{}),gt=(a=>(a.Auto="auto",a.ButtonTap="buttonTap",a))(gt||{}),Aa=(a=>(a.Rounded="rounded",a.Square="square",a))(Aa||{}),ha=(a=>(a.Light="light",a.Bold="bold",a))(ha||{}),ma=(r=>(r.NotAvailable="notAvailable",r.NotRealIdCompliant="notRealIdCompliant",r.RealIdCompliant="realIdCompliant",r))(ma||{}),Ia=(r=>(r.Female="female",r.Male="male",r.Unspecified="unspecified",r))(Ia||{});var Se=class e{constructor(){this.json=null;}get face(){var t,a;return (a=(t=this.json)==null?void 0:t.front.face)!=null?a:null}get frame(){var t,a,r,s;return (s=(r=(t=this.json)==null?void 0:t.front.frame)!=null?r:(a=this.json)==null?void 0:a.back.frame)!=null?s:null}static fromJSON(t){let a=new e;return t!=null&&(a.json=t),a}getFrame(t){var a,r,s,o;switch(t){case"front":return (r=(a=this.json)==null?void 0:a.front.frame)!=null?r:null;case"back":return (o=(s=this.json)==null?void 0:s.back.frame)!=null?o:null}return null}getCroppedDocument(t){var a,r,s,o;switch(t){case"front":return (r=(a=this.json)==null?void 0:a.front.croppedDocument)!=null?r:null;case"back":return (o=(s=this.json)==null?void 0:s.back.croppedDocument)!=null?o:null}return null}toJSONObject(){return {front:{face:this.face,croppedDocument:this.getCroppedDocument("front"),frame:this.getFrame("front")},back:{face:null,croppedDocument:this.getCroppedDocument("back"),frame:this.getFrame("back")}}}};var Ne=class e{get documentCode(){return this.json.documentCode}get namesAreTruncated(){return this.json.namesAreTruncated}get optional(){return this.json.optional}get optional1(){return this.json.optional1}get capturedMrz(){return this.json.capturedMrz}get personalIdNumber(){return this.json.personalIdNumber}get renewalTimes(){return this.json.renewalTimes}get fullNameSimplifiedChinese(){return this.json.fullNameSimplifiedChinese}get omittedCharacterCountInGbkName(){return this.json.omittedCharacterCountInGbkName}get omittedNameCount(){return this.json.omittedNameCount}get issuingAuthorityCode(){return this.json.issuingAuthorityCode}get passportIssuerIso(){return this.json.passportIssuerIso}get passportNumber(){return this.json.passportNumber}get passportDateOfExpiry(){return I.fromJSON(this.json.passportDateOfExpiry)}static fromJSON(t){let a=new e;return a.json=t,a}toJSONObject(){return {...this.json,documentCode:this.documentCode,namesAreTruncated:this.namesAreTruncated,optional:this.optional,optional1:this.optional1,capturedMrz:this.capturedMrz,personalIdNumber:this.personalIdNumber,renewalTimes:this.renewalTimes,fullNameSimplifiedChinese:this.fullNameSimplifiedChinese,omittedCharacterCountInGbkName:this.omittedCharacterCountInGbkName,omittedNameCount:this.omittedNameCount,issuingAuthorityCode:this.issuingAuthorityCode,passportIssuerIso:this.passportIssuerIso,passportNumber:this.passportNumber,passportDateOfExpiry:this.passportDateOfExpiry?this.passportDateOfExpiry.toJSONObject():null}}};var Ce=class e{constructor(){this.json={};}get code(){return this.json.code}get dateOfIssue(){return I.fromJSON(this.json.dateOfIssue)}get dateOfExpiry(){return I.fromJSON(this.json.dateOfExpiry)}static fromJSON(t){if(t==null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {code:this.code,dateOfIssue:this.dateOfIssue?this.dateOfIssue.toJSONObject():null,dateOfExpiry:this.dateOfExpiry?this.dateOfExpiry.toJSONObject():null}}};var j=class e{constructor(){this.json={};}get drivingLicenseCategories(){return this.json.drivingLicenseCategories.map(t=>Ce.fromJSON(t)).filter(t=>t!=null)}get restrictions(){return this.json.restrictions}get endorsements(){return this.json.endorsements}static fromJSON(t){if(t==null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {drivingLicenseCategories:this.drivingLicenseCategories.map(t=>t.toJSONObject()),restrictions:this.restrictions,endorsements:this.endorsements}}};var ge=class e{get firstName(){return this.json.firstName}get lastName(){return this.json.lastName}get secondaryLastName(){return this.json.secondaryLastName}get fullName(){return this.json.fullName}get additionalAddressInformation(){return this.json.additionalAddressInformation}get additionalNameInformation(){return this.json.additionalNameInformation}get documentAdditionalNumber(){return this.json.documentAdditionalNumber}get employer(){return this.json.employer}get issuingAuthority(){return this.json.issuingAuthority}get issuingJurisdiction(){return this.json.issuingJurisdiction}get issuingJurisdictionIso(){return this.json.issuingJurisdictionIso}get maritalStatus(){return this.json.maritalStatus}get personalIdNumber(){return this.json.personalIdNumber}get placeOfBirth(){return this.json.placeOfBirth}get profession(){return this.json.profession}get race(){return this.json.race}get religion(){return this.json.religion}get residentialStatus(){return this.json.residentialStatus}get mothersName(){return this.json.mothersName}get fathersName(){return this.json.fathersName}get capturedSides(){return this.json.capturedSides}get isBackSideCaptureSupported(){return this.json.isBackSideCaptureSupported}get drivingLicenseDetails(){return j.fromJSON(this.json.drivingLicenseDetails)}get bloodType(){return this.json.bloodType}get sponsor(){return this.json.sponsor}get visaNumber(){return this.json.visaNumber}get passportNumber(){return this.json.passportNumber}static fromJSON(t){let a=new e;return a.json=t,a}toJSONObject(){return {...this.json,firstName:this.firstName,lastName:this.lastName,secondaryLastName:this.secondaryLastName,fullName:this.fullName,additionalAddressInformation:this.additionalAddressInformation,additionalNameInformation:this.additionalNameInformation,documentAdditionalNumber:this.documentAdditionalNumber,employer:this.employer,issuingAuthority:this.issuingAuthority,issuingJurisdiction:this.issuingJurisdiction,issuingJurisdictionIso:this.issuingJurisdictionIso,maritalStatus:this.maritalStatus,personalIdNumber:this.personalIdNumber,placeOfBirth:this.placeOfBirth,profession:this.profession,race:this.race,religion:this.religion,residentialStatus:this.residentialStatus,mothersName:this.mothersName,fathersName:this.fathersName,capturedSides:this.capturedSides,isBackSideCaptureSupported:this.isBackSideCaptureSupported,drivingLicenseDetails:this.drivingLicenseDetails?this.drivingLicenseDetails.toJSONObject():null,bloodType:this.bloodType,sponsor:this.sponsor,passportNumber:this.passportNumber,visaNumber:this.visaNumber}}};var J=class e{constructor(){this.json={};}get allChecksPassed(){return this.json.allChecksPassed}get failedChecks(){return this.json.failedChecks}get skippedChecks(){return this.json.skippedChecks}get passedChecks(){return this.json.passedChecks}static fromJSON(t){let a=new e;return a.json=t,a}async frontReviewImage(){let t=this.json.frontFieldLocations,a=t!=null&&Object.keys(t).length>0;if(!this.allChecksPassed){let r=this.json.frontImage;if(r!=null)try{if(a)return await this.highlightImage(r,t)}catch(s){Logger.log(Logger.Level.Warn,"Failed to create image with mismatching fields.",s);}}return ""}toJSONObject(){return {...this.json}}pushQuadForKey(t,a,r){let s=t[r];return s!=null?(a.push(Quadrilateral.fromJSON(s)),!0):!1}pushQuadsForKeys(t,a,r,s=[]){if(!this.pushQuadForKey(t,a,r))for(let o of s)this.pushQuadForKey(t,a,o);}getMismatchedQuads(t){let a=[];return t!=null&&(this.failedChecks.includes("documentNumberComparison")&&this.pushQuadsForKeys(t,a,"documentNumber"),this.failedChecks.includes("fullNameComparison")&&this.pushQuadsForKeys(t,a,"fullName",["firstName","lastName"]),this.failedChecks.includes("dateOfBirthComparison")&&this.pushQuadsForKeys(t,a,"dateOfBirth"),this.failedChecks.includes("dateOfExpiryComparison")&&this.pushQuadsForKeys(t,a,"dateOfExpiry"),this.failedChecks.includes("dateOfIssueComparison")&&this.pushQuadsForKeys(t,a,"dateOfIssue")),a}async highlightImage(t,a){let r=new Image;r.src=`data:image/png;base64,${t}`,await r.decode();let s=document.createElement("canvas");s.width=r.width,s.height=r.height;let o=s.getContext("2d");o.drawImage(r,0,0);let c=this.getMismatchedQuads(a);if(c.length===0)return "";o.beginPath(),o.rect(0,0,r.width,r.height);for(let u of c)o.moveTo(u.topLeft.x,u.topLeft.y),o.lineTo(u.topLeft.x,u.bottomRight.y),o.lineTo(u.bottomRight.x,u.bottomRight.y),o.lineTo(u.bottomRight.x,u.topLeft.y),o.lineTo(u.topLeft.x,u.topLeft.y);o.fillStyle="rgba(0, 0, 0, 0.30)",o.fill(),o.lineWidth=3,o.strokeStyle="red",o.beginPath();for(let u of c)o.rect(u.topLeft.x,u.topLeft.y,u.bottomRight.x-u.topLeft.x,u.bottomRight.y-u.topLeft.y);return o.stroke(),s.toDataURL("image/jpeg",1)}};var se=class e{get dataConsistency(){let t=this.json.rejectsInconsistentData;return this.json.dataConsistencyResult!=null&&t?J.fromJSON(this.json.dataConsistencyResult):null}static fromJSON(t){let a=new e;return a.json=t,a}toJSONObject(){return {...this.json}}};var K=class extends f{constructor(a){super(a);this.documentType="driverLicense";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var Z=class extends f{constructor(a){super(a);this.documentType="healthInsuranceCard";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var Y=class extends f{constructor(a){super(a);this.documentType="idCard";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var Q=class extends f{constructor(a){super(a);this.documentType="passport";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var Na=(i=>(i.Any="any",i.EuAndSchengen="euAndSchengen",i.Aruba="aruba",i.Afghanistan="afghanistan",i.Angola="angola",i.Anguilla="anguilla",i.AlandIslands="alandIslands",i.Albania="albania",i.Andorra="andorra",i.Uae="uae",i.Argentina="argentina",i.Armenia="armenia",i.AmericanSamoa="americanSamoa",i.Antarctica="antarctica",i.FrenchSouthernTerritories="frenchSouthernTerritories",i.AntiguaAndBarbuda="antiguaAndBarbuda",i.Australia="australia",i.Austria="austria",i.Azerbaijan="azerbaijan",i.Burundi="burundi",i.Belgium="belgium",i.Benin="benin",i.BonaireSintEustatiusAndSaba="bonaireSintEustatiusAndSaba",i.BurkinaFaso="burkinaFaso",i.Bangladesh="bangladesh",i.Bulgaria="bulgaria",i.Bahrain="bahrain",i.Bahamas="bahamas",i.BosniaHerzegovina="bosniaHerzegovina",i.SaintBarthelemy="saintBarthelemy",i.Belarus="belarus",i.Belize="belize",i.Bermuda="bermuda",i.Bolivia="bolivia",i.Brazil="brazil",i.Barbados="barbados",i.BruneiDarussalam="bruneiDarussalam",i.Bhutan="bhutan",i.BouvetIsland="bouvetIsland",i.Botswana="botswana",i.Car="car",i.Canada="canada",i.CocosIslands="cocosIslands",i.Switzerland="switzerland",i.Chile="chile",i.China="china",i.CoteIvoire="coteIvoire",i.Cameroon="cameroon",i.DemocraticRepublicOfCongo="democraticRepublicOfCongo",i.Congo="congo",i.CookIslands="cookIslands",i.Colombia="colombia",i.Comoros="comoros",i.CaboVerde="caboVerde",i.CostaRica="costaRica",i.Cuba="cuba",i.Curacao="curacao",i.ChristmasIsland="christmasIsland",i.CaymanIslands="caymanIslands",i.Cyprus="cyprus",i.Czechia="czechia",i.Germany="germany",i.Djibouti="djibouti",i.Dominica="dominica",i.Denmark="denmark",i.DominicanRepublic="dominicanRepublic",i.Algeria="algeria",i.Ecuador="ecuador",i.Egypt="egypt",i.Eritrea="eritrea",i.WesternSahara="westernSahara",i.Spain="spain",i.Estonia="estonia",i.Ethiopia="ethiopia",i.Finland="finland",i.Fiji="fiji",i.FalklandIslands="falklandIslands",i.France="france",i.FaroeIslands="faroeIslands",i.Micronesia="micronesia",i.Gabon="gabon",i.Uk="uk",i.Georgia="georgia",i.Guernsey="guernsey",i.Ghana="ghana",i.Gibraltar="gibraltar",i.Guinea="guinea",i.Guadeloupe="guadeloupe",i.Gambia="gambia",i.GuineaBissau="guineaBissau",i.EquatorialGuinea="equatorialGuinea",i.Greece="greece",i.Grenada="grenada",i.Greenland="greenland",i.Guatemala="guatemala",i.FrenchGuiana="frenchGuiana",i.Guam="guam",i.Guyana="guyana",i.HongKong="hongKong",i.HeardIslandAndMcDonaldIslands="heardIslandAndMcDonaldIslands",i.Honduras="honduras",i.Croatia="croatia",i.Haiti="haiti",i.Hungary="hungary",i.Indonesia="indonesia",i.IsleOfMan="isleOfMan",i.India="india",i.BritishIndianOceanTerritory="britishIndianOceanTerritory",i.Ireland="ireland",i.Iran="iran",i.Iraq="iraq",i.Iceland="iceland",i.Israel="israel",i.Italy="italy",i.Jamaica="jamaica",i.Jersey="jersey",i.Jordan="jordan",i.Japan="japan",i.Kazakhstan="kazakhstan",i.Kenya="kenya",i.Kyrgyzstan="kyrgyzstan",i.Cambodia="cambodia",i.Kiribati="kiribati",i.SaintKittsAndNevis="saintKittsAndNevis",i.SouthKorea="southKorea",i.Kuwait="kuwait",i.Lao="lao",i.Lebanon="lebanon",i.Liberia="liberia",i.Libya="libya",i.SaintLucia="saintLucia",i.Liechtenstein="liechtenstein",i.SriLanka="sriLanka",i.Lesotho="lesotho",i.Lithuania="lithuania",i.Luxembourg="luxembourg",i.Latvia="latvia",i.Macao="macao",i.FrenchSaintMartin="frenchSaintMartin",i.Morocco="morocco",i.Monaco="monaco",i.Moldova="moldova",i.Madagascar="madagascar",i.Maldives="maldives",i.Mexico="mexico",i.MarshallIslands="marshallIslands",i.NorthMacedonia="northMacedonia",i.Mali="mali",i.Malta="malta",i.Myanmar="myanmar",i.Montenegro="montenegro",i.Mongolia="mongolia",i.NorthernMarianaIslands="northernMarianaIslands",i.Mozambique="mozambique",i.Mauritania="mauritania",i.Montserrat="montserrat",i.Martinique="martinique",i.Mauritius="mauritius",i.Malawi="malawi",i.Malaysia="malaysia",i.Mayotte="mayotte",i.Namibia="namibia",i.NewCaledonia="newCaledonia",i.Niger="niger",i.NorfolkIsland="norfolkIsland",i.Nigeria="nigeria",i.Nicaragua="nicaragua",i.Niue="niue",i.Netherlands="netherlands",i.Norway="norway",i.Nepal="nepal",i.Nauru="nauru",i.NewZealand="newZealand",i.Oman="oman",i.Pakistan="pakistan",i.Panama="panama",i.Pitcairn="pitcairn",i.Peru="peru",i.Philippines="philippines",i.Palau="palau",i.PapuaNewGuinea="papuaNewGuinea",i.Poland="poland",i.PuertoRico="puertoRico",i.NorthKorea="northKorea",i.Portugal="portugal",i.Paraguay="paraguay",i.Palestine="palestine",i.FrenchPolynesia="frenchPolynesia",i.Qatar="qatar",i.Reunion="reunion",i.Romania="romania",i.Russia="russia",i.Rwanda="rwanda",i.SaudiArabia="saudiArabia",i.Sudan="sudan",i.Senegal="senegal",i.Singapore="singapore",i.SouthGeorgiaAndTheSouthSandwichIslands="southGeorgiaAndTheSouthSandwichIslands",i.SaintHelena="saintHelena",i.SvalbardAndJanMayen="svalbardAndJanMayen",i.SolomonIslands="solomonIslands",i.SierraLeone="sierraLeone",i.ElSalvador="elSalvador",i.SanMarino="sanMarino",i.Somalia="somalia",i.SaintPierreAndMiquelon="saintPierreAndMiquelon",i.Serbia="serbia",i.SouthSudan="southSudan",i.SaoTomeAndPrincipe="saoTomeAndPrincipe",i.Suriname="suriname",i.Slovakia="slovakia",i.Slovenia="slovenia",i.Sweden="sweden",i.Eswatini="eswatini",i.DutchSintMaarten="dutchSintMaarten",i.Seychelles="seychelles",i.Syria="syria",i.TurksAndCaicosIslands="turksAndCaicosIslands",i.Chad="chad",i.Togo="togo",i.Thailand="thailand",i.Tajikistan="tajikistan",i.Tokelau="tokelau",i.Turkmenistan="turkmenistan",i.TimorLeste="timorLeste",i.Tonga="tonga",i.TrinidadAndTobago="trinidadAndTobago",i.Tunisia="tunisia",i.Turkey="turkey",i.Tuvalu="tuvalu",i.Taiwan="taiwan",i.Tanzania="tanzania",i.Uganda="uganda",i.Ukraine="ukraine",i.UsMinorOutlyingIslands="usMinorOutlyingIslands",i.Uruguay="uruguay",i.Us="us",i.Uzbekistan="uzbekistan",i.HolySee="holySee",i.SaintVincentAndTheGrenadines="saintVincentAndTheGrenadines",i.Venezuela="venezuela",i.BritishVirginIslands="britishVirginIslands",i.UsVirginIslands="usVirginIslands",i.Vietnam="vietnam",i.Vanuatu="vanuatu",i.WallisAndFutuna="wallisAndFutuna",i.Samoa="samoa",i.Kosovo="kosovo",i.Yemen="yemen",i.SouthAfrica="southAfrica",i.Zambia="zambia",i.Zimbabwe="zimbabwe",i))(Na||{});var X=class extends f{constructor(a){super("any");this.documentType="regionSpecific";this.subtype=a;}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType,documentSubtype:this.subtype}}};var $=class extends f{constructor(a){super(a);this.documentType="residencePermit";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var ee=class extends f{constructor(a){super(a);this.documentType="visaIcao";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var ne=class e{get firstName(){return this.json.firstName}get lastName(){return this.json.lastName}get secondaryLastName(){return this.json.secondaryLastName}get fullName(){return this.json.fullName}get sexType(){return this.json.sex}get sex(){return this.json.sex}get dateOfBirth(){return I.fromJSON(this.json.dateOfBirth)}get age(){return this.json.age}get nationality(){return this.json.nationality}get address(){return this.json.address}get document(){if(this.json.documentType!=null){let t=this.json.documentType,a=this.json.documentSubtype,r=this.issuingCountry;switch(t){case"passport":return new Q(r);case"idCard":return new Y(r);case"driverLicense":return new K(r);case"visaIcao":return new ee(r);case"residencePermit":return new $(r);case"healthInsuranceCard":return new Z(r);case"regionSpecific":return new X(a);}}return null}get issuingCountryIso(){return this.json.issuingCountryIso}get issuingCountry(){return this.json.issuingCountry}get documentNumber(){return this.json.documentNumber}get documentAdditionalNumber(){return this.json.documentAdditionalNumber}get dateOfExpiry(){return I.fromJSON(this.json.dateOfExpiry)}get isExpired(){return this.json.isExpired}get dateOfIssue(){return I.fromJSON(this.json.dateOfIssue)}get usRealIdStatus(){var t,a;if(((t=this.json.vizResult)==null?void 0:t.usRealIdStatus)!=null&&this.json.vizResult.usRealIdStatus!=="notAvailable")return this.json.vizResult.usRealIdStatus;switch((a=this.barcode)==null?void 0:a.isRealId){case!0:return "realIdCompliant";case!1:return "notRealIdCompliant";default:return "notAvailable"}}get barcode(){var t;return this._barcodeResult==null&&this.json.barcodeResult!=null&&(this._barcodeResult=Ie.fromJSON(this.json.barcodeResult)),(t=this._barcodeResult)!=null?t:null}get mrzResult(){var t;return this._mrzResult==null&&this.json.mrzResult!=null&&(this._mrzResult=Ne.fromJSON(this.json.mrzResult)),(t=this._mrzResult)!=null?t:null}get vizResult(){var t;return this._vizResult==null&&this.json.vizResult!=null&&(this._vizResult=ge.fromJSON(this.json.vizResult)),(t=this._vizResult)!=null?t:null}get verificationResult(){var t;return this._verificationResult==null&&this.json.verificationResult!=null&&(this._verificationResult=se.fromJSON(this.json.verificationResult)),(t=this._verificationResult)!=null?t:new se}get images(){return Se.fromJSON(this.json.imageInfo)}get barcodeResultsJSON(){var t,a;return {barcodeResult:(a=(t=this.barcode)==null?void 0:t.toJSONObject())!=null?a:null}}get mrzResultsJSON(){return {mrzResult:this.mrzResult?this.mrzResult.toJSONObject():null}}static fromJSON(t){let a=new e;return a.json=t,a}isIdCard(){var t,a;return (a=(t=this.document)==null?void 0:t.isIdCard())!=null?a:!1}isDriverLicense(){var t,a;return (a=(t=this.document)==null?void 0:t.isDriverLicense())!=null?a:!1}isPassport(){var t,a;return (a=(t=this.document)==null?void 0:t.isPassport())!=null?a:!1}isVisaIcao(){var t,a;return (a=(t=this.document)==null?void 0:t.isVisaIcao())!=null?a:!1}isRegionSpecific(t){return this.document?this.document.isRegionSpecific()&&this.document.subtype===t:!1}isResidencePermit(){var t,a;return (a=(t=this.document)==null?void 0:t.isResidencePermit())!=null?a:!1}isHealthInsuranceCard(){var t,a;return (a=(t=this.document)==null?void 0:t.isHealthInsuranceCard())!=null?a:!1}toJSONObject(){var t;return {firstName:this.firstName,lastName:this.lastName,secondaryLastName:this.secondaryLastName,fullName:this.fullName,sex:this.sex,nationality:this.nationality,address:this.address,issuingCountry:this.issuingCountry,issuingCountryIso:this.issuingCountryIso,documentNumber:this.documentNumber,documentAdditionalNumber:this.documentAdditionalNumber,dateOfBirth:this.dateOfBirth?this.dateOfBirth.toJSONObject():null,age:this.age,dateOfExpiry:this.dateOfExpiry?this.dateOfExpiry.toJSONObject():null,isExpired:this.isExpired,dateOfIssue:this.dateOfIssue?this.dateOfIssue.toJSONObject():null,documentType:this.document?this.document.documentType:null,documentSubtype:((t=this.document)==null?void 0:t.isRegionSpecific())==null?null:this.document.subtype,imageInfo:this.images.toJSONObject(),verificationResult:this.verificationResult?this.verificationResult.toJSONObject():null,vizResult:this.vizResult?this.vizResult.toJSONObject():null,idVerificationDataComparisonAvailable:this.json.idVerificationDataComparisonAvailable,usRealIdStatus:this.usRealIdStatus,...this.barcodeResultsJSON,...this.mrzResultsJSON}}};var tt=0;function Ca(){let e=tt;return tt=tt+1,e}var E=class{constructor(t){this.action=t,this.messageID=Ca();}},fe=class e extends E{constructor(t,a){super(e.action),this.wasmModuleName=t.wasmModuleName,this.licenseKey=t.licenseKey,this.userId=a,this.registerLoadCallback=t.loadProgressCallback!==null,this.allowHelloMessage=t.allowHelloMessage,this.engineLocation=t.engineLocation,this.wasmType=t.wasmType,this.initialMemory=t.initialMemory,this.blinkIDVariant=t.blinkIdVariant,this.numberOfWorkers=t.numberOfWorkers;}};fe.action="init";var te;(function(e){e[e.Any=0]="Any",e[e.Recognizer=1]="Recognizer",e[e.RecognizerSettings=2]="RecognizerSettings",e[e.Callback=3]="Callback";})(te||(te={}));var Re=class e extends E{constructor(t,a){super(e.action),this.className=t,this.params=a;}};Re.action="createNewNativeObject";var Ee=class e extends E{constructor(t,a,r){super(e.action),this.recognizerHandles=t,this.allowMultipleResults=a,this.registeredMetadataCallbacks=r;}};Ee.action="createRecognizerRunner";var De=class e extends E{constructor(t,a){super(e.action),this.recognizerHandles=t,this.allowMultipleResults=a;}};De.action="reconfigureRecognizerRunner";var Oe=class e extends E{constructor(){super(e.action);}};Oe.action="deleteRecognizerRunner";var q=class e extends E{constructor(t,a,r){super(e.action),this.objectHandle=t,this.methodName=a,this.params=r;}};q.action="invokeObject";var be=class e extends E{constructor(t){super(e.action),this.frame=t;}getTransferrables(){return [this.frame.imageData.data.buffer]}};be.action="processImage";var _e=class e extends E{constructor(t){super(e.action),this.hardReset=t;}};_e.action="resetRecognizers";var at=class{constructor(){this.onDebugText=!1,this.onDetectionFailed=!1,this.onQuadDetection=!1,this.onPointsDetection=!1,this.onFirstSideResult=!1;}},Te=class e extends E{constructor(t){super(e.action),this.registeredMetadataCallbacks=t;}};Te.action="registerMetadataCallbacks";var Le=class e extends E{constructor(t){super(e.action),this.detectionOnlyMode=t;}};Le.action="setDetectionOnly";var ve=class e extends E{constructor(t){super(e.action),this.cameraPreviewMirrored=t;}};ve.action="setCameraPreviewMirrored";var Me=class e extends E{constructor(t){super(e.action),this.userId=t;}};Me.action="getProductIntegrationInfo";var we=class e extends E{constructor(t){super(e.action),this.pingProxyUrl=t;}};we.action="setPingProxyUrl";var Pe=class e extends E{constructor(t){super(e.action),this.data=t;}};Pe.action="setPingData";var v;(function(e){e[e.onDebugText=0]="onDebugText",e[e.onDetectionFailed=1]="onDetectionFailed",e[e.onQuadDetection=2]="onQuadDetection",e[e.onPointsDetection=3]="onPointsDetection",e[e.onFirstSideResult=4]="onFirstSideResult",e[e.recognizerCallback=5]="recognizerCallback";})(v||(v={}));var U;(function(e){e.Basic="BASIC",e.Advanced="ADVANCED",e.AdvancedWithThreads="ADVANCED_WITH_THREADS";})(U||(U={}));var ga=atob("Q2VudGF1cnVz"),R=class extends Error{constructor(t,a){if(super(),!t.code||!t.message)throw new Error("Instance of SDKError is required to have code and message.");if(this.message=t.message,this.code=t.code,"details"in t){if("message"in t.details){let r=new Error(t.details.message);"stack"in t.details&&(r.stack=t.details.stack),this.details=r;}}else this.details=a;}};function fa(e){return /^https:\/\/[^\/]+(?::\d+)?\/?$/.test(e)}var A;(function(e){e.WORKER_WASM_LOAD_FAILURE="WORKER_WASM_LOAD_FAILURE",e.WORKER_WASM_INIT_MISSING="WORKER_WASM_INIT_MISSING",e.WORKER_FUNCTION_INVOKE_FAILURE="WORKER_FUNCTION_INVOKE_FAILURE",e.WORKER_RECOGNIZER_CREATION_FAILURE="WORKER_RECOGNIZER_CREATION_FAILURE",e.WORKER_RUNNER_EXISTS="WORKER_RUNNER_EXISTS",e.WORKER_RUNNER_CREATION_FAILURE="WORKER_RUNNER_CREATION_FAILURE",e.WORKER_RUNNER_MISSING="WORKER_RUNNER_MISSING",e.WORKER_RUNNER_RECONFIGURE_FAILURE="WORKER_RUNNER_RECONFIGURE_FAILURE",e.WORKER_RUNNER_DELETED="WORKER_RUNNER_DELETED",e.WORKER_RUNNER_DELETE_FAILURE="WORKER_RUNNER_DELETE_FAILURE",e.WORKER_OBJECT_INVOKE_FAILURE="WORKER_OBJECT_INVOKE_FAILURE",e.WORKER_IMAGE_PROCESS_FAILURE="WORKER_IMAGE_PROCESS_FAILURE",e.WORKER_HANDLE_UNDEFINED="WORKER_HANDLE_UNDEFINED",e.WORKER_MESSAGE_ACTION_UNKNOWN="WORKER_MESSAGE_ACTION_UNKNOWN",e.WORKER_LICENSE_UNLOCK_ERROR="WORKER_LICENSE_UNLOCK_ERROR",e.WORKER_INTEGRATION_INFO_FAILURE="WORKER_INTEGRATION_INFO_FAILURE",e.LOCAL_SDK_RUNNER_MISSING="LOCAL_SDK_RUNNER_MISSING",e.LOCAL_SDK_RUNNER_EMPTY="LOCAL_SDK_RUNNER_EMPTY",e.LICENSE_UNLOCK_ERROR="LICENSE_UNLOCK_ERROR",e.FRAME_CAPTURE_SVG_UNSUPPORTED="FRAME_CAPTURE_SVG_UNSUPPORTED",e.FRAME_CAPTURE_CANVAS_MISSING="FRAME_CAPTURE_CANVAS_MISSING",e.SDK_WASM_SETTINGS_MISSING="SDK_WASM_SETTINGS_MISSING",e.SDK_LICENSE_KEY_MISSING="SDK_LICENSE_KEY_MISSING",e.SDK_WASM_MODULE_NAME_MISSING="SDK_WASM_MODULE_NAME_MISSING",e.SDK_ENGINE_LOCATION_INVALID="SDK_ENGINE_LOCATION_INVALID",e.SDK_WORKER_LOCATION_INVALID="SDK_WORKER_LOCATION_INVALID",e.SDK_MISSING="SDK_MISSING",e.SDK_RECOGNIZERS_MISSING="SDK_RECOGNIZERS_MISSING",e.VIDEO_RECOGNIZER_ELEMENT_MISSING="VIDEO_RECOGNIZER_ELEMENT_MISSING",e.VIDEO_RECOGNIZER_CAMERA_MISSING="VIDEO_RECOGNIZER_CAMERA_MISSING",e.VIDEO_RECOGNIZER_CAMERA_NOT_ALLOWED="VIDEO_RECOGNIZER_CAMERA_NOT_ALLOWED",e.VIDEO_RECOGNIZER_CAMERA_UNAVAILABLE="VIDEO_RECOGNIZER_CAMERA_UNAVAILABLE",e.VIDEO_RECOGNIZER_CAMERA_IN_USE="VIDEO_RECOGNIZER_CAMERA_IN_USE",e.VIDEO_RECOGNIZER_MEDIA_DEVICES_UNSUPPORTED="VIDEO_RECOGNIZER_MEDIA_DEVICES_UNSUPPORTED",e.VIDEO_RECOGNIZER_FEED_RELEASED="VIDEO_RECOGNIZER_FEED_RELEASED",e.VIDEO_RECOGNIZER_FEED_NOT_PAUSED="VIDEO_RECOGNIZER_FEED_NOT_PAUSED",e.VIDEO_RECOGNIZER_PLAY_REQUEST_INTERRUPTED="VIDEO_RECOGNIZER_PLAY_REQUEST_INTERRUPTED",e.VIDEO_RECOGNIZER_FEED_PAUSED="VIDEO_RECOGNIZER_FEED_PAUSED",e.VIDEO_RECOGNIZER_RECOGNIZERS_RESET_FAILURE="VIDEO_RECOGNIZER_RECOGNIZERS_RESET_FAILURE",e.VIDEO_RECOGNIZER_FEED_MISSING="VIDEO_RECOGNIZER_FEED_MISSING",e.INVALID_PING_PROXY_URL="INVALID_PROXY_URL",e.PING_PROXY_PERMISSION_NOT_GRANTED="PING_PROXY_PERMISSION_NOT_GRANTED",e.PING_DATA_KEYS_AMOUNT_EXCEEDED="PING_DATA_KEYS_AMOUNT_EXCEEDED",e.PING_DATA_KEY_LENGTH_EXCEEDED="PING_DATA_KEY_LENGTH_EXCEEDED",e.PING_DATA_VALUE_LENGTH_EXCEEDED="PING_DATA_VALUE_LENGTH_EXCEEDED";})(A||(A={}));var h;(function(e){e.WORKER_HANDLE_UNDEFINED="Cannot find object with handle: undefined",e.WORKER_WASM_LOAD_FAILURE="Failed to load WASM in web worker!",e.WORKER_WASM_INIT_MISSING="WASM module is not initialized!",e.WORKER_FUNCTION_INVOKE_FAILURE="Failed to invoke function!",e.WORKER_RECOGNIZER_CREATION_FAILURE="Failed to create new recognizer!",e.WORKER_RUNNER_EXISTS="Recognizer runner is already created! Multiple instances are not allowed!",e.WORKER_RUNNER_CREATION_FAILURE="Failed to create new recognizer runner!",e.WORKER_RUNNER_MISSING="Recognizer runner is not created! There is nothing to reconfigure!",e.WORKER_RUNNER_RECONFIGURE_FAILURE="Failed to reconfigure recognizer runner!",e.WORKER_RUNNER_DELETED="Recognizer runner is already deleted!",e.WORKER_RUNNER_DELETE_FAILURE="Failed to delete recognizer runner!",e.WORKER_OBJECT_INVOKE_FAILURE="Failed to invoke object!",e.WORKER_IMAGE_PROCESS_FAILURE="Recognizer runner is not initialized! Cannot process image!",e.WORKER_INTEGRATION_INFO_FAILURE="Failed to get product integration info!",e.LOCAL_SDK_RUNNER_MISSING="Property nativeRecognizerRunner is not available!",e.LOCAL_SDK_RUNNER_EMPTY="Native RecognizerRunner cannot be empty!",e.LICENSE_TOKEN_STATE_INCORRECT="Internal error (Incorrect token state)",e.LICENSE_PAYLOAD_VERIFICATION_FAILED="Failed to verify server permission's digital signature!",e.LICENSE_PAYLOAD_CORRUPTED="Server permission payload is corrupted!",e.LICENSE_PERMISSION_EXPIRED="Internal error (server permission expired)",e.LICENSE_REMOTE_LOCKED="Provided license key has been remotely locked. Please contact support for more information!",e.FRAME_CAPTURE_SVG_UNSUPPORTED="Recognition of SVG elements not supported!",e.FRAME_CAPTURE_CANVAS_MISSING="Could not get canvas 2d context!",e.SDK_WASM_SETTINGS_MISSING="Missing WASM load settings!",e.SDK_LICENSE_KEY_MISSING="Missing license key!",e.SDK_WASM_MODULE_NAME_MISSING="Missing WASM module name!",e.SDK_ENGINE_LOCATION_INVALID="Setting property 'engineLocation' must be a string!",e.SDK_WORKER_LOCATION_INVALID="Setting property 'workerLocation' must be a string!",e.SDK_MISSING="SDK is not provided!",e.SDK_RECOGNIZERS_MISSING="To create RecognizerRunner at least 1 recognizer is required.",e.VIDEO_RECOGNIZER_ELEMENT_MISSING="Video element, i.e. camera feed is not provided!",e.VIDEO_RECOGNIZER_CAMERA_MISSING="Camera not found!",e.VIDEO_RECOGNIZER_CAMERA_NOT_ALLOWED="Camera not allowed!",e.VIDEO_RECOGNIZER_CAMERA_UNAVAILABLE="Camera not available!",e.VIDEO_RECOGNIZER_CAMERA_IN_USE="Camera in use!",e.VIDEO_RECOGNIZER_MEDIA_DEVICES_UNSUPPORTED="Media devices not supported by browser.",e.VIDEO_RECOGNIZER_FEED_RELEASED="The associated video feed has been released!",e.VIDEO_RECOGNIZER_FEED_NOT_PAUSED="The associated video feed is not paused. Use resumeRecognition instead!",e.VIDEO_RECOGNIZER_PLAY_REQUEST_INTERRUPTED="The play() request was interrupted or prevented by browser security rules!",e.VIDEO_RECOGNIZER_FEED_PAUSED="Cannot resume recognition while video feed is paused! Use recognize or startRecognition",e.VIDEO_RECOGNIZER_RECOGNIZERS_RESET_FAILURE="Could not reset recognizers!",e.VIDEO_RECOGNIZER_FEED_MISSING="Missing video feed!",e.INVALID_PING_PROXY_URL="Provided ping proxy URL is not a valid secure URL in format 'https://{host}:{port?}'.",e.PING_PROXY_PERMISSION_NOT_GRANTED="Allow ping proxy permission not found in license.",e.PING_DATA_KEYS_AMOUNT_EXCEEDED="Maximum number of ping data keys exceeded.",e.PING_DATA_KEY_LENGTH_EXCEEDED="Ping data key is too long.",e.PING_DATA_VALUE_LENGTH_EXCEEDED="Ping data value is too long.";})(h||(h={}));var y={wasmSettingsMissing:{message:h.SDK_WASM_SETTINGS_MISSING,code:A.SDK_WASM_SETTINGS_MISSING},licenseKeyMissing:{message:h.SDK_LICENSE_KEY_MISSING,code:A.SDK_LICENSE_KEY_MISSING},wasmModuleNameMissing:{message:h.SDK_WASM_MODULE_NAME_MISSING,code:A.SDK_WASM_MODULE_NAME_MISSING},engineLocationInvalid:{message:h.SDK_ENGINE_LOCATION_INVALID,code:A.SDK_ENGINE_LOCATION_INVALID},workerLocationInvalid:{message:h.SDK_WORKER_LOCATION_INVALID,code:A.SDK_WORKER_LOCATION_INVALID},missing:{message:h.SDK_MISSING,code:A.SDK_MISSING},recognizersMissing:{message:h.SDK_RECOGNIZERS_MISSING,code:A.SDK_RECOGNIZERS_MISSING}},Ra={invalidProxyUrl:{message:h.INVALID_PING_PROXY_URL,code:A.INVALID_PING_PROXY_URL},permissionNotGranted:{message:h.PING_PROXY_PERMISSION_NOT_GRANTED,code:A.PING_PROXY_PERMISSION_NOT_GRANTED},dataKeysAmountExceeded:{message:h.PING_DATA_KEYS_AMOUNT_EXCEEDED,code:A.PING_DATA_KEYS_AMOUNT_EXCEEDED},dataKeyLengthExceeded:{message:h.PING_DATA_KEY_LENGTH_EXCEEDED,code:A.PING_DATA_KEY_LENGTH_EXCEEDED},dataValueLengthExceeded:{message:h.PING_DATA_VALUE_LENGTH_EXCEEDED,code:A.PING_DATA_VALUE_LENGTH_EXCEEDED}};function L(e,t){return a=>{let r=a;r.success?e():typeof r.error=="string"||r.error===null?t(r.error):t(new R(r.error));}}function G(e,t){return a=>{let r=a;r.success?e(a):typeof r.error=="string"||r.error===null?t(r.error):t(new R(r.error));}}function Ea(e){let t=[];for(let a of e){let r=te.Any;a instanceof qe&&(r=te.Recognizer,a=a.getRemoteObjectHandle()),t.push({parameter:a,type:r});}return t}var qe=class{constructor(t,a,r){this.wasmSDKWorker=t,this.objectHandle=r,this.recognizerName=a,this.callbacks=new Map;}getRemoteObjectHandle(){return this.objectHandle}currentSettings(){return new Promise((t,a)=>{if(this.objectHandle<0){a("Invalid object handle: "+this.objectHandle.toString());return}let r=new q(this.objectHandle,"currentSettings",[]),s=G(o=>{t(o.result);},a);this.wasmSDKWorker.postMessage(r,s);})}toSignedJSON(){return new Promise((t,a)=>{if(this.objectHandle<0){a("Invalid object handle: "+this.objectHandle.toString());return}let r=new q(this.objectHandle,"toSignedJSON",[]),s=G(o=>{t(o.result);},a);this.wasmSDKWorker.postMessage(r,s);})}clearAllCallbacks(){this.callbacks.clear(),this.wasmSDKWorker.unregisterRecognizerCallbacks(this.objectHandle);}removeFunctions(t){this.clearAllCallbacks();let a=Object.keys(t),r=!1;for(let s of a){let o=t[s];if(typeof o=="function"){this.callbacks.set(s,o);let c={parameter:{recognizerHandle:this.objectHandle,callbackName:s},type:te.Callback};t[s]=c,r=!0;}}return r&&this.wasmSDKWorker.registerRecognizerCallbacks(this.objectHandle,this),t}updateSettings(t){return new Promise((a,r)=>{if(this.objectHandle<0){r("Invalid object handle: "+this.objectHandle.toString());return}let s=new q(this.objectHandle,"updateSettings",[{parameter:this.removeFunctions(t),type:te.RecognizerSettings}]),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}invokeCallback(t,a){let r=this.callbacks.get(t);r!==void 0?r(...a):console.warn("Cannot find callback",t);}getResult(){return new Promise((t,a)=>{if(this.objectHandle<0){a("Invalid object handle: "+this.objectHandle.toString());return}let r=new q(this.objectHandle,"getResult",[]),s=G(o=>{t(o.result);},a);this.wasmSDKWorker.postMessage(r,s);})}delete(){return new Promise((t,a)=>{if(this.objectHandle<0){a("Invalid object handle: "+this.objectHandle.toString());return}this.clearAllCallbacks();let r=new q(this.objectHandle,"delete",[]),s=L(()=>{this.objectHandle=-1,t();},a);this.wasmSDKWorker.postMessage(r,s);})}};function Gt(e){let t=new at;return t.onDebugText=!!e.onDebugText,t.onDetectionFailed=!!e.onDetectionFailed,t.onPointsDetection=!!e.onPointsDetection,t.onQuadDetection=!!e.onQuadDetection,t.onFirstSideResult=!!e.onFirstSideResult,t}var rt=class{constructor(t,a){this.deleted=!1,this.wasmSDKWorker=t,this.recognizers=a;}processImage(t){return new Promise((a,r)=>{if(this.deleted){r("Recognizer runner is deleted. It cannot be used anymore!");return}let s=new be(t),o=G(c=>{let u=c.recognitionState;a(u);},r);this.wasmSDKWorker.postTransferrableMessage(s,o);})}reconfigureRecognizers(t,a){return new Promise((r,s)=>{if(this.deleted){s("Recognizer runner is deleted. It cannot be used anymore!");return}let o=Wt(t),c=new De(o,a),u=L(r,s);this.wasmSDKWorker.postMessage(c,u),this.recognizers=t;})}setMetadataCallbacks(t){return new Promise((a,r)=>{let s=new Te(Gt(t)),o=L(a,r);this.wasmSDKWorker.postMessageAndRegisterCallbacks(s,t,o);})}resetRecognizers(t){return new Promise((a,r)=>{let s=new _e(t),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}setDetectionOnlyMode(t){return new Promise((a,r)=>{let s=new Le(t),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}setPingProxyUrl(t){if(!fa(t))throw new R(Ra.invalidProxyUrl);return new Promise((a,r)=>{let s=new we(t),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}setPingData(t){return new Promise((a,r)=>{let s=new Pe(t),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}setCameraPreviewMirrored(t){return new Promise((a,r)=>{let s=new ve(t),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}delete(){return this.deleted?Promise.reject("Recognizer runner is already deleted."):new Promise((t,a)=>{let r=new Oe,s=L(()=>{this.deleted=!0,t();},a);this.wasmSDKWorker.postMessage(r,s);})}};function Wt(e){let t=[];for(let a of e)t.push(a.getRemoteObjectHandle());return t}var it=class{constructor(t){this.wasmSDKWorker=t;}createRecognizerRunner(t,a=!1,r={}){return new Promise((s,o)=>{let c=Wt(t),u=new Ee(c,a,Gt(r)),m=L(()=>{s(new rt(this.wasmSDKWorker,t));},o);this.wasmSDKWorker.postMessageAndRegisterCallbacks(u,r,m);})}newRecognizer(t,...a){return new Promise((r,s)=>{let o=new Re(t,Ea(a)),c=G(u=>{let m=new qe(this.wasmSDKWorker,t,u.objectHandle);r(m);},s);this.wasmSDKWorker.postMessage(o,c);})}},st=class e{constructor(t,a,r,s){this.eventHandlers={},this.metadataCallbacks={},this.loadedWasmType=U.Basic,this.mbWasmWorker=t,this.mbWasmWorker.onmessage=o=>{this.handleWorkerEvent(o);},this.mbWasmWorker.onerror=()=>{s("Problem during initialization of worker file!");},this.mbWasmModule=new it(this),this.loadCallback=a,this.recognizersWithCallbacks=new Map,this.userId=r,this.showOverlay=!1;}postMessage(t,a){this.eventHandlers[t.messageID]=a,this.mbWasmWorker.postMessage(t);}postTransferrableMessage(t,a){this.eventHandlers[t.messageID]=a,this.mbWasmWorker.postMessage(t,t.getTransferrables());}postMessageAndRegisterCallbacks(t,a,r){this.eventHandlers[t.messageID]=r,this.metadataCallbacks=a,this.mbWasmWorker.postMessage(t);}registerRecognizerCallbacks(t,a){this.recognizersWithCallbacks.set(t,a);}unregisterRecognizerCallbacks(t){this.recognizersWithCallbacks.delete(t);}delete(){this.mbWasmWorker.terminate();}getProductIntegrationInfo(){return new Promise((t,a)=>{let r=new Me(this.userId),s=G(o=>{t(o.result);},a);this.postMessage(r,s);})}handleWorkerEvent(t){if("isCallbackMessage"in t.data){let a=t.data;switch(a.callbackType){case v.onDebugText:typeof this.metadataCallbacks.onDebugText=="function"&&this.metadataCallbacks.onDebugText(a.callbackParameters[0]);break;case v.onDetectionFailed:typeof this.metadataCallbacks.onDetectionFailed=="function"&&this.metadataCallbacks.onDetectionFailed();break;case v.onPointsDetection:typeof this.metadataCallbacks.onPointsDetection=="function"&&this.metadataCallbacks.onPointsDetection(a.callbackParameters[0]);break;case v.onQuadDetection:typeof this.metadataCallbacks.onQuadDetection=="function"&&this.metadataCallbacks.onQuadDetection(a.callbackParameters[0]);break;case v.onFirstSideResult:typeof this.metadataCallbacks.onFirstSideResult=="function"&&this.metadataCallbacks.onFirstSideResult();break;case v.recognizerCallback:{let r=a.callbackParameters.shift(),s=this.recognizersWithCallbacks.get(r.recognizerHandle);s!==void 0?s.invokeCallback(r.callbackName,a.callbackParameters):console.warn("Cannot find recognizer to deliver callback message. Maybe it's destroyed?",r);break}default:throw new Error(`Unknown callback type: ${v[a.callbackType]}`)}}else if("isLoadProgressMessage"in t.data){let a=t.data;typeof this.loadCallback=="function"&&this.loadCallback(a.progress);}else {let a=t.data,r=this.eventHandlers[a.messageID];delete this.eventHandlers[a.messageID],r(a);}}static async createWasmWorker(t,a,r){return new Promise((s,o)=>{let c=new e(t,a.loadProgressCallback,r,o),u=new fe(a,r),m=G(S=>{let g=S;c.showOverlay=g.showOverlay,c.loadedWasmType=g.wasmType,s(c);},S=>{c&&typeof c.delete=="function"&&c.delete(),o(S);});c.postMessage(u,m);})}},Rt;(function(e){e[e.BackFacingCamera=0]="BackFacingCamera",e[e.FrontFacingCamera=1]="FrontFacingCamera";})(Rt||(Rt={}));var ye;(function(e){e[e.RotatedLeft90=0]="RotatedLeft90",e[e.NoRotation=1]="NoRotation",e[e.RotatedRight90=2]="RotatedRight90",e[e.Rotated180=3]="Rotated180";})(ye||(ye={}));var b;(function(e){e[e.Empty=0]="Empty",e[e.Uncertain=1]="Uncertain",e[e.Valid=2]="Valid",e[e.StageValid=3]="StageValid";})(b||(b={}));var Et;(function(e){e[e.Front=0]="Front",e[e.Back=1]="Back";})(Et||(Et={}));var Ue=class{constructor(t,a,r){let s={data:t.data,width:t.width,height:t.height,colorSpace:t.colorSpace};this.imageData=s,this.orientation=a,this.videoFrame=r;}};var Dt;(function(e){e[e.Invalid=0]="Invalid",e[e.RequiresServerPermission=1]="RequiresServerPermission",e[e.Valid=2]="Valid";})(Dt||(Dt={}));var Ot;(function(e){e.LicenseTokenStateInvalid="LICENSE_TOKEN_STATE_INVALID",e.NetworkError="NETWORK_ERROR",e.RemoteLock="REMOTE_LOCK",e.PermissionExpired="PERMISSION_EXPIRED",e.PayloadCorrupted="PAYLOAD_CORRUPTED",e.PayloadSignatureVerificationFailed="PAYLOAD_SIGNATURE_VERIFICATION_FAILED",e.IncorrectTokenState="INCORRECT_TOKEN_STATE";})(Ot||(Ot={}));var bt;(function(e){e[e.Ok=0]="Ok",e[e.NetworkError=1]="NetworkError",e[e.RemoteLock=2]="RemoteLock",e[e.PermissionExpired=3]="PermissionExpired",e[e.PayloadCorrupted=4]="PayloadCorrupted",e[e.PayloadSignatureVerificationFailed=5]="PayloadSignatureVerificationFailed",e[e.IncorrectTokenState=6]="IncorrectTokenState";})(bt||(bt={}));var M;(function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success",e[e.CameraTooFar=2]="CameraTooFar",e[e.CameraTooClose=3]="CameraTooClose",e[e.CameraAngleTooSteep=4]="CameraAngleTooSteep",e[e.DocumentTooCloseToCameraEdge=5]="DocumentTooCloseToCameraEdge",e[e.DocumentPartiallyVisible=6]="DocumentPartiallyVisible",e[e.FallbackSuccess=7]="FallbackSuccess";})(M||(M={}));var nt=class extends Error{constructor(){super("Throttled function aborted"),this.name="AbortError";}};function Da({limit:e,interval:t,strict:a}){if(!Number.isFinite(e))throw new TypeError("Expected `limit` to be a finite number");if(!Number.isFinite(t))throw new TypeError("Expected `interval` to be a finite number");let r=new Map,s=0,o=0;function c(){let g=Date.now();return g-s>t?(o=1,s=g,0):(o<e?o++:(s+=t,o=1),s-g)}let u=[];function m(){let g=Date.now();if(u.length<e)return u.push(g),0;let N=u.shift()+t;return g>=N?(u.push(g),0):(u.push(N),N-g)}let S=a?m:c;return g=>{let N=function(...w){if(!N.isEnabled)return (async()=>g.apply(this,w))();let H;return new Promise((ue,ce)=>{H=setTimeout(()=>{ue(g.apply(this,w)),r.delete(H);},S()),r.set(H,ce);})};return N.abort=()=>{for(let w of r.keys())clearTimeout(w),r.get(w)(new nt);r.clear(),u.splice(0,u.length);},N.isEnabled=!0,Object.defineProperty(N,"queueSize",{get(){return r.size}}),N}}var Oa=15;Da({limit:1,interval:Math.round(1/Oa*1e3),strict:!0});var _t;(function(e){e[e.Recognition=0]="Recognition",e[e.RecognitionTest=1]="RecognitionTest",e[e.DetectionTest=2]="DetectionTest";})(_t||(_t={}));var ke=class{constructor(t){if(this.allowHelloMessage=!0,this.engineLocation="",this.workerLocation="",this.wasmType=null,this.numberOfWorkers=null,this.loadProgressCallback=null,this.wasmModuleName=ga,!t)throw new R(y.licenseKeyMissing);this.licenseKey=t;}};function Tt(){return ("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function ba(){try{let e=localStorage.getItem("mb-user-id");return e===null&&(e=Tt(),localStorage.setItem("mb-user-id",e)),e}catch(e){return Tt()}}async function Bt(e){return new Promise((t,a)=>{if(!e||typeof e!="object"){a(new R(y.wasmSettingsMissing));return}if(typeof e.licenseKey!="string"){a(new R(y.licenseKeyMissing));return}if(!e.wasmModuleName){a(new R(y.wasmModuleNameMissing));return}if(typeof e.engineLocation!="string"){a(new R(y.engineLocationInvalid));return}if(typeof e.workerLocation!="string"){a(new R(y.workerLocationInvalid));return}let r=ba();try{let s=`/resources/${e.wasmModuleName}.worker.min.js`,o=window.location.origin+s,c=e.workerLocation||o;e.allowHelloMessage&&console.log("Worker location is:",c);let u=new Worker(c);st.createWasmWorker(u,e,r).then(m=>{t(m);},a);}catch(s){a(s);}})}async function Vt(e,t,a=!1,r={}){if(typeof e!="object")throw new R(y.missing);if(typeof t!="object"||t.length<1)throw new R(y.recognizersMissing);return e.mbWasmModule.createRecognizerRunner(t,a,r)}var Lt;(function(e){e[e.NONE=0]="NONE",e[e.QR_CODE=1]="QR_CODE",e[e.DATA_MATRIX=2]="DATA_MATRIX",e[e.UPC_E=3]="UPC_E",e[e.UPC_A=4]="UPC_A",e[e.EAN_8=5]="EAN_8",e[e.EAN_13=6]="EAN_13",e[e.CODE_128=7]="CODE_128",e[e.CODE_39=8]="CODE_39",e[e.ITF=9]="ITF",e[e.AZTEC_BARCODE=10]="AZTEC_BARCODE",e[e.PDF417_BARCODE=11]="PDF417_BARCODE";})(Lt||(Lt={}));var W;(function(e){e[e.None=0]="None",e[e.ImageOnly=1]="ImageOnly",e[e.ResultFieldsOnly=2]="ResultFieldsOnly",e[e.FullResult=3]="FullResult";})(W||(W={}));var Fe=class{constructor(){this.enableMrzId=!0,this.enableMrzPassport=!0,this.enableMrzVisa=!0,this.enablePhotoId=!0,this.enableBarcodeId=!0,this.enableFullDocumentRecognition=!0;}},vt;(function(e){e[e.Strict=0]="Strict",e[e.Normal=1]="Normal",e[e.Relaxed=2]="Relaxed";})(vt||(vt={}));var Mt;(function(e){e[e.Latin=0]="Latin",e[e.Arabic=1]="Arabic",e[e.Cyrillic=2]="Cyrillic",e[e.Greek=3]="Greek",e[e.Count=4]="Count";})(Mt||(Mt={}));var wt;(function(e){e[e.DocumentType=0]="DocumentType",e[e.StandardVersionNumber=1]="StandardVersionNumber",e[e.CustomerFamilyName=2]="CustomerFamilyName",e[e.CustomerFirstName=3]="CustomerFirstName",e[e.CustomerFullName=4]="CustomerFullName",e[e.DateOfBirth=5]="DateOfBirth",e[e.Sex=6]="Sex",e[e.EyeColor=7]="EyeColor",e[e.AddressStreet=8]="AddressStreet",e[e.AddressCity=9]="AddressCity",e[e.AddressJurisdictionCode=10]="AddressJurisdictionCode",e[e.AddressPostalCode=11]="AddressPostalCode",e[e.FullAddress=12]="FullAddress",e[e.Height=13]="Height",e[e.HeightIn=14]="HeightIn",e[e.HeightCm=15]="HeightCm",e[e.CustomerMiddleName=16]="CustomerMiddleName",e[e.HairColor=17]="HairColor",e[e.NameSuffix=18]="NameSuffix",e[e.AKAFullName=19]="AKAFullName",e[e.AKAFamilyName=20]="AKAFamilyName",e[e.AKAGivenName=21]="AKAGivenName",e[e.AKASuffixName=22]="AKASuffixName",e[e.WeightRange=23]="WeightRange",e[e.WeightPounds=24]="WeightPounds",e[e.WeightKilograms=25]="WeightKilograms",e[e.CustomerIdNumber=26]="CustomerIdNumber",e[e.FamilyNameTruncation=27]="FamilyNameTruncation",e[e.FirstNameTruncation=28]="FirstNameTruncation",e[e.MiddleNameTruncation=29]="MiddleNameTruncation",e[e.PlaceOfBirth=30]="PlaceOfBirth",e[e.AddressStreet2=31]="AddressStreet2",e[e.RaceEthnicity=32]="RaceEthnicity",e[e.NamePrefix=33]="NamePrefix",e[e.CountryIdentification=34]="CountryIdentification",e[e.ResidenceStreetAddress=35]="ResidenceStreetAddress",e[e.ResidenceStreetAddress2=36]="ResidenceStreetAddress2",e[e.ResidenceCity=37]="ResidenceCity",e[e.ResidenceJurisdictionCode=38]="ResidenceJurisdictionCode",e[e.ResidencePostalCode=39]="ResidencePostalCode",e[e.ResidenceFullAddress=40]="ResidenceFullAddress",e[e.Under18=41]="Under18",e[e.Under19=42]="Under19",e[e.Under21=43]="Under21",e[e.SocialSecurityNumber=44]="SocialSecurityNumber",e[e.AKASocialSecurityNumber=45]="AKASocialSecurityNumber",e[e.AKAMiddleName=46]="AKAMiddleName",e[e.AKAPrefixName=47]="AKAPrefixName",e[e.OrganDonor=48]="OrganDonor",e[e.Veteran=49]="Veteran",e[e.AKADateOfBirth=50]="AKADateOfBirth",e[e.IssuerIdentificationNumber=51]="IssuerIdentificationNumber",e[e.DocumentExpirationDate=52]="DocumentExpirationDate",e[e.JurisdictionVersionNumber=53]="JurisdictionVersionNumber",e[e.JurisdictionVehicleClass=54]="JurisdictionVehicleClass",e[e.JurisdictionRestrictionCodes=55]="JurisdictionRestrictionCodes",e[e.JurisdictionEndorsementCodes=56]="JurisdictionEndorsementCodes",e[e.DocumentIssueDate=57]="DocumentIssueDate",e[e.FederalCommercialVehicleCodes=58]="FederalCommercialVehicleCodes",e[e.IssuingJurisdiction=59]="IssuingJurisdiction",e[e.StandardVehicleClassification=60]="StandardVehicleClassification",e[e.IssuingJurisdictionName=61]="IssuingJurisdictionName",e[e.StandardEndorsementCode=62]="StandardEndorsementCode",e[e.StandardRestrictionCode=63]="StandardRestrictionCode",e[e.JurisdictionVehicleClassificationDescription=64]="JurisdictionVehicleClassificationDescription",e[e.JurisdictionEndorsmentCodeDescription=65]="JurisdictionEndorsmentCodeDescription",e[e.JurisdictionRestrictionCodeDescription=66]="JurisdictionRestrictionCodeDescription",e[e.InventoryControlNumber=67]="InventoryControlNumber",e[e.CardRevisionDate=68]="CardRevisionDate",e[e.DocumentDiscriminator=69]="DocumentDiscriminator",e[e.LimitedDurationDocument=70]="LimitedDurationDocument",e[e.AuditInformation=71]="AuditInformation",e[e.ComplianceType=72]="ComplianceType",e[e.IssueTimestamp=73]="IssueTimestamp",e[e.PermitExpirationDate=74]="PermitExpirationDate",e[e.PermitIdentifier=75]="PermitIdentifier",e[e.PermitIssueDate=76]="PermitIssueDate",e[e.NumberOfDuplicates=77]="NumberOfDuplicates",e[e.HAZMATExpirationDate=78]="HAZMATExpirationDate",e[e.MedicalIndicator=79]="MedicalIndicator",e[e.NonResident=80]="NonResident",e[e.UniqueCustomerId=81]="UniqueCustomerId",e[e.DataDiscriminator=82]="DataDiscriminator",e[e.DocumentExpirationMonth=83]="DocumentExpirationMonth",e[e.DocumentNonexpiring=84]="DocumentNonexpiring",e[e.SecurityVersion=85]="SecurityVersion",e[e.Count=86]="Count";})(wt||(wt={}));var C;(function(e){e[e.NONE=0]="NONE",e[e.ALBANIA=1]="ALBANIA",e[e.ALGERIA=2]="ALGERIA",e[e.ARGENTINA=3]="ARGENTINA",e[e.AUSTRALIA=4]="AUSTRALIA",e[e.AUSTRIA=5]="AUSTRIA",e[e.AZERBAIJAN=6]="AZERBAIJAN",e[e.BAHRAIN=7]="BAHRAIN",e[e.BANGLADESH=8]="BANGLADESH",e[e.BELGIUM=9]="BELGIUM",e[e.BOSNIA_AND_HERZEGOVINA=10]="BOSNIA_AND_HERZEGOVINA",e[e.BRUNEI=11]="BRUNEI",e[e.BULGARIA=12]="BULGARIA",e[e.CAMBODIA=13]="CAMBODIA",e[e.CANADA=14]="CANADA",e[e.CHILE=15]="CHILE",e[e.COLOMBIA=16]="COLOMBIA",e[e.COSTA_RICA=17]="COSTA_RICA",e[e.CROATIA=18]="CROATIA",e[e.CYPRUS=19]="CYPRUS",e[e.CZECHIA=20]="CZECHIA",e[e.DENMARK=21]="DENMARK",e[e.DOMINICAN_REPUBLIC=22]="DOMINICAN_REPUBLIC",e[e.EGYPT=23]="EGYPT",e[e.ESTONIA=24]="ESTONIA",e[e.FINLAND=25]="FINLAND",e[e.FRANCE=26]="FRANCE",e[e.GEORGIA=27]="GEORGIA",e[e.GERMANY=28]="GERMANY",e[e.GHANA=29]="GHANA",e[e.GREECE=30]="GREECE",e[e.GUATEMALA=31]="GUATEMALA",e[e.HONG_KONG=32]="HONG_KONG",e[e.HUNGARY=33]="HUNGARY",e[e.INDIA=34]="INDIA",e[e.INDONESIA=35]="INDONESIA",e[e.IRELAND=36]="IRELAND",e[e.ISRAEL=37]="ISRAEL",e[e.ITALY=38]="ITALY",e[e.JORDAN=39]="JORDAN",e[e.KAZAKHSTAN=40]="KAZAKHSTAN",e[e.KENYA=41]="KENYA",e[e.KOSOVO=42]="KOSOVO",e[e.KUWAIT=43]="KUWAIT",e[e.LATVIA=44]="LATVIA",e[e.LITHUANIA=45]="LITHUANIA",e[e.MALAYSIA=46]="MALAYSIA",e[e.MALDIVES=47]="MALDIVES",e[e.MALTA=48]="MALTA",e[e.MAURITIUS=49]="MAURITIUS",e[e.MEXICO=50]="MEXICO",e[e.MOROCCO=51]="MOROCCO",e[e.NETHERLANDS=52]="NETHERLANDS",e[e.NEW_ZEALAND=53]="NEW_ZEALAND",e[e.NIGERIA=54]="NIGERIA",e[e.PAKISTAN=55]="PAKISTAN",e[e.PANAMA=56]="PANAMA",e[e.PARAGUAY=57]="PARAGUAY",e[e.PHILIPPINES=58]="PHILIPPINES",e[e.POLAND=59]="POLAND",e[e.PORTUGAL=60]="PORTUGAL",e[e.PUERTO_RICO=61]="PUERTO_RICO",e[e.QATAR=62]="QATAR",e[e.ROMANIA=63]="ROMANIA",e[e.RUSSIA=64]="RUSSIA",e[e.SAUDI_ARABIA=65]="SAUDI_ARABIA",e[e.SERBIA=66]="SERBIA",e[e.SINGAPORE=67]="SINGAPORE",e[e.SLOVAKIA=68]="SLOVAKIA",e[e.SLOVENIA=69]="SLOVENIA",e[e.SOUTH_AFRICA=70]="SOUTH_AFRICA",e[e.SPAIN=71]="SPAIN",e[e.SWEDEN=72]="SWEDEN",e[e.SWITZERLAND=73]="SWITZERLAND",e[e.TAIWAN=74]="TAIWAN",e[e.THAILAND=75]="THAILAND",e[e.TUNISIA=76]="TUNISIA",e[e.TURKEY=77]="TURKEY",e[e.UAE=78]="UAE",e[e.UGANDA=79]="UGANDA",e[e.UK=80]="UK",e[e.UKRAINE=81]="UKRAINE",e[e.USA=82]="USA",e[e.VIETNAM=83]="VIETNAM",e[e.BRAZIL=84]="BRAZIL",e[e.NORWAY=85]="NORWAY",e[e.OMAN=86]="OMAN",e[e.ECUADOR=87]="ECUADOR",e[e.EL_SALVADOR=88]="EL_SALVADOR",e[e.SRI_LANKA=89]="SRI_LANKA",e[e.PERU=90]="PERU",e[e.URUGUAY=91]="URUGUAY",e[e.BAHAMAS=92]="BAHAMAS",e[e.BERMUDA=93]="BERMUDA",e[e.BOLIVIA=94]="BOLIVIA",e[e.CHINA=95]="CHINA",e[e.EUROPEAN_UNION=96]="EUROPEAN_UNION",e[e.HAITI=97]="HAITI",e[e.HONDURAS=98]="HONDURAS",e[e.ICELAND=99]="ICELAND",e[e.JAPAN=100]="JAPAN",e[e.LUXEMBOURG=101]="LUXEMBOURG",e[e.MONTENEGRO=102]="MONTENEGRO",e[e.NICARAGUA=103]="NICARAGUA",e[e.SOUTH_KOREA=104]="SOUTH_KOREA",e[e.VENEZUELA=105]="VENEZUELA",e[e.AFGHANISTAN=106]="AFGHANISTAN",e[e.ALAND_ISLANDS=107]="ALAND_ISLANDS",e[e.AMERICAN_SAMOA=108]="AMERICAN_SAMOA",e[e.ANDORRA=109]="ANDORRA",e[e.ANGOLA=110]="ANGOLA",e[e.ANGUILLA=111]="ANGUILLA",e[e.ANTARCTICA=112]="ANTARCTICA",e[e.ANTIGUA_AND_BARBUDA=113]="ANTIGUA_AND_BARBUDA",e[e.ARMENIA=114]="ARMENIA",e[e.ARUBA=115]="ARUBA",e[e.BAILIWICK_OF_GUERNSEY=116]="BAILIWICK_OF_GUERNSEY",e[e.BAILIWICK_OF_JERSEY=117]="BAILIWICK_OF_JERSEY",e[e.BARBADOS=118]="BARBADOS",e[e.BELARUS=119]="BELARUS",e[e.BELIZE=120]="BELIZE",e[e.BENIN=121]="BENIN",e[e.BHUTAN=122]="BHUTAN",e[e.BONAIRE_SAINT_EUSTATIUS_AND_SABA=123]="BONAIRE_SAINT_EUSTATIUS_AND_SABA",e[e.BOTSWANA=124]="BOTSWANA",e[e.BOUVET_ISLAND=125]="BOUVET_ISLAND",e[e.BRITISH_INDIAN_OCEAN_TERRITORY=126]="BRITISH_INDIAN_OCEAN_TERRITORY",e[e.BURKINA_FASO=127]="BURKINA_FASO",e[e.BURUNDI=128]="BURUNDI",e[e.CAMEROON=129]="CAMEROON",e[e.CAPE_VERDE=130]="CAPE_VERDE",e[e.CARIBBEAN_NETHERLANDS=131]="CARIBBEAN_NETHERLANDS",e[e.CAYMAN_ISLANDS=132]="CAYMAN_ISLANDS",e[e.CENTRAL_AFRICAN_REPUBLIC=133]="CENTRAL_AFRICAN_REPUBLIC",e[e.CHAD=134]="CHAD",e[e.CHRISTMAS_ISLAND=135]="CHRISTMAS_ISLAND",e[e.COCOS_ISLANDS=136]="COCOS_ISLANDS",e[e.COMOROS=137]="COMOROS",e[e.CONGO=138]="CONGO",e[e.COOK_ISLANDS=139]="COOK_ISLANDS",e[e.CUBA=140]="CUBA",e[e.CURACAO=141]="CURACAO",e[e.DEMOCRATIC_REPUBLIC_OF_THE_CONGO=142]="DEMOCRATIC_REPUBLIC_OF_THE_CONGO",e[e.DJIBOUTI=143]="DJIBOUTI",e[e.DOMINICA=144]="DOMINICA",e[e.EAST_TIMOR=145]="EAST_TIMOR",e[e.EQUATORIAL_GUINEA=146]="EQUATORIAL_GUINEA",e[e.ERITREA=147]="ERITREA",e[e.ETHIOPIA=148]="ETHIOPIA",e[e.FALKLAND_ISLANDS=149]="FALKLAND_ISLANDS",e[e.FAROE_ISLANDS=150]="FAROE_ISLANDS",e[e.FEDERATED_STATES_OF_MICRONESIA=151]="FEDERATED_STATES_OF_MICRONESIA",e[e.FIJI=152]="FIJI",e[e.FRENCH_GUIANA=153]="FRENCH_GUIANA",e[e.FRENCH_POLYNESIA=154]="FRENCH_POLYNESIA",e[e.FRENCH_SOUTHERN_TERRITORIES=155]="FRENCH_SOUTHERN_TERRITORIES",e[e.GABON=156]="GABON",e[e.GAMBIA=157]="GAMBIA",e[e.GIBRALTAR=158]="GIBRALTAR",e[e.GREENLAND=159]="GREENLAND",e[e.GRENADA=160]="GRENADA",e[e.GUADELOUPE=161]="GUADELOUPE",e[e.GUAM=162]="GUAM",e[e.GUINEA=163]="GUINEA",e[e.GUINEA_BISSAU=164]="GUINEA_BISSAU",e[e.GUYANA=165]="GUYANA",e[e.HEARD_ISLAND_AND_MCDONALD_ISLANDS=166]="HEARD_ISLAND_AND_MCDONALD_ISLANDS",e[e.IRAN=167]="IRAN",e[e.IRAQ=168]="IRAQ",e[e.ISLE_OF_MAN=169]="ISLE_OF_MAN",e[e.IVORY_COAST=170]="IVORY_COAST",e[e.JAMAICA=171]="JAMAICA",e[e.KIRIBATI=172]="KIRIBATI",e[e.KYRGYZSTAN=173]="KYRGYZSTAN",e[e.LAOS=174]="LAOS",e[e.LEBANON=175]="LEBANON",e[e.LESOTHO=176]="LESOTHO",e[e.LIBERIA=177]="LIBERIA",e[e.LIBYA=178]="LIBYA",e[e.LIECHTENSTEIN=179]="LIECHTENSTEIN",e[e.MACAU=180]="MACAU",e[e.MADAGASCAR=181]="MADAGASCAR",e[e.MALAWI=182]="MALAWI",e[e.MALI=183]="MALI",e[e.MARSHALL_ISLANDS=184]="MARSHALL_ISLANDS",e[e.MARTINIQUE=185]="MARTINIQUE",e[e.MAURITANIA=186]="MAURITANIA",e[e.MAYOTTE=187]="MAYOTTE",e[e.MOLDOVA=188]="MOLDOVA",e[e.MONACO=189]="MONACO",e[e.MONGOLIA=190]="MONGOLIA",e[e.MONTSERRAT=191]="MONTSERRAT",e[e.MOZAMBIQUE=192]="MOZAMBIQUE",e[e.MYANMAR=193]="MYANMAR",e[e.NAMIBIA=194]="NAMIBIA",e[e.NAURU=195]="NAURU",e[e.NEPAL=196]="NEPAL",e[e.NEW_CALEDONIA=197]="NEW_CALEDONIA",e[e.NIGER=198]="NIGER",e[e.NIUE=199]="NIUE",e[e.NORFOLK_ISLAND=200]="NORFOLK_ISLAND",e[e.NORTHERN_CYPRUS=201]="NORTHERN_CYPRUS",e[e.NORTHERN_MARIANA_ISLANDS=202]="NORTHERN_MARIANA_ISLANDS",e[e.NORTH_KOREA=203]="NORTH_KOREA",e[e.NORTH_MACEDONIA=204]="NORTH_MACEDONIA",e[e.PALAU=205]="PALAU",e[e.PALESTINE=206]="PALESTINE",e[e.PAPUA_NEW_GUINEA=207]="PAPUA_NEW_GUINEA",e[e.PITCAIRN=208]="PITCAIRN",e[e.REUNION=209]="REUNION",e[e.RWANDA=210]="RWANDA",e[e.SAINT_BARTHELEMY=211]="SAINT_BARTHELEMY",e[e.SAINT_HELENA_ASCENSION_AND_TRISTIAN_DA_CUNHA=212]="SAINT_HELENA_ASCENSION_AND_TRISTIAN_DA_CUNHA",e[e.SAINT_KITTS_AND_NEVIS=213]="SAINT_KITTS_AND_NEVIS",e[e.SAINT_LUCIA=214]="SAINT_LUCIA",e[e.SAINT_MARTIN=215]="SAINT_MARTIN",e[e.SAINT_PIERRE_AND_MIQUELON=216]="SAINT_PIERRE_AND_MIQUELON",e[e.SAINT_VINCENT_AND_THE_GRENADINES=217]="SAINT_VINCENT_AND_THE_GRENADINES",e[e.SAMOA=218]="SAMOA",e[e.SAN_MARINO=219]="SAN_MARINO",e[e.SAO_TOME_AND_PRINCIPE=220]="SAO_TOME_AND_PRINCIPE",e[e.SENEGAL=221]="SENEGAL",e[e.SEYCHELLES=222]="SEYCHELLES",e[e.SIERRA_LEONE=223]="SIERRA_LEONE",e[e.SINT_MAARTEN=224]="SINT_MAARTEN",e[e.SOLOMON_ISLANDS=225]="SOLOMON_ISLANDS",e[e.SOMALIA=226]="SOMALIA",e[e.SOUTH_GEORGIA_AND_THE_SOUTH_SANDWICH_ISLANDS=227]="SOUTH_GEORGIA_AND_THE_SOUTH_SANDWICH_ISLANDS",e[e.SOUTH_SUDAN=228]="SOUTH_SUDAN",e[e.SUDAN=229]="SUDAN",e[e.SURINAME=230]="SURINAME",e[e.SVALBARD_AND_JAN_MAYEN=231]="SVALBARD_AND_JAN_MAYEN",e[e.ESWATINI=232]="ESWATINI",e[e.SYRIA=233]="SYRIA",e[e.TAJIKISTAN=234]="TAJIKISTAN",e[e.TANZANIA=235]="TANZANIA",e[e.TOGO=236]="TOGO",e[e.TOKELAU=237]="TOKELAU",e[e.TONGA=238]="TONGA",e[e.TRINIDAD_AND_TOBAGO=239]="TRINIDAD_AND_TOBAGO",e[e.TURKMENISTAN=240]="TURKMENISTAN",e[e.TURKS_AND_CAICOS_ISLANDS=241]="TURKS_AND_CAICOS_ISLANDS",e[e.TUVALU=242]="TUVALU",e[e.UNITED_STATES_MINOR_OUTLYING_ISLANDS=243]="UNITED_STATES_MINOR_OUTLYING_ISLANDS",e[e.UZBEKISTAN=244]="UZBEKISTAN",e[e.VANUATU=245]="VANUATU",e[e.VATICAN_CITY=246]="VATICAN_CITY",e[e.VIRGIN_ISLANDS_BRITISH=247]="VIRGIN_ISLANDS_BRITISH",e[e.VIRGIN_ISLANDS_US=248]="VIRGIN_ISLANDS_US",e[e.WALLIS_AND_FUTUNA=249]="WALLIS_AND_FUTUNA",e[e.WESTERN_SAHARA=250]="WESTERN_SAHARA",e[e.YEMEN=251]="YEMEN",e[e.YUGOSLAVIA=252]="YUGOSLAVIA",e[e.ZAMBIA=253]="ZAMBIA",e[e.ZIMBABWE=254]="ZIMBABWE",e[e.SCHENGEN_AREA=255]="SCHENGEN_AREA",e[e.COUNT=256]="COUNT";})(C||(C={}));var n;(function(e){e[e.NONE=0]="NONE",e[e.ALABAMA=1]="ALABAMA",e[e.ALASKA=2]="ALASKA",e[e.ALBERTA=3]="ALBERTA",e[e.ARIZONA=4]="ARIZONA",e[e.ARKANSAS=5]="ARKANSAS",e[e.AUSTRALIAN_CAPITAL_TERRITORY=6]="AUSTRALIAN_CAPITAL_TERRITORY",e[e.BRITISH_COLUMBIA=7]="BRITISH_COLUMBIA",e[e.CALIFORNIA=8]="CALIFORNIA",e[e.COLORADO=9]="COLORADO",e[e.CONNECTICUT=10]="CONNECTICUT",e[e.DELAWARE=11]="DELAWARE",e[e.DISTRICT_OF_COLUMBIA=12]="DISTRICT_OF_COLUMBIA",e[e.FLORIDA=13]="FLORIDA",e[e.GEORGIA=14]="GEORGIA",e[e.HAWAII=15]="HAWAII",e[e.IDAHO=16]="IDAHO",e[e.ILLINOIS=17]="ILLINOIS",e[e.INDIANA=18]="INDIANA",e[e.IOWA=19]="IOWA",e[e.KANSAS=20]="KANSAS",e[e.KENTUCKY=21]="KENTUCKY",e[e.LOUISIANA=22]="LOUISIANA",e[e.MAINE=23]="MAINE",e[e.MANITOBA=24]="MANITOBA",e[e.MARYLAND=25]="MARYLAND",e[e.MASSACHUSETTS=26]="MASSACHUSETTS",e[e.MICHIGAN=27]="MICHIGAN",e[e.MINNESOTA=28]="MINNESOTA",e[e.MISSISSIPPI=29]="MISSISSIPPI",e[e.MISSOURI=30]="MISSOURI",e[e.MONTANA=31]="MONTANA",e[e.NEBRASKA=32]="NEBRASKA",e[e.NEVADA=33]="NEVADA",e[e.NEW_BRUNSWICK=34]="NEW_BRUNSWICK",e[e.NEW_HAMPSHIRE=35]="NEW_HAMPSHIRE",e[e.NEW_JERSEY=36]="NEW_JERSEY",e[e.NEW_MEXICO=37]="NEW_MEXICO",e[e.NEW_SOUTH_WALES=38]="NEW_SOUTH_WALES",e[e.NEW_YORK=39]="NEW_YORK",e[e.NORTHERN_TERRITORY=40]="NORTHERN_TERRITORY",e[e.NORTH_CAROLINA=41]="NORTH_CAROLINA",e[e.NORTH_DAKOTA=42]="NORTH_DAKOTA",e[e.NOVA_SCOTIA=43]="NOVA_SCOTIA",e[e.OHIO=44]="OHIO",e[e.OKLAHOMA=45]="OKLAHOMA",e[e.ONTARIO=46]="ONTARIO",e[e.OREGON=47]="OREGON",e[e.PENNSYLVANIA=48]="PENNSYLVANIA",e[e.QUEBEC=49]="QUEBEC",e[e.QUEENSLAND=50]="QUEENSLAND",e[e.RHODE_ISLAND=51]="RHODE_ISLAND",e[e.SASKATCHEWAN=52]="SASKATCHEWAN",e[e.SOUTH_AUSTRALIA=53]="SOUTH_AUSTRALIA",e[e.SOUTH_CAROLINA=54]="SOUTH_CAROLINA",e[e.SOUTH_DAKOTA=55]="SOUTH_DAKOTA",e[e.TASMANIA=56]="TASMANIA",e[e.TENNESSEE=57]="TENNESSEE",e[e.TEXAS=58]="TEXAS",e[e.UTAH=59]="UTAH",e[e.VERMONT=60]="VERMONT",e[e.VICTORIA=61]="VICTORIA",e[e.VIRGINIA=62]="VIRGINIA",e[e.WASHINGTON=63]="WASHINGTON",e[e.WESTERN_AUSTRALIA=64]="WESTERN_AUSTRALIA",e[e.WEST_VIRGINIA=65]="WEST_VIRGINIA",e[e.WISCONSIN=66]="WISCONSIN",e[e.WYOMING=67]="WYOMING",e[e.YUKON=68]="YUKON",e[e.CIUDAD_DE_MEXICO=69]="CIUDAD_DE_MEXICO",e[e.JALISCO=70]="JALISCO",e[e.NEWFOUNDLAND_AND_LABRADOR=71]="NEWFOUNDLAND_AND_LABRADOR",e[e.NUEVO_LEON=72]="NUEVO_LEON",e[e.BAJA_CALIFORNIA=73]="BAJA_CALIFORNIA",e[e.CHIHUAHUA=74]="CHIHUAHUA",e[e.GUANAJUATO=75]="GUANAJUATO",e[e.GUERRERO=76]="GUERRERO",e[e.MEXICO=77]="MEXICO",e[e.MICHOACAN=78]="MICHOACAN",e[e.NEW_YORK_CITY=79]="NEW_YORK_CITY",e[e.TAMAULIPAS=80]="TAMAULIPAS",e[e.VERACRUZ=81]="VERACRUZ",e[e.CHIAPAS=82]="CHIAPAS",e[e.COAHUILA=83]="COAHUILA",e[e.DURANGO=84]="DURANGO",e[e.GUERRERO_COCULA=85]="GUERRERO_COCULA",e[e.GUERRERO_JUCHITAN=86]="GUERRERO_JUCHITAN",e[e.GUERRERO_TEPECOACUILCO=87]="GUERRERO_TEPECOACUILCO",e[e.GUERRERO_TLACOAPA=88]="GUERRERO_TLACOAPA",e[e.GUJARAT=89]="GUJARAT",e[e.HIDALGO=90]="HIDALGO",e[e.KARNATAKA=91]="KARNATAKA",e[e.KERALA=92]="KERALA",e[e.KHYBER_PAKHTUNKHWA=93]="KHYBER_PAKHTUNKHWA",e[e.MADHYA_PRADESH=94]="MADHYA_PRADESH",e[e.MAHARASHTRA=95]="MAHARASHTRA",e[e.MORELOS=96]="MORELOS",e[e.NAYARIT=97]="NAYARIT",e[e.OAXACA=98]="OAXACA",e[e.PUEBLA=99]="PUEBLA",e[e.PUNJAB=100]="PUNJAB",e[e.QUERETARO=101]="QUERETARO",e[e.SAN_LUIS_POTOSI=102]="SAN_LUIS_POTOSI",e[e.SINALOA=103]="SINALOA",e[e.SONORA=104]="SONORA",e[e.TABASCO=105]="TABASCO",e[e.TAMIL_NADU=106]="TAMIL_NADU",e[e.YUCATAN=107]="YUCATAN",e[e.ZACATECAS=108]="ZACATECAS",e[e.AGUASCALIENTES=109]="AGUASCALIENTES",e[e.BAJA_CALIFORNIA_SUR=110]="BAJA_CALIFORNIA_SUR",e[e.CAMPECHE=111]="CAMPECHE",e[e.COLIMA=112]="COLIMA",e[e.QUINTANA_ROO_BENITO_JUAREZ=113]="QUINTANA_ROO_BENITO_JUAREZ",e[e.UINTANA_ROO=114]="UINTANA_ROO",e[e.QUINTANA_ROO_SOLIDARIDAD=115]="QUINTANA_ROO_SOLIDARIDAD",e[e.TLAXCALA=116]="TLAXCALA",e[e.QUINTANA_ROO_COZUMEL=117]="QUINTANA_ROO_COZUMEL",e[e.SAO_PAOLO=118]="SAO_PAOLO",e[e.RIO_DE_JANEIRO=119]="RIO_DE_JANEIRO",e[e.RIO_GRANDE_DO_SUL=120]="RIO_GRANDE_DO_SUL",e[e.NORTHWEST_TERRITORIES=121]="NORTHWEST_TERRITORIES",e[e.NUNAVUT=122]="NUNAVUT",e[e.PRINCE_EDWARD_ISLAND=123]="PRINCE_EDWARD_ISLAND",e[e.DISTRITO_FEDERAL=124]="DISTRITO_FEDERAL",e[e.MARANHAO=125]="MARANHAO",e[e.MATO_GROSSO=126]="MATO_GROSSO",e[e.MINAS_GERAIS=127]="MINAS_GERAIS",e[e.PARA=128]="PARA",e[e.PARANA=129]="PARANA",e[e.PERNAMBUCO=130]="PERNAMBUCO",e[e.SANTA_CATARINA=131]="SANTA_CATARINA",e[e.ANDHRA_PRADESH=132]="ANDHRA_PRADESH",e[e.CEARA=133]="CEARA",e[e.GOIAS=134]="GOIAS",e[e.GUERRERO_ACAPULCO_DE_JUAREZ=135]="GUERRERO_ACAPULCO_DE_JUAREZ",e[e.HARYANA=136]="HARYANA",e[e.SERGIPE=137]="SERGIPE",e[e.ALAGOAS=138]="ALAGOAS",e[e.BANGSAMORO=139]="BANGSAMORO",e[e.COUNT=140]="COUNT";})(n||(n={}));var l;(function(e){e[e.NONE=0]="NONE",e[e.CONSULAR_ID=1]="CONSULAR_ID",e[e.DL=2]="DL",e[e.DL_PUBLIC_SERVICES_CARD=3]="DL_PUBLIC_SERVICES_CARD",e[e.EMPLOYMENT_PASS=4]="EMPLOYMENT_PASS",e[e.FIN_CARD=5]="FIN_CARD",e[e.ID=6]="ID",e[e.MULTIPURPOSE_ID=7]="MULTIPURPOSE_ID",e[e.MYKAD=8]="MYKAD",e[e.MYKID=9]="MYKID",e[e.MYPR=10]="MYPR",e[e.MYTENTERA=11]="MYTENTERA",e[e.PAN_CARD=12]="PAN_CARD",e[e.PROFESSIONAL_ID=13]="PROFESSIONAL_ID",e[e.PUBLIC_SERVICES_CARD=14]="PUBLIC_SERVICES_CARD",e[e.RESIDENCE_PERMIT=15]="RESIDENCE_PERMIT",e[e.RESIDENT_ID=16]="RESIDENT_ID",e[e.TEMPORARY_RESIDENCE_PERMIT=17]="TEMPORARY_RESIDENCE_PERMIT",e[e.VOTER_ID=18]="VOTER_ID",e[e.WORK_PERMIT=19]="WORK_PERMIT",e[e.IKAD=20]="IKAD",e[e.MILITARY_ID=21]="MILITARY_ID",e[e.MYKAS=22]="MYKAS",e[e.SOCIAL_SECURITY_CARD=23]="SOCIAL_SECURITY_CARD",e[e.HEALTH_INSURANCE_CARD=24]="HEALTH_INSURANCE_CARD",e[e.PASSPORT=25]="PASSPORT",e[e.S_PASS=26]="S_PASS",e[e.ADDRESS_CARD=27]="ADDRESS_CARD",e[e.ALIEN_ID=28]="ALIEN_ID",e[e.ALIEN_PASSPORT=29]="ALIEN_PASSPORT",e[e.GREEN_CARD=30]="GREEN_CARD",e[e.MINORS_ID=31]="MINORS_ID",e[e.POSTAL_ID=32]="POSTAL_ID",e[e.PROFESSIONAL_DL=33]="PROFESSIONAL_DL",e[e.TAX_ID=34]="TAX_ID",e[e.WEAPON_PERMIT=35]="WEAPON_PERMIT",e[e.VISA=36]="VISA",e[e.BORDER_CROSSING_CARD=37]="BORDER_CROSSING_CARD",e[e.DRIVER_CARD=38]="DRIVER_CARD",e[e.GLOBAL_ENTRY_CARD=39]="GLOBAL_ENTRY_CARD",e[e.MYPOLIS=40]="MYPOLIS",e[e.NEXUS_CARD=41]="NEXUS_CARD",e[e.PASSPORT_CARD=42]="PASSPORT_CARD",e[e.PROOF_OF_AGE_CARD=43]="PROOF_OF_AGE_CARD",e[e.REFUGEE_ID=44]="REFUGEE_ID",e[e.TRIBAL_ID=45]="TRIBAL_ID",e[e.VETERAN_ID=46]="VETERAN_ID",e[e.CITIZENSHIP_CERTIFICATE=47]="CITIZENSHIP_CERTIFICATE",e[e.MY_NUMBER_CARD=48]="MY_NUMBER_CARD",e[e.CONSULAR_PASSPORT=49]="CONSULAR_PASSPORT",e[e.MINORS_PASSPORT=50]="MINORS_PASSPORT",e[e.MINORS_PUBLIC_SERVICES_CARD=51]="MINORS_PUBLIC_SERVICES_CARD",e[e.DRIVING_PRIVILEGE_CARD=52]="DRIVING_PRIVILEGE_CARD",e[e.ASYLUM_REQUEST=53]="ASYLUM_REQUEST",e[e.DRIVER_QUALIFICATION_CARD=54]="DRIVER_QUALIFICATION_CARD",e[e.PROVISIONAL_DL=55]="PROVISIONAL_DL",e[e.REFUGEE_PASSPORT=56]="REFUGEE_PASSPORT",e[e.SPECIAL_ID=57]="SPECIAL_ID",e[e.UNIFORMED_SERVICES_ID=58]="UNIFORMED_SERVICES_ID",e[e.IMMIGRANT_VISA=59]="IMMIGRANT_VISA",e[e.CONSULAR_VOTER_ID=60]="CONSULAR_VOTER_ID",e[e.TWIC_CARD=61]="TWIC_CARD",e[e.EXIT_ENTRY_PERMIT=62]="EXIT_ENTRY_PERMIT",e[e.MAINLAND_TRAVEL_PERMIT_TAIWAN=63]="MAINLAND_TRAVEL_PERMIT_TAIWAN",e[e.NBI_CLEARANCE=64]="NBI_CLEARANCE",e[e.PROOF_OF_REGISTRATION=65]="PROOF_OF_REGISTRATION",e[e.TEMPORARY_PROTECTION_PERMIT=66]="TEMPORARY_PROTECTION_PERMIT",e[e.AFGHAN_CITIZEN_CARD=67]="AFGHAN_CITIZEN_CARD",e[e.EID=68]="EID",e[e.PASS=69]="PASS",e[e.SIS_ID=70]="SIS_ID",e[e.ASIC_CARD=71]="ASIC_CARD",e[e.BIDOON_CARD=72]="BIDOON_CARD",e[e.INTERIM_HEALTH_INSURANCE_CARD=73]="INTERIM_HEALTH_INSURANCE_CARD",e[e.NON_VOTER_ID=74]="NON_VOTER_ID",e[e.RECIPROCAL_HEALTH_INSURANCE_CARD=75]="RECIPROCAL_HEALTH_INSURANCE_CARD",e[e.VEHICLE_REGISTRATION=76]="VEHICLE_REGISTRATION",e[e.COUNT=77]="COUNT";})(l||(l={}));var Pt;(function(e){e[e.AdditionalAddressInformation=0]="AdditionalAddressInformation",e[e.AdditionalNameInformation=1]="AdditionalNameInformation",e[e.AdditionalOptionalAddressInformation=2]="AdditionalOptionalAddressInformation",e[e.AdditionalPersonalIdNumber=3]="AdditionalPersonalIdNumber",e[e.Address=4]="Address",e[e.ClassEffectiveDate=5]="ClassEffectiveDate",e[e.ClassExpiryDate=6]="ClassExpiryDate",e[e.Conditions=7]="Conditions",e[e.DateOfBirth=8]="DateOfBirth",e[e.DateOfExpiry=9]="DateOfExpiry",e[e.DateOfIssue=10]="DateOfIssue",e[e.DocumentAdditionalNumber=11]="DocumentAdditionalNumber",e[e.DocumentOptionalAdditionalNumber=12]="DocumentOptionalAdditionalNumber",e[e.DocumentNumber=13]="DocumentNumber",e[e.Employer=14]="Employer",e[e.Endorsements=15]="Endorsements",e[e.FathersName=16]="FathersName",e[e.FirstName=17]="FirstName",e[e.FullName=18]="FullName",e[e.IssuingAuthority=19]="IssuingAuthority",e[e.LastName=20]="LastName",e[e.LicenceType=21]="LicenceType",e[e.LocalizedName=22]="LocalizedName",e[e.MaritalStatus=23]="MaritalStatus",e[e.MothersName=24]="MothersName",e[e.Mrz=25]="Mrz",e[e.Nationality=26]="Nationality",e[e.PersonalIdNumber=27]="PersonalIdNumber",e[e.PlaceOfBirth=28]="PlaceOfBirth",e[e.Profession=29]="Profession",e[e.Race=30]="Race",e[e.Religion=31]="Religion",e[e.ResidentialStatus=32]="ResidentialStatus",e[e.Restrictions=33]="Restrictions",e[e.Sex=34]="Sex",e[e.VehicleClass=35]="VehicleClass",e[e.BloodType=36]="BloodType",e[e.Sponsor=37]="Sponsor",e[e.VisaType=38]="VisaType",e[e.DocumentSubtype=39]="DocumentSubtype",e[e.Remarks=40]="Remarks",e[e.ResidencePermitType=41]="ResidencePermitType",e[e.ManufacturingYear=42]="ManufacturingYear",e[e.VehicleType=43]="VehicleType",e[e.DependentDateOfBirth=44]="DependentDateOfBirth",e[e.DependentSex=45]="DependentSex",e[e.DependentDocumentNumber=46]="DependentDocumentNumber",e[e.DependentFullName=47]="DependentFullName",e[e.EligibilityCategory=48]="EligibilityCategory",e[e.SpecificDocumentValidity=49]="SpecificDocumentValidity",e[e.Count=50]="Count";})(Pt||(Pt={}));var qt;(function(e){e[e.FullDocument=0]="FullDocument",e[e.Face=1]="Face",e[e.Signature=2]="Signature";})(qt||(qt={}));var yt;(function(e){e[e.NotAvailable=0]="NotAvailable",e[e.BlackAndWhite=1]="BlackAndWhite",e[e.Color=2]="Color";})(yt||(yt={}));var ae;(function(e){e[e.NotAvailable=0]="NotAvailable",e[e.NotDetected=1]="NotDetected",e[e.Detected=2]="Detected";})(ae||(ae={}));var Ut;(function(e){e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e[e.NotAvailable=2]="NotAvailable";})(Ut||(Ut={}));var kt;(function(e){e[e.None=0]="None",e[e.Clockwise90=1]="Clockwise90",e[e.CounterClockwise90=2]="CounterClockwise90",e[e.UpsideDown=3]="UpsideDown";})(kt||(kt={}));var xe;(function(e){e[e.Success=0]="Success",e[e.DetectionFailed=1]="DetectionFailed",e[e.ImagePreprocessingFailed=2]="ImagePreprocessingFailed",e[e.StabilityTestFailed=3]="StabilityTestFailed",e[e.ScanningWrongSide=4]="ScanningWrongSide",e[e.FieldIdentificationFailed=5]="FieldIdentificationFailed",e[e.MandatoryFieldMissing=6]="MandatoryFieldMissing",e[e.InvalidCharactersFound=7]="InvalidCharactersFound",e[e.ImageReturnFailed=8]="ImageReturnFailed",e[e.BarcodeRecognitionFailed=9]="BarcodeRecognitionFailed",e[e.MrzParsingFailed=10]="MrzParsingFailed",e[e.ClassFiltered=11]="ClassFiltered",e[e.UnsupportedClass=12]="UnsupportedClass",e[e.UnsupportedByLicense=13]="UnsupportedByLicense",e[e.AwaitingOtherSide=14]="AwaitingOtherSide",e[e.NotScanned=15]="NotScanned",e[e.BarcodeDetectionFailed=16]="BarcodeDetectionFailed",e[e.Count=17]="Count";})(xe||(xe={}));var Ft;(function(e){e[e.None=0]="None",e[e.MrzId=1]="MrzId",e[e.MrzVisa=2]="MrzVisa",e[e.MrzPassport=3]="MrzPassport",e[e.PhotoId=4]="PhotoId",e[e.FullRecognition=5]="FullRecognition",e[e.BarcodeId=6]="BarcodeId",e[e.Count=7]="Count";})(Ft||(Ft={}));async function Ht(e){return e.mbWasmModule.newRecognizer(atob("QmxpbmtJZFNpbmdsZVNpZGVSZWNvZ25pemVy"))}async function zt(e){return e.mbWasmModule.newRecognizer(atob("QmxpbmtJZE11bHRpU2lkZVJlY29nbml6ZXI="))}var xt;(function(e){e[e.None=0]="None",e[e.AAMVACompliant=1]="AAMVACompliant",e[e.ArgentinaID=2]="ArgentinaID",e[e.ArgentinaAlienID=3]="ArgentinaAlienID",e[e.ArgentinaDL=4]="ArgentinaDL",e[e.ColombiaID=5]="ColombiaID",e[e.ColombiaDL=6]="ColombiaDL",e[e.NigeriaVoterID=7]="NigeriaVoterID",e[e.NigeriaDL=8]="NigeriaDL",e[e.PanamaID=9]="PanamaID",e[e.SouthAfricaID=10]="SouthAfricaID";})(xt||(xt={}));var Ge=class e{get location(){return this._location}static fromJSON(t){let a=new e;return t.location!=null&&(a._location=Quadrilateral.fromJSON(t.location)),a}toJSONObject(){return {location:this.location.toJSONObject()}}};var Ta={[n.NONE]:null,[n.COUNT]:null,[n.AUSTRALIAN_CAPITAL_TERRITORY]:"Australian Capital Territory",[n.NEW_SOUTH_WALES]:"New South Wales",[n.NORTHERN_TERRITORY]:"Northern Territory",[n.QUEENSLAND]:"Queensland",[n.SOUTH_AUSTRALIA]:"South Australia",[n.TASMANIA]:"Tasmania",[n.WESTERN_AUSTRALIA]:"Western Australia",[n.VICTORIA]:"Victoria",[n.ALBERTA]:"Alberta",[n.BRITISH_COLUMBIA]:"British Columbia",[n.MANITOBA]:"Manitoba",[n.NEW_BRUNSWICK]:"New Brunswick",[n.NEWFOUNDLAND_AND_LABRADOR]:"Newfoundland and Labrador",[n.NORTHWEST_TERRITORIES]:"Northwest Territories",[n.NOVA_SCOTIA]:"Nova Scotia",[n.NUNAVUT]:"Nunavut",[n.PRINCE_EDWARD_ISLAND]:"Prince Edward Island",[n.QUEBEC]:"Quebec",[n.SASKATCHEWAN]:"Saskatchewan",[n.ANDHRA_PRADESH]:"Andhra Pradesh",[n.GUJARAT]:"Gujarat",[n.HARYANA]:"Haryana",[n.KARNATAKA]:"Karnataka",[n.KERALA]:"Kerala",[n.MADHYA_PRADESH]:"Madhya Pradesh",[n.MAHARASHTRA]:"Maharashtra",[n.PUNJAB]:"Punjab",[n.TAMIL_NADU]:"Tamil Nadu",[n.AGUASCALIENTES]:"Aguascalientes",[n.BAJA_CALIFORNIA]:"Baja California",[n.BAJA_CALIFORNIA_SUR]:"Baja California Sur",[n.CAMPECHE]:"Campeche",[n.CHIAPAS]:"Chiapas",[n.CHIHUAHUA]:"Chihuahua",[n.CIUDAD_DE_MEXICO]:"Mexico City",[n.COAHUILA]:"Coahuila",[n.COLIMA]:"Colima",[n.DURANGO]:"Durango",[n.GUANAJUATO]:"Guanajuato",[n.GUERRERO]:"Guerrero",[n.GUERRERO_ACAPULCO_DE_JUAREZ]:"Acapulco de Ju\xE1rez, Guerrero",[n.GUERRERO_COCULA]:"Cocula, Guerrero",[n.GUERRERO_JUCHITAN]:"Juchit\xE1n, Guerrero",[n.GUERRERO_TEPECOACUILCO]:"Tepecoacuilco de Trujano, Guerrero",[n.GUERRERO_TLACOAPA]:"Tlacoapa, Guerrero",[n.HIDALGO]:"Hidalgo",[n.JALISCO]:"Jalisco",[n.MEXICO]:"M\xE9xico",[n.MICHOACAN]:"Michoac\xE1n",[n.MORELOS]:"Morelos",[n.NAYARIT]:"Nayarit",[n.NUEVO_LEON]:"Nuevo Le\xF3n",[n.OAXACA]:"Oaxaca",[n.PUEBLA]:"Puebla",[n.UINTANA_ROO]:"Quintana Roo",[n.QUINTANA_ROO_BENITO_JUAREZ]:"Benito Ju\xE1rez, Quintana Roo",[n.QUINTANA_ROO_SOLIDARIDAD]:"Solidaridad, Quintana Roo",[n.QUINTANA_ROO_COZUMEL]:"Cozumel, Quintana Roo",[n.QUERETARO]:"Quer\xE9taro",[n.SAN_LUIS_POTOSI]:"San Luis Potos\xED",[n.SINALOA]:"Sinaloa",[n.SONORA]:"Sonora",[n.TABASCO]:"Tabasco",[n.TAMAULIPAS]:"Tamaulipas",[n.TLAXCALA]:"Tlaxcala",[n.VERACRUZ]:"Veracruz",[n.YUCATAN]:"Yucatan",[n.ZACATECAS]:"Zacatecas",[n.KHYBER_PAKHTUNKHWA]:"Khyber Pakhtunkhwa",[n.ALABAMA]:"Alabama",[n.ALASKA]:"Alaska",[n.ARIZONA]:"Arizona",[n.ARKANSAS]:"Arkansas",[n.CALIFORNIA]:"California",[n.COLORADO]:"Colorado",[n.CONNECTICUT]:"Connecticut",[n.DELAWARE]:"Delaware",[n.DISTRICT_OF_COLUMBIA]:"District of Columbia",[n.FLORIDA]:"Florida",[n.GEORGIA]:"Georgia",[n.HAWAII]:"Hawaii",[n.IDAHO]:"Idaho",[n.ILLINOIS]:"Illinois",[n.INDIANA]:"Indiana",[n.IOWA]:"Iowa",[n.KANSAS]:"Kansas",[n.KENTUCKY]:"Kentucky",[n.LOUISIANA]:"Louisiana",[n.MAINE]:"Maine",[n.MARYLAND]:"Maryland",[n.MASSACHUSETTS]:"Massachusetts",[n.MICHIGAN]:"Michigan",[n.MINNESOTA]:"Minnesota",[n.MISSISSIPPI]:"Mississippi",[n.MISSOURI]:"Missouri",[n.MONTANA]:"Montana",[n.NEBRASKA]:"Nebraska",[n.NEVADA]:"Nevada",[n.NEW_HAMPSHIRE]:"New Hampshire",[n.NEW_JERSEY]:"New Jersey",[n.NEW_MEXICO]:"New Mexico",[n.NEW_YORK]:"New York",[n.NEW_YORK_CITY]:"New York City",[n.NORTH_CAROLINA]:"North Carolina",[n.NORTH_DAKOTA]:"North Dakota",[n.OHIO]:"Ohio",[n.OKLAHOMA]:"Oklahoma",[n.ONTARIO]:"Ontario",[n.OREGON]:"Oregon",[n.PENNSYLVANIA]:"Pennsylvania",[n.RHODE_ISLAND]:"Rhode Island",[n.SOUTH_CAROLINA]:"South Carolina",[n.SOUTH_DAKOTA]:"South Dakota",[n.TENNESSEE]:"Tennessee",[n.TEXAS]:"Texas",[n.UTAH]:"Utah",[n.VERMONT]:"Vermont",[n.VIRGINIA]:"Virginia",[n.WASHINGTON]:"Washington",[n.WEST_VIRGINIA]:"West Virginia",[n.WISCONSIN]:"Wisconsin",[n.WYOMING]:"Wyoming",[n.YUKON]:"Yukon",[n.CEARA]:"Cear\xE1",[n.DISTRITO_FEDERAL]:"Federal District",[n.GOIAS]:"Goi\xE1s",[n.MARANHAO]:"Maranh\xE3o",[n.MATO_GROSSO]:"Mato Grosso",[n.MINAS_GERAIS]:"Minas Gerais",[n.PARA]:"Par\xE1",[n.PARANA]:"Paran\xE1",[n.PERNAMBUCO]:"Pernambuco",[n.RIO_DE_JANEIRO]:"Rio de Janeiro",[n.RIO_GRANDE_DO_SUL]:"Rio Grand do Sul",[n.SANTA_CATARINA]:"Santa Catarina",[n.SAO_PAOLO]:"Sao Paolo",[n.SERGIPE]:"Sergipe",[n.ALAGOAS]:"Alagoas",[n.BANGSAMORO]:"Bangsamoro"};function jt(e){return Ta[e]}var We=class e{constructor(t){this.workerCall=t;}static create(t){return new e(t)}async createDrivingLicenseDetailsFromBlinkIdData(t,a,r){let s=await this.workerCall("idCaptureDrivingLicenseDetailsCreateWithBlinkIdData",{details:{vehicleClass:t,restrictions:a,endorsements:r}});return j.fromJSON(s.result)}};var Jt={ABW:"aruba",AFG:"afghanistan",AGO:"angola",AIA:"anguilla",ALA:"alandIslands",ALB:"albania",AND:"andorra",ARE:"uae",ARG:"argentina",ARM:"armenia",ASM:"americanSamoa",ATA:"antarctica",ATF:"frenchSouthernTerritories",ATG:"antiguaAndBarbuda",AUS:"australia",AUT:"austria",AZE:"azerbaijan",BDI:"burundi",BEL:"belgium",BEN:"benin",BES:"bonaireSintEustatiusAndSaba",BFA:"burkinaFaso",BGD:"bangladesh",BGR:"bulgaria",BHR:"bahrain",BHS:"bahamas",BIH:"bosniaHerzegovina",BLM:"saintBarthelemy",BLR:"belarus",BLZ:"belize",BMU:"bermuda",BOL:"bolivia",BRA:"brazil",BRB:"barbados",BRN:"bruneiDarussalam",BTN:"bhutan",BVT:"bouvetIsland",BWA:"botswana",CAF:"car",CAN:"canada",CCK:"cocosIslands",CHE:"switzerland",CHL:"chile",CHN:"china",CIV:"coteIvoire",CMR:"cameroon",COD:"democraticRepublicOfCongo",COG:"congo",COK:"cookIslands",COL:"colombia",COM:"comoros",CPV:"caboVerde",CRI:"costaRica",CUB:"cuba",CUW:"curacao",CXR:"christmasIsland",CYM:"caymanIslands",CYP:"cyprus",CZE:"czechia",DEU:"germany",DJI:"djibouti",DMA:"dominica",DNK:"denmark",DOM:"dominicanRepublic",DZA:"algeria",ECU:"ecuador",EGY:"egypt",ERI:"eritrea",ESH:"westernSahara",ESP:"spain",EST:"estonia",ETH:"ethiopia",FIN:"finland",FJI:"fiji",FLK:"falklandIslands",FRA:"france",FRO:"faroeIslands",FSM:"micronesia",GAB:"gabon",GBR:"uk",GEO:"georgia",GGY:"guernsey",GHA:"ghana",GIB:"gibraltar",GIN:"guinea",GLP:"guadeloupe",GMB:"gambia",GNB:"guineaBissau",GNQ:"equatorialGuinea",GRC:"greece",GRD:"grenada",GRL:"greenland",GTM:"guatemala",GUF:"frenchGuiana",GUM:"guam",GUY:"guyana",HKG:"hongKong",HMD:"heardIslandAndMcDonaldIslands",HND:"honduras",HRV:"croatia",HTI:"haiti",HUN:"hungary",IDN:"indonesia",IMN:"isleOfMan",IND:"india",IOT:"britishIndianOceanTerritory",IRL:"ireland",IRN:"iran",IRQ:"iraq",ISL:"iceland",ISR:"israel",ITA:"italy",JAM:"jamaica",JEY:"jersey",JOR:"jordan",JPN:"japan",KAZ:"kazakhstan",KEN:"kenya",KGZ:"kyrgyzstan",KHM:"cambodia",KIR:"kiribati",KNA:"saintKittsAndNevis",KOR:"southKorea",KWT:"kuwait",LAO:"lao",LBN:"lebanon",LBR:"liberia",LBY:"libya",LCA:"saintLucia",LIE:"liechtenstein",LKA:"sriLanka",LSO:"lesotho",LTU:"lithuania",LUX:"luxembourg",LVA:"latvia",MAC:"macao",MAF:"frenchSaintMartin",MAR:"morocco",MCO:"monaco",MDA:"moldova",MDG:"madagascar",MDV:"maldives",MEX:"mexico",MHL:"marshallIslands",MKD:"northMacedonia",MLI:"mali",MLT:"malta",MMR:"myanmar",MNE:"montenegro",MNG:"mongolia",MNP:"northernMarianaIslands",MOZ:"mozambique",MRT:"mauritania",MSR:"montserrat",MTQ:"martinique",MUS:"mauritius",MWI:"malawi",MYS:"malaysia",MYT:"mayotte",NAM:"namibia",NCL:"newCaledonia",NER:"niger",NFK:"norfolkIsland",NGA:"nigeria",NIC:"nicaragua",NIU:"niue",NLD:"netherlands",NOR:"norway",NPL:"nepal",NRU:"nauru",NZL:"newZealand",OMN:"oman",PAK:"pakistan",PAN:"panama",PCN:"pitcairn",PER:"peru",PHL:"philippines",PLW:"palau",PNG:"papuaNewGuinea",POL:"poland",PRI:"puertoRico",PRK:"northKorea",PRT:"portugal",PRY:"paraguay",PSE:"palestine",PYF:"frenchPolynesia",QAT:"qatar",REU:"reunion",ROU:"romania",RUS:"russia",RWA:"rwanda",SAU:"saudiArabia",SDN:"sudan",SEN:"senegal",SGP:"singapore",SGS:"southGeorgiaAndTheSouthSandwichIslands",SHN:"saintHelena",SJM:"svalbardAndJanMayen",SLB:"solomonIslands",SLE:"sierraLeone",SLV:"elSalvador",SMR:"sanMarino",SOM:"somalia",SPM:"saintPierreAndMiquelon",SRB:"serbia",SSD:"southSudan",STP:"saoTomeAndPrincipe",SUR:"suriname",SVK:"slovakia",SVN:"slovenia",SWE:"sweden",SWZ:"eswatini",SXM:"dutchSintMaarten",SYC:"seychelles",SYR:"syria",TCA:"turksAndCaicosIslands",TCD:"chad",TGO:"togo",THA:"thailand",TJK:"tajikistan",TKL:"tokelau",TKM:"turkmenistan",TLS:"timorLeste",TON:"tonga",TTO:"trinidadAndTobago",TUN:"tunisia",TUR:"turkey",TUV:"tuvalu",TWN:"taiwan",TZA:"tanzania",UGA:"uganda",UKR:"ukraine",UMI:"usMinorOutlyingIslands",URY:"uruguay",USA:"us",UZB:"uzbekistan",VAT:"holySee",VCT:"saintVincentAndTheGrenadines",VEN:"venezuela",VGB:"britishVirginIslands",VIR:"usVirginIslands",VNM:"vietnam",VUT:"vanuatu",WLF:"wallisAndFutuna",WSM:"samoa",XKX:"kosovo",YEM:"yemen",ZAF:"southAfrica",ZMB:"zambia",ZWE:"zimbabwe"};var La=(d=>(d.UsBorderCrossingCard="usBorderCrossingCard",d.ChinaExitEntryPermit="chinaExitEntryPermit",d.UsGlobalEntryCard="usGlobalEntryCard",d.ChinaMainlandTravelPermitTaiwan="chinaMainlandTravelPermitTaiwan",d.UsNexusCard="usNexusCard",d.ChinaMainlandTravelPermitHongKongMacau="chinaMainlandTravelPermitHongKongMacau",d.ApecBusinessTravelCard="apecBusinessTravelCard",d.PakistanAfghanCitizenCard="pakistanAfghanCitizenCard",d.SingaporeFinCard="singaporeFinCard",d.UsGreenCard="usGreenCard",d.MalaysiaIkad="malaysiaIkad",d.MalaysiaMykad="malaysiaMykad",d.MalaysiaMypr="malaysiaMypr",d.MexicoConsularVoterId="mexicoConsularVoterId",d.GermanyEid="germanyEid",d.UsCommonAccessCard="usCommonAccessCard",d.PhilippinesMultipurposeId="philippinesMultipurposeId",d.MalaysiaMykas="malaysiaMykas",d.MalaysiaMykid="malaysiaMykid",d.MalaysiaMytentera="malaysiaMytentera",d.MexicoProfessionalId="mexicoProfessionalId",d.MalaysiaRefugeeId="malaysiaRefugeeId",d.CanadaTribalId="canadaTribalId",d.UsUniformedServicesId="usUniformedServicesId",d.UsVeteranId="usVeteranId",d.PhilippinesWorkPermit="philippinesWorkPermit",d.SingaporeWorkPermit="singaporeWorkPermit",d.UsWorkPermit="usWorkPermit",d.PhilippinesSocialSecurityCard="philippinesSocialSecurityCard",d.SwedenSocialSecurityCard="swedenSocialSecurityCard",d.CanadaSocialSecurityCard="canadaSocialSecurityCard",d.UsSocialSecurityCard="usSocialSecurityCard",d.BelgiumMinorsId="belgiumMinorsId",d.ColombiaMinorsId="colombiaMinorsId",d.PeruMinorsId="peruMinorsId",d.BoliviaMinorsId="boliviaMinorsId",d.HungaryAddressCard="hungaryAddressCard",d.UkAsylumRequest="ukAsylumRequest",d.CanadaCitizenshipCertificate="canadaCitizenshipCertificate",d.SingaporeEmploymentPass="singaporeEmploymentPass",d.CanadaMinorsPublicServicesCard="canadaMinorsPublicServicesCard",d.MalaysiaMypolis="malaysiaMypolis",d.PhilippinesNbiClearance="philippinesNbiClearance",d.IndiaPanCard="indiaPanCard",d.PhilippinesPostalId="philippinesPostalId",d.PakistanProofOfRegistration="pakistanProofOfRegistration",d.SingaporeSPass="singaporeSPass",d.SwedenSisId="swedenSisId",d.ColombiaTemporaryProtectionPermit="colombiaTemporaryProtectionPermit",d.UsTwicCard="usTwicCard",d.UsWeaponPermit="usWeaponPermit",d.CanadaWeaponPermit="canadaWeaponPermit",d.IrelandPublicServicesCard="irelandPublicServicesCard",d.CanadaPublicServicesCard="canadaPublicServicesCard",d.PakistanConsularId="pakistanConsularId",d.GuatemalaConsularId="guatemalaConsularId",d.MexicoConsularId="mexicoConsularId",d.PhilippinesTaxId="philippinesTaxId",d.MexicoTaxId="mexicoTaxId",d.ChinaOneWayPermit="chinaOneWayPermit",d.UsMedicalMarijuanaCard="usMedicalMarijuanaCard",d.UsMunicipalId="usMunicipalId",d.AustraliaAsicCard="australiaAsicCard",d.UaeVehicleRegistrationCard="uaeVehicleRegistrationCard",d))(La||{});function Zt(e){return e.state===b.StageValid&&e.scanningFirstSideDone||!e.backViz.empty}function Ma(e){return Zt(e)||e.backProcessingStatus===xe.Success?e.state===b.Valid&&e.scanningFirstSideDone?"frontAndBack":"frontOnly":"frontOnly"}function wa(e){return "backViz"in e&&!e.backViz.empty}function Pa(e){switch(e){case C.PAKISTAN:return ["regionSpecific","pakistanConsularId"];case C.GUATEMALA:return ["regionSpecific","guatemalaConsularId"];case C.MEXICO:return ["regionSpecific","mexicoConsularId"];default:return ["regionSpecific",null]}}function qa(e){switch(e){case C.IRELAND:return ["regionSpecific","irelandPublicServicesCard"];case C.CANADA:return ["regionSpecific","canadaPublicServicesCard"];default:return ["regionSpecific",null]}}function ya(e){switch(e){case C.PHILIPPINES:return ["regionSpecific","philippinesWorkPermit"];case C.SINGAPORE:return ["regionSpecific","singaporeWorkPermit"];case C.USA:return ["regionSpecific","usWorkPermit"];default:return ["regionSpecific",null]}}function Ua(e){switch(e){case C.PHILIPPINES:return ["regionSpecific","philippinesSocialSecurityCard"];case C.SWEDEN:return ["regionSpecific","swedenSocialSecurityCard"];case C.CANADA:return ["regionSpecific","canadaSocialSecurityCard"];case C.USA:return ["regionSpecific","usSocialSecurityCard"];default:return ["regionSpecific",null]}}function ka(e){switch(e){case C.BELGIUM:return ["regionSpecific","belgiumMinorsId"];case C.COLOMBIA:return ["regionSpecific","colombiaMinorsId"];case C.PERU:return ["regionSpecific","peruMinorsId"];case C.BOLIVIA:return ["regionSpecific","boliviaMinorsId"];default:return ["regionSpecific",null]}}function Fa(e){switch(e){case C.PHILIPPINES:return ["regionSpecific","philippinesTaxId"];case C.MEXICO:return ["regionSpecific","mexicoTaxId"];default:return ["regionSpecific",null]}}function xa(e){switch(e){case C.USA:return ["regionSpecific","usWeaponPermit"];case C.CANADA:return ["regionSpecific","canadaWeaponPermit"];default:return ["regionSpecific",null]}}var oe=class e{constructor(t,a,r){this.alreadyReturnedStageValid=!1;this.recognizer=t,this.workerCallProvider=a,this.capturedSides=r;}reset(){this.alreadyReturnedStageValid=!1;}static concatenateReducer(t,a){return t+String.fromCodePoint(a)}static stringFromMultiScriptResult(t){return typeof t.latin=="string"&&t.latin.length>0?t.latin:typeof t.arabic=="string"&&t.arabic.length>0?t.arabic:typeof t.cyrillic=="string"&&t.cyrillic.length>0?t.cyrillic:""}static isCentaurusDateResult(t){return Object.prototype.hasOwnProperty.call(t,"originalString")}static isCentaurusStringResult(t){return !e.isCentaurusDateResult(t)}async processResult(t){var r,s;if(t===b.Uncertain)return {result:null,requiresReset:this.capturedSides==="frontOnly"?"hard":"soft"};let a=this.capturedSides==="frontOnly"?await this.processSingleSideResult(t):await this.processDoubleSideResult(t);return ((r=a.result)==null?void 0:r.vizResult.documentType)==null?{result:null,requiresReset:(s=a.requiresReset)!=null?s:"soft"}:a}centaurusDocumentTypeToIdCaptureDocumentType(t,a){switch(t){case l.NONE:case l.COUNT:return null;case l.ID:case l.VOTER_ID:case l.PASSPORT_CARD:case l.PROOF_OF_REGISTRATION:case l.NON_VOTER_ID:case l.PROOF_OF_AGE_CARD:return ["idCard",null];case l.DL:case l.DL_PUBLIC_SERVICES_CARD:case l.PROFESSIONAL_DL:case l.DRIVER_CARD:case l.DRIVING_PRIVILEGE_CARD:case l.DRIVER_QUALIFICATION_CARD:case l.PROVISIONAL_DL:return ["driverLicense",null];case l.PASSPORT:case l.ALIEN_PASSPORT:case l.CONSULAR_PASSPORT:case l.MINORS_PASSPORT:case l.REFUGEE_PASSPORT:return ["passport",null];case l.RESIDENCE_PERMIT:case l.RESIDENT_ID:case l.TEMPORARY_RESIDENCE_PERMIT:case l.ALIEN_ID:case l.SPECIAL_ID:return ["residencePermit",null];case l.VISA:case l.IMMIGRANT_VISA:return ["visaIcao",null];case l.HEALTH_INSURANCE_CARD:case l.INTERIM_HEALTH_INSURANCE_CARD:case l.RECIPROCAL_HEALTH_INSURANCE_CARD:return ["healthInsuranceCard",null];case l.CONSULAR_ID:return Pa(a);case l.EMPLOYMENT_PASS:return ["regionSpecific","singaporeEmploymentPass"];case l.FIN_CARD:return ["regionSpecific","singaporeFinCard"];case l.MULTIPURPOSE_ID:return ["regionSpecific","philippinesMultipurposeId"];case l.MYKAD:return ["regionSpecific","malaysiaMykad"];case l.MYKID:return ["regionSpecific","malaysiaMykid"];case l.MYPR:return ["regionSpecific","malaysiaMypr"];case l.MYTENTERA:return ["regionSpecific","malaysiaMytentera"];case l.PAN_CARD:return ["regionSpecific","indiaPanCard"];case l.PROFESSIONAL_ID:return ["regionSpecific","mexicoProfessionalId"];case l.PUBLIC_SERVICES_CARD:return qa(a);case l.WORK_PERMIT:return ya(a);case l.IKAD:return ["regionSpecific","malaysiaIkad"];case l.MILITARY_ID:return ["regionSpecific","usCommonAccessCard"];case l.MYKAS:return ["regionSpecific","malaysiaMykas"];case l.SOCIAL_SECURITY_CARD:return Ua(a);case l.S_PASS:return ["regionSpecific","singaporeSPass"];case l.ADDRESS_CARD:return ["regionSpecific","hungaryAddressCard"];case l.GREEN_CARD:return ["regionSpecific","usGreenCard"];case l.MINORS_ID:return ka(a);case l.POSTAL_ID:return ["regionSpecific","philippinesPostalId"];case l.TAX_ID:return Fa(a);case l.WEAPON_PERMIT:return xa(a);case l.BORDER_CROSSING_CARD:return ["regionSpecific","usBorderCrossingCard"];case l.GLOBAL_ENTRY_CARD:return ["regionSpecific","usGlobalEntryCard"];case l.MYPOLIS:return ["regionSpecific","malaysiaMypolis"];case l.NEXUS_CARD:return ["regionSpecific","usNexusCard"];case l.REFUGEE_ID:return ["regionSpecific","malaysiaRefugeeId"];case l.TRIBAL_ID:return ["regionSpecific","canadaTribalId"];case l.VETERAN_ID:return ["regionSpecific","usVeteranId"];case l.CITIZENSHIP_CERTIFICATE:return ["regionSpecific","canadaCitizenshipCertificate"];case l.MINORS_PUBLIC_SERVICES_CARD:return ["regionSpecific","canadaMinorsPublicServicesCard"];case l.ASYLUM_REQUEST:return ["regionSpecific","ukAsylumRequest"];case l.UNIFORMED_SERVICES_ID:return ["regionSpecific","usUniformedServicesId"];case l.CONSULAR_VOTER_ID:return ["regionSpecific","mexicoConsularVoterId"];case l.TWIC_CARD:return ["regionSpecific","usTwicCard"];case l.NBI_CLEARANCE:return ["regionSpecific","philippinesNbiClearance"];case l.TEMPORARY_PROTECTION_PERMIT:return ["regionSpecific","colombiaTemporaryProtectionPermit"];case l.AFGHAN_CITIZEN_CARD:return ["regionSpecific","pakistanAfghanCitizenCard"];case l.EID:return ["regionSpecific","germanyEid"];case l.SIS_ID:return ["regionSpecific","swedenSisId"];case l.ASIC_CARD:return ["regionSpecific","australiaAsicCard"];case l.VEHICLE_REGISTRATION:return ["regionSpecific","uaeVehicleRegistrationCard"];case l.EXIT_ENTRY_PERMIT:case l.MAINLAND_TRAVEL_PERMIT_TAIWAN:case l.BIDOON_CARD:case l.PASS:case l.MY_NUMBER_CARD:return null;default:assertUnreachable(t);}return null}convertDate(t){if(t.successfullyParsed===!0&&t.empty===!1){let a=t;return {day:a.day,month:a.month,year:a.year}}return null}async convertResult(t){if(t.state===b.Empty)return {result:null};if(this.isSingleSideResult(t)){if(t.viz.empty)return !t.barcode.empty||t.mrz.rawMRZString.length>0?{result:null,requiresReset:"hard"}:{result:null}}else if(t.frontViz.empty&&t.backViz.empty)return {result:null,requiresReset:"hard"};return this.alreadyReturnedStageValid=t.state===b.StageValid,{result:{mrzResult:null,vizResult:await this.getVizData(t),barcodeResult:null,imageInfo:this.getImageData(t),verificationResult:null}}}async extractVizData(t,a,r){var w,H,ue,ce;let s=e.stringFromMultiScriptResult,o=s(a.vehicleClass),c=s(a.restrictions),u=s(a.endorsements),m=this.workerCallProvider(),S=null;m&&(o.length>0||c.length>0||u.length>0)&&(S=await We.create(m).createDrivingLicenseDetailsFromBlinkIdData(o,c,u));let[g,N]=(w=this.centaurusDocumentTypeToIdCaptureDocumentType(t.documentType,t.country))!=null?w:[null,null];return {firstName:s(r.firstName),lastName:s(r.lastName),secondaryLastName:null,fullName:s(r.fullName),sex:s(r.sex),dateOfBirth:this.convertDate(r.dateOfBirth),nationality:s(r.nationality),address:s(r.address),documentType:g,documentSubtype:N,issuingCountryIso:(H=t.isoAlpha3CountryCode)!=null?H:null,issuingCountry:(ce=Jt[(ue=t.isoAlpha3CountryCode)!=null?ue:""])!=null?ce:null,documentNumber:s(r.documentNumber),dateOfExpiry:this.convertDate(r.dateOfExpiry),dateOfIssue:this.convertDate(r.dateOfIssue),additionalAddressInformation:s(r.additionalAddressInformation),additionalNameInformation:s(r.additionalNameInformation),documentAdditionalNumber:s(r.documentAdditionalNumber),employer:s(r.employer),issuingAuthority:s(r.issuingAuthority),maritalStatus:s(r.maritalStatus),personalIdNumber:s(r.personalIdNumber),placeOfBirth:s(r.placeOfBirth),profession:s(r.profession),race:s(r.race),religion:s(r.religion),residentialStatus:s(r.residentialStatus),mothersName:s(r.mothersName),fathersName:s(r.fathersName),issuingJurisdiction:jt(t.region),issuingJurisdictionIso:null,drivingLicenseDetails:S?S.toJSONObject():null,bloodType:s(r.bloodType),sponsor:s(r.sponsor),passportNumber:null,visaNumber:null}}getFieldLocations(t){var r,s;let a={};for(let o of Object.keys(t)){let c=o,u=t[c];if(typeof u=="object"){if(u.hasOwnProperty("latinLocation")&&((r=u.latinLocation)==null?void 0:r.topLeft)!=null){let{topLeft:m,bottomRight:S}=u.latinLocation;a[c]=new Quadrilateral(new Point(m.x,m.y),new Point(S.x,m.y),new Point(S.x,S.y),new Point(m.x,S.y)).toJSONObject();}else if(u.hasOwnProperty("originalString")){let m=u;if(((s=m.originalString)==null?void 0:s.hasOwnProperty("latinLocation"))===!0&&m.originalString.latinLocation!==void 0){let{topLeft:S,bottomRight:g}=m.originalString.latinLocation;a[c]=new Quadrilateral(new Point(S.x,S.y),new Point(g.x,S.y),new Point(g.x,g.y),new Point(S.x,g.y)).toJSONObject();}}}}return a}getImageBase64String(t){return t?btoa(t.reduce((a,r)=>e.concatenateReducer(a,r),"")):null}getImageData(t){let a={face:this.getImageBase64String(t.faceImage.encodedImage)};return this.isSingleSideResult(t)?{front:{...a,croppedDocument:this.getImageBase64String(t.fullDocumentImage.encodedImage),frame:null},back:{face:null,croppedDocument:null,frame:null}}:{front:{...a,croppedDocument:this.getImageBase64String(t.fullDocumentFrontImage.encodedImage),frame:null},back:{face:null,croppedDocument:this.getImageBase64String(t.fullDocumentBackImage.encodedImage),frame:null}}}getRealIdStatus(t){switch(this.isSingleSideResult(t)?t.imageAnalysisResult.realIDDetectionStatus:t.frontImageAnalysisResult.realIDDetectionStatus){case ae.NotAvailable:return "notAvailable";case ae.NotDetected:return "notRealIdCompliant";case ae.Detected:return "realIdCompliant";default:return "notAvailable"}}async getVizData(t){let a=this.getRealIdStatus(t);if(this.isSingleSideResult(t))return {...await this.extractVizData(t.classInfo,t.driverLicenseDetailedInfo,t.viz),usRealIdStatus:a,capturedSides:"frontOnly",isBackSideCaptureSupported:!1,frontFieldLocations:this.getFieldLocations(t.viz)};let r=Ma(t),s={...await this.extractVizData(t.classInfo,t.driverLicenseDetailedInfo,t.frontViz),usRealIdStatus:a,capturedSides:r,isBackSideCaptureSupported:Zt(t),frontFieldLocations:this.getFieldLocations(t.frontViz)};if(!wa(t))return s;let o=["address","dateOfBirth","dateOfExpiry","dateOfIssue","documentNumber","firstName","fullName","lastName","nationality","sex","additionalAddressInformation","additionalNameInformation","documentAdditionalNumber","employer","issuingAuthority","maritalStatus","personalIdNumber","placeOfBirth","profession","race","religion","residentialStatus","mothersName","fathersName"],{backViz:c}=t;for(let u of o)if(s[u]==null||s[u]===""){let S=c[u];this.handleEmptyFrontValue(s,u,S);}return s}handleEmptyFrontValue(t,a,r){if(e.isCentaurusStringResult(r)){let s=e.stringFromMultiScriptResult(r);s.length>0&&(t[a]=s);}else if(e.isCentaurusDateResult(r)){let s=this.convertDate(r);s&&(t[a]=s);}}isSingleSideResult(t){return this.capturedSides==="frontOnly"}hasResult(t){return t===b.Valid||t===b.StageValid&&!this.alreadyReturnedStageValid}async processDoubleSideResult(t){if(this.hasResult(t)){let a=await this.recognizer.getResult();return this.convertResult(a)}return {result:null}}async processSingleSideResult(t){if(t===b.Valid){let a=await this.recognizer.getResult();return this.convertResult(a)}return {result:null}}};var T=class{static isSingleSideScanner(t){return !t._isFull}static isFullDocumentScanner(t){return t._isFull}};var Ve=class e{constructor(t,a,r){this._settingsCapturedSides=null;this.isProcessing=!1;this._lastError=null;this._lastResult=null;this._lastLocalization=null;this._currentDetectionOnlyMode=!1;this.idCapture=t,this.centaurusWasmSDK=a,this._workerCallProvider=r;}static hasRecognizerRunnerCrashed(t){return t instanceof R&&t.code===A.WORKER_IMAGE_PROCESS_FAILURE}static updatePassedRecognizerSettings(t,a,r={}){a.returnFullDocumentImage=t.getShouldPassImageTypeToResult("croppedDocument"),a.returnEncodedFullDocumentImage=t.getShouldPassImageTypeToResult("croppedDocument"),a.returnFaceImage=t.getShouldPassImageTypeToResult("face"),a.returnEncodedFaceImage=t.getShouldPassImageTypeToResult("face");let s=new Fe;switch(s.enableMrzId=!0,s.enableMrzPassport=!0,s.enableMrzVisa=!0,s.enableBarcodeId=!0,s.enablePhotoId=!1,s.enableFullDocumentRecognition=!0,a.recognitionModeFilter=s,t.getProperty("anonymizeCapturedData")===!1&&(t.anonymizationMode="none"),t.anonymizationMode){case"none":{a.anonymizationMode=W.None;break}case"fieldsOnly":{a.anonymizationMode=W.None;break}case"imagesOnly":{a.anonymizationMode=W.ImageOnly;break}case"fieldsAndImages":{a.anonymizationMode=W.ImageOnly;break}}a.scanCroppedDocumentImage=typeof r.scanCroppedDocumentImage=="boolean"?r.scanCroppedDocumentImage:!1;}async init(t){if(e.recognizerRunner!=null)throw new DataCaptureError({name:"MULTIPLE_RECOGNIZER_RUNNER",message:"A RecognizerRunner already exists, but it must be a singleton"});this.idCaptureSettings=t;let{scannerType:a}=t;this._settingsCapturedSides=T.isSingleSideScanner(a)?"frontOnly":"frontAndBack";let r=await this.getConfiguredRecognizer(this.idCaptureSettings);if(!r)throw new DataCaptureError({name:"RECOGNIZER_CREATION_FAILURE",message:"Recognizer instance could not be created."});this.recognizer=r,await this.createRunner(),await this.setDetectionOnlyMode(t.captureTrigger==="buttonTap"),this.resultProcessor=new oe(this.recognizer,this._workerCallProvider,this._settingsCapturedSides);}async applySettings(t){let a=T.isSingleSideScanner(t.scannerType)?"frontOnly":"frontAndBack",r=this._settingsCapturedSides!==a;if(this.idCaptureSettings=t,this._settingsCapturedSides=a,r&&e.recognizerRunner){await e.recognizerRunner.reconfigureRecognizers([],!1),await this.recognizer.delete();let s=await this.getConfiguredRecognizer(this.idCaptureSettings);if(s==null)throw new DataCaptureError({name:"RECOGNIZER_CREATION_FAILURE",message:"applySettings: recognizer instance could not be created."});this.recognizer=s,await e.recognizerRunner.reconfigureRecognizers([this.recognizer],!1),this.resultProcessor=new oe(this.recognizer,this._workerCallProvider,this._settingsCapturedSides);}else await this.reconfigureRecognizer(t);}async processFrame(t,a){if(this.isProcessing||e.recognizerRunner==null)return !1;this.isProcessing=!0,await this.configuringRecognizersPromise,(a==null?void 0:a.scanCroppedDocumentImage)===!0&&await this.reconfigureRecognizer(this.idCaptureSettings,{scanCroppedDocumentImage:!0});try{await this.recognize(t);}finally{(a==null?void 0:a.scanCroppedDocumentImage)===!0&&await this.reconfigureRecognizer(this.idCaptureSettings,{scanCroppedDocumentImage:!1}),this.isProcessing=!1;}return this.getLastResult()!=null}onQuadDetection(t){this._lastLocalization=t.detectionStatus===M.Success?Quadrilateral.fromJSON(t):null,this.reportLastLocalizedDocument(this._lastLocalization),this.reportLastDetectionIssue(t);}async dispose(){var t;await((t=e.recognizerRunner)==null?void 0:t.delete()),e.recognizerRunner=void 0,await this.recognizer.delete();}async reset(t=!0){var a;await((a=e.recognizerRunner)==null?void 0:a.resetRecognizers(t)),this._lastResult=null,this._lastError=null,t&&this.resultProcessor.reset();}async setDetectionOnlyMode(t){if(this._currentDetectionOnlyMode!==t){if(e.recognizerRunner==null)throw new O("Cannot set detection mode, IdCapture has not initialized yet.");this._currentDetectionOnlyMode=t,await e.recognizerRunner.setDetectionOnlyMode(t);}}displayDetectionStatusInUI(t){let a=window,r=a.centaurusDetectionStatus;r==null&&(r=document.createElement("div"),r.className="centaurusDetectionStatus",r.style.position="absolute",r.style.zIndex="1000",r.style.top="10px",r.style.left="10px",r.style.padding="0 1rem",r.style.backgroundColor="white",document.body.append(r),a.centaurusDetectionStatus=r),r.textContent=`LocalizedStatus: ${M[t.detectionStatus]}`;}reportLastLocalizedDocument(t){if(t==null)this.idCapture.reportLastLocalizedId(null);else {let a=Ge.fromJSON({location:t});this.idCapture.reportLastLocalizedId(a);}}reportLastDetectionIssue(t){let a=null;switch(t.detectionStatus){case M.CameraTooFar:{a="DocumentTooFar";break}case M.CameraTooClose:case M.DocumentTooCloseToCameraEdge:case M.DocumentPartiallyVisible:{a="DocumentTooClose";break}default:a=null;}this.idCapture.reportLastDetectionIssue(a);}getLastResult(){return this._lastResult}async setLastResult(t){return this._lastResult=t,this.idCapture.reportLastResult(t)}getLastError(){return this._lastError}async setLastError(t){if(t!==this._lastError)return this.idCapture.reportLastError(t);this._lastError=t;}async createRunner(){e.recognizerRunner=await Vt(this.centaurusWasmSDK,[this.recognizer],!1,this);}async getConfiguredRecognizer(t){let{centaurusWasmSDK:a}=this,r=T.isFullDocumentScanner(t.scannerType),s;try{if(r){s=await zt(a);let o=await s.currentSettings();e.updatePassedRecognizerSettings(t,o),await s.updateSettings(o);}else {s=await Ht(a);let o=await s.currentSettings();e.updatePassedRecognizerSettings(t,o),await s.updateSettings(o);}}catch(o){Logger.log(Logger.Level.Warn,"Error while applying new settings on recognizer object, some features might not work.",o);}return s}getRecognizerErrorMessage(t){return t instanceof R?`Processing frame failed: ${t.message} (code=${t.code})`:`Processing frame failed: ${t instanceof Error?t.message:"unknown error"}`}async recognize(t){let a=new Ue({...t,colorSpace:"srgb"},ye.NoRotation,!1),r;try{await this.setLastResult(null),await this.setLastError(null),r=await e.recognizerRunner.processImage(a);}catch(c){if(e.hasRecognizerRunnerCrashed(c)){await this.resetRecognizerRunner(),this.notifyRecoveryAfterError();return}let u=this.getRecognizerErrorMessage(c);throw await this.setLastError({type:"Undefined",message:u}),O.create({type:"Undefined",message:u})}let{result:s,requiresReset:o}=await this.resultProcessor.processResult(r);typeof o=="string"&&await this.reset(o==="hard"),!(s!=null&&!this.checkImagesPresence(s,r))&&(s!=null&&this._lastLocalization!=null&&this.addLocationInformationToResult(s,this._lastLocalization),await this.setLastResult(s));}checkImagesPresence(t,a){if(!(t.vizResult.capturedSides==="frontAndBack")||a!==b.Valid)return !0;let s=Object.values(et).filter(c=>c!=="frame");return !s.some(c=>this.isImageRequiredButEmpty(t.imageInfo,c))}addLocationInformationToResult(t,a){let r=["barcodeResult","mrzResult","vizResult"];for(let s of r)t[s]!=null&&(t[s].location=a.toJSONObject());}async reconfigureRecognizer(t,a={}){if(e.recognizerRunner){await e.recognizerRunner.reconfigureRecognizers([],!1);let r=await this.recognizer.currentSettings();e.updatePassedRecognizerSettings(t,r,a),await this.recognizer.updateSettings(r),await e.recognizerRunner.reconfigureRecognizers([this.recognizer],!1);}}async resetRecognizerRunner(){var t;return await((t=e.recognizerRunner)==null?void 0:t.delete()),await this.recognizer.delete(),e.recognizerRunner=void 0,Logger.log(Logger.Level.Debug,"Recreating Centaurus recognizer"),this.init(this.idCaptureSettings)}notifyRecoveryAfterError(){this.idCapture.notifyRecoveryAfterCrash();}isImageRequiredButEmpty(t,a){var s,o,c;return this.idCaptureSettings.getShouldPassImageTypeToResult(a)?a==="face"?((s=t==null?void 0:t.front.face)!=null?s:"")==="":a==="croppedDocument"?((o=t==null?void 0:t.front.croppedDocument)!=null?o:"")===""||((c=t==null?void 0:t.back.croppedDocument)!=null?c:"")==="":!1:!1}};var Wa=(N=>(N.NotAcceptedDocumentType="notAcceptedDocumentType",N.InvalidFormat="invalidFormat",N.DocumentVoided="documentVoided",N.Timeout="timeout",N.SingleImageNotRecognized="singleImageNotRecognized",N.DocumentExpired="documentExpired",N.DocumentExpiresSoon="documentExpiresSoon",N.NotRealIdCompliant="notRealIdCompliant",N.HolderUnderage="holderUnderage",N.ForgedAamvaBarcode="forgedAamvaBarcode",N.InconsistentData="inconsistentData",N))(Wa||{});var D={Available:"Available",ProcessingFrame:"ProcessingFrame",ProcessingQueue:"ProcessingQueue"},He=class e{constructor(){this.type="idCapture";this._synchronousFrameFlow=!0;this.state=D.Available;this._isEnabled=!0;this._context=null;this.listeners=[];this.overlayListeners=new Set;this._endOfCycleTasks=[];this._feedback=pe.defaultFeedback;this._onProcessFrameListener=this.onProcessFrame.bind(this);this.workerMessageListener=this.onWorkerMessage.bind(this);e._centaurusLoader!=null&&(this._centaurusConnector=new Ve(this,e._centaurusLoader.wasmSDK,()=>{var t;return (t=this.privateContext)==null?void 0:t.workerCommand})),this.contextListener={didChangeFrameSource:this.didChangeFrameSource.bind(this)};}static get recommendedCameraSettings(){return new CameraSettings(_.IdCapture.RecommendedCameraSettings)}get context(){return this._context}get feedback(){return this._feedback}get privateContext(){return this.context}static setCentaurusLoader(t){e._centaurusLoader=t;}static async forContext(t,a){let r=new e;if(r.settings=a,r._centaurusConnector)try{await r._centaurusConnector.init(r.settings);}catch(s){throw s instanceof DataCaptureError&&s.name==="MULTIPLE_RECOGNIZER_RUNNER"&&Logger.log(Logger.Level.Error,"The newly created IdCapture mode is invalid, an existing IdCapture mode is still attached to the context and must be removed first."),s}else r.checkCaptureSettingsAgainstSDKConfiguration(a);return t&&await t.addMode(r),r}async setFeedback(t){return this._feedback=t,this.didChange()}addListener(t){this.listeners.includes(t)||this.listeners.push(t);}removeListener(t){this.listeners.includes(t)&&this.listeners.splice(this.listeners.indexOf(t),1);}isEnabled(){return this._isEnabled}async setEnabled(t){this._isEnabled!==t&&(this._isEnabled=t,this.enqueueTask(async()=>this.didChange([{type:"modeEnabled",newValue:t}])),this.state===D.Available&&this.moveToState(D.ProcessingQueue));}async reset(){this.enqueueTask(async()=>this.doReset()),this.state===D.Available&&this.moveToState(D.ProcessingQueue);}async applySettings(t){this.enqueueTask(async()=>this.doApplySettings(t)),this.state===D.Available&&this.moveToState(D.ProcessingQueue);}async parse(t){if(this.context){let a=await this.context.workerCommand("idCaptureParse",{code:t});if((a==null?void 0:a.result)!=null){let r=a.result;if((r==null?void 0:r.status)==="error")throw O.create({type:"InvalidLicenseKeyForParser",message:r.error});if((r==null?void 0:r.status)==="success"){let s=this.convertRawImagesToBase64(r.capturedId.rawImageInfo);return ne.fromJSON({...r.capturedId,imageInfo:s})}}}return null}toJSONObject(){var t,a;return {enabled:this._isEnabled,type:this.type,settings:{...this.settings.toJSONObject(),licensee:"",licenseKey:(a=(t=e._centaurusLoader)==null?void 0:t.licenseKey)!=null?a:""}}}didChangeFrameSource(){this.moveToState(D.ProcessingQueue);}moveToState(t){this.state=t,t===D.ProcessingQueue&&this.processQueue();}async doReset(){var t;await((t=this.privateContext)==null?void 0:t.workerCommand("idCaptureReset",{}));}async doApplySettings(t){var a,r,s;this.context&&(this.settings=t,this.checkCaptureSettingsAgainstSDKConfiguration(t),await Promise.all([this.settingsIncludeVIZDocuments(t)?(a=this._centaurusConnector)==null?void 0:a.applySettings(t):Promise.resolve(),(r=this.privateContext)==null?void 0:r.workerCommand("idCaptureApplySettings",{settings:t.toJSONObject()}),(s=this.privateContext)==null?void 0:s.update()]));}addOverlayListener(t){this.overlayListeners.add(t);}removeOverlayListener(t){this.overlayListeners.delete(t);}checkCaptureSettingsAgainstSDKConfiguration(t){if(!this._centaurusConnector&&this.settingsIncludeVIZDocuments(t))throw O.create({type:"InvalidSettingsForVIZProcessing",message:"Invalid IdCapture configuration or settings: supported documents contain some VIZ documents, but VIZ scanning is disabled."})}async onProcessFrame(t){var a,r;return this.state!==D.Available?"skip":((a=this.privateContext)==null||a.performanceMark("processFrameBeforeCentaurus"),this.moveToState(D.ProcessingFrame),await this.doProcessFrame(t),(r=this.privateContext)==null||r.performanceMark("processFrameAfterCentaurus"),"continue")}async doProcessFrame(t){var a;if(this._isEnabled&&this.settingsIncludeVIZDocuments(this.settings)){let r=new Uint8ClampedArray(t.data),s=(a=this.context)==null?void 0:a.frameSource;!await this.processFrameWithCentaurus({data:r,width:t.width,height:t.height})&&(s==null?void 0:s.type)==="singleImageUploader"&&(r=new Uint8ClampedArray(t.data),await this.processFrameWithCentaurus({data:r,width:t.width,height:t.height},{scanCroppedDocumentImage:!0}));}}async onAfterProcessFrame(){this.moveToState(D.ProcessingQueue);}logPerformance(){let t=performance.getEntriesByName("processFrameBeforeCentaurus").length>0?performance.measure("Centaurus","processFrameBeforeCentaurus","processFrameAfterCentaurus").duration:0,a=performance.measure("SDC","processFrameBeforeSDC","processFrameAfterSDC").duration,r=`${(t+a).toFixed(2)}ms`;console.log(`centaurus: ${t.toFixed(2)}`,`sdc: ${a.toFixed(2)}`,`total: ${r}`),performance.clearMarks();}enqueueTask(t){this._endOfCycleTasks.push(t);}async processQueue(){if(this._endOfCycleTasks.length===0){this.moveToState(D.Available);return}for(;this._endOfCycleTasks.length>0;){let t=this._endOfCycleTasks.shift();await(t==null?void 0:t());}this.moveToState(D.Available);}settingsIncludeVIZDocuments(t){let{scannerType:a}=t;return T.isFullDocumentScanner(a)?!0:a.visualInspectionZone}attachedToContext(t){this._context=t,this._context.subscribeToWorkerMessages(this.workerMessageListener),this._context.registerFrameHandler(this._onProcessFrameListener),this._context.addListener(this.contextListener);}async detachedFromContext(){var t,a,r;return (t=this._context)==null||t.unsubscribeToWorkerMessages(this.workerMessageListener),(a=this._context)==null||a.unregisterFrameHandler(this._onProcessFrameListener),(r=this._context)==null||r.removeListener(this.contextListener),this._context=null,this.dispose()}async dispose(){var t;this.listeners=[],await((t=this._centaurusConnector)==null?void 0:t.dispose()),this._centaurusConnector=void 0;}async didChange(t){if(this.context)return this.context.update(t)}async onWorkerMessage(t){switch(t.type){case"idCaptureDidCaptureId":{this.triggerListenersForResult("didCaptureId",t.payload);break}case"idCaptureDidRejectId":{await this.triggerListenersForResult("didRejectId",t.payload),t.payload.rejectionReason==="singleImageNotRecognized"&&await this.reset();break}case"idCaptureDidShutterButtonPositionChanged":{for(let a of this.overlayListeners)a.onShutterPositionUpdate(t.payload.position);break}case"idCaptureDidShutterButtonStateChanged":{for(let a of this.overlayListeners)a.onShutterButtonStateChanged(t.payload.state);break}case"idCaptureIdCapturedFeedback":{this._feedback.idCaptured.emit();break}case"idCaptureIdRejectedFeedback":{this._feedback.idRejected.emit();break}case"idCaptureBackendReset":{this.enqueueTask(async()=>{var a;return (a=this._centaurusConnector)==null?void 0:a.reset()});break}case"idCaptureDetectionOnlyMode":{this.enqueueTask(async()=>{var a;return (a=this._centaurusConnector)==null?void 0:a.setDetectionOnlyMode(t.payload.detectionOnlyMode)}),this.state===D.Available&&this.moveToState(D.ProcessingQueue);break}case"onFrameProcessingStarted":break;case"onFrameProcessingFinished":{this.onAfterProcessFrame();break}case"onFrameSkipped":{this.onAfterProcessFrame();break}}}async processFrameWithCentaurus(t,a){try{return await this._centaurusConnector.processFrame(t,a)}catch(r){return r instanceof O?(Logger.log(Logger.Level.Debug,r.message),this.triggerErrorListener(r)):(Logger.log(Logger.Level.Debug,"Error while processing incoming frame from SDC",r),this.triggerErrorListener(O.create({type:"Undefined",message:"Error while processing a frame"}))),!1}}uint8ArrayImageToBase64(t,a,r){let s=document.createElement("canvas");s.width=a,s.height=r;let o=s.getContext("2d");if(!o)throw new Error("Could not get 2d context from an HTMLCanvasElement");o.putImageData(new ImageData(t,a,r,{colorSpace:"srgb"}),0,0);let c=o.canvas.toDataURL("image/png",1).replace("data:image/png;base64,","");return o=null,s=null,c}convertRawImagesToBase64(t){return {front:{...t.front,frame:t.front.frame.data==null?null:this.uint8ArrayImageToBase64(t.front.frame.data,t.front.frame.width,t.front.frame.height)},back:{...t.back,frame:t.back.frame.data==null?null:this.uint8ArrayImageToBase64(t.back.frame.data,t.back.frame.width,t.back.frame.height)}}}async triggerListenersForResult(t,a){if(!this.context||!this._isEnabled)return;let r=null;if(a.capturedId){let s=this.convertRawImagesToBase64(a.capturedId.rawImageInfo);r=ne.fromJSON({...a.capturedId,imageInfo:s});}for(let s of this.listeners)if(typeof s[t]=="function"){let o=[r];t==="didRejectId"&&typeof a.rejectionReason=="string"&&o.push(a.rejectionReason);let c=s[t].apply(null,o);c instanceof Promise&&await c;}}notifyRecoveryAfterCrash(){if(!this._isEnabled)return;let t=!1;for(let a of this.listeners)typeof a.didFailWithError=="function"&&(a.didFailWithError(this,O.create({type:"RecoveredAfterFailure",message:"Last image processing failed but SDK could recover. Please reset scanning process."})),t=!0);!t&&this.settings.scannerType._isFull&&Logger.log(Logger.Level.Warn,`A process responsible to scan images malfunctioned and was restarted. No listener for "didFailWithError" was
|
|
2
2
|
found: this may result in unexpected behaviour in your application. Please define the listener
|
|
3
3
|
"didFailWithError" and handle the error "IdCaptureErrorCode.RecoveredAfterFailure". Informing the user to
|
|
4
|
-
start over and calling "idCapture.reset()" in this case is recommended.`);}triggerErrorListener(t){if(this._isEnabled)for(let a of this.listeners)typeof a.didFailWithError=="function"&&a.didFailWithError(this,t);}async reportLastResult(t){var a;if(this.context)return (a=this.privateContext)==null?void 0:a.workerCommand("idCaptureSetLastResult",{result:t==null?"":JSON.stringify(t)})}async reportLastError(t){var a;if(this.context)return (a=this.privateContext)==null?void 0:a.workerCommand("idCaptureSetLastError",{error:t==null?"":JSON.stringify(t)})}async reportLastLocalizedId(t){var a;if(this.context)return (a=this.privateContext)==null?void 0:a.workerCommand("idCaptureSetLastLocalizedId",{localizedId:t==null?"":JSON.stringify(t.toJSONObject())})}async reportLastDetectionIssue(t){var a;if(this.context)return (a=this.privateContext)==null?void 0:a.workerCommand("idCaptureSetLastDetectionIssue",{issue:JSON.stringify({issue:t!=null?t:""})})}};var ze=class{constructor(t){this.idCaptureWorkerManager=t;}get workerCommand(){return this.idCaptureWorkerManager.workerCommand.bind(this.idCaptureWorkerManager)}async getLicenseText(){return (await this.workerCommand("getIdOpenSourceSoftwareLicenseInfo",{})).licenseText}};var Yt={"id.idCaptureOverlay.scanFrontSideHint":"","id.idCaptureOverlay.scanBackSideHint":"","id.idCaptureOverlay.moveCloseTextHint":"","id.idCaptureOverlay.moveFurtherAwayTextHint":"","id.idCaptureOverlay.tapShutterToScan":"","id.idCaptureOverlay.lookingForDocument":"","id.idCaptureOverlay.holdStill":""};function Qt(e){let t=URL.createObjectURL(new Blob(['"use strict";(()=>{var ye=(a,e)=>()=>(a&&(e=a(a=0)),e);var g,c=ye(()=>{g={"scandit-datacapture-sdk-id-pthreads.wasm":{bytes:8234748},"scandit-datacapture-sdk-id-simd.wasm":{bytes:8121044},"scandit-datacapture-sdk-id.wasm":{bytes:8182686},"scandit-datacapture-sdk-id-simd-pthreads.wasm":{bytes:8173878}}});c();c();c();c();var d;(a=>{(n=>(n.Debug="debug",n.Info="info",n.Warn="warn",n.Error="error",n.Quiet="quiet"))(a.Level||(a.Level={}));let e=new Map([["debug",1],["info",2],["warn",3],["error",4],["quiet",5]]),t="debug";function r(n){t=n}a.setLevel=r;function s(n,...u){if(!(e.get(t)>e.get(n)))switch(n){case"debug":{console.debug(...u);break}case"info":{console.log(...u);break}case"warn":{console.warn(...u);break}case"error":{console.error(...u);break}}}a.log=s;function i(...n){s("warn",...n)}a.warn=i;function o(...n){s("debug",...n)}a.debug=o;function l(...n){s("info",...n)}a.info=l;function p(...n){s("error",...n)}a.error=p})(d||(d={}));c();c();c();c();var A=class q extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,q.prototype),this.name=e.name}toString(){return`${this.name}: ${this.message}`}};var F=Promise.resolve(),H=!1,N=!1,M,T={writableDataPath:""};async function X(a){if(M==null)return;H=!0;let e=new Promise((t,r)=>{setTimeout(()=>{r(new A({name:"BlockedIndexedDB",message:"IndexedDB database is blocked"}))},1500)});try{await Promise.race([new Promise((t,r)=>{M?.(a,s=>{if(s!=null){r(s);return}t()})}),e])}finally{H=!1}}async function Y(a){return N||(H?(N=!0,F=F.then(async()=>(N=!1,X(a)))):F=X(a)),F}async function Z(a){T=a,M=FS.syncfs,FS.syncfs=(e,t)=>{let r=t,s=i=>{r(i)};Y(e).then(s).catch(s)};try{FS.mkdir(T.writableDataPath)}catch(e){if(e.code!=="EEXIST")throw M=void 0,e}return FS.mount(IDBFS,{},T.writableDataPath),Y(!0)}c();c();c();c();var B=(a,e)=>(e=Symbol[a])?e:Symbol.for("Symbol."+a);var V=function(a,e){this[0]=a,this[1]=e},Q=(a,e,t)=>{var r=(o,l,p,n)=>{try{var u=t[o](l),h=(l=u.value)instanceof V,C=u.done;Promise.resolve(h?l[0]:l).then(y=>h?r(o==="return"?o:"next",l[1]?{done:y.done,value:y.value}:y,p,n):p({value:y,done:C})).catch(y=>r("throw",y,p,n))}catch(y){n(y)}},s=o=>i[o]=l=>new Promise((p,n)=>r(o,l,p,n)),i={};return t=t.apply(a,e),i[B("asyncIterator")]=()=>i,s("next"),s("throw"),s("return"),i},ee=(a,e,t)=>(e=a[B("asyncIterator")])?e.call(a):(a=a[B("iterator")](),e={},t=(r,s)=>(s=a[r])&&(e[r]=i=>new Promise((o,l,p)=>(i=s.call(a,i),p=i.done,Promise.resolve(i.value).then(n=>o({value:n,done:p}),l)))),t("next"),t("return"),e);var te={};function Ie(a){return[...new Uint8Array(a)].map(e=>{let t=e.toString(16);return t.length===1?`0${t}`:t}).join("")}function De(a){return Q(this,null,function*(){let e=a.getReader();try{for(;;){let{done:t,value:r}=yield new V(e.read());if(t)return;yield r}}finally{e.releaseLock()}})}async function be(a){let e=[],t=0,r=0;try{for(var s=ee(De(a)),i,o,l;i=!(o=await s.next()).done;i=!1){let n=o.value;e.push(n),t+=n.length}}catch(n){l=[n]}finally{try{i&&(o=s.return)&&await o.call(s)}finally{if(l)throw l[0]}}let p=new Uint8Array(t);for(let n of e)p.set(n,r),r+=n.length;return p.buffer}var we=(a=>(a.VALID="VALID",a.INVALID="INVALID",a.NOT_VERIFIABLE="NOT_VERIFIABLE",a))(we||{});async function Me(a,e,t){if(typeof crypto.subtle.digest!="function")return d.log(d.Level.Warn,`Insecure context (see https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts): The hash of the Scandit Data Capture library WASM file found at ${t} could not be verified`),"NOT_VERIFIABLE";try{let r=a instanceof Promise?await a:a,s=await crypto.subtle.digest("SHA-256",r),i=Ie(s);return e==null?(d.log(d.Level.Warn,"The library hash is not defined or empty, cannot correctly verify integrity."),"NOT_VERIFIABLE"):i===e?(d.log(d.Level.Debug,`Data Capture library WASM integrity found at ${t} has been verified correctly.`),"VALID"):(d.log(d.Level.Warn,`The Scandit Data Capture library WASM file found at ${t} seems invalid: expected file hash doesn\'t match (received: ${i}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),"INVALID")}catch(r){return d.log(d.Level.Warn,"Wasm response could not be verified",r),"NOT_VERIFIABLE"}}var _=new Map([["br",4.4],["gzip",2.9],["none",1]]);function ve(a){var e;let t="content-encoding";if(a==null||a.get(t)==null)return _.get("none");let r=new Set(((e=a.get(t))!=null?e:"").split(",").map(s=>s.trim()));for(let[s,i]of _)if(r.has(s))return i;return _.get("none")}function xe(a){var e,t;if(a==null)return 0;let r=(e=ve(a))!=null?e:1,s=Number.parseInt((t=a.get("content-length"))!=null?t:"0",10);return Number.isNaN(s)?0:Math.floor(s*r*100)/100}function Le(a){let{pathname:e}=new URL(a);for(let[t,r]of Object.entries(te))if(e.endsWith(t))return r.bytes;return 0}function ae(a){te=a}var Re=(a,e)=>{let t=xe(e);return t===0?Le(a):t};function ke(a,e,t,{onProgress:r,onError:s,onComplete:i}){if(!e.body)return[e];let o=Re(a,e.headers),l=0,p=0,[n,u]=t?e.body.tee():[e.body],h=n.pipeThrough(new TransformStream({async transform(C,y){try{l+=C.length,p=Number((l/o*100).toFixed(2)),o>0&&C.length>0&&p<100?r?.({percentage:p,loadedBytes:l,privateUri:a}):o===0&&C.length>0&&r?.({percentage:null,loadedBytes:l,privateUri:a}),y.enqueue(C)}catch(D){y.error(D),s?.({error:D})}},flush(C){r?.({percentage:100,loadedBytes:l,privateUri:a}),i?.({percentage:100,loadedBytes:l,privateUri:a}),C.terminate()}}));return[new Response(h,{headers:new Headers(e.headers),status:e.status,statusText:e.statusText}),u]}async function z({wasmURI:a,expectedHash:e,verifyResponseHash:t,onProgress:r,onComplete:s,onError:i,referredOrigin:o}){let l=await fetch(a,{referrerPolicy:"origin",referrer:o??""});if(!l.ok)throw new Error(`HTTP status code is not ok: ${l.status}, ${l.statusText}`);let[p,n]=ke(a,l,t,{onProgress:r,onError:i,onComplete:s});return n!=null&&Me(be(n),e,a),p}function re({wasmURI:a,expectedHash:e,verifyResponseHash:t,progressCallback:r,successCallback:s,importObject:i,referredOrigin:o}){async function l(n){try{let u=await z({wasmURI:a,expectedHash:e,verifyResponseHash:t,onProgress:r,referredOrigin:o}),h=await(n??u).arrayBuffer(),C=await globalThis.WebAssembly.instantiate(h,i);s(C.instance,C.module)}catch(u){d.log(d.Level.Error,u),d.log(d.Level.Error,`Couldn\'t instantiate Scandit SDK DataCapture library at ${a}, did you configure the path for it correctly?`)}}async function p(){let n;try{n=await z({wasmURI:a,expectedHash:e,verifyResponseHash:t,onProgress:r,referredOrigin:o});let u=await globalThis.WebAssembly.instantiateStreaming(n,i);s(u.instance,u.module)}catch(u){d.log(d.Level.Warn,u),d.log(d.Level.Warn,"WebAssembly streaming compile failed. Falling back to ArrayBuffer instantiation (this will make things slower)"),l(n?.bodyUsed===!0?void 0:n)}}typeof globalThis.WebAssembly.instantiateStreaming=="function"?p():l()}async function J(a,e,t,r){return new Promise((s,i)=>{a().then(s).catch(o=>{let l=e*2;if(l>t){i(o);return}r(o),globalThis.setTimeout(()=>{J(a,l,t,r).then(s).catch(i)},e)})})}function U(a){var e,t;let r="";if((e=a.href)!=null&&e.startsWith("blob:null/"))r="localhost";else{let s=((t=a.pathname)==null?void 0:t.length)>1&&!a.pathname.startsWith("/");r=new URL(s?a.pathname:a.origin).hostname}return r.startsWith("[")&&r.endsWith("]")&&(r=r.slice(1,-1)),r}async function se(a,e){async function t(){return importScripts(a)}try{await J(t,250,4e3,s=>{d.log(d.Level.Warn,s),d.log(d.Level.Warn,`Couldn\'t retrieve Scandit Data Capture library at ${a}, retrying...`)}),self.Module.mainScriptUrlOrBlob=a;let r=globalThis.SDC_WASM_JS_VERSION;return r!==e&&d.log(d.Level.Warn,`The Scandit Data Capture library JS file found at ${a} seems invalid: expected version doesn\'t match (received: ${r}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),!0}catch(r){return d.log(d.Level.Error,r),!1}}c();function Ae(a){return/^https?:\\/\\/(?:[^./]*\\.)*cdn.jsdelivr.net\\//.test(a)?{result:!0,cdnBaseURL:"https://cdn.jsdelivr.net/npm/"}:/^https?:\\/\\/(?:[^./]*\\.)*unpkg.com\\//.test(a)?{result:!0,cdnBaseURL:"https://unpkg.com/"}:{result:!1,cdnBaseURL:""}}function Fe(a){let e=/@scandit\\/web-datacapture-[a-z]+/i.exec(a);return e?e[0]:null}function ie(a,e,t){let r=e,s=Ae(r);if(s.result){let o=Fe(r);o!=null&&(r=`${s.cdnBaseURL}${o}@${a}/sdc-lib/`)}let i=t.replace(".wasm","");return s.result?{jsURI:`${r}${i}.js`,wasmURI:`${r}${i}.wasm`}:{jsURI:`${r}${i}.js?v=${a}`,wasmURI:`${r}${i}.wasm?v=${a}`}}c();var O;(a=>{function e(){return"7.1.1"}a.sdkVersion=e})(O||(O={}));c();var ne=class{constructor(){this.promise=new Promise((a,e)=>{this.reject=e,this.resolve=a})}};c();var Oe=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),Ee=()=>(async a=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(a)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]));function Pe(){return typeof crossOriginIsolated>"u"?!1:crossOriginIsolated}function We(){try{return new WebAssembly.Memory({initial:1,maximum:1,shared:!0}).buffer.constructor.name==="SharedArrayBuffer"}catch{return!1}}async function oe(){return Oe()}async function Ne(){if(!await Ee())return!1;let a=null;try{a=new Worker(URL.createObjectURL(new Blob([\'postMessage("Worker" in self);\'],{type:"text/javascript"})),{name:"nestedWorkerTest"})}catch{return!1}return new Promise(e=>{if(a==null){e(!1);return}a.onmessage=t=>{a?.terminate(),e(t.data)}})}async function de(){let a=await Ne();return Pe()&&We()&&a}var le=class ue{constructor(e,t){this.hintPresenterV2=null,this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL=10,this.redrawInterval=1e3/30,this.redrawRequests=[],this._isDrawLoopRunning=!1,this.frameDataPool=new Map,this.lastFrameCounter=-1,this.poorMansBenchmarkLogs=!1,this.writableDataPathStandard="/scandit_sync_folder",this.resourceFilesSubfolder="resources",this.performanceMetricsReporterTimer=void 0,this.performanceMetrics={frameDataPoolSize:0,processedFramesCount:0,redrawRequestsCount:0,actualRedrawsCount:0},this.gestureListener=null,this.webPlatformHintPresenter=null,this.moduleHandler=e,this.workerFunctions=t,this._loadProgressCallback=this._loadProgressCallback.bind(this),ae(this.getWasmMetadata())}get Module(){return this.moduleHandler.get()}set isDrawLoopRunning(e){this._isDrawLoopRunning=e,!e&&typeof this.loopTimeoutId=="number"&&(clearTimeout(this.loopTimeoutId),this.loopTimeoutId=void 0)}get isDrawLoopRunning(){return this._isDrawLoopRunning}convertToLoadableFrameData(e){let t=this.getNextFrameId();this.frameDataPool.set(t,new Uint8ClampedArray(e.getFrameData()));let r=this.lastUsedModuleMirrorAxis==null?!1:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return{frameId:t,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:r}}createContext(e){var t,r,s,i,o;let l=this.getModeDeserializers(),p=U(location);(p==="localhost"||p==="127.0.0.1")&&navigator.userAgent.includes("Electron")&&e.appName!=null&&(p+=`-${e.appName}`),this.parentDomain=e.parentDomain,this.contextDeserializer=new this.Module.DataCaptureContextDeserializer(this.writableDataPath,e.deviceId,e.context.deviceModelName,p,this.parentDomain,l,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let n=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(n==null){let m=this.contextDeserializer.getLastError();throw new Error(`Could not create the context: ${m}`)}let u=n.getView();this.context=n.getContext(),n.delete();let h=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(m,S)=>{this.contextDidChangeStatus(JSON.parse(S.toJson())),m.delete()},didStartObservingContext:m=>{this.didStartObservingContext(),m.delete()},didStopObservingContext:m=>{m.delete()}}),C=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:m=>{m.delete()},onObservationStopped:m=>{m.delete()},onFrameProcessingStarted:(m,S)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"}),S.delete(),m.delete()},onFrameProcessingFinished:(m,S)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"}),S.delete(),m.delete()},onFrameSkipped:(m,S)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"}),S.delete(),m.delete()}}),y=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(m,S)=>{var R;(R=this.gestureListener)==null||R.delete(),this.gestureListener=m.clone(),m.delete()}});(t=this.gestureRecognizer)==null||t.delete(),this.gestureRecognizer=new y;let D=new h;this.context.addListener(D),D.delete();let b=new C;this.context.addFrameListener(b),b.delete(),this.setView(u),(r=this.view)==null||r.setGestureRecognizer(this.gestureRecognizer);let w=this.Module.PlatformHintPresenter.extend("PlatformHintPresenter",{setHintPresenter:m=>{m.delete()},showToast:m=>{this.workerFunctions.postMessage({type:"showToast",payload:JSON.parse(m)})},hideToast:m=>{this.workerFunctions.postMessage({type:"hideToast",payload:JSON.parse(m)})},showGuidance:m=>{this.workerFunctions.postMessage({type:"showGuidance",payload:JSON.parse(m)})},hideGuidance:m=>{this.workerFunctions.postMessage({type:"hideGuidance",payload:JSON.parse(m)})},startUpdateTimer:m=>{this.workerFunctions.postMessage({type:"startUpdateTimer",payload:{duration:{unit:"ms",value:m}}})},stopUpdateTimer:()=>{this.workerFunctions.postMessage({type:"stopUpdateTimer"})}});(s=this.hintPresenterV2)==null||s.delete(),(i=this.webPlatformHintPresenter)==null||i.delete(),this.webPlatformHintPresenter=new w,this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter),(o=this.view)==null||o.setHintPresenterV2(this.hintPresenterV2)}onTap(e){var t;(t=this.gestureListener)==null||t.onTap(JSON.stringify(e))}hintPresenterV2Update(){var e;(e=this.hintPresenterV2)==null||e.update()}startReportingPerformanceMetrics(){this.performanceMetricsReporterTimer==null&&(this.performanceMetricsReporterTimer=setInterval(()=>{this.reportPerformanceMetrics();for(let e of Object.keys(this.performanceMetrics))this.performanceMetrics[e]=0},1e3))}async reportPerformanceMetrics(){this.workerFunctions.postMessage({type:"performanceMetricsReport",payload:{...this.performanceMetrics}})}deleteFrameData(e){this.frameDataPool.delete(e)}dispose(){var e,t;this.context.dispose(),this.frameDataPool.clear(),this.isDrawLoopRunning=!1,this.lastFrameCounter=-1,(e=this.gestureRecognizer)==null||e.delete(),this.gestureRecognizer=null,(t=this.gestureListener)==null||t.delete(),this.gestureListener=null}flushAnalytics(){this.context.flushAnalytics()}extractCentaurusLicense(e){return{payload:{centaurus:{licenseKey:this.Module.LicenseUtils[ue.get3dPartyLicenseKeyMethodName](e)}}}}getModeDeserializers(){return new this.Module.VectorDataCaptureModeDeserializer}loadLibrary(e){return this.libraryLoadingPromise!=null?this.libraryLoadingPromise:(this.libraryLoadingPromise=this.setup(e),this.libraryLoadingPromise)}processFrame(e){var t;if(this.context==null)return{payload:e,transferables:[e.data.buffer]};let r=e.data,s=e.colorType==="GRAYSCALE"?this.Module.ImageBufferFormat.Grayscale8:this.Module.ImageBufferFormat.Rgba8888,i=this.Module.allocateUint8Array(r.byteLength);return this.Module.HEAPU8.set(r,i),(t=this.imageFrameSource)==null||t.outputFrame(i,e.width,e.height,s),{payload:e,transferables:[e.data.buffer]}}reportCameraProperties(e){this.context.setCameraProperties(e.deviceId,e.isFrontFacing,e.hasAutofocus)}requestFrameData(e){let t=this.frameDataPool.get(e);return t==null?{payload:{data:null}}:{payload:{data:t},transferables:[t.buffer]}}scheduleRedraw(e,t){this.addRedrawRequest(t),this.isDrawLoopRunning||this.startDrawLoop(e)}sendViewRefreshCommands(e){this.workerFunctions.postMessage({type:"draw",payload:e},[e.buffer])}setFrameSource(e,t){var r;this.lastUsedModuleMirrorAxis=this.mapMirrorAxisOnModule(e),(r=this.imageFrameSource)==null||r.delete(),this.imageFrameSource=new this.Module.ImageBufferFrameSource(this.lastUsedModuleMirrorAxis,t,0),this.context.setFrameSource(this.imageFrameSource)}startDrawLoop(e){this.isDrawLoopRunning=!0;let t=i=>this.redrawRequests.length>0&&this.redrawRequests[0]<=i,r=i=>{for(;this.redrawRequests.length>0&&this.redrawRequests[0]<=i;)this.redrawRequests.shift()},s=()=>{this.loopTimeoutId=setTimeout(()=>{if(!this.isDrawLoopRunning)return;let i=performance.now();if(t(i)){r(i),e.draw();let o=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(o))}s()},this.redrawInterval)};s()}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let t=this.contextDeserializer.updateContextFromJson(this.context,this.view,JSON.stringify(e.context));if(t==null){let s=this.contextDeserializer.getLastError();throw new Error(`Could not update the context: ${s}`)}this.context.delete(),this.context=t.getContext();let r=t.getView();t.delete(),r!=null&&e.view!=null&&r.setViewSize(e.view.width,e.view.height,e.view.orientation),this.hintPresenterV2!=null&&r?.setHintPresenterV2(this.hintPresenterV2),this.gestureRecognizer!=null&&r?.setGestureRecognizer(this.gestureRecognizer),this.setView(r),d.log(d.Level.Debug,"context updated",e)}}onDocumentVisibilityChange(e){e==="hidden"&&this.context.flushAnalytics()}isFeatureSupported(e){return{payload:{supported:this.context.isFeatureSupported(e)}}}getViewfinderInfo(){var e,t;return{payload:{isDisplayingViewfinder:(t=(e=this.view)==null?void 0:e.isDisplayingViewfinder())!=null?t:!1,rect:JSON.parse(this.view.getViewfinderRect())}}}getOpenSourceSoftwareLicenseInfo(){return{payload:{licenseText:this.Module.OpenSourceSoftwareLicenseInfo.getLicenseText()}}}getNextFrameId(){return this.lastFrameCounter++,this.lastFrameCounter>=this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL&&(this.lastFrameCounter=0),this.lastFrameCounter}getWasmDynamicLibraries(e){return this.getWasmSideModuleFileName()==null?[]:[`${e.replace(/\\/[^/]*$/,"/")}${this.getWasmSideModuleFileName()}`]}getWasmCoreExpectedHash(e,t){return t?e?"e9ed2cf625313fb7917f4ae77162b195d6d4669df19f9d8484edcfe9c8dfdb93":"432e938eaf2c71035d6c3959176220b94d7d00ad5b02c16dd0707ea74a7b0d24":e?"86bfc128321bd3906f621c5dddb14b0b329b7d6b23f9114683cc3b5beaf1df25":""}getWasmCoreFileName(e,t){return t?e?"scandit-datacapture-sdk-id-simd-pthreads.wasm":"scandit-datacapture-sdk-id-pthreads.wasm":e?"scandit-datacapture-sdk-id-simd.wasm":""}getWasmMetadata(){return g}getWasmSideModuleFileName(){return""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e})}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((t,r)=>t-r)}contextDidChangeStatus(e){e.code===260?e.message=e.message.replace("domain name",`domain name (${U(location)})`):e.code===265&&(e.message=e.message.replace("domain name",`domain name (${this.parentDomain})`)),this.workerFunctions.postMessage({type:"contextDidChangeStatus",payload:e})}didStartObservingContext(){this.workerFunctions.postMessage({type:"didStartObservingContext"})}mapMirrorAxisOnModule(e){switch(e){case"None":return this.Module.Axis.None;case"X":return this.Module.Axis.X;case"Y":return this.Module.Axis.Y;default:return this.Module.Axis.None}}setView(e){this.view=e,this.setViewRefreshHandler(e),e==null&&(this.isDrawLoopRunning=!1,this.sendViewRefreshCommands(new Uint8Array([])))}setViewRefreshHandler(e){if(e==null||e.isViewRefreshHandlerSet)return;let t=this.Module.NeedsRedrawDelegate.extend("NeedsRedrawDelegate",{setNeedsRedrawIn:this.scheduleRedraw.bind(this,e)}),r=new t;e.setNeedsRedrawDelegate(r),e.isViewRefreshHandlerSet=!0}setupDataDecoding(){let e=this.moduleHandler.get(),t=e.DataDecoding.extend("DataDecoding",{decode(r,s){try{let i=JSON.parse(s),o=[];for(let l of i){let p=new TextDecoder(l.ianaName,{fatal:!0});o.push(p.decode(r.slice(l.startIndex,l.endIndex)))}return o.join("")}catch{return""}}});e.setDataDecoding(new t)}start(e,t,r){e&&t&&(this.setupDataDecoding(),this.moduleHandler.get().callMain(),this.moduleHandler.get().__emscripten_proxy_main!==void 0||r())}getWritableDataPath(e){return e!=null?(d.log(d.Level.Debug,`IndexedDB database name override in use to recover from blocked standard database: ${e}`),e):this.writableDataPathStandard}numOfMBToPages(e){return Math.ceil(1024*e*1024/64/1024)}async setup({libraryLocation:e,locationPath:t,writableDataPathOverride:r,overrideThreadsSupport:s,overrideSimdSupport:i,verifyResponseHash:o,referredOrigin:l,fixedWasmMemory:p}){var n;let u=!1,h=!1;this.writableDataPath=this.getWritableDataPath(r),this.resourcePath=`${e}${this.resourceFilesSubfolder}/`,globalThis.path=t;let{resolve:C,reject:y,promise:D}=new ne,b=O.sdkVersion();if(b==="")throw new A({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let[w,m]=await Promise.all([oe(),de()]);s!=="auto"&&(m=s==="on"),i!=="auto"&&(w=i==="on");let S=this.getWasmCoreFileName(w,m),R=ie(b,e,S),{jsURI:W,wasmURI:G}=R,Ce={instantiateWasm:(I,fe)=>(re({importObject:I,wasmURI:G,expectedHash:this.getWasmCoreExpectedHash(w,m),verifyResponseHash:o,successCallback:fe,progressCallback:this._loadProgressCallback,referredOrigin:l}),{})},k=p===null?null:new WebAssembly.Memory({initial:this.numOfMBToPages(p),maximum:this.numOfMBToPages(p),shared:m});return k!==null&&d.log(d.Level.Debug,"Fixed wasmMemory set",k),this.moduleHandler.set({...k?{wasmMemory:k}:{},mainScriptUrlOrBlob:W,canvas:(n=this.workerFunctions.getOffscreenCanvas())!=null?n:{getContext:()=>null},...Ce,dynamicLibraries:this.getWasmDynamicLibraries(G),locateFile:I=>e+I,noInitialRun:!0,preRun:[async()=>{try{await Z({writableDataPath:this.writableDataPath})}catch(I){if(I.name==="BlockedIndexedDB"){y(I.toString());return}d.log(d.Level.Debug,"No IndexedDB support, some data will not be persisted:",I)}h=!0,this.start(h,u,C)}],onMainComplete:()=>{if([u,h].includes(!1)){d.log(d.Level.Warn,{runtimeLoaded:u,fileSystemSynced:h},"Both runtimeLoaded and fileSystemSynced should be true when calling onMainComplete"),y("onMainComplete has been called but runtime or file system was not ready.");return}C()},onRuntimeInitialized:()=>{u=!0,this.start(h,u,C)},print:I=>{d.log(d.Level.Info,I)}}),await se(W,b)||y(`Couldn\'t retrieve Scandit Data Capture library at ${W}, did you configure the path for it correctly?`),D}};le.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var v=le;c();function ce(a){return typeof a=="object"&&a!=null&&a.document==null&&"addEventListener"in a&&typeof a.importScripts=="function"}c();c();function x(a){return typeof a=="object"&&a!=null}function L(a){if(typeof a=="string")return a;if(x(a)){if(typeof a.message=="string")return a.message}else if(typeof a?.toString=="function")return a.toString();return"unknown error"}c();function pe(a){console.warn("Reached unexpected case",a)}var $=class{constructor(a,e){this.onMessageListener=this.onMessage.bind(this),this.workerSelf=a,this.dataCaptureInstance=new v(e,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),ce(a)&&this.listenToMessages()}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",a=>{d.log(d.Level.Error,a)}),this.workerSelf.addEventListener("messageerror",a=>{d.log(d.Level.Error,a)})}postMessage(a,e){this.workerSelf.postMessage(a,e??[])}getOffscreenCanvas(){if(typeof this.workerSelf.OffscreenCanvas=="function")return new this.workerSelf.OffscreenCanvas(32,32)}hasPayload(a){return x(a)&&"payload"in a}hasTransferables(a){return x(a)&&Array.isArray(a.transferables)}async respondWith(a,e,t){let r=null,s;try{s=t(),s instanceof Promise&&(s=await s)}catch(o){s=void 0,r=L(o)}let i={type:"workerTaskId",command:a,id:e,payload:this.hasPayload(s)?s.payload:void 0};r!=null&&(i.error=r),this.postMessage(i,this.hasTransferables(s)?s.transferables:[])}onMessage(a){switch(a.data.command){case"loadLibrary":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.loadLibrary({libraryLocation:e.libraryLocation,locationPath:e.locationPath,referredOrigin:e.referredOrigin,writableDataPathOverride:e.writableDataPathOverride,overrideThreadsSupport:e.overrideThreadsSupport,overrideSimdSupport:e.overrideSimdSupport,verifyResponseHash:e.verifyResponseHash,fixedWasmMemory:e.fixedWasmMemory}))}break}case"onTap":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.onTap(e.point)})}break}case"hintPresenterV2update":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.hintPresenterV2Update()})}break}case"createContext":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.createContext({context:e.context,deviceId:e.deviceId,delayedRegistration:e.delayedRegistration,highEndBlurryRecognition:e.highEndBlurryRecognition,appName:e.appName,parentDomain:e.parentDomain}))}break}case"setFrameSource":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.setFrameSource(e.mirrorAxis,e.isCameraFrameSource))}break}case"processFrame":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.processFrame({data:e.data,width:e.width,height:e.height,colorType:e.colorType}))}break}case"requestFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.requestFrameData(e.frameId))}break}case"deleteFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.deleteFrameData(e.frameId)})}break}case"updateContext":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.updateContext(e))}break}case"dispose":{this.respondWith(a.data.command,a.data.id,()=>this.dataCaptureInstance.dispose());break}case"flushAnalytics":{this.respondWith(a.data.command,a.data.id,()=>{this.dataCaptureInstance.flushAnalytics()});break}case"reportCameraProperties":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.reportCameraProperties(e))}break}case"setLogLevel":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{d.setLevel(e.level)})}break}case"extractCentaurusLicense":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.extractCentaurusLicense(e.licenseKey))}break}case"documentVisibility":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.onDocumentVisibilityChange(e.state)})}break}case"isFeatureSupported":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.isFeatureSupported(e.feature))}break}case"getViewfinderInfo":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getViewfinderInfo())}break}case"getOpenSourceSoftwareLicenseInfo":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getOpenSourceSoftwareLicenseInfo())}break}default:return pe(a.data),!1}return!0}};c();c();c();c();function me(a){return a.ok()}function he(a,e){return me(a)?a.value():e}function ge(a,e){return me(a)?e:a.error()}function f(a,e){return a===void 0?e:a}function j(a){if(typeof a=="string")try{return JSON.parse(a)}catch{return null}return null}var E=class extends v{constructor(t,r){super(t,r);this.lastIdCaptureModeSerializedSettings=""}processFrame(t){return this.idCaptureMode.isReadyToProcessFrame()?super.processFrame(t):{payload:t,transferables:[t.data.buffer]}}updateContext(t){super.updateContext(t),this.idCaptureMode.start()}idCaptureSetLastResult(t){this.idCaptureMode.setLastResult(t)}idCaptureSetLastError(t){this.idCaptureMode.setLastError(t)}idCaptureSetLastLocalizedId(t){this.idCaptureMode.setLastLocalizedId(t)}idCaptureSetLastDetectionIssue(t){this.idCaptureMode.setLastDetectionIssue(t)}async idCaptureReset(){this.idCaptureMode.reset()}async idCaptureApplySettings(t){return this.idCaptureMode.applySettings(t)}async idCaptureParse(t){return{payload:{result:this.idCaptureMode.parse(t)}}}async idCaptureBarcodeVerifyAamvaCapture(t,r){return{payload:{result:await this.idCaptureMode.idCaptureBarcodeVerifyAamvaCapture(t,r)}}}idCaptureDataConsistencyVerifyCapture(t){return{payload:{result:this.idCaptureMode.idCaptureDataConsistencyVerifyCapture(t)}}}idCaptureDrivingLicenseDetailsCreateWithBlinkIdData(t,r,s){let i=this.Module.DrivingLicenseDetails.createWithBlinkIdData(t,r,s);return{payload:{result:JSON.parse(i)}}}getIdOpenSourceSoftwareLicenseInfo(){return{payload:{licenseText:this.Module.IdOpenSourceSoftwareLicenseInfo.getLicenseText()}}}getModeDeserializers(){this.idCaptureMode=new K(this,this.Module,this.workerFunctions),this.idCaptureMode.start();let t=super.getModeDeserializers();return t.push_back(this.idCaptureMode.getDeserializer()),t}getWasmSideModuleFileName(){return""}getWasmCoreFileName(t,r){return r?t?"scandit-datacapture-sdk-id-simd-pthreads.wasm":"scandit-datacapture-sdk-id-pthreads.wasm":t?"scandit-datacapture-sdk-id-simd.wasm":"scandit-datacapture-sdk-id.wasm"}getWasmCoreExpectedHash(t,r){return r?t?"e9ed2cf625313fb7917f4ae77162b195d6d4669df19f9d8484edcfe9c8dfdb93":"432e938eaf2c71035d6c3959176220b94d7d00ad5b02c16dd0707ea74a7b0d24":t?"86bfc128321bd3906f621c5dddb14b0b329b7d6b23f9114683cc3b5beaf1df25":"31bd17f4a113f3fe116d296105c852b2c449babdd38d6c48b487e3ed5b8deba0"}getWasmMetadata(){return g}},K=class{constructor(e,t,r){this.SDCIdCaptureMode=null;this.listenerSet=!1;this.lastResult="";this.lastError="";this.lastLocalizedId="";this.lastDetectionIssue="";this._state="initial";this.coreEngine=e,this.Module=t,this.workerFunctions=r,this.state="created"}get state(){return this._state}set state(e){this._state=e}isReadyToProcessFrame(){return this.state==="started"}setLastResult(e){this.lastResult=e}setLastError(e){this.lastError=e}setLastLocalizedId(e){this.lastLocalizedId=e}setLastDetectionIssue(e){this.lastDetectionIssue=e}async applySettings(e){this.SDCIdCaptureMode?.applySettings(JSON.stringify(e))}reset(){this.SDCIdCaptureMode?.reset()}parse(e){if(this.SDCIdCaptureMode){let t=this.SDCIdCaptureMode.parse(e);if(t.ok()){let r=he(t,null);if(r!=null){let s=this.extractCaptureId(r);if(s!=null)return{status:"success",capturedId:s}}}else return{status:"error",error:ge(t,"Undefined error")}}return null}idCaptureDataConsistencyVerifyCapture(e){let r=new this.Module.DataConsistencyVerifier(this.coreEngine.context).verify(JSON.stringify(e));if(r==null)return null;let s=JSON.parse(r.toJson());return r.delete(),s}async idCaptureBarcodeVerifyAamvaCapture(e,t){return new Promise(r=>{let s=this.Module.AamvaBarcodeVerifier.extend("AamvaBarcodeVerifier",{retriggerVerificationIn(o){setTimeout(()=>{i.startVerification(JSON.stringify(e))},o)},verificationEnded(){let o=i.getBarcodeVerificationResponse();r({isSuccess:o.isSuccess,error:o.error,allChecksPassed:o.allChecksPassed,serverResponseJSON:o.serverResponseJson})}}),i=new s;i.initialize(this.coreEngine.context,t??""),i.startVerification(JSON.stringify(e))})}start(){if(this.initHintPresenterIfNotInitialized(),this.state==="started")return;let e=this.Module.IdCaptureListener.extend("IdCaptureListener",{onSessionUpdated:(n,u)=>{n.delete(),u.delete()},onIdCaptured:(n,u)=>{this.onIdCapturedCallback(u),n.delete(),u.delete()},onIdRejected:(n,u,h)=>{this.onIdRejectedCallback(u,h),n.delete(),u.delete()},onShutterButtonPositionChanged:n=>{this.onShutterButtonPositionChangedCallback(n)},onShutterButtonStateChanged:n=>{this.onShutterButtonStateChangedCallback(n)}}),t=this.Module.Feedback.extend("Feedback",{emit:()=>{this.workerFunctions.postMessage({type:"idCaptureIdCapturedFeedback"})}}),r=this.Module.Feedback.extend("Feedback",{emit:()=>{this.workerFunctions.postMessage({type:"idCaptureIdRejectedFeedback"})}}),s=this.Module.IdCaptureDeserializerListener.extend("IdCaptureDeserializerListener",{onModeDeserializationFinished:(n,u,h)=>{if(!this.listenerSet){let C=new e;u.addListener(C),C.delete(),this.listenerSet=!0,u.setFeedbacks(new t,new r)}n.delete(),u.delete(),h.delete()},onModeDeserializationStarted(n,u,h){n.delete(),u.delete(),h.delete()},onSettingsDeserializationStarted(n,u,h){n.delete(),u.delete(),h.delete()},onSettingsDeserializationFinished(n,u,h){n.delete(),u.delete(),h.delete()}}),i=this.Module.IdCaptureBackend.extend("IdCaptureBackend",{getLastError:()=>this.lastError,getLastResult:()=>this.lastResult,getLocalizedOnlyId:()=>this.lastLocalizedId,getLastIssue:()=>this.lastDetectionIssue,processFrame:(n,u,h,C)=>{},reset:this.onResetFromSDC.bind(this),setDetectionOnlyMode:this.setDetectionOnlyMode.bind(this)}),o=this.Module.IdCaptureDeserializerHelper.extend("IdCaptureDeserializerHelper",{createMode:(n,u)=>{this.SDCIdCaptureMode!=null&&this.SDCIdCaptureMode.delete();let h=new i;return this.SDCIdCaptureMode=new this.Module.IdCapture(n,h,u,null),h.delete(),n.delete(),u.delete(),this.SDCIdCaptureMode}}),l=new o;this.idCaptureDeserializer=new this.Module.IdCaptureDeserializer(l),l.delete();let p=new s;this.idCaptureDeserializer.setListener(p),p.delete(),this.state="started"}onResetFromSDC(){this.workerFunctions.postMessage({type:"idCaptureBackendReset"}),this.lastError="",this.lastResult="",this.lastLocalizedId=""}setDetectionOnlyMode(e){this.workerFunctions.postMessage({type:"idCaptureDetectionOnlyMode",payload:{detectionOnlyMode:e}})}onIdCapturedCallback(e){let t=this.extractCaptureId(e);t&&this.workerFunctions.postMessage({type:"idCaptureDidCaptureId",payload:{capturedId:t}},this.extractImageTransferablesFromCapturedId(t))}onIdRejectedCallback(e,t){let r=this.extractCaptureId(e);this.workerFunctions.postMessage({type:"idCaptureDidRejectId",payload:{capturedId:r,rejectionReason:t}},r?this.extractImageTransferablesFromCapturedId(r):[])}extractCaptureId(e){if(e==null)return null;let t=e.getImages(),r=t.getFrameFront(),s=t.getFrameBack(),i=f(t.getFace(),null),o=f(t.getCroppedDocumentFront(),null),l=f(t.getCroppedDocumentBack(),null),p={front:{face:i,croppedDocument:o,frame:{data:r?new Uint8ClampedArray(r.getFrameData()):null,width:r?.getWidth()??0,height:r?.getHeight()??0,mirrorAxis:r?.getMirrorAxis().value??0,orientation:r?.getOrientation()??0}},back:{face:null,croppedDocument:l,frame:{data:s?new Uint8ClampedArray(s.getFrameData()):null,width:s?.getWidth()??0,height:s?.getHeight()??0,mirrorAxis:s?.getMirrorAxis().value??0,orientation:s?.getOrientation()??0}}};r?.delete(),s?.delete(),t.delete();let n=JSON.parse(e.toJson());return{...{firstName:f(e.getFirstName(),""),lastName:f(e.getLastName(),""),secondaryLastName:f(e.getSecondaryLastName(),""),fullName:e.getFullName(),sex:f(e.getSex(),""),age:f(e.getAge(),null),isExpired:f(e.isExpired(),null),nationality:f(e.getNationality(),""),address:f(e.getAddress(),""),issuingCountry:f(e.getIssuingCountry(),""),issuingCountryIso:f(e.getIssuingCountryIso(),""),documentNumber:f(e.getDocumentNumber(),""),documentAdditionalNumber:f(e.getDocumentAdditionalNumber(),""),dateOfBirth:j(f(e.getDateOfBirth(),null)),dateOfExpiry:j(f(e.getDateOfExpiry(),null)),dateOfIssue:j(f(e.getDateOfIssue(),null)),documentType:f(e.getDocumentType(),null),documentSubtype:f(e.getDocumentSubtype(),null)},...n,imageInfo:null,rawImageInfo:p}}onShutterButtonPositionChangedCallback(e){this.workerFunctions.postMessage({type:"idCaptureDidShutterButtonPositionChanged",payload:{position:JSON.parse(e)}})}onShutterButtonStateChangedCallback(e){this.workerFunctions.postMessage({type:"idCaptureDidShutterButtonStateChanged",payload:{state:e}})}parseIdCaptureSession(e){return JSON.parse(e.toJson())}getDeserializer(){return this.idCaptureDeserializer}dispose(){this.state==="started"&&(this.idCaptureDeserializer.delete(),this.lastError="",this.lastLocalizedId="",this.lastResult="",this.listenerSet=!1,this.state="disposed")}restart(){this.dispose(),this.start()}extractImageTransferablesFromCapturedId(e){let t=[];return e.rawImageInfo.front.frame.data&&e.rawImageInfo.front.frame.data.length>0&&t.push(e.rawImageInfo.front.frame.data.buffer),e.rawImageInfo.back.frame.data&&e.rawImageInfo.back.frame.data.length>0&&t.push(e.rawImageInfo.back.frame.data.buffer),t}isReadyToDisplayHints(){return this.coreEngine.view?this.coreEngine.view.hintPresenterInitialized():!1}initHintPresenterIfNotInitialized(){if(this.isReadyToDisplayHints())return;let e=this.Module.HintPresenter.extend("HintPresenter",{showHint:(t,r)=>{this.workerFunctions.postMessage({type:"showHint",payload:{text:t,style:JSON.parse(r)}})},updateHint:t=>{this.workerFunctions.postMessage({type:"updateHint",payload:{style:JSON.parse(t)}})},hideHint:()=>{this.workerFunctions.postMessage({type:"hideHint",payload:{}})}});this.coreEngine.view?.setHintPresenter(new e)}};var P=class extends ${constructor(e,t){super(e,t),this.dataCaptureInstance=new E(t,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)})}async respondWith(e,t,r){let s=null,i;try{i=r(),i instanceof Promise&&(i=await i)}catch(l){d.log(d.Level.Debug,l),i=void 0,s=L(l)}let o={type:"workerTaskId",command:e,id:t,payload:this.hasPayload(i)?i.payload:void 0};s!=null&&(o.error=s),this.postMessage(o,this.hasTransferables(i)?i.transferables:[])}onMessage(e){switch(e.data.command){case"idCaptureSetLastResult":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>{this.dataCaptureInstance.idCaptureSetLastResult(t.result)}),!0}case"idCaptureSetLastError":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>{this.dataCaptureInstance.idCaptureSetLastError(t.error)}),!0}case"idCaptureSetLastLocalizedId":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>{this.dataCaptureInstance.idCaptureSetLastLocalizedId(t.localizedId)}),!0}case"idCaptureSetLastDetectionIssue":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>{this.dataCaptureInstance.idCaptureSetLastDetectionIssue(t.issue)}),!0}case"idCaptureReset":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureReset()),!0}case"idCaptureApplySettings":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureApplySettings(t.settings)),!0}case"idCaptureParse":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureParse(t.code)),!0}case"idCaptureBarcodeVerifyAamvaCapture":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureBarcodeVerifyAamvaCapture(t.capturedId,t.endpoint)),!0}case"idCaptureDataConsistencyVerifyCapture":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureDataConsistencyVerifyCapture(t.capturedId)),!0}case"idCaptureDrivingLicenseDetailsCreateWithBlinkIdData":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureDrivingLicenseDetailsCreateWithBlinkIdData(t.details.vehicleClass,t.details.restrictions,t.details.endorsements)),!0}case"getIdOpenSourceSoftwareLicenseInfo":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>this.dataCaptureInstance.getIdOpenSourceSoftwareLicenseInfo()),!0}default:return super.onMessage(e)}}};var ha=new P(globalThis,{get:()=>globalThis.Module,set:a=>{globalThis.Module=a}});function ga(a){}})();\n'],{type:"application/javascript"})),a=new Worker(t,e);return URL.revokeObjectURL(t),a}var je=class e extends DataCaptureLoader{constructor(){super(...arguments);this._name="IdCapture";}get dataCaptureWorker(){return (this._dataCaptureWorker)!=null||(this._dataCaptureWorker=Qt({name:this.name})),this._dataCaptureWorker}get name(){return this._name}get fixedWasmMemory(){return BrowserHelper.isIPhone()&&BrowserHelper.isSafari()?256:null}static async create(a){var s;let r=new e(a);return r.workerCommand("setLogLevel",{level:(s=a.logLevel)!=null?s:Logger.Level.Debug}),await r.load(),r}async workerCommand(...a){let[r,s,o]=a;return new Promise((c,u)=>{let m=this.workerCommandId++;this.workerTasks.set(m,{resolve:c,reject:u,command:r});let S={...s,command:r,id:m};this.dataCaptureWorker.postMessage(S,o);})}};function ja(e){return isObject(e)&&Object.prototype.hasOwnProperty.call(e,"code")&&Object.values(A).includes(e.code)}function Ja(e){return /^This license is invalid for version .+\. It is valid only for licensee '.+', for product '.+' on platform '.+' up to version .+\. Please contact support for more information\.$/.test(e.message)}var ct=new Map;ct.set([77,105,99,114,111,98,108,105,110,107],"Scandit");ct.set([66,108,105,110,107,73,68],"ID Capture");var dt="Centaurus",Ke=class e{static async load(t){let a=new e;try{await a.initCentaurus(t);}catch(r){if(ja(r)){if(Ja(r))throw new DataCaptureError({message:"Invalid embedded license version.",name:"IdCaptureLoadingError"});if(r.code===A.LICENSE_UNLOCK_ERROR)throw new DataCaptureError({message:"Invalid license key. Platform or domain may be incorrect.",name:"IdCaptureLoadingError"});if(r.code===A.SDK_LICENSE_KEY_MISSING)throw new DataCaptureError({message:"Invalid license key (sub-part is missing).",name:"IdCaptureLoadingError"})}throw new DataCaptureError({message:e.replaceCentaurusMentions(isObject(r)?r.message:"(no message)",ct),name:"IdCaptureLoadingError"})}return a}static replaceCentaurusMentions(t,a){return typeof t=="string"?[...a.entries()].reduce((r,[s,o])=>{let c=s.map(u=>String.fromCodePoint(u)).join("");return r.replace(new RegExp(c,"gi"),o)},t):"(no message)"}static async getWasmType(){let[t,a]=await Promise.all([BrowserHelper.hasSIMDSupport(),BrowserHelper.hasThreadsSupport()]);return t?a?BrowserHelper.isDesktopDevice()?U.AdvancedWithThreads:U.Advanced:U.Advanced:U.Basic}async initCentaurus(t){this.licenseKey=t.licenseKey;let a=new ke(t.licenseKey);a.engineLocation=t.libraryLocation;let r=new URL("Centaurus.worker.min.js",t.libraryLocation).toString(),s=new Blob([`importScripts("${r}");`],{type:"text/javascript"});a.workerLocation=URL.createObjectURL(s),a.initialMemory=500,a.allowHelloMessage=!1,a.wasmModuleName=dt,a.wasmType=await e.getWasmType(),a.blinkIdVariant="lightweight";let o=0;a.loadProgressCallback=c=>{var u;c>=o&&((u=t.loadProgressNotifier)==null||u.call(t,{percentage:c,privateUri:new URL(`${a.wasmModuleName}.wasm`,t.libraryLocation).toString()})),o=c;},this.wasmSDK=await Bt(a);}};var pt=43,Za=100-pt,ea={condition:e=>Object.keys(p).some(t=>e.pathname.endsWith(t)),do:e=>(e.info.percentage==null||(e.info.percentage=pt*e.info.percentage/100),e.info)},ta={condition:e=>e.pathname.endsWith(`${dt}.wasm`),do:e=>(e.info.percentage==null||(e.info.percentage=pt+Za*e.info.percentage/100),e.info)};function Ya(e){if(typeof e=="function")return function(a){if(a.percentage==null){e(a);return}let{pathname:r}=new URL(a.privateUri,document.baseURI),s=match({pathname:r,info:a}).when(ea.condition,ea.do).when(ta.condition,ta.do).otherwise(o=>o.info).run();e(s);}}var aa=Ya;var B=class{constructor(){this.type="shutter";this.view=null;}toJSONObject(){return {type:this.type}}};B.CLASS_NAME=ViewClassNames.SHUTTER_BUTTON_CONTROL_CLASS_NAME;var Ye={standby:"standby",active:"active",scanning:"scanning"},Ze=class{constructor(t,a){this.control=t,this.controlsElement=a;}async install(){return this.shutterButton||(ShutterButton.register(),this.shutterButton=ShutterButton.create(),this.shutterButton.classList.add("scandit-control-widget"),this.shutterButton.classList.add(`scandit-control-widget-${B.CLASS_NAME}`),this.shutterButton.style.margin="0",this.lastPositionReceived&&this.applyPositioning(this.lastPositionReceived)),this.appendShutterButton(),!0}updatePosition(t){if(t.size.width===0&&t.size.height===0&&this.shutterButton){this.remove();return}this.lastPositionReceived=structuredClone(t),this.applyPositioning(t),this.appendShutterButton();}updateState(t){if(this.shutterButton)switch(t){case"scanning":{this.shutterButton.rotating=!0,this.shutterButton.pulse=!1;break}case"standby":{this.shutterButton.rotating=!1,this.shutterButton.pulse=!1;break}case"active":{this.shutterButton.rotating=!1,this.shutterButton.pulse=!0;break}}}remove(t){var a;(a=this.shutterButton)==null||a.remove(),t===!0&&(this.shutterButton=void 0);}appendShutterButton(){this.shutterButton&&!this.controlsElement.contains(this.shutterButton)&&this.controlsElement.append(this.shutterButton);}applyPositioning(t){this.shutterButton&&(this.shutterButton.style.position="absolute",this.shutterButton.style.left=`${t.origin.x}px`,this.shutterButton.style.top=`${t.origin.y}px`,this.shutterButton.style.width=`${t.size.width}px`,this.shutterButton.style.height=`${t.size.height}px`);}};var ia=class e{constructor(){this.type="idCapture";this._idLayoutStyle="rounded";this._defaultCapturedBrush=new Brush(_.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.fillColor,_.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.strokeColor,_.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.strokeWidth);this._defaultLocalizedBrush=new Brush(_.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.fillColor,_.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.strokeColor,_.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.strokeWidth);this._defaultRejectedBrush=new Brush(_.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.fillColor,_.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.strokeColor,_.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.strokeWidth);this._capturedBrush=this._defaultCapturedBrush;this._localizedBrush=this._defaultLocalizedBrush;this._rejectedBrush=this._defaultRejectedBrush;this._idLayoutLineStyle="light";this._showTextHints=!0;this._frontSideTextHint=Localization.getInstance().get("id.idCaptureOverlay.scanFrontSideHint");this._backSideTextHint=Localization.getInstance().get("id.idCaptureOverlay.scanBackSideHint");this._moveCloserTextHint=Localization.getInstance().get("id.idCaptureOverlay.moveCloseTextHint");this._moveFurtherAwayTextHint=Localization.getInstance().get("id.idCaptureOverlay.moveFurtherAwayTextHint");this._tapShutterToScanTextHint=Localization.getInstance().get("id.idCaptureOverlay.tapShutterToScan");this._lookingForDocumentTextHint=Localization.getInstance().get("id.idCaptureOverlay.lookingForDocument");this._holdStillTextHint=Localization.getInstance().get("id.idCaptureOverlay.holdStill");this.onShutterPositionUpdateListener=this.onShutterPositionUpdate.bind(this);this.onShutterButtonStateChangedListener=this.onShutterButtonStateChanged.bind(this);this.onContextUpdatedListener=this.onContextUpdated.bind(this);this.overlayListener={onShutterPositionUpdate:this.onShutterPositionUpdateListener,onShutterButtonStateChanged:this.onShutterButtonStateChangedListener};}get idLayoutStyle(){return this._idLayoutStyle}set idLayoutStyle(t){this._idLayoutStyle=t,this.idCapture.didChange();}get idLayoutLineStyle(){return this._idLayoutLineStyle}set idLayoutLineStyle(t){this._idLayoutLineStyle=t,this.idCapture.didChange();}get showTextHints(){return this._showTextHints}set showTextHints(t){this._showTextHints=t,this.idCapture.didChange();}get defaultCapturedBrush(){return this._defaultCapturedBrush}get defaultLocalizedBrush(){return this._defaultLocalizedBrush}get defaultRejectedBrush(){return this._defaultRejectedBrush}static async withIdCapture(t){return e.withIdCaptureForView(t,null)}static async withIdCaptureForView(t,a){var s;let r=new e;return r.idCapture=t,await r.setCapturedBrush(r.defaultCapturedBrush),await r.setLocalizedBrush(r.defaultLocalizedBrush),await r.setRejectedBrush(r.defaultRejectedBrush),a&&(r.view=a,await a.addOverlay(r),await r.installShutterButton()),t.addOverlayListener(r.overlayListener),(s=t.context)==null||s.updateListeners.add(r.onContextUpdatedListener),r}async setFrontSideTextHint(t){Logger.log(Logger.Level.Debug,"DEPRECATED: IdCaptureOverlay.setFrontSideTextHint. Use the Localization API instead."),this._frontSideTextHint=t,await this.idCapture.didChange();}async setBackSideTextHint(t){Logger.log(Logger.Level.Debug,"DEPRECATED: IdCaptureOverlay.setBackSideTextHint. Use the Localization API instead."),this._backSideTextHint=t,await this.idCapture.didChange();}async setMoveCloserTextHint(t){Logger.log(Logger.Level.Debug,"DEPRECATED: IdCaptureOverlay.setMoveCloserTextHint. Use the Localization API instead."),this._moveCloserTextHint=t,await this.idCapture.didChange();}async setMoveFurtherAwayTextHint(t){Logger.log(Logger.Level.Debug,"DEPRECATED: IdCaptureOverlay.setMoveFurtherAwayTextHint. Use the Localization API instead."),this._moveFurtherAwayTextHint=t,await this.idCapture.didChange();}getCapturedBrush(){return this._capturedBrush}async setCapturedBrush(t){this._capturedBrush=t,await this.idCapture.didChange();}getLocalizedBrush(){return this._localizedBrush}async setLocalizedBrush(t){this._localizedBrush=t,await this.idCapture.didChange();}getRejectedBrush(){return this._rejectedBrush}async setRejectedBrush(t){this._rejectedBrush=t,await this.idCapture.didChange();}toJSONObject(){return {type:this.type,idLayoutStyle:this.idLayoutStyle,idLayoutLineStyle:this.idLayoutLineStyle,showTextHints:this._showTextHints,capturedBrush:this._capturedBrush.toJSONObject(),localizedBrush:this._localizedBrush.toJSONObject(),rejectedBrush:this._rejectedBrush.toJSONObject(),frontSideTextHint:this._frontSideTextHint,backSideTextHint:this._backSideTextHint,moveCloserTextHint:this._moveCloserTextHint,moveFurtherAwayTextHint:this._moveFurtherAwayTextHint,tapShutterToScanTextHint:this._tapShutterToScanTextHint,lookingForDocumentTextHint:this._lookingForDocumentTextHint,holdStillTextHint:this._holdStillTextHint}}async installShutterButton(){if(this.view&&this.idCapture.settings.captureTrigger==="buttonTap")if(this.shutterWidget)await this.shutterWidget.install();else {let t=new B;this.shutterWidget=this.view.registerControlWidget(t,Ze),this.view.addControl(t);}}onContextUpdated(t){var s,o,c,u;if(t.type==="modeEnabled"&&!t.newValue){(s=this.shutterWidget)==null||s.remove();return}t.type==="removeOverlay"&&t.newValue===this&&(this.idCapture.removeOverlayListener(this.overlayListener),(o=this.idCapture.context)==null||o.updateListeners.delete(this.onContextUpdatedListener));let a=(c=this.idCapture.context)==null?void 0:c.toJSONObject().modes,r=a==null?void 0:a.find(m=>m.type==="idCapture");r&&r.settings.captureTrigger==="auto"&&this.shutterWidget?(u=this.view)==null||u.removeControl(this.shutterWidget.control):this.installShutterButton();}onShutterPositionUpdate(t){var a,r,s;(a=this.shutterWidget)==null||a.updatePosition(t),t.size.width===0&&t.size.height===0&&((r=this.shutterWidget)!=null&&r.control)&&((s=this.view)==null||s.removeControl(this.shutterWidget.control));}onShutterButtonStateChanged(t){var a,r,s;switch(t){case"untapped":{(a=this.shutterWidget)==null||a.updateState(Ye.standby);break}case"untappedLocalized":{(r=this.shutterWidget)==null||r.updateState(Ye.active);break}case"tapped":{(s=this.shutterWidget)==null||s.updateState(Ye.scanning);break}}}};var Qe=class extends T{constructor(){super();this._isFull=!0;}toJSONObject(){return {isFull:this._isFull,options:{barcode:!0,machineReadableZone:!0,visualInspectionZone:!0}}}};var le=class extends T{constructor(a,r,s){super();this._isFull=!1;this._barcode=a,this._machineReadableZone=r,this._visualInspectionZone=s;}get barcode(){return this._barcode}get machineReadableZone(){return this._machineReadableZone}get visualInspectionZone(){return this._visualInspectionZone}toJSONObject(){return {isFull:this._isFull,options:{barcode:this.barcode,machineReadableZone:this.machineReadableZone,visualInspectionZone:this.visualInspectionZone}}}};var Xe=class{constructor(t,a,r){this._days=t,this._months=a,this._years=r;}get days(){return this._days}get months(){return this._months}get years(){return this._years}toJSONObject(){return {days:this.days,months:this.months,years:this.years}}};var sa=class e{constructor(){this.acceptedDocuments=[];this.rejectedDocuments=[];this.anonymizationMode="fieldsOnly";this.captureTrigger="auto";this.rejectVoidedIds=!1;this.decodeBackOfEuropeanDrivingLicense=!1;this.rejectExpiredIds=!1;this.rejectNotRealIdCompliant=!1;this.rejectInconsistentData=!1;this.rejectHolderBelowAge=null;this.rejectIdsExpiringIn=null;this.properties={};this.imageToResult={};this.scannerType=new le(!1,!1,!1);}setProperty(t,a){this.properties[t]=a;}getProperty(t){return this.properties[t]}setShouldPassImageTypeToResult(t,a){this.imageToResult[t]=a;}getShouldPassImageTypeToResult(t){var a;return (a=this.imageToResult[t])!=null?a:!1}toJSONObject(){return {acceptedDocuments:this.acceptedDocuments.map(t=>t.toJSONObject()),rejectedDocuments:this.rejectedDocuments.map(t=>t.toJSONObject()),scannerType:this.scannerType.toJSONObject(),imageToResult:{face:this.imageToResult.face,croppedDocument:this.imageToResult.croppedDocument,frame:this.imageToResult.frame},properties:{...this.properties},anonymizationMode:this.anonymizationMode,captureTrigger:this.captureTrigger,rejectVoidedIds:this.rejectVoidedIds,decodeBackOfEuropeanDrivingLicense:this.decodeBackOfEuropeanDrivingLicense,rejectExpiredIds:this.rejectExpiredIds,rejectNotRealIdCompliant:this.rejectNotRealIdCompliant,rejectInconsistentData:this.rejectInconsistentData,rejectHolderBelowAge:this.rejectHolderBelowAge,rejectIdsExpiringIn:this.rejectIdsExpiringIn?this.rejectIdsExpiringIn.toJSONObject():null}}static fromJSON(t){let a=new e;a.acceptedDocuments=t.acceptedDocuments.map(o=>{var c;return a.createDocumentFromTypeAndRegion(o.documentType,(c=o==null?void 0:o.subtype)!=null?c:o.region)}),a.rejectedDocuments=t.rejectedDocuments.map(o=>{var c;return a.createDocumentFromTypeAndRegion(o.documentType,(c=o==null?void 0:o.subtype)!=null?c:o.region)});let r=t.scannerType;a.scannerType=t.scannerType.isFull?new Qe:new le(r.options.barcode,r.options.machineReadableZone,r.options.visualInspectionZone),a.anonymizationMode=t.anonymizationMode,a.decodeBackOfEuropeanDrivingLicense=t.decodeBackOfEuropeanDrivingLicense,a.captureTrigger=t.captureTrigger,a.rejectVoidedIds=t.rejectVoidedIds,a.rejectExpiredIds=t.rejectExpiredIds,a.rejectNotRealIdCompliant=t.rejectNotRealIdCompliant,a.rejectInconsistentData=t.rejectInconsistentData,a.rejectHolderBelowAge=t.rejectHolderBelowAge;let s=t.rejectIdsExpiringIn;return a.rejectIdsExpiringIn=s?new Xe(s.days,s.months,s.years):null,a.imageToResult={...t.imageToResult},a.properties={...t.properties},a}createDocumentFromTypeAndRegion(t,a){let r=a,s=a;switch(t){case"driverLicense":return new K(r);case"healthInsuranceCard":return new Z(r);case"idCard":return new Y(r);case"passport":return new Q(r);case"residencePermit":return new $(r);case"visaIcao":return new ee(r);case"regionSpecific":return new X(s)}assertUnreachable(t);}};var $e=class e{get allChecksPassed(){return this.json.allChecksPassed}get error(){return typeof this.json.error=="string"&&this.json.error!==""?this.json.error:null}static fromJSON(t){let a=new e;return a.json=t,a}};var oa=class e{constructor(t,a=null){this._context=t,this._endpoint=a;}static async create(t){return new e(t)}async verify(t){let a=await this._context.workerCommand("idCaptureBarcodeVerifyAamvaCapture",{capturedId:t.toJSONObject(),endpoint:this._endpoint});return a.result.isSuccess||Logger.log(Logger.Level.Warn,"Error during Aamva verification:",a.result.error),$e.fromJSON(a.result)}};var la=class e{constructor(t){this._context=t;}static create(t){return new e(t)}async verify(t){let a=await this._context.workerCommand("idCaptureDataConsistencyVerifyCapture",{capturedId:t.toJSONObject()});return a.result==null?null:J.fromJSON(a.result)}};var ht,ie;function Yn(e){Localization.getInstance().updateIfMissing({...Yt});let t=typeof(e==null?void 0:e.enableVIZDocuments)=="boolean"?e.enableVIZDocuments:!1;return {moduleName:"IdCapture",load:async a=>{if(a.loadProgressNotifier=t?aa(a.loadProgressNotifier):a.loadProgressNotifier,a.overrideThreadsSupport=OverrideState.Off,a.verifyResponseHash=!0,ie=await je.create(a),DataCaptureContext.moduleLicenseTextProviders.push(new ze(ie)),!t)return Logger.log(Logger.Level.Info,"VIZ scanning is disabled (enableVIZDocuments option was not passed to idCaptureLoader, or its value was false)"),ie;let o=(await ie.workerCommand("extractCentaurusLicense",{licenseKey:a.licenseKey})).centaurus.licenseKey;if(o.length===0)throw Logger.log(Logger.Level.Error,"Invalid license key: VIZ scanning is enabled in the options but the license key has no VIZ scanning enabled. Update the license key or disable VIZ scanning when calling idCaptureloader."),O.create({type:"InvalidLicenseKeyForVIZProcessing",message:"Invalid license key for VIZ scanning. Update license key or disable VIZ scanning."});return Logger.log(Logger.Level.Info,"VIZ scanning is enabled, VIZ processor will be initialized"),ht=await Ke.load({libraryLocation:`${a.libraryLocation}idcapture/`,licenseKey:o,logLevel:a.logLevel,loadProgressNotifier:a.loadProgressNotifier}),He.setCentaurusLoader(ht),ie}}}function Qn(e){ie=e;}function Xn(e){ht=e;}
|
|
4
|
+
start over and calling "idCapture.reset()" in this case is recommended.`);}triggerErrorListener(t){if(this._isEnabled)for(let a of this.listeners)typeof a.didFailWithError=="function"&&a.didFailWithError(this,t);}async reportLastResult(t){var a;if(this.context)return (a=this.privateContext)==null?void 0:a.workerCommand("idCaptureSetLastResult",{result:t==null?"":JSON.stringify(t)})}async reportLastError(t){var a;if(this.context)return (a=this.privateContext)==null?void 0:a.workerCommand("idCaptureSetLastError",{error:t==null?"":JSON.stringify(t)})}async reportLastLocalizedId(t){var a;if(this.context)return (a=this.privateContext)==null?void 0:a.workerCommand("idCaptureSetLastLocalizedId",{localizedId:t==null?"":JSON.stringify(t.toJSONObject())})}async reportLastDetectionIssue(t){var a;if(this.context)return (a=this.privateContext)==null?void 0:a.workerCommand("idCaptureSetLastDetectionIssue",{issue:JSON.stringify({issue:t!=null?t:""})})}};var ze=class{constructor(t){this.idCaptureWorkerManager=t;}get workerCommand(){return this.idCaptureWorkerManager.workerCommand.bind(this.idCaptureWorkerManager)}async getLicenseText(){return (await this.workerCommand("getIdOpenSourceSoftwareLicenseInfo",{})).licenseText}};var Yt={"id.idCaptureOverlay.scanFrontSideHint":"","id.idCaptureOverlay.scanBackSideHint":"","id.idCaptureOverlay.moveCloseTextHint":"","id.idCaptureOverlay.moveFurtherAwayTextHint":"","id.idCaptureOverlay.tapShutterToScan":"","id.idCaptureOverlay.lookingForDocument":"","id.idCaptureOverlay.holdStill":""};function Qt(e){let t=URL.createObjectURL(new Blob(['"use strict";(()=>{var ye=(a,e)=>()=>(a&&(e=a(a=0)),e);var g,c=ye(()=>{g={"scandit-datacapture-sdk-id-pthreads.wasm":{bytes:8237286},"scandit-datacapture-sdk-id.wasm":{bytes:8185237},"scandit-datacapture-sdk-id-simd-pthreads.wasm":{bytes:8176551},"scandit-datacapture-sdk-id-simd.wasm":{bytes:8123730}}});c();c();c();c();var d;(a=>{(n=>(n.Debug="debug",n.Info="info",n.Warn="warn",n.Error="error",n.Quiet="quiet"))(a.Level||(a.Level={}));let e=new Map([["debug",1],["info",2],["warn",3],["error",4],["quiet",5]]),t="debug";function r(n){t=n}a.setLevel=r;function s(n,...u){if(!(e.get(t)>e.get(n)))switch(n){case"debug":{console.debug(...u);break}case"info":{console.log(...u);break}case"warn":{console.warn(...u);break}case"error":{console.error(...u);break}}}a.log=s;function i(...n){s("warn",...n)}a.warn=i;function o(...n){s("debug",...n)}a.debug=o;function l(...n){s("info",...n)}a.info=l;function p(...n){s("error",...n)}a.error=p})(d||(d={}));c();c();c();function Ie(a){return/^https?:\\/\\/(?:[^./]*\\.)*cdn.jsdelivr.net\\//.test(a)?{result:!0,cdnBaseURL:"https://cdn.jsdelivr.net/npm/"}:/^https?:\\/\\/(?:[^./]*\\.)*unpkg.com\\//.test(a)?{result:!0,cdnBaseURL:"https://unpkg.com/"}:{result:!1,cdnBaseURL:""}}function De(a){let e=/@scandit\\/web-datacapture-[a-z]+/i.exec(a);return e?e[0]:null}function q(a,e,t){let r=e,s=Ie(r);if(s.result){let o=De(r);o!=null&&(r=`${s.cdnBaseURL}${o}@${a}/sdc-lib/`)}let i=t.replace(".wasm","");return s.result?{jsURI:`${r}${i}.js`,wasmURI:`${r}${i}.wasm`}:{jsURI:`${r}${i}.js?v=${a}`,wasmURI:`${r}${i}.wasm?v=${a}`}}c();c();var A=class X extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,X.prototype),this.name=e.name}toString(){return`${this.name}: ${this.message}`}};var F=Promise.resolve(),H=!1,N=!1,M,T={writableDataPath:""};async function Y(a){if(M==null)return;H=!0;let e=new Promise((t,r)=>{setTimeout(()=>{r(new A({name:"BlockedIndexedDB",message:"IndexedDB database is blocked"}))},1500)});try{await Promise.race([new Promise((t,r)=>{M?.(a,s=>{if(s!=null){r(s);return}t()})}),e])}finally{H=!1}}async function Z(a){return N||(H?(N=!0,F=F.then(async()=>(N=!1,Y(a)))):F=Y(a)),F}async function Q(a){T=a,M=FS.syncfs,FS.syncfs=(e,t)=>{let r=t,s=i=>{r(i)};Z(e).then(s).catch(s)};try{FS.mkdir(T.writableDataPath)}catch(e){if(e.code!=="EEXIST")throw M=void 0,e}return FS.mount(IDBFS,{},T.writableDataPath),Z(!0)}c();c();c();c();var B=(a,e)=>(e=Symbol[a])?e:Symbol.for("Symbol."+a);var V=function(a,e){this[0]=a,this[1]=e},ee=(a,e,t)=>{var r=(o,l,p,n)=>{try{var u=t[o](l),h=(l=u.value)instanceof V,C=u.done;Promise.resolve(h?l[0]:l).then(y=>h?r(o==="return"?o:"next",l[1]?{done:y.done,value:y.value}:y,p,n):p({value:y,done:C})).catch(y=>r("throw",y,p,n))}catch(y){n(y)}},s=o=>i[o]=l=>new Promise((p,n)=>r(o,l,p,n)),i={};return t=t.apply(a,e),i[B("asyncIterator")]=()=>i,s("next"),s("throw"),s("return"),i},te=(a,e,t)=>(e=a[B("asyncIterator")])?e.call(a):(a=a[B("iterator")](),e={},t=(r,s)=>(s=a[r])&&(e[r]=i=>new Promise((o,l,p)=>(i=s.call(a,i),p=i.done,Promise.resolve(i.value).then(n=>o({value:n,done:p}),l)))),t("next"),t("return"),e);var ae={};function be(a){return[...new Uint8Array(a)].map(e=>{let t=e.toString(16);return t.length===1?`0${t}`:t}).join("")}function we(a){return ee(this,null,function*(){let e=a.getReader();try{for(;;){let{done:t,value:r}=yield new V(e.read());if(t)return;yield r}}finally{e.releaseLock()}})}async function Me(a){let e=[],t=0,r=0;try{for(var s=te(we(a)),i,o,l;i=!(o=await s.next()).done;i=!1){let n=o.value;e.push(n),t+=n.length}}catch(n){l=[n]}finally{try{i&&(o=s.return)&&await o.call(s)}finally{if(l)throw l[0]}}let p=new Uint8Array(t);for(let n of e)p.set(n,r),r+=n.length;return p.buffer}var ve=(a=>(a.VALID="VALID",a.INVALID="INVALID",a.NOT_VERIFIABLE="NOT_VERIFIABLE",a))(ve||{});async function xe(a,e,t){if(typeof crypto.subtle.digest!="function")return d.log(d.Level.Warn,`Insecure context (see https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts): The hash of the Scandit Data Capture library WASM file found at ${t} could not be verified`),"NOT_VERIFIABLE";try{let r=a instanceof Promise?await a:a,s=await crypto.subtle.digest("SHA-256",r),i=be(s);return e==null?(d.log(d.Level.Warn,"The library hash is not defined or empty, cannot correctly verify integrity."),"NOT_VERIFIABLE"):i===e?(d.log(d.Level.Debug,`Data Capture library WASM integrity found at ${t} has been verified correctly.`),"VALID"):(d.log(d.Level.Warn,`The Scandit Data Capture library WASM file found at ${t} seems invalid: expected file hash doesn\'t match (received: ${i}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),"INVALID")}catch(r){return d.log(d.Level.Warn,"Wasm response could not be verified",r),"NOT_VERIFIABLE"}}var _=new Map([["br",4.4],["gzip",2.9],["none",1]]);function Le(a){var e;let t="content-encoding";if(a==null||a.get(t)==null)return _.get("none");let r=new Set(((e=a.get(t))!=null?e:"").split(",").map(s=>s.trim()));for(let[s,i]of _)if(r.has(s))return i;return _.get("none")}function Re(a){var e,t;if(a==null)return 0;let r=(e=Le(a))!=null?e:1,s=Number.parseInt((t=a.get("content-length"))!=null?t:"0",10);return Number.isNaN(s)?0:Math.floor(s*r*100)/100}function ke(a){let{pathname:e}=new URL(a);for(let[t,r]of Object.entries(ae))if(e.endsWith(t))return r.bytes;return 0}function re(a){ae=a}var Ae=(a,e)=>{let t=Re(e);return t===0?ke(a):t};function Fe(a,e,t,{onProgress:r,onError:s,onComplete:i}){if(!e.body)return[e];let o=Ae(a,e.headers),l=0,p=0,[n,u]=t?e.body.tee():[e.body],h=n.pipeThrough(new TransformStream({async transform(C,y){try{l+=C.length,p=Number((l/o*100).toFixed(2)),o>0&&C.length>0&&p<100?r?.({percentage:p,loadedBytes:l,privateUri:a}):o===0&&C.length>0&&r?.({percentage:null,loadedBytes:l,privateUri:a}),y.enqueue(C)}catch(D){y.error(D),s?.({error:D})}},flush(C){r?.({percentage:100,loadedBytes:l,privateUri:a}),i?.({percentage:100,loadedBytes:l,privateUri:a}),C.terminate()}}));return[new Response(h,{headers:new Headers(e.headers),status:e.status,statusText:e.statusText}),u]}async function z({wasmURI:a,expectedHash:e,verifyResponseHash:t,onProgress:r,onComplete:s,onError:i,referredOrigin:o}){let l=await fetch(a,{referrerPolicy:"origin",referrer:o??""});if(!l.ok)throw new Error(`HTTP status code is not ok: ${l.status}, ${l.statusText}`);let[p,n]=Fe(a,l,t,{onProgress:r,onError:i,onComplete:s});return n!=null&&xe(Me(n),e,a),p}function se({wasmURI:a,expectedHash:e,verifyResponseHash:t,progressCallback:r,successCallback:s,importObject:i,referredOrigin:o}){async function l(n){try{let u=await z({wasmURI:a,expectedHash:e,verifyResponseHash:t,onProgress:r,referredOrigin:o}),h=await(n??u).arrayBuffer(),C=await globalThis.WebAssembly.instantiate(h,i);s(C.instance,C.module)}catch(u){d.log(d.Level.Error,u),d.log(d.Level.Error,`Couldn\'t instantiate Scandit SDK DataCapture library at ${a}, did you configure the path for it correctly?`)}}async function p(){let n;try{n=await z({wasmURI:a,expectedHash:e,verifyResponseHash:t,onProgress:r,referredOrigin:o});let u=await globalThis.WebAssembly.instantiateStreaming(n,i);s(u.instance,u.module)}catch(u){d.log(d.Level.Warn,u),d.log(d.Level.Warn,"WebAssembly streaming compile failed. Falling back to ArrayBuffer instantiation (this will make things slower)"),l(n?.bodyUsed===!0?void 0:n)}}typeof globalThis.WebAssembly.instantiateStreaming=="function"?p():l()}async function J(a,e,t,r){return new Promise((s,i)=>{a().then(s).catch(o=>{let l=e*2;if(l>t){i(o);return}r(o),globalThis.setTimeout(()=>{J(a,l,t,r).then(s).catch(i)},e)})})}function U(a){var e,t;let r="";if((e=a.href)!=null&&e.startsWith("blob:null/"))r="localhost";else{let s=((t=a.pathname)==null?void 0:t.length)>1&&!a.pathname.startsWith("/");r=new URL(s?a.pathname:a.origin).hostname}return r.startsWith("[")&&r.endsWith("]")&&(r=r.slice(1,-1)),r}async function ie(a,e){async function t(){return importScripts(a)}try{await J(t,250,4e3,s=>{d.log(d.Level.Warn,s),d.log(d.Level.Warn,`Couldn\'t retrieve Scandit Data Capture library at ${a}, retrying...`)}),self.Module.mainScriptUrlOrBlob=a;let r=globalThis.SDC_WASM_JS_VERSION;return r!==e&&d.log(d.Level.Warn,`The Scandit Data Capture library JS file found at ${a} seems invalid: expected version doesn\'t match (received: ${r}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),!0}catch(r){return d.log(d.Level.Error,r),!1}}c();var O;(a=>{function e(){return"7.1.3"}a.sdkVersion=e})(O||(O={}));c();var ne=class{constructor(){this.promise=new Promise((a,e)=>{this.reject=e,this.resolve=a})}};c();var Oe=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),Ee=()=>(async a=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(a)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]));function Pe(){return typeof crossOriginIsolated>"u"?!1:crossOriginIsolated}function We(){try{return new WebAssembly.Memory({initial:1,maximum:1,shared:!0}).buffer.constructor.name==="SharedArrayBuffer"}catch{return!1}}async function oe(){return Oe()}async function Ne(){if(!await Ee())return!1;let a=null;try{a=new Worker(URL.createObjectURL(new Blob([\'postMessage("Worker" in self);\'],{type:"text/javascript"})),{name:"nestedWorkerTest"})}catch{return!1}return new Promise(e=>{if(a==null){e(!1);return}a.onmessage=t=>{a?.terminate(),e(t.data)}})}async function de(){let a=await Ne();return Pe()&&We()&&a}var le=class ue{constructor(e,t){this.hintPresenterV2=null,this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL=10,this.redrawInterval=1e3/30,this.redrawRequests=[],this._isDrawLoopRunning=!1,this.frameDataPool=new Map,this.lastFrameCounter=-1,this.poorMansBenchmarkLogs=!1,this.writableDataPathStandard="/scandit_sync_folder",this.resourceFilesSubfolder="resources",this.performanceMetricsReporterTimer=void 0,this.performanceMetrics={frameDataPoolSize:0,processedFramesCount:0,redrawRequestsCount:0,actualRedrawsCount:0},this.gestureListener=null,this.webPlatformHintPresenter=null,this.moduleHandler=e,this.workerFunctions=t,this._loadProgressCallback=this._loadProgressCallback.bind(this),re(this.getWasmMetadata())}get Module(){return this.moduleHandler.get()}set isDrawLoopRunning(e){this._isDrawLoopRunning=e,!e&&typeof this.loopTimeoutId=="number"&&(clearTimeout(this.loopTimeoutId),this.loopTimeoutId=void 0)}get isDrawLoopRunning(){return this._isDrawLoopRunning}convertToLoadableFrameData(e){let t=this.getNextFrameId();this.frameDataPool.set(t,new Uint8ClampedArray(e.getFrameData()));let r=this.lastUsedModuleMirrorAxis==null?!1:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return{frameId:t,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:r}}createContext(e){var t,r,s,i,o;let l=this.getModeDeserializers(),p=U(location);(p==="localhost"||p==="127.0.0.1")&&navigator.userAgent.includes("Electron")&&e.appName!=null&&(p+=`-${e.appName}`),this.parentDomain=e.parentDomain,this.contextDeserializer=new this.Module.DataCaptureContextDeserializer(this.writableDataPath,e.deviceId,e.context.deviceModelName,p,this.parentDomain,l,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let n=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(n==null){let m=this.contextDeserializer.getLastError();throw new Error(`Could not create the context: ${m}`)}let u=n.getView();this.context=n.getContext(),n.delete();let h=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(m,S)=>{this.contextDidChangeStatus(JSON.parse(S.toJson())),m.delete()},didStartObservingContext:m=>{this.didStartObservingContext(),m.delete()},didStopObservingContext:m=>{m.delete()}}),C=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:m=>{m.delete()},onObservationStopped:m=>{m.delete()},onFrameProcessingStarted:(m,S)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"}),S.delete(),m.delete()},onFrameProcessingFinished:(m,S)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"}),S.delete(),m.delete()},onFrameSkipped:(m,S)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"}),S.delete(),m.delete()}}),y=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(m,S)=>{var R;(R=this.gestureListener)==null||R.delete(),this.gestureListener=m.clone(),m.delete()}});(t=this.gestureRecognizer)==null||t.delete(),this.gestureRecognizer=new y;let D=new h;this.context.addListener(D),D.delete();let b=new C;this.context.addFrameListener(b),b.delete(),this.setView(u),(r=this.view)==null||r.setGestureRecognizer(this.gestureRecognizer);let w=this.Module.PlatformHintPresenter.extend("PlatformHintPresenter",{setHintPresenter:m=>{m.delete()},showToast:m=>{this.workerFunctions.postMessage({type:"showToast",payload:JSON.parse(m)})},hideToast:m=>{this.workerFunctions.postMessage({type:"hideToast",payload:JSON.parse(m)})},showGuidance:m=>{this.workerFunctions.postMessage({type:"showGuidance",payload:JSON.parse(m)})},hideGuidance:m=>{this.workerFunctions.postMessage({type:"hideGuidance",payload:JSON.parse(m)})},startUpdateTimer:m=>{this.workerFunctions.postMessage({type:"startUpdateTimer",payload:{duration:{unit:"ms",value:m}}})},stopUpdateTimer:()=>{this.workerFunctions.postMessage({type:"stopUpdateTimer"})}});(s=this.hintPresenterV2)==null||s.delete(),(i=this.webPlatformHintPresenter)==null||i.delete(),this.webPlatformHintPresenter=new w,this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter),(o=this.view)==null||o.setHintPresenterV2(this.hintPresenterV2)}onTap(e){var t;(t=this.gestureListener)==null||t.onTap(JSON.stringify(e))}hintPresenterV2Update(){var e;(e=this.hintPresenterV2)==null||e.update()}startReportingPerformanceMetrics(){this.performanceMetricsReporterTimer==null&&(this.performanceMetricsReporterTimer=setInterval(()=>{this.reportPerformanceMetrics();for(let e of Object.keys(this.performanceMetrics))this.performanceMetrics[e]=0},1e3))}async reportPerformanceMetrics(){this.workerFunctions.postMessage({type:"performanceMetricsReport",payload:{...this.performanceMetrics}})}deleteFrameData(e){this.frameDataPool.delete(e)}dispose(){var e,t;this.context.dispose(),this.frameDataPool.clear(),this.isDrawLoopRunning=!1,this.lastFrameCounter=-1,(e=this.gestureRecognizer)==null||e.delete(),this.gestureRecognizer=null,(t=this.gestureListener)==null||t.delete(),this.gestureListener=null}flushAnalytics(){this.context.flushAnalytics()}extractCentaurusLicense(e){return{payload:{centaurus:{licenseKey:this.Module.LicenseUtils[ue.get3dPartyLicenseKeyMethodName](e)}}}}getModeDeserializers(){return new this.Module.VectorDataCaptureModeDeserializer}loadLibrary(e){return this.libraryLoadingPromise!=null?this.libraryLoadingPromise:(this.libraryLoadingPromise=this.setup(e),this.libraryLoadingPromise)}processFrame(e){var t;if(this.context==null)return{payload:e,transferables:[e.data.buffer]};let r=e.data,s=e.colorType==="GRAYSCALE"?this.Module.ImageBufferFormat.Grayscale8:this.Module.ImageBufferFormat.Rgba8888,i=this.Module.allocateUint8Array(r.byteLength);return this.Module.HEAPU8.set(r,i),(t=this.imageFrameSource)==null||t.outputFrame(i,e.width,e.height,s),{payload:e,transferables:[e.data.buffer]}}reportCameraProperties(e){this.context.setCameraProperties(e.deviceId,e.isFrontFacing,e.hasAutofocus)}requestFrameData(e){let t=this.frameDataPool.get(e);return t==null?{payload:{data:null}}:{payload:{data:t},transferables:[t.buffer]}}scheduleRedraw(e,t){this.addRedrawRequest(t),this.isDrawLoopRunning||this.startDrawLoop(e)}sendViewRefreshCommands(e){this.workerFunctions.postMessage({type:"draw",payload:e},[e.buffer])}setFrameSource(e,t){var r;this.lastUsedModuleMirrorAxis=this.mapMirrorAxisOnModule(e),(r=this.imageFrameSource)==null||r.delete(),this.imageFrameSource=new this.Module.ImageBufferFrameSource(this.lastUsedModuleMirrorAxis,t,0),this.context.setFrameSource(this.imageFrameSource)}startDrawLoop(e){this.isDrawLoopRunning=!0;let t=i=>this.redrawRequests.length>0&&this.redrawRequests[0]<=i,r=i=>{for(;this.redrawRequests.length>0&&this.redrawRequests[0]<=i;)this.redrawRequests.shift()},s=()=>{this.loopTimeoutId=setTimeout(()=>{if(!this.isDrawLoopRunning)return;let i=performance.now();if(t(i)){r(i),e.draw();let o=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(o))}s()},this.redrawInterval)};s()}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let t=this.contextDeserializer.updateContextFromJson(this.context,this.view,JSON.stringify(e.context));if(t==null){let s=this.contextDeserializer.getLastError();throw new Error(`Could not update the context: ${s}`)}this.context.delete(),this.context=t.getContext();let r=t.getView();t.delete(),r!=null&&e.view!=null&&r.setViewSize(e.view.width,e.view.height,e.view.orientation),this.hintPresenterV2!=null&&r?.setHintPresenterV2(this.hintPresenterV2),this.gestureRecognizer!=null&&r?.setGestureRecognizer(this.gestureRecognizer),this.setView(r),d.log(d.Level.Debug,"context updated",e)}}onDocumentVisibilityChange(e){e==="hidden"&&this.context.flushAnalytics()}isFeatureSupported(e){return{payload:{supported:this.context.isFeatureSupported(e)}}}getViewfinderInfo(){var e,t;return{payload:{isDisplayingViewfinder:(t=(e=this.view)==null?void 0:e.isDisplayingViewfinder())!=null?t:!1,rect:JSON.parse(this.view.getViewfinderRect())}}}getOpenSourceSoftwareLicenseInfo(){return{payload:{licenseText:this.Module.OpenSourceSoftwareLicenseInfo.getLicenseText()}}}getNextFrameId(){return this.lastFrameCounter++,this.lastFrameCounter>=this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL&&(this.lastFrameCounter=0),this.lastFrameCounter}getWasmDynamicLibraries(e){return this.getWasmSideModuleFileName()==null?[]:[`${e.replace(/\\/[^/]*$/,"/")}${this.getWasmSideModuleFileName()}`]}getWasmCoreExpectedHash(e,t){return t?e?"eddbc4d8354c4df18bc746917c2a11579517ee96a01293c46cc44b68306f546e":"e5a6649998035ababed66c5dfc241dcc7447b27ec0bcb85bdccaa0b67f755417":e?"47af0d47cd93a224fb5ac28eae40af230cdf0ef60212fbee43e1dedc68f11016":""}getWasmCoreFileName(e,t){return t?e?"scandit-datacapture-sdk-id-simd-pthreads.wasm":"scandit-datacapture-sdk-id-pthreads.wasm":e?"scandit-datacapture-sdk-id-simd.wasm":""}getWasmMetadata(){return g}getWasmSideModuleFileName(){return""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e})}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((t,r)=>t-r)}contextDidChangeStatus(e){e.code===260?e.message=e.message.replace("domain name",`domain name (${U(location)})`):e.code===265&&(e.message=e.message.replace("domain name",`domain name (${this.parentDomain})`)),this.workerFunctions.postMessage({type:"contextDidChangeStatus",payload:e})}didStartObservingContext(){this.workerFunctions.postMessage({type:"didStartObservingContext"})}mapMirrorAxisOnModule(e){switch(e){case"None":return this.Module.Axis.None;case"X":return this.Module.Axis.X;case"Y":return this.Module.Axis.Y;default:return this.Module.Axis.None}}setView(e){this.view=e,this.setViewRefreshHandler(e),e==null&&(this.isDrawLoopRunning=!1,this.sendViewRefreshCommands(new Uint8Array([])))}setViewRefreshHandler(e){if(e==null||e.isViewRefreshHandlerSet)return;let t=this.Module.NeedsRedrawDelegate.extend("NeedsRedrawDelegate",{setNeedsRedrawIn:this.scheduleRedraw.bind(this,e)}),r=new t;e.setNeedsRedrawDelegate(r),e.isViewRefreshHandlerSet=!0}setupDataDecoding(){let e=this.moduleHandler.get(),t=e.DataDecoding.extend("DataDecoding",{decode(r,s){try{let i=JSON.parse(s),o=[];for(let l of i){let p=new TextDecoder(l.ianaName,{fatal:!0});o.push(p.decode(r.slice(l.startIndex,l.endIndex)))}return o.join("")}catch{return""}}});e.setDataDecoding(new t)}start(e,t,r){e&&t&&(this.setupDataDecoding(),this.moduleHandler.get().callMain(),this.moduleHandler.get().__emscripten_proxy_main!==void 0||r())}getWritableDataPath(e){return e!=null?(d.log(d.Level.Debug,`IndexedDB database name override in use to recover from blocked standard database: ${e}`),e):this.writableDataPathStandard}numOfMBToPages(e){return Math.ceil(1024*e*1024/64/1024)}async setup({libraryLocation:e,locationPath:t,writableDataPathOverride:r,overrideThreadsSupport:s,overrideSimdSupport:i,verifyResponseHash:o,referredOrigin:l,fixedWasmMemory:p}){var n;let u=!1,h=!1;this.writableDataPath=this.getWritableDataPath(r),this.resourcePath=`${e}${this.resourceFilesSubfolder}/`,globalThis.path=t;let{resolve:C,reject:y,promise:D}=new ne,b=O.sdkVersion();if(b==="")throw new A({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let[w,m]=await Promise.all([oe(),de()]);s!=="auto"&&(m=s==="on"),i!=="auto"&&(w=i==="on");let S=this.getWasmCoreFileName(w,m),R=q(b,e,S),{jsURI:W,wasmURI:G}=R,Ce={instantiateWasm:(I,fe)=>(se({importObject:I,wasmURI:G,expectedHash:this.getWasmCoreExpectedHash(w,m),verifyResponseHash:o,successCallback:fe,progressCallback:this._loadProgressCallback,referredOrigin:l}),{})},k=p===null?null:new WebAssembly.Memory({initial:this.numOfMBToPages(p),maximum:this.numOfMBToPages(p),shared:m});return k!==null&&d.log(d.Level.Debug,"Fixed wasmMemory set",k),this.moduleHandler.set({...k?{wasmMemory:k}:{},mainScriptUrlOrBlob:W,canvas:(n=this.workerFunctions.getOffscreenCanvas())!=null?n:{getContext:()=>null},...Ce,dynamicLibraries:this.getWasmDynamicLibraries(G),locateFile:I=>e+I,noInitialRun:!0,preRun:[async()=>{try{await Q({writableDataPath:this.writableDataPath})}catch(I){if(I.name==="BlockedIndexedDB"){y(I.toString());return}d.log(d.Level.Debug,"No IndexedDB support, some data will not be persisted:",I)}h=!0,this.start(h,u,C)}],onMainComplete:()=>{if([u,h].includes(!1)){d.log(d.Level.Warn,{runtimeLoaded:u,fileSystemSynced:h},"Both runtimeLoaded and fileSystemSynced should be true when calling onMainComplete"),y("onMainComplete has been called but runtime or file system was not ready.");return}C()},onRuntimeInitialized:()=>{u=!0,this.start(h,u,C)},print:I=>{d.log(d.Level.Info,I)}}),await ie(W,b)||y(`Couldn\'t retrieve Scandit Data Capture library at ${W}, did you configure the path for it correctly?`),D}};le.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var v=le;c();function ce(a){return typeof a=="object"&&a!=null&&a.document==null&&"addEventListener"in a&&typeof a.importScripts=="function"}c();c();function x(a){return typeof a=="object"&&a!=null}function L(a){if(typeof a=="string")return a;if(x(a)){if(typeof a.message=="string")return a.message}else if(typeof a?.toString=="function")return a.toString();return"unknown error"}c();function pe(a){console.warn("Reached unexpected case",a)}var $=class{constructor(a,e){this.onMessageListener=this.onMessage.bind(this),this.workerSelf=a,this.dataCaptureInstance=new v(e,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),ce(a)&&this.listenToMessages()}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",a=>{d.log(d.Level.Error,a)}),this.workerSelf.addEventListener("messageerror",a=>{d.log(d.Level.Error,a)})}postMessage(a,e){this.workerSelf.postMessage(a,e??[])}getOffscreenCanvas(){if(typeof this.workerSelf.OffscreenCanvas=="function")return new this.workerSelf.OffscreenCanvas(32,32)}hasPayload(a){return x(a)&&"payload"in a}hasTransferables(a){return x(a)&&Array.isArray(a.transferables)}async respondWith(a,e,t){let r=null,s;try{s=t(),s instanceof Promise&&(s=await s)}catch(o){s=void 0,r=L(o)}let i={type:"workerTaskId",command:a,id:e,payload:this.hasPayload(s)?s.payload:void 0};r!=null&&(i.error=r),this.postMessage(i,this.hasTransferables(s)?s.transferables:[])}onMessage(a){switch(a.data.command){case"loadLibrary":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.loadLibrary({libraryLocation:e.libraryLocation,locationPath:e.locationPath,referredOrigin:e.referredOrigin,writableDataPathOverride:e.writableDataPathOverride,overrideThreadsSupport:e.overrideThreadsSupport,overrideSimdSupport:e.overrideSimdSupport,verifyResponseHash:e.verifyResponseHash,fixedWasmMemory:e.fixedWasmMemory}))}break}case"onTap":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.onTap(e.point)})}break}case"hintPresenterV2update":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.hintPresenterV2Update()})}break}case"createContext":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.createContext({context:e.context,deviceId:e.deviceId,delayedRegistration:e.delayedRegistration,highEndBlurryRecognition:e.highEndBlurryRecognition,appName:e.appName,parentDomain:e.parentDomain}))}break}case"setFrameSource":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.setFrameSource(e.mirrorAxis,e.isCameraFrameSource))}break}case"processFrame":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.processFrame({data:e.data,width:e.width,height:e.height,colorType:e.colorType}))}break}case"requestFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.requestFrameData(e.frameId))}break}case"deleteFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.deleteFrameData(e.frameId)})}break}case"updateContext":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.updateContext(e))}break}case"dispose":{this.respondWith(a.data.command,a.data.id,()=>this.dataCaptureInstance.dispose());break}case"flushAnalytics":{this.respondWith(a.data.command,a.data.id,()=>{this.dataCaptureInstance.flushAnalytics()});break}case"reportCameraProperties":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.reportCameraProperties(e))}break}case"setLogLevel":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{d.setLevel(e.level)})}break}case"extractCentaurusLicense":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.extractCentaurusLicense(e.licenseKey))}break}case"documentVisibility":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.onDocumentVisibilityChange(e.state)})}break}case"isFeatureSupported":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.isFeatureSupported(e.feature))}break}case"getViewfinderInfo":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getViewfinderInfo())}break}case"getOpenSourceSoftwareLicenseInfo":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getOpenSourceSoftwareLicenseInfo())}break}default:return pe(a.data),!1}return!0}};c();c();c();c();function me(a){return a.ok()}function he(a,e){return me(a)?a.value():e}function ge(a,e){return me(a)?e:a.error()}function f(a,e){return a===void 0?e:a}function j(a){if(typeof a=="string")try{return JSON.parse(a)}catch{return null}return null}var E=class extends v{constructor(t,r){super(t,r);this.lastIdCaptureModeSerializedSettings=""}processFrame(t){return this.idCaptureMode.isReadyToProcessFrame()?super.processFrame(t):{payload:t,transferables:[t.data.buffer]}}updateContext(t){super.updateContext(t),this.idCaptureMode.start()}idCaptureSetLastResult(t){this.idCaptureMode.setLastResult(t)}idCaptureSetLastError(t){this.idCaptureMode.setLastError(t)}idCaptureSetLastLocalizedId(t){this.idCaptureMode.setLastLocalizedId(t)}idCaptureSetLastDetectionIssue(t){this.idCaptureMode.setLastDetectionIssue(t)}async idCaptureReset(){this.idCaptureMode.reset()}async idCaptureApplySettings(t){return this.idCaptureMode.applySettings(t)}async idCaptureParse(t){return{payload:{result:this.idCaptureMode.parse(t)}}}async idCaptureBarcodeVerifyAamvaCapture(t,r){return{payload:{result:await this.idCaptureMode.idCaptureBarcodeVerifyAamvaCapture(t,r)}}}idCaptureDataConsistencyVerifyCapture(t){return{payload:{result:this.idCaptureMode.idCaptureDataConsistencyVerifyCapture(t)}}}idCaptureDrivingLicenseDetailsCreateWithBlinkIdData(t,r,s){let i=this.Module.DrivingLicenseDetails.createWithBlinkIdData(t,r,s);return{payload:{result:JSON.parse(i)}}}getIdOpenSourceSoftwareLicenseInfo(){return{payload:{licenseText:this.Module.IdOpenSourceSoftwareLicenseInfo.getLicenseText()}}}getModeDeserializers(){this.idCaptureMode=new K(this,this.Module,this.workerFunctions),this.idCaptureMode.start();let t=super.getModeDeserializers();return t.push_back(this.idCaptureMode.getDeserializer()),t}getWasmSideModuleFileName(){return""}getWasmCoreFileName(t,r){return r?t?"scandit-datacapture-sdk-id-simd-pthreads.wasm":"scandit-datacapture-sdk-id-pthreads.wasm":t?"scandit-datacapture-sdk-id-simd.wasm":"scandit-datacapture-sdk-id.wasm"}getWasmCoreExpectedHash(t,r){return r?t?"eddbc4d8354c4df18bc746917c2a11579517ee96a01293c46cc44b68306f546e":"e5a6649998035ababed66c5dfc241dcc7447b27ec0bcb85bdccaa0b67f755417":t?"47af0d47cd93a224fb5ac28eae40af230cdf0ef60212fbee43e1dedc68f11016":"6e65011775c95b91d3633158a23f6b4a05afab45fad3f6d13ddfe76708e0cff4"}getWasmMetadata(){return g}},K=class{constructor(e,t,r){this.SDCIdCaptureMode=null;this.listenerSet=!1;this.lastResult="";this.lastError="";this.lastLocalizedId="";this.lastDetectionIssue="";this._state="initial";this.coreEngine=e,this.Module=t,this.workerFunctions=r,this.state="created"}get state(){return this._state}set state(e){this._state=e}isReadyToProcessFrame(){return this.state==="started"}setLastResult(e){this.lastResult=e}setLastError(e){this.lastError=e}setLastLocalizedId(e){this.lastLocalizedId=e}setLastDetectionIssue(e){this.lastDetectionIssue=e}async applySettings(e){this.SDCIdCaptureMode?.applySettings(JSON.stringify(e))}reset(){this.SDCIdCaptureMode?.reset()}parse(e){if(this.SDCIdCaptureMode){let t=this.SDCIdCaptureMode.parse(e);if(t.ok()){let r=he(t,null);if(r!=null){let s=this.extractCaptureId(r);if(s!=null)return{status:"success",capturedId:s}}}else return{status:"error",error:ge(t,"Undefined error")}}return null}idCaptureDataConsistencyVerifyCapture(e){let r=new this.Module.DataConsistencyVerifier(this.coreEngine.context).verify(JSON.stringify(e));if(r==null)return null;let s=JSON.parse(r.toJson());return r.delete(),s}async idCaptureBarcodeVerifyAamvaCapture(e,t){return new Promise(r=>{let s=this.Module.AamvaBarcodeVerifier.extend("AamvaBarcodeVerifier",{retriggerVerificationIn(o){setTimeout(()=>{i.startVerification(JSON.stringify(e))},o)},verificationEnded(){let o=i.getBarcodeVerificationResponse();r({isSuccess:o.isSuccess,error:o.error,allChecksPassed:o.allChecksPassed,serverResponseJSON:o.serverResponseJson})}}),i=new s;i.initialize(this.coreEngine.context,t??""),i.startVerification(JSON.stringify(e))})}start(){if(this.initHintPresenterIfNotInitialized(),this.state==="started")return;let e=this.Module.IdCaptureListener.extend("IdCaptureListener",{onSessionUpdated:(n,u)=>{n.delete(),u.delete()},onIdCaptured:(n,u)=>{this.onIdCapturedCallback(u),n.delete(),u.delete()},onIdRejected:(n,u,h)=>{this.onIdRejectedCallback(u,h),n.delete(),u.delete()},onShutterButtonPositionChanged:n=>{this.onShutterButtonPositionChangedCallback(n)},onShutterButtonStateChanged:n=>{this.onShutterButtonStateChangedCallback(n)}}),t=this.Module.Feedback.extend("Feedback",{emit:()=>{this.workerFunctions.postMessage({type:"idCaptureIdCapturedFeedback"})}}),r=this.Module.Feedback.extend("Feedback",{emit:()=>{this.workerFunctions.postMessage({type:"idCaptureIdRejectedFeedback"})}}),s=this.Module.IdCaptureDeserializerListener.extend("IdCaptureDeserializerListener",{onModeDeserializationFinished:(n,u,h)=>{if(!this.listenerSet){let C=new e;u.addListener(C),C.delete(),this.listenerSet=!0,u.setFeedbacks(new t,new r)}n.delete(),u.delete(),h.delete()},onModeDeserializationStarted(n,u,h){n.delete(),u.delete(),h.delete()},onSettingsDeserializationStarted(n,u,h){n.delete(),u.delete(),h.delete()},onSettingsDeserializationFinished(n,u,h){n.delete(),u.delete(),h.delete()}}),i=this.Module.IdCaptureBackend.extend("IdCaptureBackend",{getLastError:()=>this.lastError,getLastResult:()=>this.lastResult,getLocalizedOnlyId:()=>this.lastLocalizedId,getLastIssue:()=>this.lastDetectionIssue,processFrame:(n,u,h,C)=>{},reset:this.onResetFromSDC.bind(this),setDetectionOnlyMode:this.setDetectionOnlyMode.bind(this)}),o=this.Module.IdCaptureDeserializerHelper.extend("IdCaptureDeserializerHelper",{createMode:(n,u)=>{this.SDCIdCaptureMode!=null&&this.SDCIdCaptureMode.delete();let h=new i;return this.SDCIdCaptureMode=new this.Module.IdCapture(n,h,u,null),h.delete(),n.delete(),u.delete(),this.SDCIdCaptureMode}}),l=new o;this.idCaptureDeserializer=new this.Module.IdCaptureDeserializer(l),l.delete();let p=new s;this.idCaptureDeserializer.setListener(p),p.delete(),this.state="started"}onResetFromSDC(){this.workerFunctions.postMessage({type:"idCaptureBackendReset"}),this.lastError="",this.lastResult="",this.lastLocalizedId=""}setDetectionOnlyMode(e){this.workerFunctions.postMessage({type:"idCaptureDetectionOnlyMode",payload:{detectionOnlyMode:e}})}onIdCapturedCallback(e){let t=this.extractCaptureId(e);t&&this.workerFunctions.postMessage({type:"idCaptureDidCaptureId",payload:{capturedId:t}},this.extractImageTransferablesFromCapturedId(t))}onIdRejectedCallback(e,t){let r=this.extractCaptureId(e);this.workerFunctions.postMessage({type:"idCaptureDidRejectId",payload:{capturedId:r,rejectionReason:t}},r?this.extractImageTransferablesFromCapturedId(r):[])}extractCaptureId(e){if(e==null)return null;let t=e.getImages(),r=t.getFrameFront(),s=t.getFrameBack(),i=f(t.getFace(),null),o=f(t.getCroppedDocumentFront(),null),l=f(t.getCroppedDocumentBack(),null),p={front:{face:i,croppedDocument:o,frame:{data:r?new Uint8ClampedArray(r.getFrameData()):null,width:r?.getWidth()??0,height:r?.getHeight()??0,mirrorAxis:r?.getMirrorAxis().value??0,orientation:r?.getOrientation()??0}},back:{face:null,croppedDocument:l,frame:{data:s?new Uint8ClampedArray(s.getFrameData()):null,width:s?.getWidth()??0,height:s?.getHeight()??0,mirrorAxis:s?.getMirrorAxis().value??0,orientation:s?.getOrientation()??0}}};r?.delete(),s?.delete(),t.delete();let n=JSON.parse(e.toJson());return{...{firstName:f(e.getFirstName(),""),lastName:f(e.getLastName(),""),secondaryLastName:f(e.getSecondaryLastName(),""),fullName:e.getFullName(),sex:f(e.getSex(),""),age:f(e.getAge(),null),isExpired:f(e.isExpired(),null),nationality:f(e.getNationality(),""),address:f(e.getAddress(),""),issuingCountry:f(e.getIssuingCountry(),""),issuingCountryIso:f(e.getIssuingCountryIso(),""),documentNumber:f(e.getDocumentNumber(),""),documentAdditionalNumber:f(e.getDocumentAdditionalNumber(),""),dateOfBirth:j(f(e.getDateOfBirth(),null)),dateOfExpiry:j(f(e.getDateOfExpiry(),null)),dateOfIssue:j(f(e.getDateOfIssue(),null)),documentType:f(e.getDocumentType(),null),documentSubtype:f(e.getDocumentSubtype(),null)},...n,imageInfo:null,rawImageInfo:p}}onShutterButtonPositionChangedCallback(e){this.workerFunctions.postMessage({type:"idCaptureDidShutterButtonPositionChanged",payload:{position:JSON.parse(e)}})}onShutterButtonStateChangedCallback(e){this.workerFunctions.postMessage({type:"idCaptureDidShutterButtonStateChanged",payload:{state:e}})}parseIdCaptureSession(e){return JSON.parse(e.toJson())}getDeserializer(){return this.idCaptureDeserializer}dispose(){this.state==="started"&&(this.idCaptureDeserializer.delete(),this.lastError="",this.lastLocalizedId="",this.lastResult="",this.listenerSet=!1,this.state="disposed")}restart(){this.dispose(),this.start()}extractImageTransferablesFromCapturedId(e){let t=[];return e.rawImageInfo.front.frame.data&&e.rawImageInfo.front.frame.data.length>0&&t.push(e.rawImageInfo.front.frame.data.buffer),e.rawImageInfo.back.frame.data&&e.rawImageInfo.back.frame.data.length>0&&t.push(e.rawImageInfo.back.frame.data.buffer),t}isReadyToDisplayHints(){return this.coreEngine.view?this.coreEngine.view.hintPresenterInitialized():!1}initHintPresenterIfNotInitialized(){if(this.isReadyToDisplayHints())return;let e=this.Module.HintPresenter.extend("HintPresenter",{showHint:(t,r)=>{this.workerFunctions.postMessage({type:"showHint",payload:{text:t,style:JSON.parse(r)}})},updateHint:t=>{this.workerFunctions.postMessage({type:"updateHint",payload:{style:JSON.parse(t)}})},hideHint:()=>{this.workerFunctions.postMessage({type:"hideHint",payload:{}})}});this.coreEngine.view?.setHintPresenter(new e)}};var P=class extends ${constructor(e,t){super(e,t),this.dataCaptureInstance=new E(t,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)})}async respondWith(e,t,r){let s=null,i;try{i=r(),i instanceof Promise&&(i=await i)}catch(l){d.log(d.Level.Debug,l),i=void 0,s=L(l)}let o={type:"workerTaskId",command:e,id:t,payload:this.hasPayload(i)?i.payload:void 0};s!=null&&(o.error=s),this.postMessage(o,this.hasTransferables(i)?i.transferables:[])}onMessage(e){switch(e.data.command){case"idCaptureSetLastResult":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>{this.dataCaptureInstance.idCaptureSetLastResult(t.result)}),!0}case"idCaptureSetLastError":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>{this.dataCaptureInstance.idCaptureSetLastError(t.error)}),!0}case"idCaptureSetLastLocalizedId":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>{this.dataCaptureInstance.idCaptureSetLastLocalizedId(t.localizedId)}),!0}case"idCaptureSetLastDetectionIssue":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>{this.dataCaptureInstance.idCaptureSetLastDetectionIssue(t.issue)}),!0}case"idCaptureReset":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureReset()),!0}case"idCaptureApplySettings":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureApplySettings(t.settings)),!0}case"idCaptureParse":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureParse(t.code)),!0}case"idCaptureBarcodeVerifyAamvaCapture":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureBarcodeVerifyAamvaCapture(t.capturedId,t.endpoint)),!0}case"idCaptureDataConsistencyVerifyCapture":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureDataConsistencyVerifyCapture(t.capturedId)),!0}case"idCaptureDrivingLicenseDetailsCreateWithBlinkIdData":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureDrivingLicenseDetailsCreateWithBlinkIdData(t.details.vehicleClass,t.details.restrictions,t.details.endorsements)),!0}case"getIdOpenSourceSoftwareLicenseInfo":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>this.dataCaptureInstance.getIdOpenSourceSoftwareLicenseInfo()),!0}default:return super.onMessage(e)}}};var ha=new P(globalThis,{get:()=>globalThis.Module,set:a=>{globalThis.Module=a}});function ga(a){}})();\n'],{type:"application/javascript"})),a=new Worker(t,e);return URL.revokeObjectURL(t),a}var je=class e extends DataCaptureLoader{constructor(){super(...arguments);this._name="IdCapture";}get dataCaptureWorker(){return (this._dataCaptureWorker)!=null||(this._dataCaptureWorker=Qt({name:this.name})),this._dataCaptureWorker}get name(){return this._name}get fixedWasmMemory(){return BrowserHelper.isIPhone()&&BrowserHelper.isSafari()?256:null}static async create(a){var s;let r=new e(a);return r.workerCommand("setLogLevel",{level:(s=a.logLevel)!=null?s:Logger.Level.Debug}),await r.load(),r}async workerCommand(...a){let[r,s,o]=a;return new Promise((c,u)=>{let m=this.workerCommandId++;this.workerTasks.set(m,{resolve:c,reject:u,command:r});let S={...s,command:r,id:m};this.dataCaptureWorker.postMessage(S,o);})}};function ja(e){return isObject(e)&&Object.prototype.hasOwnProperty.call(e,"code")&&Object.values(A).includes(e.code)}function Ja(e){return /^This license is invalid for version .+\. It is valid only for licensee '.+', for product '.+' on platform '.+' up to version .+\. Please contact support for more information\.$/.test(e.message)}var ct=new Map;ct.set([77,105,99,114,111,98,108,105,110,107],"Scandit");ct.set([66,108,105,110,107,73,68],"ID Capture");var dt="Centaurus",Ke=class e{static async load(t){let a=new e;try{await a.initCentaurus(t);}catch(r){if(ja(r)){if(Ja(r))throw new DataCaptureError({message:"Invalid embedded license version.",name:"IdCaptureLoadingError"});if(r.code===A.LICENSE_UNLOCK_ERROR)throw new DataCaptureError({message:"Invalid license key. Platform or domain may be incorrect.",name:"IdCaptureLoadingError"});if(r.code===A.SDK_LICENSE_KEY_MISSING)throw new DataCaptureError({message:"Invalid license key (sub-part is missing).",name:"IdCaptureLoadingError"})}throw new DataCaptureError({message:e.replaceCentaurusMentions(isObject(r)?r.message:"(no message)",ct),name:"IdCaptureLoadingError"})}return a}static replaceCentaurusMentions(t,a){return typeof t=="string"?[...a.entries()].reduce((r,[s,o])=>{let c=s.map(u=>String.fromCodePoint(u)).join("");return r.replace(new RegExp(c,"gi"),o)},t):"(no message)"}static async getWasmType(){let[t,a]=await Promise.all([BrowserHelper.hasSIMDSupport(),BrowserHelper.hasThreadsSupport()]);return t?a?BrowserHelper.isDesktopDevice()?U.AdvancedWithThreads:U.Advanced:U.Advanced:U.Basic}async initCentaurus(t){this.licenseKey=t.licenseKey;let a=new ke(t.licenseKey);a.engineLocation=t.libraryLocation;let r=new URL("Centaurus.worker.min.js",t.libraryLocation).toString(),s=new Blob([`importScripts("${r}");`],{type:"text/javascript"});a.workerLocation=URL.createObjectURL(s),a.initialMemory=500,a.allowHelloMessage=!1,a.wasmModuleName=dt,a.wasmType=await e.getWasmType(),a.blinkIdVariant="lightweight";let o=0;a.loadProgressCallback=c=>{var u;c>=o&&((u=t.loadProgressNotifier)==null||u.call(t,{percentage:c,privateUri:new URL(`${a.wasmModuleName}.wasm`,t.libraryLocation).toString()})),o=c;},this.wasmSDK=await Bt(a);}};var pt=43,Za=100-pt,ea={condition:e=>Object.keys(p).some(t=>e.pathname.endsWith(t)),do:e=>(e.info.percentage==null||(e.info.percentage=pt*e.info.percentage/100),e.info)},ta={condition:e=>e.pathname.endsWith(`${dt}.wasm`),do:e=>(e.info.percentage==null||(e.info.percentage=pt+Za*e.info.percentage/100),e.info)};function Ya(e){if(typeof e=="function")return function(a){if(a.percentage==null){e(a);return}let{pathname:r}=new URL(a.privateUri,document.baseURI),s=match({pathname:r,info:a}).when(ea.condition,ea.do).when(ta.condition,ta.do).otherwise(o=>o.info).run();e(s);}}var aa=Ya;var B=class{constructor(){this.type="shutter";this.view=null;}toJSONObject(){return {type:this.type}}};B.CLASS_NAME=ViewClassNames.SHUTTER_BUTTON_CONTROL_CLASS_NAME;var Ye={standby:"standby",active:"active",scanning:"scanning"},Ze=class{constructor(t,a){this.control=t,this.controlsElement=a;}async install(){return this.shutterButton||(ShutterButton.register(),this.shutterButton=ShutterButton.create(),this.shutterButton.classList.add("scandit-control-widget"),this.shutterButton.classList.add(`scandit-control-widget-${B.CLASS_NAME}`),this.shutterButton.style.margin="0",this.lastPositionReceived&&this.applyPositioning(this.lastPositionReceived)),this.appendShutterButton(),!0}updatePosition(t){if(t.size.width===0&&t.size.height===0&&this.shutterButton){this.remove();return}this.lastPositionReceived=structuredClone(t),this.applyPositioning(t),this.appendShutterButton();}updateState(t){if(this.shutterButton)switch(t){case"scanning":{this.shutterButton.rotating=!0,this.shutterButton.pulse=!1;break}case"standby":{this.shutterButton.rotating=!1,this.shutterButton.pulse=!1;break}case"active":{this.shutterButton.rotating=!1,this.shutterButton.pulse=!0;break}}}remove(t){var a;(a=this.shutterButton)==null||a.remove(),t===!0&&(this.shutterButton=void 0);}appendShutterButton(){this.shutterButton&&!this.controlsElement.contains(this.shutterButton)&&this.controlsElement.append(this.shutterButton);}applyPositioning(t){this.shutterButton&&(this.shutterButton.style.position="absolute",this.shutterButton.style.left=`${t.origin.x}px`,this.shutterButton.style.top=`${t.origin.y}px`,this.shutterButton.style.width=`${t.size.width}px`,this.shutterButton.style.height=`${t.size.height}px`);}};var ia=class e{constructor(){this.type="idCapture";this._idLayoutStyle="rounded";this._defaultCapturedBrush=new Brush(_.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.fillColor,_.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.strokeColor,_.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.strokeWidth);this._defaultLocalizedBrush=new Brush(_.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.fillColor,_.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.strokeColor,_.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.strokeWidth);this._defaultRejectedBrush=new Brush(_.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.fillColor,_.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.strokeColor,_.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.strokeWidth);this._capturedBrush=this._defaultCapturedBrush;this._localizedBrush=this._defaultLocalizedBrush;this._rejectedBrush=this._defaultRejectedBrush;this._idLayoutLineStyle="light";this._showTextHints=!0;this._frontSideTextHint=Localization.getInstance().get("id.idCaptureOverlay.scanFrontSideHint");this._backSideTextHint=Localization.getInstance().get("id.idCaptureOverlay.scanBackSideHint");this._moveCloserTextHint=Localization.getInstance().get("id.idCaptureOverlay.moveCloseTextHint");this._moveFurtherAwayTextHint=Localization.getInstance().get("id.idCaptureOverlay.moveFurtherAwayTextHint");this._tapShutterToScanTextHint=Localization.getInstance().get("id.idCaptureOverlay.tapShutterToScan");this._lookingForDocumentTextHint=Localization.getInstance().get("id.idCaptureOverlay.lookingForDocument");this._holdStillTextHint=Localization.getInstance().get("id.idCaptureOverlay.holdStill");this.onShutterPositionUpdateListener=this.onShutterPositionUpdate.bind(this);this.onShutterButtonStateChangedListener=this.onShutterButtonStateChanged.bind(this);this.onContextUpdatedListener=this.onContextUpdated.bind(this);this.overlayListener={onShutterPositionUpdate:this.onShutterPositionUpdateListener,onShutterButtonStateChanged:this.onShutterButtonStateChangedListener};}get idLayoutStyle(){return this._idLayoutStyle}set idLayoutStyle(t){this._idLayoutStyle=t,this.idCapture.didChange();}get idLayoutLineStyle(){return this._idLayoutLineStyle}set idLayoutLineStyle(t){this._idLayoutLineStyle=t,this.idCapture.didChange();}get showTextHints(){return this._showTextHints}set showTextHints(t){this._showTextHints=t,this.idCapture.didChange();}get defaultCapturedBrush(){return this._defaultCapturedBrush}get defaultLocalizedBrush(){return this._defaultLocalizedBrush}get defaultRejectedBrush(){return this._defaultRejectedBrush}static async withIdCapture(t){return e.withIdCaptureForView(t,null)}static async withIdCaptureForView(t,a){var s;let r=new e;return r.idCapture=t,await r.setCapturedBrush(r.defaultCapturedBrush),await r.setLocalizedBrush(r.defaultLocalizedBrush),await r.setRejectedBrush(r.defaultRejectedBrush),a&&(r.view=a,await a.addOverlay(r),await r.installShutterButton()),t.addOverlayListener(r.overlayListener),(s=t.context)==null||s.updateListeners.add(r.onContextUpdatedListener),r}async setFrontSideTextHint(t){Logger.log(Logger.Level.Debug,"DEPRECATED: IdCaptureOverlay.setFrontSideTextHint. Use the Localization API instead."),this._frontSideTextHint=t,await this.idCapture.didChange();}async setBackSideTextHint(t){Logger.log(Logger.Level.Debug,"DEPRECATED: IdCaptureOverlay.setBackSideTextHint. Use the Localization API instead."),this._backSideTextHint=t,await this.idCapture.didChange();}async setMoveCloserTextHint(t){Logger.log(Logger.Level.Debug,"DEPRECATED: IdCaptureOverlay.setMoveCloserTextHint. Use the Localization API instead."),this._moveCloserTextHint=t,await this.idCapture.didChange();}async setMoveFurtherAwayTextHint(t){Logger.log(Logger.Level.Debug,"DEPRECATED: IdCaptureOverlay.setMoveFurtherAwayTextHint. Use the Localization API instead."),this._moveFurtherAwayTextHint=t,await this.idCapture.didChange();}getCapturedBrush(){return this._capturedBrush}async setCapturedBrush(t){this._capturedBrush=t,await this.idCapture.didChange();}getLocalizedBrush(){return this._localizedBrush}async setLocalizedBrush(t){this._localizedBrush=t,await this.idCapture.didChange();}getRejectedBrush(){return this._rejectedBrush}async setRejectedBrush(t){this._rejectedBrush=t,await this.idCapture.didChange();}toJSONObject(){return {type:this.type,idLayoutStyle:this.idLayoutStyle,idLayoutLineStyle:this.idLayoutLineStyle,showTextHints:this._showTextHints,capturedBrush:this._capturedBrush.toJSONObject(),localizedBrush:this._localizedBrush.toJSONObject(),rejectedBrush:this._rejectedBrush.toJSONObject(),frontSideTextHint:this._frontSideTextHint,backSideTextHint:this._backSideTextHint,moveCloserTextHint:this._moveCloserTextHint,moveFurtherAwayTextHint:this._moveFurtherAwayTextHint,tapShutterToScanTextHint:this._tapShutterToScanTextHint,lookingForDocumentTextHint:this._lookingForDocumentTextHint,holdStillTextHint:this._holdStillTextHint}}async installShutterButton(){if(this.view&&this.idCapture.settings.captureTrigger==="buttonTap")if(this.shutterWidget)await this.shutterWidget.install();else {let t=new B;this.shutterWidget=this.view.registerControlWidget(t,Ze),this.view.addControl(t);}}onContextUpdated(t){var s,o,c,u;if(t.type==="modeEnabled"&&!t.newValue){(s=this.shutterWidget)==null||s.remove();return}t.type==="removeOverlay"&&t.newValue===this&&(this.idCapture.removeOverlayListener(this.overlayListener),(o=this.idCapture.context)==null||o.updateListeners.delete(this.onContextUpdatedListener));let a=(c=this.idCapture.context)==null?void 0:c.toJSONObject().modes,r=a==null?void 0:a.find(m=>m.type==="idCapture");r&&r.settings.captureTrigger==="auto"&&this.shutterWidget?(u=this.view)==null||u.removeControl(this.shutterWidget.control):this.installShutterButton();}onShutterPositionUpdate(t){var a,r,s;(a=this.shutterWidget)==null||a.updatePosition(t),t.size.width===0&&t.size.height===0&&((r=this.shutterWidget)!=null&&r.control)&&((s=this.view)==null||s.removeControl(this.shutterWidget.control));}onShutterButtonStateChanged(t){var a,r,s;switch(t){case"untapped":{(a=this.shutterWidget)==null||a.updateState(Ye.standby);break}case"untappedLocalized":{(r=this.shutterWidget)==null||r.updateState(Ye.active);break}case"tapped":{(s=this.shutterWidget)==null||s.updateState(Ye.scanning);break}}}};var Qe=class extends T{constructor(){super();this._isFull=!0;}toJSONObject(){return {isFull:this._isFull,options:{barcode:!0,machineReadableZone:!0,visualInspectionZone:!0}}}};var le=class extends T{constructor(a,r,s){super();this._isFull=!1;this._barcode=a,this._machineReadableZone=r,this._visualInspectionZone=s;}get barcode(){return this._barcode}get machineReadableZone(){return this._machineReadableZone}get visualInspectionZone(){return this._visualInspectionZone}toJSONObject(){return {isFull:this._isFull,options:{barcode:this.barcode,machineReadableZone:this.machineReadableZone,visualInspectionZone:this.visualInspectionZone}}}};var Xe=class{constructor(t,a,r){this._days=t,this._months=a,this._years=r;}get days(){return this._days}get months(){return this._months}get years(){return this._years}toJSONObject(){return {days:this.days,months:this.months,years:this.years}}};var sa=class e{constructor(){this.acceptedDocuments=[];this.rejectedDocuments=[];this.anonymizationMode="fieldsOnly";this.captureTrigger="auto";this.rejectVoidedIds=!1;this.decodeBackOfEuropeanDrivingLicense=!1;this.rejectExpiredIds=!1;this.rejectNotRealIdCompliant=!1;this.rejectInconsistentData=!1;this.rejectHolderBelowAge=null;this.rejectIdsExpiringIn=null;this.properties={};this.imageToResult={};this.scannerType=new le(!1,!1,!1);}setProperty(t,a){this.properties[t]=a;}getProperty(t){return this.properties[t]}setShouldPassImageTypeToResult(t,a){this.imageToResult[t]=a;}getShouldPassImageTypeToResult(t){var a;return (a=this.imageToResult[t])!=null?a:!1}toJSONObject(){return {acceptedDocuments:this.acceptedDocuments.map(t=>t.toJSONObject()),rejectedDocuments:this.rejectedDocuments.map(t=>t.toJSONObject()),scannerType:this.scannerType.toJSONObject(),imageToResult:{face:this.imageToResult.face,croppedDocument:this.imageToResult.croppedDocument,frame:this.imageToResult.frame},properties:{...this.properties},anonymizationMode:this.anonymizationMode,captureTrigger:this.captureTrigger,rejectVoidedIds:this.rejectVoidedIds,decodeBackOfEuropeanDrivingLicense:this.decodeBackOfEuropeanDrivingLicense,rejectExpiredIds:this.rejectExpiredIds,rejectNotRealIdCompliant:this.rejectNotRealIdCompliant,rejectInconsistentData:this.rejectInconsistentData,rejectHolderBelowAge:this.rejectHolderBelowAge,rejectIdsExpiringIn:this.rejectIdsExpiringIn?this.rejectIdsExpiringIn.toJSONObject():null}}static fromJSON(t){let a=new e;a.acceptedDocuments=t.acceptedDocuments.map(o=>{var c;return a.createDocumentFromTypeAndRegion(o.documentType,(c=o==null?void 0:o.subtype)!=null?c:o.region)}),a.rejectedDocuments=t.rejectedDocuments.map(o=>{var c;return a.createDocumentFromTypeAndRegion(o.documentType,(c=o==null?void 0:o.subtype)!=null?c:o.region)});let r=t.scannerType;a.scannerType=t.scannerType.isFull?new Qe:new le(r.options.barcode,r.options.machineReadableZone,r.options.visualInspectionZone),a.anonymizationMode=t.anonymizationMode,a.decodeBackOfEuropeanDrivingLicense=t.decodeBackOfEuropeanDrivingLicense,a.captureTrigger=t.captureTrigger,a.rejectVoidedIds=t.rejectVoidedIds,a.rejectExpiredIds=t.rejectExpiredIds,a.rejectNotRealIdCompliant=t.rejectNotRealIdCompliant,a.rejectInconsistentData=t.rejectInconsistentData,a.rejectHolderBelowAge=t.rejectHolderBelowAge;let s=t.rejectIdsExpiringIn;return a.rejectIdsExpiringIn=s?new Xe(s.days,s.months,s.years):null,a.imageToResult={...t.imageToResult},a.properties={...t.properties},a}createDocumentFromTypeAndRegion(t,a){let r=a,s=a;switch(t){case"driverLicense":return new K(r);case"healthInsuranceCard":return new Z(r);case"idCard":return new Y(r);case"passport":return new Q(r);case"residencePermit":return new $(r);case"visaIcao":return new ee(r);case"regionSpecific":return new X(s)}assertUnreachable(t);}};var $e=class e{get allChecksPassed(){return this.json.allChecksPassed}get error(){return typeof this.json.error=="string"&&this.json.error!==""?this.json.error:null}static fromJSON(t){let a=new e;return a.json=t,a}};var oa=class e{constructor(t,a=null){this._context=t,this._endpoint=a;}static async create(t){return new e(t)}async verify(t){let a=await this._context.workerCommand("idCaptureBarcodeVerifyAamvaCapture",{capturedId:t.toJSONObject(),endpoint:this._endpoint});return a.result.isSuccess||Logger.log(Logger.Level.Warn,"Error during Aamva verification:",a.result.error),$e.fromJSON(a.result)}};var la=class e{constructor(t){this._context=t;}static create(t){return new e(t)}async verify(t){let a=await this._context.workerCommand("idCaptureDataConsistencyVerifyCapture",{capturedId:t.toJSONObject()});return a.result==null?null:J.fromJSON(a.result)}};var ht,ie;function Yn(e){Localization.getInstance().updateIfMissing({...Yt});let t=typeof(e==null?void 0:e.enableVIZDocuments)=="boolean"?e.enableVIZDocuments:!1;return {moduleName:"IdCapture",load:async a=>{if(a.loadProgressNotifier=t?aa(a.loadProgressNotifier):a.loadProgressNotifier,a.overrideThreadsSupport=OverrideState.Off,a.verifyResponseHash=!0,ie=await je.create(a),DataCaptureContext.moduleLicenseTextProviders.push(new ze(ie)),!t)return Logger.log(Logger.Level.Info,"VIZ scanning is disabled (enableVIZDocuments option was not passed to idCaptureLoader, or its value was false)"),ie;let o=(await ie.workerCommand("extractCentaurusLicense",{licenseKey:a.licenseKey})).centaurus.licenseKey;if(o.length===0)throw Logger.log(Logger.Level.Error,"Invalid license key: VIZ scanning is enabled in the options but the license key has no VIZ scanning enabled. Update the license key or disable VIZ scanning when calling idCaptureloader."),O.create({type:"InvalidLicenseKeyForVIZProcessing",message:"Invalid license key for VIZ scanning. Update license key or disable VIZ scanning."});return Logger.log(Logger.Level.Info,"VIZ scanning is enabled, VIZ processor will be initialized"),ht=await Ke.load({libraryLocation:`${a.libraryLocation}idcapture/`,licenseKey:o,logLevel:a.logLevel,loadProgressNotifier:a.loadProgressNotifier}),He.setCentaurusLoader(ht),ie}}}function Qn(e){ie=e;}function Xn(e){ht=e;}
|
|
5
5
|
export{$e as AamvaBarcodeVerificationResult,oa as AamvaBarcodeVerifier,Ie as BarcodeResult,ne as CapturedId,Nt as CapturedSides,J as DataConsistencyResult,la as DataConsistencyVerifier,I as DateResult,K as DriverLicense,Ce as DrivingLicenseCategory,j as DrivingLicenseDetails,Xe as Duration,Qe as FullDocumentScanner,Z as HealthInsuranceCard,Ct as IdAnonymizationMode,He as IdCapture,f as IdCaptureDocument,P as IdCaptureDocumentType,O as IdCaptureError,de as IdCaptureErrorCode,pe as IdCaptureFeedback,ia as IdCaptureOverlay,T as IdCaptureScanner,sa as IdCaptureSettings,gt as IdCaptureTrigger,Y as IdCard,et as IdImageType,ha as IdLayoutLineStyle,Aa as IdLayoutStyle,pa as IdSide,Ge as LocalizedOnlyId,Ne as MRZResult,Q as Passport,he as ProfessionalDrivingPermit,Na as Region,X as RegionSpecific,La as RegionSpecificSubtype,Wa as RejectionReason,$ as ResidencePermit,D as STATE,Ia as Sex,le as SingleSideScanner,ma as UsRealIdStatus,ge as VIZResult,me as VehicleRestriction,ee as VisaIcao,ht as centaurusLoader,Yn as idCaptureLoader,ie as mainDataCaptureLoader,Xn as setCentaurusLoader,Qn as setMainDataCaptureLoader};
|