@idscan/idvc2 2.7.2 → 2.7.4
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/README.md +10 -0
- package/dist/idvc.js +3 -3
- package/dist/index.html +2 -0
- package/dist/js/environment/documentTypes.ts +2 -2
- package/dist/js/environment/langs.js +1 -1
- package/dist/js/environment/stepsDescription.ts +1 -1
- package/dist/networks/Blur-chunk.js +1 -0
- package/dist/networks/Bubble-chunk.js +1 -0
- package/dist/networks/MRZ-chunk.js +1 -0
- package/dist/networks/{156-2c44-chunk.js → bubbleWorker.js} +1 -1
- package/dist/networks/mrzWorker.js +1 -0
- package/dist/types/environment/documentTypes.d.ts +1 -1
- package/dist/types/helpers/workers.d.ts +1 -0
- package/dist/types/loader/loaderBubble.d.ts +2 -0
- package/dist/types/modules/bubbleModule.d.ts +6 -0
- package/dist/types/modules/validation/ValidateDocumentTypes.d.ts +2 -2
- package/dist/types/neural models/classLocalModel.d.ts +1 -1
- package/package.json +1 -1
- package/dist/networks/190-0e4f-chunk.js +0 -5
- package/dist/networks/Blur-a35a-chunk.js +0 -1
- package/dist/networks/MRZ-6b1d-chunk.js +0 -1
- package/dist/types/workers/loadNetworksWorker.d.ts +0 -0
- /package/dist/networks/{ClassLocal-835d-chunk.js → ClassLocal-chunk.js} +0 -0
- /package/dist/networks/{Face-e2da-chunk.js → Face-chunk.js} +0 -0
- /package/dist/networks/{PDF-c6c7-chunk.js → PDF-chunk.js} +0 -0
- /package/dist/networks/{ZXing-ce9f-chunk.js → ZXing-chunk.js} +0 -0
- /package/dist/networks/{77-7273-chunk.js → blurWorker.js} +0 -0
package/dist/index.html
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type DocumentTypeIndex = 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10;
|
|
2
2
|
export type DocumentTypeName = 'ID' | 'Passport' | 'PassportCard' | 'GreenCard' | 'InternationalId' | 'VIN' | 'Barcode' | 'FaceAuthorization';
|
|
3
|
-
export type HumanName = 'Driver\'s License or State Identification Card' | 'Passport' | 'Passport Card' | 'Green Card or Employment Authorization' | 'International ID' | 'Vehicle Identification Number' | '1-D and 2-D Barcodes' | 'Face Authorization';
|
|
3
|
+
export type HumanName = 'Driver\'s License or State Identification Card' | 'Passport' | 'US Passport Card' | 'Green Card or Employment Authorization' | 'International ID' | 'Vehicle Identification Number' | '1-D and 2-D Barcodes' | 'Face Authorization';
|
|
4
4
|
export type ImageSource = 'video' | 'file';
|
|
5
5
|
|
|
6
6
|
export interface DocumentRecord {
|
|
@@ -43,7 +43,7 @@ const documentType: DocumentType = {
|
|
|
43
43
|
name: 'PassportCard',
|
|
44
44
|
id: 3,
|
|
45
45
|
nName: 'passpcard',
|
|
46
|
-
humanName: 'Passport Card',
|
|
46
|
+
humanName: 'US Passport Card',
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
name: 'GreenCard',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __webpack_require__={};__webpack_require__.d=(e,a)=>{for(var o in a)__webpack_require__.o(a,o)&&!__webpack_require__.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:a[o]})},__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a);var __webpack_exports__={};__webpack_require__.d(__webpack_exports__,{J3:()=>supportedLanguages,_2:()=>setTranslation,i0:()=>getTranslation});var supportedLanguages=["en","es"],labels={es:{errorCodes:{mrzNotFound:"Advertencia: <br/>No se ha encontrado MRZ.",mrzNotRecognized:"Advertencia: <br/>No se han podido leer los datos MRZ.<br/>Intente tomar una imagen de mayor calidad.",barcodeNotFound:"Warning: <br/>C\xf3digo de barras no encontrado.",barcodeNotRecognized:"Advertencia: <br/>No se pudieron leer los datos del c\xf3digo de barras.<br/>Intente tomar una imagen de mayor calidad.",heic:"El archivo HEIC est\xe1 da\xf1ado",fileTypeHeic:"Error de tipo de archivo: S\xf3lo se admiten im\xe1genes jpeg, png y heic.",fileType:"Error de tipo de archivo: S\xf3lo se admiten im\xe1genes jpeg y png.",disableStepFileUpload:"Se debe utilizar un dispositivo con una c\xe1mara para capturar esta imagen",notAllowedDocument:"Este tipo de documento no est\xe1 permitido",documentSideLowPerimeter:"Advertencia: <br/>El documento de la foto es demasiado peque\xf1o, ac\xe9rcalo m\xe1s",frontSideNotDetected:"Advertencia: <br/>La imagen no se reconoce como el anverso del tipo de documento elegido",backSideNotDetected:"Advertencia: <br/>La imagen no se reconoce como el reverso del tipo de documento elegido",faceNotFound:"Advertencia: <br/>No se ha encontrado la cara de una persona en la imagen capturada",default:"Lo sentimos, <br/>pero hubo un problema al capturar y enviar las im\xe1genes de su documento. Por favor, int\xe9ntelo de nuevo.",CameraNotFound:"No se encontr\xf3 ninguna c\xe1mara en su dispositivo",CameraNotFoundInVerification:"No se ha encontrado ninguna c\xe1mara en su dispositivo.<br/> Por favor, utilice
|
|
1
|
+
var __webpack_require__={};__webpack_require__.d=(e,a)=>{for(var o in a)__webpack_require__.o(a,o)&&!__webpack_require__.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:a[o]})},__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a);var __webpack_exports__={};__webpack_require__.d(__webpack_exports__,{J3:()=>supportedLanguages,_2:()=>setTranslation,i0:()=>getTranslation});var supportedLanguages=["en","es"],labels={es:{errorCodes:{mrzNotFound:"Advertencia: <br/>No se ha encontrado MRZ.",mrzNotRecognized:"Advertencia: <br/>No se han podido leer los datos MRZ.<br/>Intente tomar una imagen de mayor calidad.",barcodeNotFound:"Warning: <br/>C\xf3digo de barras no encontrado.",barcodeNotRecognized:"Advertencia: <br/>No se pudieron leer los datos del c\xf3digo de barras.<br/>Intente tomar una imagen de mayor calidad.",heic:"El archivo HEIC est\xe1 da\xf1ado",fileTypeHeic:"Error de tipo de archivo: S\xf3lo se admiten im\xe1genes jpeg, png y heic.",fileType:"Error de tipo de archivo: S\xf3lo se admiten im\xe1genes jpeg y png.",disableStepFileUpload:"Se debe utilizar un dispositivo con una c\xe1mara para capturar esta imagen",notAllowedDocument:"Este tipo de documento no est\xe1 permitido",documentSideLowPerimeter:"Advertencia: <br/>El documento de la foto es demasiado peque\xf1o, ac\xe9rcalo m\xe1s",frontSideNotDetected:"Advertencia: <br/>La imagen no se reconoce como el anverso del tipo de documento elegido",backSideNotDetected:"Advertencia: <br/>La imagen no se reconoce como el reverso del tipo de documento elegido",faceNotFound:"Advertencia: <br/>No se ha encontrado la cara de una persona en la imagen capturada",default:"Lo sentimos, <br/>pero hubo un problema al capturar y enviar las im\xe1genes de su documento. Por favor, int\xe9ntelo de nuevo.",CameraNotFound:"No se encontr\xf3 ninguna c\xe1mara en su dispositivo",CameraNotFoundInVerification:"No se ha encontrado ninguna c\xe1mara en su dispositivo.<br/> Por favor, utilice un dispositivo diferente o permitir el acceso a la c\xe1mara para la verificaci\xf3n",CameraNotAllowed:"Has denegado el acceso a la c\xe1mara de tu dispositivo",CameraNotAvailable:"La c\xe1mara no est\xe1 disponible en este momento",CameraInUse:"La c\xe1mara ya est\xe1 en uso",MediaDevicesNotSupported:"Tu navegador no es compatible",lowImageResolution:"La resoluci\xf3n de la imagen cargada es demasiado baja",imageIsBlurred:"La imagen es demasiado borrosa para ser utilizada",faceLowArea:"El \xe1rea de la cara en la foto ocupa muy poco espacio"},hintTexts:{front:"Coloque el anverso del documento",frontMRZ:"Haga zoom para capturar el c\xf3digo en la parte inferior",mrz:"Haga zoom para capturar el c\xf3digo en la parte posterior",capturing:"Coloque el anverso del documento",pdf:"Coloque el c\xf3digo de barras dentro del marco",back:"Da la vuelta a tu documento",barcode:"Coloque el c\xf3digo de barras dentro del marco",hold:"Sostener el **placeholder** lado del documento <br> dentro de la caja",dontSee:"No te veo",dontMove:"No te muevas",turnFaceLeft:"Gira la cara a la izquierda",turnFaceRight:"Gira la cara a la derecha",turnFaceUp:"Levanta tu cara",turnFaceDown:"Bajar la cara",faceCam:"Enfr\xe9ntate a la c\xe1mara",camAway:"Mover la c\xe1mara m\xe1s lejos",moveCenter:"Mover al centro",comeCloser:"Ac\xe9rcate",documentCloser:"Acerque el documento",holdCamera:"Mant\xe9ngase firme, analizando el documento <br>"},keyErrors:["La clave de licencia ha caducado","Clave de licencia no v\xe1lida"],camera:{loading:"Carga",awaiting:"A la espera de la respuesta de la c\xe1mara"},general:{documentType:"Su Tipo de Documento es",selectDocumentTypeText:"Seleccionar Tipo de Documento",changeBtn:"Cambiar",correctBtn:"Corregir",cancelBtn:"Cancelar",doneBtn:"Hecho",closeBtn:"Cerrar",retakeBtn:"VOLVER",continueBtn:"CONTINUAR",submitBtn:"ENVIAR",resetAllStepsBtn:"Restablecer todos los pasos",btnUploader:"Cambiar a cargador manual",btnCamera:"Cambiar al modo de c\xe1mara",pressToUpdateText:"Pulse para actualizar",pressToUpdateTextSuccess:"Pulse para actualizar"},uploaderDescription:{textFront:"Haga clic aqu\xed para cargar el frente de su identificaci\xf3n",textBack:"Haga clic aqu\xed para cargar el reverso de una identificaci\xf3n",textFace:"Haga clic aqu\xed para cargar una foto de su rostro",textPdf:"Haga clic aqu\xed para cargar el reverso de una identificaci\xf3n",textMrz:"Haga clic aqu\xed para cargar una foto de su documento'",textFrontBack:"Aseg\xfarese de que su identificaci\xf3n llene toda la pantalla de la c\xe1mara con poco o ning\xfan fondo.",textPass:"Aseg\xfarese de que su identificaci\xf3n llene toda la pantalla de la c\xe1mara <br> con poco o ning\xfan fondo, y que se incluya el c\xf3digo MRZ completo",textFacePosition:"Coloque su rostro para ocupar toda la pantalla de la c\xe1mara con poco o ning\xfan fondo."},documentsTypes:{ID:"Licencia de Conducir",Passport:"Pasaporte",PassportCard:"Tarjeta de Pasaporte",GreenCard:"Tarjeta Verde o Autorizaci\xf3n de Empleo",InternationalId:"Identificaci\xf3n Internacional"},spinnerText:{warmup:{top:"La red neuronal se est\xe1 calentando",bottom:"La captura de documentos estar\xe1 lista para su uso en breve"}}},en:{errorCodes:{mrzNotFound:"Warning: <br/>MRZ was not found.",mrzNotRecognized:"Warning: <br/>MRZ data could not be read.<br/>Try taking a higher quality image.",barcodeNotFound:"Warning: <br/>Barcode not found.",barcodeNotRecognized:"Warning: <br/>Barcode data could not be read.<br/>Try taking a higher quality image.",heic:"HEIC file incorrupted",fileType:"File Type Error: Only jpeg and png images are supported.",fileTypeHeic:"File Type Error: Only jpeg, png and heic images are supported.",disableStepFileUpload:"A device with a camera must be used to capture this image",notAllowedDocument:"This document type is not allowed",documentSideLowPerimeter:"Warning: <br/>The document in the photo is too small, bring it closer",frontSideNotDetected:"Warning: <br/>The image isn't recognized as the front side of the chosen document type",backSideNotDetected:"Warning: <br/>The document's side isn't recognized as the back side of the chosen document type",faceNotFound:"Warning: <br/>A person's face was not found in captured image",default:"We're sorry, <br/>but there was an issue capturing and submitting the images of your document. Please try again",CameraNotFound:"No camera was found on your device",CameraNotFoundInVerification:"No camera was found on your device. <br/>Please use a different device or allow access to the camera for verification",CameraNotAllowed:"You have denied access to your device's camera",CameraNotAvailable:"Camera is not available at the moment",CameraInUse:"Camera is already in use",MediaDevicesNotSupported:"Your browser is not supported",lowImageResolution:"The resolution of the uploaded image is too low",imageIsBlurred:"The image is too blurry to be used",faceLowArea:"Face area in the photo takes up too little space"},hintTexts:{front:"Position the front of the document",frontMRZ:"Zoom in to capture code at bottom",mrz:"Zoom in to capture code on back side",capturing:"Position the front of the document",pdf:"Position the barcode inside the frame",back:"Turn around your document",barcode:"Position the barcode inside the frame",hold:"Hold the **placeholder** side of the document <br> inside the box",dontSee:"I don't see you",dontMove:"Don't move",turnFaceLeft:"Turn your face left",turnFaceRight:"Turn your face right",turnFaceUp:"Turn your face up",turnFaceDown:"Turn your face down",faceCam:"Face the camera",camAway:"Move camera further away",moveCenter:"Move to the center",comeCloser:"Come closer",documentCloser:"Bring the document closer",holdCamera:"Hold steady, analyzing document <br>"},keyErrors:["License Key has expired","Invalid License Key"],camera:{loading:"Loading",awaiting:"Awaiting camera response"},general:{documentType:"Your document type is",selectDocumentTypeText:"Select Document Type",changeBtn:"Change",correctBtn:"Correct",cancelBtn:"Cancel",doneBtn:"Done",closeBtn:"CLOSE",retakeBtn:"Retake",continueBtn:"CONTINUE",submitBtn:"SUBMIT",resetAllStepsBtn:"Reset all steps",btnUploader:"Switch to manual uploader",btnCamera:"Switch to camera mode",pressToUpdateText:"Press to update",pressToUpdateTextSuccess:"Press to update"},documentsTypes:{ID:"Driver's License or State Identification Card",Passport:"Passport",PassportCard:"US Passport Card",GreenCard:"Green Card or Employment Authorization",InternationalId:"International ID"},uploaderDescription:{textFront:"Click here to upload the front of your ID",textBack:"Click here to upload the back of your ID",textFace:"Click here to upload a photo of your face",textPdf:"Click here to upload the back of a ID",textMrz:"Click here to upload a photo of your document",textFrontBack:"Please make sure your ID fills up the entire <br> camera screen with little to no background.",textPass:"Please make sure your ID fills up the entire camera screen <br> with little to no background, and the full MRZ code is included.",textFacePosition:"Please position your face to take up <br> the full camera screen with little to no background."},spinnerText:{warmup:{top:"Neural network is warming up",bottom:"Document capture will be ready to use shortly"}}}},translation=labels.en,setTranslation=function(e){if(e){var a=e.toLowerCase(),o=Object.keys(labels).includes(a)?a:"en";translation=labels[o]}else translation=labels.en},getTranslation=function(e){return e?translation[e]:translation},__webpack_exports__getTranslation=__webpack_exports__.i0,__webpack_exports__setTranslation=__webpack_exports__._2,__webpack_exports__supportedLanguages=__webpack_exports__.J3;export{__webpack_exports__getTranslation as getTranslation,__webpack_exports__setTranslation as setTranslation,__webpack_exports__supportedLanguages as supportedLanguages};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_idscan_idvc2=self.webpackChunk_idscan_idvc2||[]).push([[311],{4550:(e,n,t)=>{function r(e,n,t,r,o,i,u){try{var a=e[i](u),c=a.value}catch(e){t(e);return}a.done?n(c):Promise.resolve(c).then(r,o)}function o(e){return function(){var n=this,t=arguments;return new Promise(function(o,i){var u=e.apply(n,t);function a(e){r(u,o,i,a,c,"next",e)}function c(e){r(u,o,i,a,c,"throw",e)}a(void 0)})}}function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function u(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){i(e,n,t[n])})}return e}function a(e,n){var t,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(t)throw TypeError("Generator is already executing.");for(;u;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=n.call(e,u)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}t.d(n,{o:()=>s});var c="application/javascript",l=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=u({skipSameOrigin:!0,useBlob:!0},n);return!e.includes("://")||e.includes(window.location.origin)?Promise.resolve(e):new Promise(function(n,r){return fetch(e).then(function(e){return e.text()}).then(function(r){var o=new URL(e).href.split("/");o.pop();var i="const _importScripts = importScripts;\nconst _fixImports = (url) => new URL(url, '".concat("".concat(o.join("/"),"/"),"').href;\nimportScripts = (...urls) => _importScripts(...urls.map(_fixImports));"),u="data:".concat(c,",").concat(encodeURIComponent(i+r));t.useBlob&&(u=URL.createObjectURL(new Blob(['importScripts("'.concat(u,'")')],{type:c}))),n(u)}).catch(r)})},s=function(){var e=o(function(e){var n;return a(this,function(t){switch(t.label){case 0:return[4,l(e)];case 1:return n=t.sent(),[2,new Worker(n)]}})});return function(n){return e.apply(this,arguments)}}()},6790:(e,n,t)=>{t.r(n),t.d(n,{default:()=>w});var r=t(1026);function o(e,n,t,r,o,i,u){try{var a=e[i](u),c=a.value}catch(e){t(e);return}a.done?n(c):Promise.resolve(c).then(r,o)}function i(e){return function(){var n=this,t=arguments;return new Promise(function(r,i){var u=e.apply(n,t);function a(e){o(u,r,i,a,c,"next",e)}function c(e){o(u,r,i,a,c,"throw",e)}a(void 0)})}}function u(e,n){if(!(e instanceof n))throw TypeError("Cannot call a class as a function")}function a(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,n,t){return n&&a(e.prototype,n),t&&a(e,t),e}function l(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function s(e,n){var t,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(t)throw TypeError("Generator is already executing.");for(;u;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=n.call(e,u)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var f=function(){"use strict";function e(n){u(this,e),l(this,"worker",void 0),this.worker=n,this.worker.postMessage({fn:"init"})}return c(e,[{key:"process",value:function(e){var n=this;return new Promise(function(t){var r;n.worker.postMessage({fn:"process",iData:e}),n.worker.onmessage=(r=i(function(e){return s(this,function(n){return t(e.data.blurConfidence),[2]})}),function(e){return r.apply(this,arguments)})})}},{key:"drop",value:function(){this.worker.postMessage({fn:"drop"})}}]),e}(),p=t(4550),b=t(4328);function h(e,n,t,r,o,i,u){try{var a=e[i](u),c=a.value}catch(e){t(e);return}a.done?n(c):Promise.resolve(c).then(r,o)}function v(e){return function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function u(e){h(i,r,o,u,a,"next",e)}function a(e){h(i,r,o,u,a,"throw",e)}u(void 0)})}}function y(e,n){var t,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(t)throw TypeError("Generator is already executing.");for(;u;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=n.call(e,u)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}let w=v(function(){var e,n;return y(this,function(t){switch(t.label){case 0:return[4,(0,p.o)("".concat(b.Z.config.chunkPublicPath,"blurWorker.js"))];case 1:return e=t.sent(),n=new f(e),r.Z.setModule("module","blur",n),[2]}})})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_idscan_idvc2=self.webpackChunk_idscan_idvc2||[]).push([[373],{4550:(e,n,t)=>{function r(e,n,t,r,o,i,c){try{var u=e[i](c),a=u.value}catch(e){t(e);return}u.done?n(a):Promise.resolve(a).then(r,o)}function o(e){return function(){var n=this,t=arguments;return new Promise(function(o,i){var c=e.apply(n,t);function u(e){r(c,o,i,u,a,"next",e)}function a(e){r(c,o,i,u,a,"throw",e)}u(void 0)})}}function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){i(e,n,t[n])})}return e}function u(e,n){var t,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw TypeError("Generator is already executing.");for(;c;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=n.call(e,c)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}t.d(n,{o:()=>s});var a="application/javascript",l=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=c({skipSameOrigin:!0,useBlob:!0},n);return!e.includes("://")||e.includes(window.location.origin)?Promise.resolve(e):new Promise(function(n,r){return fetch(e).then(function(e){return e.text()}).then(function(r){var o=new URL(e).href.split("/");o.pop();var i="const _importScripts = importScripts;\nconst _fixImports = (url) => new URL(url, '".concat("".concat(o.join("/"),"/"),"').href;\nimportScripts = (...urls) => _importScripts(...urls.map(_fixImports));"),c="data:".concat(a,",").concat(encodeURIComponent(i+r));t.useBlob&&(c=URL.createObjectURL(new Blob(['importScripts("'.concat(c,'")')],{type:a}))),n(c)}).catch(r)})},s=function(){var e=o(function(e){var n;return u(this,function(t){switch(t.label){case 0:return[4,l(e)];case 1:return n=t.sent(),[2,new Worker(n)]}})});return function(n){return e.apply(this,arguments)}}()},4942:(e,n,t)=>{t.r(n),t.d(n,{default:()=>h});var r=t(1026);function o(e,n){if(!(e instanceof n))throw TypeError("Cannot call a class as a function")}function i(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,n,t){return n&&i(e.prototype,n),t&&i(e,t),e}function u(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var a=function(){"use strict";function e(n){o(this,e),u(this,"worker",void 0),this.worker=n}return c(e,[{key:"process",value:function(e){var n=this;return new Promise(function(t){n.worker.postMessage(e),n.worker.onmessage=function(e){t(e.data.segments)}})}}]),e}(),l=t(4550),s=t(4328);function f(e,n,t,r,o,i,c){try{var u=e[i](c),a=u.value}catch(e){t(e);return}u.done?n(a):Promise.resolve(a).then(r,o)}function p(e){return function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function c(e){f(i,r,o,c,u,"next",e)}function u(e){f(i,r,o,c,u,"throw",e)}c(void 0)})}}function b(e,n){var t,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw TypeError("Generator is already executing.");for(;c;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=n.call(e,c)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}let h=p(function(){var e,n;return b(this,function(t){switch(t.label){case 0:return[4,(0,l.o)("".concat(s.Z.config.chunkPublicPath,"bubbleWorker.js"))];case 1:return e=t.sent(),n=new a(e),r.Z.setModule("module","bubble",n),[2]}})})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_idscan_idvc2=self.webpackChunk_idscan_idvc2||[]).push([[343],{4550:(e,t,r)=>{function n(e,t,r,n,o,i,u){try{var c=e[i](u),a=c.value}catch(e){r(e);return}c.done?t(a):Promise.resolve(a).then(n,o)}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,i){var u=e.apply(t,r);function c(e){n(u,o,i,c,a,"next",e)}function a(e){n(u,o,i,c,a,"throw",e)}c(void 0)})}}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){i(e,t,r[t])})}return e}function c(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}r.d(t,{o:()=>s});var a="application/javascript",l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=u({skipSameOrigin:!0,useBlob:!0},t);return!e.includes("://")||e.includes(window.location.origin)?Promise.resolve(e):new Promise(function(t,n){return fetch(e).then(function(e){return e.text()}).then(function(n){var o=new URL(e).href.split("/");o.pop();var i="const _importScripts = importScripts;\nconst _fixImports = (url) => new URL(url, '".concat("".concat(o.join("/"),"/"),"').href;\nimportScripts = (...urls) => _importScripts(...urls.map(_fixImports));"),u="data:".concat(a,",").concat(encodeURIComponent(i+n));r.useBlob&&(u=URL.createObjectURL(new Blob(['importScripts("'.concat(u,'")')],{type:a}))),t(u)}).catch(n)})},s=function(){var e=o(function(e){var t;return c(this,function(r){switch(r.label){case 0:return[4,l(e)];case 1:return t=r.sent(),[2,new Worker(t)]}})});return function(t){return e.apply(this,arguments)}}()},5470:(e,t,r)=>{r.r(t),r.d(t,{default:()=>q});var n=r(4328),o=r(1026),i=r(8736),u=r(6955),c=r(813),a=r(683),l=["0","1","2","3","4","*","5","6","7","*","8","9","A","*","B","C","*","D","*","E","*","F","*","G","*","H","I","J","*","K","*","L","*","M","N","O","P","*","Q","R","*","S","T","*","U","*","V","*","W","X","Y","*","Z","<","*"];function s(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t,r,n,o,i,u){try{var c=e[i](u),a=c.value}catch(e){r(e);return}c.done?t(a):Promise.resolve(a).then(n,o)}function p(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){f(i,n,o,u,c,"next",e)}function c(e){f(i,n,o,u,c,"throw",e)}u(void 0)})}}function y(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function b(e,t,r){return t&&h(e.prototype,t),r&&h(e,r),e}function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}function w(e,t){return t&&("object"===k(t)||"function"==typeof t)?t:s(e)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function k(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function O(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function P(e){var t=O();return function(){var r,n=d(e);if(t){var o=d(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return w(this,r)}}function j(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var S=784,x=[1,28,28,1],R="input_1",E="dense",A=function(e){"use strict";m(r,e);var t=P(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.z.WASM,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return y(this,r),v(s(e=t.call(this,n,o,i)),"promiseList",void 0),v(s(e),"predictionList",void 0),e}return b(r,[{key:"predict",value:function(e){var t=v({},R,new i.Tensor("float32",e,x));return this.session.run(t)}},{key:"predictFromArray",value:function(e,t){var r=this;return p(function(){var n,o;return j(this,function(i){switch(i.label){case 0:if(r.promiseList||(r.promiseList=Array(t).fill(0)),r.predictionList||(r.predictionList=Array(t).fill(0)),r.loading)return[2,[]];for(o=0,n=(0,a.Fv)(e,a.eQ.STANDART);o<t;o+=1)r.promiseList[o]=r.predict(n.subarray(S*o,S*(o+1)));return[4,Promise.all(r.promiseList)];case 1:return i.sent().forEach(function(e,t){r.predictionList[t]=r.interpret(e[E].data)}),[2,r.predictionList]}})})()}},{key:"interpret",value:function(e){return Array.from(e).map(function(e,t){return{value:l[t],confidence:e}}).sort(function(e,t){return e.confidence-t.confidence}).slice(-3).reverse()}},{key:"isLoading",get:function(){return this.loading}},{key:"predictFromImage",value:function(e,t){}}]),r}(u.Z),M=r(4554);function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function T(e){if(Array.isArray(e))return e}function C(e,t,r,n,o,i,u){try{var c=e[i](u),a=c.value}catch(e){r(e);return}c.done?t(a):Promise.resolve(a).then(n,o)}function I(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){C(i,n,o,u,c,"next",e)}function c(e){C(i,n,o,u,c,"throw",e)}u(void 0)})}}function L(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function z(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Z(e,t,r){return t&&z(e.prototype,t),r&&z(e,r),e}function B(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],u=!0,c=!1;try{for(o=o.call(e);!(u=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);u=!0);}catch(e){c=!0,n=e}finally{try{u||null==o.return||o.return()}finally{if(c)throw n}}return i}}function U(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){B(e,t,r[t])})}return e}function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function G(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):N(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function V(e,t){return T(e)||D(e,t)||W(e,t)||U()}function W(e,t){if(e){if("string"==typeof e)return _(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _(e,t)}}function K(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var Q=function(){"use strict";function e(t,r,n){var o=this;L(this,e),B(this,"w",0),B(this,"h",0),B(this,"successCount",0),B(this,"worker",void 0),B(this,"model",void 0),B(this,"isInitialized",!1),B(this,"isProcessing",!1),B(this,"MIN_MRZ_FRAMES",3),this.model=new A("".concat(M.t.$I),c.z.WASM,n),this.worker=t,this.worker.postMessage({fn:"init",initData:{key:r,networkUrl:n}}),this.worker.onmessage=function(e){var t=e.data,r=t.name,n=t.data;"initialization"===r&&(o.isInitialized=n)}}return Z(e,[{key:"getErrorVal",value:function(e){var t;return -3===e&&(t=0),-2===e&&(t=1),t}},{key:"licenseError",value:function(e){return{error:!0,errorType:"licenceKeyError",errorVal:this.getErrorVal(e)}}},{key:"yComparator",value:function(e,t){return e.y<t.y?[e,t]:[t,e]}},{key:"allocate",value:function(){}},{key:"prepareMRZlocation",value:function(e){var t=[e.leftTop,e.rightTop,e.rightBottom,e.leftBottom].sort(function(e,t){return e.x-t.x}),r=V(this.yComparator(t[0],t[1]),2),n=r[0],o=r[1],i=V(this.yComparator(t[2],t[3]),2),u=i[0],c=i[1];return{leftTop:{x:n.x-.03,y:n.y-.03},rightTop:{x:u.x+.03,y:u.y-.03},rightBottom:{x:c.x+.03,y:c.y+.03},leftBottom:{x:o.x-.03,y:o.y+.03}}}},{key:"writeResults",value:function(e){var t={mrzText:""},r=e.fields.filter(function(e){return -1!==e.name.indexOf("Line")&&e.value.length>0}).map(function(e){return e.value}).join("\n");return r.length>0&&(t.mrzText=window.btoa(r)),t}},{key:"predict",value:function(e,t){var r=this;return I(function(){var n;return K(this,function(o){switch(o.label){case 0:return[4,r.model.predictFromArray(e,t)];case 1:if(!((n=o.sent()).filter(function(e){return"*"===V(e,1)[0].value}).length>3))return[3,3];return[4,r.model.predictFromArray(e.reverse(),t)];case 2:n=o.sent(),o.label=3;case 3:return[2,n]}})})()}},{key:"scan",value:function(e){var t=this;return new Promise(function(r){var n;t.worker.postMessage({fn:"prepare",iData:e}),t.worker.onmessage=(n=I(function(e){var n,o,i,u;return K(this,function(c){switch(c.label){case 0:if(o=(n=e.data).name,i=n.data,"batchArr"!==o)return[3,2];return[4,t.predict(i.batchArr,i.batchSize)];case 1:return u=c.sent(),t.worker.postMessage({fn:"process",predictions:u}),[2];case 2:return"result"===o&&r(i),r(i),[2]}})}),function(e){return n.apply(this,arguments)})})}},{key:"processMRZ",value:function(e){var t=this;return I(function(){var r,n,o,i,u,c,a;return K(this,function(l){switch(l.label){case 0:if(n={status:!1,cancel:!1,touch:!1,image:null,type:"mrz",isSuccessProcess:!1},t.isProcessing||!t.isInitialized)return[2,n];return t.isProcessing=!0,[4,t.scan(e)];case 1:if(null==(o=l.sent())?void 0:o.errorId)return t.isProcessing=!1,[2,G(F({},o),{error:t.licenseError(o.errorId)})];return o&&(null==o?void 0:null===(r=o.status)||void 0===r?void 0:r.value)===0&&(null==o?void 0:o.count)>0?(u=(i=t.estimateResults(o))===o.count&&o.symbolsConf>.95?"green":"yellow",n.coords={locations:t.prepareMRZlocation(o.location),color:u},c=i===o.count&&o.symbolsConf>.85,a=i>=o.count-2,(c||a)&&(t.successCount+=1,n.isSuccessProcess=!0,t.successCount>=t.MIN_MRZ_FRAMES&&(n.status=!0,n.needToCut=!0,n.image=e,n.results=t.writeResults(o)))):(n.coords=null,t.successCount=0),t.isProcessing=!1,[2,n]}})})()}},{key:"estimateResults",value:function(e){return 0===e.count?0:e.fields.reduce(function(e,t){return"Valid"===t.status?e+1:e},0)}},{key:"detectMrz",value:function(e){var t=this;return I(function(){var r,n,o;return K(this,function(i){switch(i.label){case 0:return[4,t.scan(e)];case 1:if(r=i.sent(),n=!0,r&&r.count>0&&r.symbolsConf>.8)return[2,{status:!0,locations:t.prepareMRZlocation(r.location),results:t.writeResults(r),isNotMRZ:n=!1}];return r&&r.symbolsConf>.6&&(n=!1),o={status:!1,isNotMRZ:n},(null==r?void 0:r.errorId)&&(o.error=t.licenseError(r.errorId)),[2,o]}})})()}}]),e}(),$=r(4295),H=r(4550);function J(e,t,r,n,o,i,u){try{var c=e[i](u),a=c.value}catch(e){r(e);return}c.done?t(a):Promise.resolve(a).then(n,o)}function X(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){J(i,n,o,u,c,"next",e)}function c(e){J(i,n,o,u,c,"throw",e)}u(void 0)})}}function Y(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}let q=function(){var e=X(function(e){var t,r,i,u;return Y(this,function(c){switch(c.label){case 0:if(t=e.commonLicenseKey)return[3,1];return(0,$.Z)(),[3,3];case 1:return[4,(0,H.o)("".concat(n.Z.config.chunkPublicPath,"mrzWorker.js"))];case 2:i=c.sent(),u=new Q(i,t,n.Z.networkUrl),o.Z.setModule("module","mrz",u),r=[u.model.initialize.bind(u.model)],c.label=3;case 3:return[2,r]}})});return function(t){return e.apply(this,arguments)}}()}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __webpack_exports__={},generateFaceColorFromAngle=function(t){var n=Math.abs(Math.trunc(255-t));return n>200&&(n=200),n<50&&(n=50),"rgba(255,215,".concat(n.toString(),",0.3)")},binarize=function(t){var n,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:120,o=t.width*t.height,i=new Uint8ClampedArray(o),r=0,u=0;for(n=0;n<o;n+=1){var h=n<<2;77*(r=t.data[h+0])+151*t.data[h+1]+28*t.data[h+2]>>8<e&&(i[n]=1)}return i},topPoint=function(t,n){return t-n},bottomPoint=function(t,n){return t+n},leftPoint=function(t,n){return t%n>1?t-1:-1},rightPoint=function(t,n){return(t+1)%n>=0?t+1:-1},topLeftPoint=function(t,n){return leftPoint(topPoint(t,n),n)},topRightPoint=function(t,n){return rightPoint(topPoint(t,n),n)},bottomLeftPoint=function(t,n){return leftPoint(bottomPoint(t,n),n)},bottomRightPoint=function(t,n){return rightPoint(bottomPoint(t,n),n)},getNeigbors=function(t,n){return[topLeftPoint,topPoint,topRightPoint,rightPoint,bottomRightPoint,bottomPoint,bottomLeftPoint,leftPoint].map(function(e){return e(t,n)})},segmentize2=function(t,n){var e,o=[],i=[],r=t.length,u=0;for(e=0;e<r;e+=1)0!==t[e]&&(i[u]=new Set,o.push(e),function(){for(;o.length;){var e=o.pop();if(!e)break;t[e]=0,i[u].add(e),getNeigbors(e,n).forEach(function(n){n>0&&0!==t[n]&&n<r&&o.push(n)})}}(),u+=1);return i},getResizedSizes=function(t,n){var e=n.baseWidth,o=n.baseHeight,i=t,r=t;return e>o&&(r=(i=t)*o/e),o>e&&(i=(r=t)*e/o),{width:Math.trunc(i),height:Math.trunc(r)}},getCrop=function(t,n){var e=t.width/t.height,o=n.width/n.height,i={x:0,y:0,width:n.width,height:n.height};return e>o?(i.height=~~(n.width/e),i.y=(n.height-i.height)/2):(i.width=~~(i.height*e),i.x=(n.width-i.width)/2),i},POINT_FILL_STYLE="rgba(255, 255, 255, 0.5)",POINT_STROKE_STYLE="rgba(255, 255, 255, 0)",SCALE_FACTOR=.3,getColumn=function(t,n){return t%n},getRow=function(t,n){return Math.floor(t/n)},createCoordFromPointIdx=function(t,n){return[getColumn(t,n),getRow(t,n)]},notNull=function(t){return null!=t},coordinateSegment=function(t){var n=t.segments,e=t.width,o=t.scaleWidth,i=t.scaleHeight;return n.map(function(t){var n=Number.MAX_VALUE,r=Number.MAX_VALUE,u=Number.MIN_VALUE,h=Number.MIN_VALUE;t.forEach(function(t){var o=createCoordFromPointIdx(t,e);o[0]<n&&(n=o[0]),o[1]<r&&(r=o[1]),o[0]>u&&(u=o[0]),o[1]>h&&(h=o[1])});var a=(u-n)*(h-r);return a>5&&a<500?{perimeter:a,x1:Math.trunc(n/SCALE_FACTOR/o),y1:Math.trunc(r/SCALE_FACTOR/i),x2:Math.trunc(u/SCALE_FACTOR/o),y2:Math.trunc(h/SCALE_FACTOR/i)}:null}).filter(notNull)},pointsProcess=function(t,n,e){return coordinateSegment({segments:segmentize2(binarize(t),t.width),width:t.width,scaleWidth:n,scaleHeight:e})};onmessage=function(t){var n=t.data
|
|
1
|
+
var __webpack_exports__={},generateFaceColorFromAngle=function(t){var n=Math.abs(Math.trunc(255-t));return n>200&&(n=200),n<50&&(n=50),"rgba(255,215,".concat(n.toString(),",0.3)")},binarize=function(t){var n,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:120,o=t.width*t.height,i=new Uint8ClampedArray(o),r=0,u=0;for(n=0;n<o;n+=1){var h=n<<2;77*(r=t.data[h+0])+151*t.data[h+1]+28*t.data[h+2]>>8<e&&(i[n]=1)}return i},topPoint=function(t,n){return t-n},bottomPoint=function(t,n){return t+n},leftPoint=function(t,n){return t%n>1?t-1:-1},rightPoint=function(t,n){return(t+1)%n>=0?t+1:-1},topLeftPoint=function(t,n){return leftPoint(topPoint(t,n),n)},topRightPoint=function(t,n){return rightPoint(topPoint(t,n),n)},bottomLeftPoint=function(t,n){return leftPoint(bottomPoint(t,n),n)},bottomRightPoint=function(t,n){return rightPoint(bottomPoint(t,n),n)},getNeigbors=function(t,n){return[topLeftPoint,topPoint,topRightPoint,rightPoint,bottomRightPoint,bottomPoint,bottomLeftPoint,leftPoint].map(function(e){return e(t,n)})},segmentize2=function(t,n){var e,o=[],i=[],r=t.length,u=0;for(e=0;e<r;e+=1)0!==t[e]&&(i[u]=new Set,o.push(e),function(){for(;o.length;){var e=o.pop();if(!e)break;t[e]=0,i[u].add(e),getNeigbors(e,n).forEach(function(n){n>0&&0!==t[n]&&n<r&&o.push(n)})}}(),u+=1);return i},getResizedSizes=function(t,n){var e=n.baseWidth,o=n.baseHeight,i=t,r=t;return e>o&&(r=(i=t)*o/e),o>e&&(i=(r=t)*e/o),{width:Math.trunc(i),height:Math.trunc(r)}},getCrop=function(t,n){var e=t.width/t.height,o=n.width/n.height,i={x:0,y:0,width:n.width,height:n.height};return e>o?(i.height=~~(n.width/e),i.y=(n.height-i.height)/2):(i.width=~~(i.height*e),i.x=(n.width-i.width)/2),i},POINT_FILL_STYLE="rgba(255, 255, 255, 0.5)",POINT_STROKE_STYLE="rgba(255, 255, 255, 0)",SCALE_FACTOR=.3,getColumn=function(t,n){return t%n},getRow=function(t,n){return Math.floor(t/n)},createCoordFromPointIdx=function(t,n){return[getColumn(t,n),getRow(t,n)]},notNull=function(t){return null!=t},coordinateSegment=function(t){var n=t.segments,e=t.width,o=t.scaleWidth,i=t.scaleHeight;return n.map(function(t){var n=Number.MAX_VALUE,r=Number.MAX_VALUE,u=Number.MIN_VALUE,h=Number.MIN_VALUE;t.forEach(function(t){var o=createCoordFromPointIdx(t,e);o[0]<n&&(n=o[0]),o[1]<r&&(r=o[1]),o[0]>u&&(u=o[0]),o[1]>h&&(h=o[1])});var a=(u-n)*(h-r);return a>5&&a<500?{perimeter:a,x1:Math.trunc(n/SCALE_FACTOR/o),y1:Math.trunc(r/SCALE_FACTOR/i),x2:Math.trunc(u/SCALE_FACTOR/o),y2:Math.trunc(h/SCALE_FACTOR/i)}:null}).filter(notNull)},pointsProcess=function(t,n,e){return coordinateSegment({segments:segmentize2(binarize(t),t.width),width:t.width,scaleWidth:n,scaleHeight:e})};onmessage=function(t){var n=t.data;if(n){var e=pointsProcess(n.iData,n.resizedToBorderScaleWidth,n.resizedToBorderScaleHeight);postMessage({segments:e})}};
|