idmission-web-sdk 2.3.174 → 2.3.175-feature-barcode-client-scan-eaf765f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/common/debug.d.ts +3 -0
- package/dist/components/common/debug.d.ts.map +1 -1
- package/dist/components/customer_flows/IdValidation.d.ts +11 -0
- package/dist/components/customer_flows/IdValidation.d.ts.map +1 -1
- package/dist/components/id_capture/BarcodeGuideOverlay.d.ts +23 -0
- package/dist/components/id_capture/BarcodeGuideOverlay.d.ts.map +1 -0
- package/dist/components/id_capture/BarcodeSuccessOverlay.d.ts +8 -0
- package/dist/components/id_capture/BarcodeSuccessOverlay.d.ts.map +1 -0
- package/dist/components/id_capture/DynamsoftBarcodeProvider.d.ts +29 -0
- package/dist/components/id_capture/DynamsoftBarcodeProvider.d.ts.map +1 -0
- package/dist/components/id_capture/DynamsoftLicensePrompt.d.ts +9 -0
- package/dist/components/id_capture/DynamsoftLicensePrompt.d.ts.map +1 -0
- package/dist/components/id_capture/IdCapture.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureGuides.d.ts +5 -1
- package/dist/components/id_capture/IdCaptureGuides.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureModelsProvider.d.ts +8 -0
- package/dist/components/id_capture/IdCaptureModelsProvider.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureStateProvider.d.ts +74 -1
- package/dist/components/id_capture/IdCaptureStateProvider.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureSuccess.d.ts +18 -1
- package/dist/components/id_capture/IdCaptureSuccess.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureWizard.d.ts +32 -1
- package/dist/components/id_capture/IdCaptureWizard.d.ts.map +1 -1
- package/dist/lib/barcode/AAMVAParser.d.ts +32 -0
- package/dist/lib/barcode/AAMVAParser.d.ts.map +1 -0
- package/dist/lib/barcode/DynamsoftLoader.d.ts +26 -0
- package/dist/lib/barcode/DynamsoftLoader.d.ts.map +1 -0
- package/dist/lib/barcode/DynamsoftTypes.d.ts +128 -0
- package/dist/lib/barcode/DynamsoftTypes.d.ts.map +1 -0
- package/dist/lib/barcode/NativeBarcodeDecoder.d.ts +93 -0
- package/dist/lib/barcode/NativeBarcodeDecoder.d.ts.map +1 -0
- package/dist/lib/camera/cameraStore.d.ts.map +1 -1
- package/dist/lib/models/DocumentDetection.d.ts.map +1 -1
- package/dist/sdk2.cjs.development.js +2677 -522
- package/dist/sdk2.cjs.development.js.map +1 -1
- package/dist/sdk2.cjs.production.js +1 -1
- package/dist/sdk2.cjs.production.js.map +1 -1
- package/dist/sdk2.esm.js +2677 -522
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +2679 -524
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/package.json +1 -1
|
@@ -459,16 +459,16 @@
|
|
|
459
459
|
}, children));
|
|
460
460
|
});
|
|
461
461
|
LoaderButton.displayName = 'LoaderButton';
|
|
462
|
-
var StyledButton = styled.button(templateObject_1$S || (templateObject_1$S = __makeTemplateObject(["\n ", "\n\n /*!\n * Ladda\n * http://lab.hakim.se/ladda\n * MIT licensed\n *\n * Copyright (C) 2018 Hakim El Hattab, http://hakim.se\n */\n\n position: relative;\n\n .ladda-spinner {\n position: absolute;\n z-index: 2;\n display: inline-block;\n width: 32px;\n top: 50%;\n margin-top: 0;\n opacity: 0;\n pointer-events: none;\n }\n .ladda-label {\n position: relative;\n z-index: 3;\n }\n .ladda-progress {\n position: absolute;\n width: 0;\n height: 100%;\n left: 0;\n top: 0;\n background: rgba(0, 0, 0, 0.2);\n display: none;\n transition: 0.1s linear all !important;\n }\n &[data-loading] .ladda-progress {\n display: block;\n }\n\n transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;\n\n .ladda-spinner,\n .ladda-label {\n transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;\n }\n &[data-style='zoom-in'],\n &[data-style='zoom-in'] .ladda-spinner,\n &[data-style='zoom-in'] .ladda-label,\n &[data-style='zoom-out'],\n &[data-style='zoom-out'] .ladda-spinner,\n &[data-style='zoom-out'] .ladda-label {\n transition: 0.3s ease all !important;\n }\n &[data-style='expand-right'] .ladda-spinner {\n right: -6px;\n }\n &[data-style='expand-right'][data-size='s'] .ladda-spinner,\n &[data-style='expand-right'][data-size='xs'] .ladda-spinner {\n right: -12px;\n }\n &[data-style='expand-right'][data-loading] {\n padding-right: 56px;\n }\n &[data-style='expand-right'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-right'][data-loading][data-size='s'],\n &[data-style='expand-right'][data-loading][data-size='xs'] {\n padding-right: 40px;\n }\n &[data-style='expand-left'] .ladda-spinner {\n left: 26px;\n }\n &[data-style='expand-left'][data-size='s'] .ladda-spinner,\n &[data-style='expand-left'][data-size='xs'] .ladda-spinner {\n left: 4px;\n }\n &[data-style='expand-left'][data-loading] {\n padding-left: 56px;\n }\n &[data-style='expand-left'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-left'][data-loading][data-size='s'],\n &[data-style='expand-left'][data-loading][data-size='xs'] {\n padding-left: 40px;\n }\n &[data-style='expand-up'] {\n overflow: hidden;\n }\n &[data-style='expand-up'] .ladda-spinner {\n top: -32px;\n left: 50%;\n margin-left: 0;\n }\n &[data-style='expand-up'][data-loading] {\n padding-top: 54px;\n }\n &[data-style='expand-up'][data-loading] .ladda-spinner {\n opacity: 1;\n top: 26px;\n margin-top: 0;\n }\n &[data-style='expand-up'][data-loading][data-size='s'],\n &[data-style='expand-up'][data-loading][data-size='xs'] {\n padding-top: 32px;\n }\n &[data-style='expand-up'][data-loading][data-size='s'] .ladda-spinner,\n &[data-style='expand-up'][data-loading][data-size='xs'] .ladda-spinner {\n top: 4px;\n }\n &[data-style='expand-down'] {\n overflow: hidden;\n }\n &[data-style='expand-down'] .ladda-spinner {\n top: 62px;\n left: 50%;\n margin-left: 0;\n }\n &[data-style='expand-down'][data-size='s'] .ladda-spinner,\n &[data-style='expand-down'][data-size='xs'] .ladda-spinner {\n top: 40px;\n }\n &[data-style='expand-down'][data-loading] {\n padding-bottom: 54px;\n }\n &[data-style='expand-down'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-down'][data-loading][data-size='s'],\n &[data-style='expand-down'][data-loading][data-size='xs'] {\n padding-bottom: 32px;\n }\n &[data-style='slide-left'] {\n overflow: hidden;\n }\n &[data-style='slide-left'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-left'] .ladda-spinner {\n left: 100%;\n margin-left: 0;\n }\n &[data-style='slide-left'][data-loading] .ladda-label {\n opacity: 0;\n left: -100%;\n }\n &[data-style='slide-left'][data-loading] .ladda-spinner {\n opacity: 1;\n left: 50%;\n }\n &[data-style='slide-right'] {\n overflow: hidden;\n }\n &[data-style='slide-right'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-right'] .ladda-spinner {\n right: 100%;\n margin-left: 0;\n left: 16px;\n }\n [dir='rtl'] &[data-style='slide-right'] .ladda-spinner {\n right: auto;\n }\n &[data-style='slide-right'][data-loading] .ladda-label {\n opacity: 0;\n left: 100%;\n }\n &[data-style='slide-right'][data-loading] .ladda-spinner {\n opacity: 1;\n left: 50%;\n }\n &[data-style='slide-up'] {\n overflow: hidden;\n }\n &[data-style='slide-up'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-up'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n margin-top: 1em;\n }\n &[data-style='slide-up'][data-loading] .ladda-label {\n opacity: 0;\n top: -1em;\n }\n &[data-style='slide-up'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-top: 0;\n }\n &[data-style='slide-down'] {\n overflow: hidden;\n }\n &[data-style='slide-down'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-down'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n margin-top: -2em;\n }\n &[data-style='slide-down'][data-loading] .ladda-label {\n opacity: 0;\n top: 1em;\n }\n &[data-style='slide-down'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-top: 0;\n }\n &[data-style='zoom-out'] {\n overflow: hidden;\n }\n &[data-style='zoom-out'] .ladda-spinner {\n left: 50%;\n margin-left: 32px;\n transform: scale(2.5);\n }\n &[data-style='zoom-out'] .ladda-label {\n position: relative;\n display: inline-block;\n }\n &[data-style='zoom-out'][data-loading] .ladda-label {\n opacity: 0;\n transform: scale(0.5);\n }\n &[data-style='zoom-out'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-left: 0;\n transform: none;\n }\n &[data-style='zoom-in'] {\n overflow: hidden;\n }\n &[data-style='zoom-in'] .ladda-spinner {\n left: 50%;\n margin-left: -16px;\n transform: scale(0.2);\n }\n &[data-style='zoom-in'] .ladda-label {\n position: relative;\n display: inline-block;\n }\n &[data-style='zoom-in'][data-loading] .ladda-label {\n opacity: 0;\n transform: scale(2.2);\n }\n &[data-style='zoom-in'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-left: 0;\n transform: none;\n }\n &[data-style='contract'] {\n overflow: hidden;\n width: 100px;\n }\n &[data-style='contract'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n }\n &[data-style='contract'][data-loading] {\n border-radius: 50%;\n width: 52px;\n }\n &[data-style='contract'][data-loading] .ladda-label {\n opacity: 0;\n }\n &[data-style='contract'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='contract-overlay'] {\n overflow: hidden;\n width: 100px;\n box-shadow: 0px 0px 0px 2000px rgba(0, 0, 0, 0);\n }\n &[data-style='contract-overlay'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n }\n &[data-style='contract-overlay'][data-loading] {\n border-radius: 50%;\n width: 52px;\n box-shadow: 0px 0px 0px 2000px rgba(0, 0, 0, 0.8);\n }\n &[data-style='contract-overlay'][data-loading] .ladda-label {\n opacity: 0;\n }\n &[data-style='contract-overlay'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n [dir='rtl'] .ladda-spinner > div {\n left: 25% !important;\n }\n"], ["\n ", "\n\n /*!\n * Ladda\n * http://lab.hakim.se/ladda\n * MIT licensed\n *\n * Copyright (C) 2018 Hakim El Hattab, http://hakim.se\n */\n\n position: relative;\n\n .ladda-spinner {\n position: absolute;\n z-index: 2;\n display: inline-block;\n width: 32px;\n top: 50%;\n margin-top: 0;\n opacity: 0;\n pointer-events: none;\n }\n .ladda-label {\n position: relative;\n z-index: 3;\n }\n .ladda-progress {\n position: absolute;\n width: 0;\n height: 100%;\n left: 0;\n top: 0;\n background: rgba(0, 0, 0, 0.2);\n display: none;\n transition: 0.1s linear all !important;\n }\n &[data-loading] .ladda-progress {\n display: block;\n }\n\n transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;\n\n .ladda-spinner,\n .ladda-label {\n transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;\n }\n &[data-style='zoom-in'],\n &[data-style='zoom-in'] .ladda-spinner,\n &[data-style='zoom-in'] .ladda-label,\n &[data-style='zoom-out'],\n &[data-style='zoom-out'] .ladda-spinner,\n &[data-style='zoom-out'] .ladda-label {\n transition: 0.3s ease all !important;\n }\n &[data-style='expand-right'] .ladda-spinner {\n right: -6px;\n }\n &[data-style='expand-right'][data-size='s'] .ladda-spinner,\n &[data-style='expand-right'][data-size='xs'] .ladda-spinner {\n right: -12px;\n }\n &[data-style='expand-right'][data-loading] {\n padding-right: 56px;\n }\n &[data-style='expand-right'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-right'][data-loading][data-size='s'],\n &[data-style='expand-right'][data-loading][data-size='xs'] {\n padding-right: 40px;\n }\n &[data-style='expand-left'] .ladda-spinner {\n left: 26px;\n }\n &[data-style='expand-left'][data-size='s'] .ladda-spinner,\n &[data-style='expand-left'][data-size='xs'] .ladda-spinner {\n left: 4px;\n }\n &[data-style='expand-left'][data-loading] {\n padding-left: 56px;\n }\n &[data-style='expand-left'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-left'][data-loading][data-size='s'],\n &[data-style='expand-left'][data-loading][data-size='xs'] {\n padding-left: 40px;\n }\n &[data-style='expand-up'] {\n overflow: hidden;\n }\n &[data-style='expand-up'] .ladda-spinner {\n top: -32px;\n left: 50%;\n margin-left: 0;\n }\n &[data-style='expand-up'][data-loading] {\n padding-top: 54px;\n }\n &[data-style='expand-up'][data-loading] .ladda-spinner {\n opacity: 1;\n top: 26px;\n margin-top: 0;\n }\n &[data-style='expand-up'][data-loading][data-size='s'],\n &[data-style='expand-up'][data-loading][data-size='xs'] {\n padding-top: 32px;\n }\n &[data-style='expand-up'][data-loading][data-size='s'] .ladda-spinner,\n &[data-style='expand-up'][data-loading][data-size='xs'] .ladda-spinner {\n top: 4px;\n }\n &[data-style='expand-down'] {\n overflow: hidden;\n }\n &[data-style='expand-down'] .ladda-spinner {\n top: 62px;\n left: 50%;\n margin-left: 0;\n }\n &[data-style='expand-down'][data-size='s'] .ladda-spinner,\n &[data-style='expand-down'][data-size='xs'] .ladda-spinner {\n top: 40px;\n }\n &[data-style='expand-down'][data-loading] {\n padding-bottom: 54px;\n }\n &[data-style='expand-down'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-down'][data-loading][data-size='s'],\n &[data-style='expand-down'][data-loading][data-size='xs'] {\n padding-bottom: 32px;\n }\n &[data-style='slide-left'] {\n overflow: hidden;\n }\n &[data-style='slide-left'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-left'] .ladda-spinner {\n left: 100%;\n margin-left: 0;\n }\n &[data-style='slide-left'][data-loading] .ladda-label {\n opacity: 0;\n left: -100%;\n }\n &[data-style='slide-left'][data-loading] .ladda-spinner {\n opacity: 1;\n left: 50%;\n }\n &[data-style='slide-right'] {\n overflow: hidden;\n }\n &[data-style='slide-right'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-right'] .ladda-spinner {\n right: 100%;\n margin-left: 0;\n left: 16px;\n }\n [dir='rtl'] &[data-style='slide-right'] .ladda-spinner {\n right: auto;\n }\n &[data-style='slide-right'][data-loading] .ladda-label {\n opacity: 0;\n left: 100%;\n }\n &[data-style='slide-right'][data-loading] .ladda-spinner {\n opacity: 1;\n left: 50%;\n }\n &[data-style='slide-up'] {\n overflow: hidden;\n }\n &[data-style='slide-up'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-up'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n margin-top: 1em;\n }\n &[data-style='slide-up'][data-loading] .ladda-label {\n opacity: 0;\n top: -1em;\n }\n &[data-style='slide-up'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-top: 0;\n }\n &[data-style='slide-down'] {\n overflow: hidden;\n }\n &[data-style='slide-down'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-down'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n margin-top: -2em;\n }\n &[data-style='slide-down'][data-loading] .ladda-label {\n opacity: 0;\n top: 1em;\n }\n &[data-style='slide-down'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-top: 0;\n }\n &[data-style='zoom-out'] {\n overflow: hidden;\n }\n &[data-style='zoom-out'] .ladda-spinner {\n left: 50%;\n margin-left: 32px;\n transform: scale(2.5);\n }\n &[data-style='zoom-out'] .ladda-label {\n position: relative;\n display: inline-block;\n }\n &[data-style='zoom-out'][data-loading] .ladda-label {\n opacity: 0;\n transform: scale(0.5);\n }\n &[data-style='zoom-out'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-left: 0;\n transform: none;\n }\n &[data-style='zoom-in'] {\n overflow: hidden;\n }\n &[data-style='zoom-in'] .ladda-spinner {\n left: 50%;\n margin-left: -16px;\n transform: scale(0.2);\n }\n &[data-style='zoom-in'] .ladda-label {\n position: relative;\n display: inline-block;\n }\n &[data-style='zoom-in'][data-loading] .ladda-label {\n opacity: 0;\n transform: scale(2.2);\n }\n &[data-style='zoom-in'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-left: 0;\n transform: none;\n }\n &[data-style='contract'] {\n overflow: hidden;\n width: 100px;\n }\n &[data-style='contract'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n }\n &[data-style='contract'][data-loading] {\n border-radius: 50%;\n width: 52px;\n }\n &[data-style='contract'][data-loading] .ladda-label {\n opacity: 0;\n }\n &[data-style='contract'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='contract-overlay'] {\n overflow: hidden;\n width: 100px;\n box-shadow: 0px 0px 0px 2000px rgba(0, 0, 0, 0);\n }\n &[data-style='contract-overlay'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n }\n &[data-style='contract-overlay'][data-loading] {\n border-radius: 50%;\n width: 52px;\n box-shadow: 0px 0px 0px 2000px rgba(0, 0, 0, 0.8);\n }\n &[data-style='contract-overlay'][data-loading] .ladda-label {\n opacity: 0;\n }\n &[data-style='contract-overlay'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n [dir='rtl'] .ladda-spinner > div {\n left: 25% !important;\n }\n"])), function (props) {
|
|
462
|
+
var StyledButton = styled.button(templateObject_1$V || (templateObject_1$V = __makeTemplateObject(["\n ", "\n\n /*!\n * Ladda\n * http://lab.hakim.se/ladda\n * MIT licensed\n *\n * Copyright (C) 2018 Hakim El Hattab, http://hakim.se\n */\n\n position: relative;\n\n .ladda-spinner {\n position: absolute;\n z-index: 2;\n display: inline-block;\n width: 32px;\n top: 50%;\n margin-top: 0;\n opacity: 0;\n pointer-events: none;\n }\n .ladda-label {\n position: relative;\n z-index: 3;\n }\n .ladda-progress {\n position: absolute;\n width: 0;\n height: 100%;\n left: 0;\n top: 0;\n background: rgba(0, 0, 0, 0.2);\n display: none;\n transition: 0.1s linear all !important;\n }\n &[data-loading] .ladda-progress {\n display: block;\n }\n\n transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;\n\n .ladda-spinner,\n .ladda-label {\n transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;\n }\n &[data-style='zoom-in'],\n &[data-style='zoom-in'] .ladda-spinner,\n &[data-style='zoom-in'] .ladda-label,\n &[data-style='zoom-out'],\n &[data-style='zoom-out'] .ladda-spinner,\n &[data-style='zoom-out'] .ladda-label {\n transition: 0.3s ease all !important;\n }\n &[data-style='expand-right'] .ladda-spinner {\n right: -6px;\n }\n &[data-style='expand-right'][data-size='s'] .ladda-spinner,\n &[data-style='expand-right'][data-size='xs'] .ladda-spinner {\n right: -12px;\n }\n &[data-style='expand-right'][data-loading] {\n padding-right: 56px;\n }\n &[data-style='expand-right'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-right'][data-loading][data-size='s'],\n &[data-style='expand-right'][data-loading][data-size='xs'] {\n padding-right: 40px;\n }\n &[data-style='expand-left'] .ladda-spinner {\n left: 26px;\n }\n &[data-style='expand-left'][data-size='s'] .ladda-spinner,\n &[data-style='expand-left'][data-size='xs'] .ladda-spinner {\n left: 4px;\n }\n &[data-style='expand-left'][data-loading] {\n padding-left: 56px;\n }\n &[data-style='expand-left'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-left'][data-loading][data-size='s'],\n &[data-style='expand-left'][data-loading][data-size='xs'] {\n padding-left: 40px;\n }\n &[data-style='expand-up'] {\n overflow: hidden;\n }\n &[data-style='expand-up'] .ladda-spinner {\n top: -32px;\n left: 50%;\n margin-left: 0;\n }\n &[data-style='expand-up'][data-loading] {\n padding-top: 54px;\n }\n &[data-style='expand-up'][data-loading] .ladda-spinner {\n opacity: 1;\n top: 26px;\n margin-top: 0;\n }\n &[data-style='expand-up'][data-loading][data-size='s'],\n &[data-style='expand-up'][data-loading][data-size='xs'] {\n padding-top: 32px;\n }\n &[data-style='expand-up'][data-loading][data-size='s'] .ladda-spinner,\n &[data-style='expand-up'][data-loading][data-size='xs'] .ladda-spinner {\n top: 4px;\n }\n &[data-style='expand-down'] {\n overflow: hidden;\n }\n &[data-style='expand-down'] .ladda-spinner {\n top: 62px;\n left: 50%;\n margin-left: 0;\n }\n &[data-style='expand-down'][data-size='s'] .ladda-spinner,\n &[data-style='expand-down'][data-size='xs'] .ladda-spinner {\n top: 40px;\n }\n &[data-style='expand-down'][data-loading] {\n padding-bottom: 54px;\n }\n &[data-style='expand-down'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-down'][data-loading][data-size='s'],\n &[data-style='expand-down'][data-loading][data-size='xs'] {\n padding-bottom: 32px;\n }\n &[data-style='slide-left'] {\n overflow: hidden;\n }\n &[data-style='slide-left'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-left'] .ladda-spinner {\n left: 100%;\n margin-left: 0;\n }\n &[data-style='slide-left'][data-loading] .ladda-label {\n opacity: 0;\n left: -100%;\n }\n &[data-style='slide-left'][data-loading] .ladda-spinner {\n opacity: 1;\n left: 50%;\n }\n &[data-style='slide-right'] {\n overflow: hidden;\n }\n &[data-style='slide-right'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-right'] .ladda-spinner {\n right: 100%;\n margin-left: 0;\n left: 16px;\n }\n [dir='rtl'] &[data-style='slide-right'] .ladda-spinner {\n right: auto;\n }\n &[data-style='slide-right'][data-loading] .ladda-label {\n opacity: 0;\n left: 100%;\n }\n &[data-style='slide-right'][data-loading] .ladda-spinner {\n opacity: 1;\n left: 50%;\n }\n &[data-style='slide-up'] {\n overflow: hidden;\n }\n &[data-style='slide-up'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-up'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n margin-top: 1em;\n }\n &[data-style='slide-up'][data-loading] .ladda-label {\n opacity: 0;\n top: -1em;\n }\n &[data-style='slide-up'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-top: 0;\n }\n &[data-style='slide-down'] {\n overflow: hidden;\n }\n &[data-style='slide-down'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-down'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n margin-top: -2em;\n }\n &[data-style='slide-down'][data-loading] .ladda-label {\n opacity: 0;\n top: 1em;\n }\n &[data-style='slide-down'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-top: 0;\n }\n &[data-style='zoom-out'] {\n overflow: hidden;\n }\n &[data-style='zoom-out'] .ladda-spinner {\n left: 50%;\n margin-left: 32px;\n transform: scale(2.5);\n }\n &[data-style='zoom-out'] .ladda-label {\n position: relative;\n display: inline-block;\n }\n &[data-style='zoom-out'][data-loading] .ladda-label {\n opacity: 0;\n transform: scale(0.5);\n }\n &[data-style='zoom-out'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-left: 0;\n transform: none;\n }\n &[data-style='zoom-in'] {\n overflow: hidden;\n }\n &[data-style='zoom-in'] .ladda-spinner {\n left: 50%;\n margin-left: -16px;\n transform: scale(0.2);\n }\n &[data-style='zoom-in'] .ladda-label {\n position: relative;\n display: inline-block;\n }\n &[data-style='zoom-in'][data-loading] .ladda-label {\n opacity: 0;\n transform: scale(2.2);\n }\n &[data-style='zoom-in'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-left: 0;\n transform: none;\n }\n &[data-style='contract'] {\n overflow: hidden;\n width: 100px;\n }\n &[data-style='contract'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n }\n &[data-style='contract'][data-loading] {\n border-radius: 50%;\n width: 52px;\n }\n &[data-style='contract'][data-loading] .ladda-label {\n opacity: 0;\n }\n &[data-style='contract'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='contract-overlay'] {\n overflow: hidden;\n width: 100px;\n box-shadow: 0px 0px 0px 2000px rgba(0, 0, 0, 0);\n }\n &[data-style='contract-overlay'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n }\n &[data-style='contract-overlay'][data-loading] {\n border-radius: 50%;\n width: 52px;\n box-shadow: 0px 0px 0px 2000px rgba(0, 0, 0, 0.8);\n }\n &[data-style='contract-overlay'][data-loading] .ladda-label {\n opacity: 0;\n }\n &[data-style='contract-overlay'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n [dir='rtl'] .ladda-spinner > div {\n left: 25% !important;\n }\n"], ["\n ", "\n\n /*!\n * Ladda\n * http://lab.hakim.se/ladda\n * MIT licensed\n *\n * Copyright (C) 2018 Hakim El Hattab, http://hakim.se\n */\n\n position: relative;\n\n .ladda-spinner {\n position: absolute;\n z-index: 2;\n display: inline-block;\n width: 32px;\n top: 50%;\n margin-top: 0;\n opacity: 0;\n pointer-events: none;\n }\n .ladda-label {\n position: relative;\n z-index: 3;\n }\n .ladda-progress {\n position: absolute;\n width: 0;\n height: 100%;\n left: 0;\n top: 0;\n background: rgba(0, 0, 0, 0.2);\n display: none;\n transition: 0.1s linear all !important;\n }\n &[data-loading] .ladda-progress {\n display: block;\n }\n\n transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;\n\n .ladda-spinner,\n .ladda-label {\n transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;\n }\n &[data-style='zoom-in'],\n &[data-style='zoom-in'] .ladda-spinner,\n &[data-style='zoom-in'] .ladda-label,\n &[data-style='zoom-out'],\n &[data-style='zoom-out'] .ladda-spinner,\n &[data-style='zoom-out'] .ladda-label {\n transition: 0.3s ease all !important;\n }\n &[data-style='expand-right'] .ladda-spinner {\n right: -6px;\n }\n &[data-style='expand-right'][data-size='s'] .ladda-spinner,\n &[data-style='expand-right'][data-size='xs'] .ladda-spinner {\n right: -12px;\n }\n &[data-style='expand-right'][data-loading] {\n padding-right: 56px;\n }\n &[data-style='expand-right'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-right'][data-loading][data-size='s'],\n &[data-style='expand-right'][data-loading][data-size='xs'] {\n padding-right: 40px;\n }\n &[data-style='expand-left'] .ladda-spinner {\n left: 26px;\n }\n &[data-style='expand-left'][data-size='s'] .ladda-spinner,\n &[data-style='expand-left'][data-size='xs'] .ladda-spinner {\n left: 4px;\n }\n &[data-style='expand-left'][data-loading] {\n padding-left: 56px;\n }\n &[data-style='expand-left'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-left'][data-loading][data-size='s'],\n &[data-style='expand-left'][data-loading][data-size='xs'] {\n padding-left: 40px;\n }\n &[data-style='expand-up'] {\n overflow: hidden;\n }\n &[data-style='expand-up'] .ladda-spinner {\n top: -32px;\n left: 50%;\n margin-left: 0;\n }\n &[data-style='expand-up'][data-loading] {\n padding-top: 54px;\n }\n &[data-style='expand-up'][data-loading] .ladda-spinner {\n opacity: 1;\n top: 26px;\n margin-top: 0;\n }\n &[data-style='expand-up'][data-loading][data-size='s'],\n &[data-style='expand-up'][data-loading][data-size='xs'] {\n padding-top: 32px;\n }\n &[data-style='expand-up'][data-loading][data-size='s'] .ladda-spinner,\n &[data-style='expand-up'][data-loading][data-size='xs'] .ladda-spinner {\n top: 4px;\n }\n &[data-style='expand-down'] {\n overflow: hidden;\n }\n &[data-style='expand-down'] .ladda-spinner {\n top: 62px;\n left: 50%;\n margin-left: 0;\n }\n &[data-style='expand-down'][data-size='s'] .ladda-spinner,\n &[data-style='expand-down'][data-size='xs'] .ladda-spinner {\n top: 40px;\n }\n &[data-style='expand-down'][data-loading] {\n padding-bottom: 54px;\n }\n &[data-style='expand-down'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-down'][data-loading][data-size='s'],\n &[data-style='expand-down'][data-loading][data-size='xs'] {\n padding-bottom: 32px;\n }\n &[data-style='slide-left'] {\n overflow: hidden;\n }\n &[data-style='slide-left'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-left'] .ladda-spinner {\n left: 100%;\n margin-left: 0;\n }\n &[data-style='slide-left'][data-loading] .ladda-label {\n opacity: 0;\n left: -100%;\n }\n &[data-style='slide-left'][data-loading] .ladda-spinner {\n opacity: 1;\n left: 50%;\n }\n &[data-style='slide-right'] {\n overflow: hidden;\n }\n &[data-style='slide-right'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-right'] .ladda-spinner {\n right: 100%;\n margin-left: 0;\n left: 16px;\n }\n [dir='rtl'] &[data-style='slide-right'] .ladda-spinner {\n right: auto;\n }\n &[data-style='slide-right'][data-loading] .ladda-label {\n opacity: 0;\n left: 100%;\n }\n &[data-style='slide-right'][data-loading] .ladda-spinner {\n opacity: 1;\n left: 50%;\n }\n &[data-style='slide-up'] {\n overflow: hidden;\n }\n &[data-style='slide-up'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-up'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n margin-top: 1em;\n }\n &[data-style='slide-up'][data-loading] .ladda-label {\n opacity: 0;\n top: -1em;\n }\n &[data-style='slide-up'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-top: 0;\n }\n &[data-style='slide-down'] {\n overflow: hidden;\n }\n &[data-style='slide-down'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-down'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n margin-top: -2em;\n }\n &[data-style='slide-down'][data-loading] .ladda-label {\n opacity: 0;\n top: 1em;\n }\n &[data-style='slide-down'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-top: 0;\n }\n &[data-style='zoom-out'] {\n overflow: hidden;\n }\n &[data-style='zoom-out'] .ladda-spinner {\n left: 50%;\n margin-left: 32px;\n transform: scale(2.5);\n }\n &[data-style='zoom-out'] .ladda-label {\n position: relative;\n display: inline-block;\n }\n &[data-style='zoom-out'][data-loading] .ladda-label {\n opacity: 0;\n transform: scale(0.5);\n }\n &[data-style='zoom-out'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-left: 0;\n transform: none;\n }\n &[data-style='zoom-in'] {\n overflow: hidden;\n }\n &[data-style='zoom-in'] .ladda-spinner {\n left: 50%;\n margin-left: -16px;\n transform: scale(0.2);\n }\n &[data-style='zoom-in'] .ladda-label {\n position: relative;\n display: inline-block;\n }\n &[data-style='zoom-in'][data-loading] .ladda-label {\n opacity: 0;\n transform: scale(2.2);\n }\n &[data-style='zoom-in'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-left: 0;\n transform: none;\n }\n &[data-style='contract'] {\n overflow: hidden;\n width: 100px;\n }\n &[data-style='contract'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n }\n &[data-style='contract'][data-loading] {\n border-radius: 50%;\n width: 52px;\n }\n &[data-style='contract'][data-loading] .ladda-label {\n opacity: 0;\n }\n &[data-style='contract'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='contract-overlay'] {\n overflow: hidden;\n width: 100px;\n box-shadow: 0px 0px 0px 2000px rgba(0, 0, 0, 0);\n }\n &[data-style='contract-overlay'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n }\n &[data-style='contract-overlay'][data-loading] {\n border-radius: 50%;\n width: 52px;\n box-shadow: 0px 0px 0px 2000px rgba(0, 0, 0, 0.8);\n }\n &[data-style='contract-overlay'][data-loading] .ladda-label {\n opacity: 0;\n }\n &[data-style='contract-overlay'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n [dir='rtl'] .ladda-spinner > div {\n left: 25% !important;\n }\n"])), function (props) {
|
|
463
463
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
464
464
|
return ((_a = props.theme.buttons) === null || _a === void 0 ? void 0 : _a.style) === 'bootstrap' && "\n border-radius: 0;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n text-transform: none;\n -webkit-appearance: button;\n \n &:not(:disabled),\n &[type='button']:not(:disabled),\n &[type='reset']:not(:disabled),\n &[type='submit']:not(:disabled) {\n cursor: pointer;\n }\n \n &:focus:not(:focus-visible) {\n outline: 0;\n }\n \n --bs-btn-padding-x: 0.75rem;\n --bs-btn-padding-y: 0.375rem;\n --bs-btn-font-family: ;\n --bs-btn-font-size: 1rem;\n --bs-btn-font-weight: 400;\n --bs-btn-line-height: 1.5;\n --bs-btn-color: var(--bs-body-color);\n --bs-btn-bg: transparent;\n --bs-btn-border-width: var(--bs-border-width);\n --bs-btn-border-color: transparent;\n --bs-btn-border-radius: var(--bs-border-radius);\n --bs-btn-hover-border-color: transparent;\n --bs-btn-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15),\n 0 1px 1px rgba(0, 0, 0, 0.075);\n --bs-btn-disabled-opacity: 0.65;\n --bs-btn-focus-box-shadow: 0 0 0 0.25rem\n rgba(var(--bs-btn-focus-shadow-rgb), 0.5);\n display: inline-block;\n padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x);\n font-family: var(--bs-btn-font-family);\n font-size: var(--bs-btn-font-size);\n font-weight: var(--bs-btn-font-weight);\n line-height: var(--bs-btn-line-height);\n color: var(--bs-btn-color);\n text-align: center;\n text-decoration: none;\n vertical-align: middle;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n border: var(--bs-btn-border-width) solid var(--bs-btn-border-color);\n border-radius: var(--bs-btn-border-radius);\n background-color: var(--bs-btn-bg);\n //transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,\n // border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n \n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n \n &:hover {\n filter: brightness(1.15);\n }\n \n &:focus-visible {\n color: var(--bs-btn-color);\n background-color: var(--bs-btn-bg);\n border-color: var(--bs-btn-border-color);\n outline: 0;\n box-shadow: var(--bs-btn-focus-box-shadow);\n }\n \n &:disabled,\n &.disabled,\n fieldset:disabled & {\n color: var(--bs-btn-disabled-color);\n pointer-events: none;\n background-color: var(--bs-btn-disabled-bg);\n border-color: var(--bs-btn-disabled-border-color);\n opacity: var(--bs-btn-disabled-opacity);\n }\n \n --bs-btn-color: ".concat((_f = (_b = props.$textColor) !== null && _b !== void 0 ? _b : (_e = (_c = props.theme.buttons) === null || _c === void 0 ? void 0 : _c[(_d = props.$variant) !== null && _d !== void 0 ? _d : 'primary']) === null || _e === void 0 ? void 0 : _e.textColor) !== null && _f !== void 0 ? _f : '#fff', ";\n --bs-btn-bg: ").concat((_l = (_g = props.$backgroundColor) !== null && _g !== void 0 ? _g : (_k = (_h = props.theme.buttons) === null || _h === void 0 ? void 0 : _h[(_j = props.$variant) !== null && _j !== void 0 ? _j : 'primary']) === null || _k === void 0 ? void 0 : _k.backgroundColor) !== null && _l !== void 0 ? _l : '#0d6efd', ";\n --bs-btn-border-color: var(--bs-btn-bg);\n --bs-btn-focus-shadow-rgb: 49, 132, 253;\n --bs-btn-active-color: #fff;\n --bs-btn-active-bg: #0a58ca;\n --bs-btn-active-border-color: #0a53be;\n --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n --bs-btn-disabled-color: ").concat((_q = (_m = props.$disabledTextColor) !== null && _m !== void 0 ? _m : (_p = (_o = props.theme.buttons) === null || _o === void 0 ? void 0 : _o.loading) === null || _p === void 0 ? void 0 : _p.textColor) !== null && _q !== void 0 ? _q : '#fff', ";\n --bs-btn-disabled-bg: ").concat((_u = (_r = props.$disabledBackgroundColor) !== null && _r !== void 0 ? _r : (_t = (_s = props.theme.buttons) === null || _s === void 0 ? void 0 : _s.loading) === null || _t === void 0 ? void 0 : _t.backgroundColor) !== null && _u !== void 0 ? _u : 'gray', ";\n --bs-btn-disabled-border-color: ").concat((_v = props.$disabledBackgroundColor) !== null && _v !== void 0 ? _v : '#0d6efd', ";\n \n --bs-btn-padding-y: 14px;\n --bs-btn-padding-x: 1rem;\n --bs-btn-font-size: 18px;\n --bs-btn-border-radius: 4px;\n ");
|
|
465
465
|
});
|
|
466
|
-
var templateObject_1$
|
|
466
|
+
var templateObject_1$V;
|
|
467
467
|
|
|
468
|
-
var ButtonsRow$2 = styled.div(templateObject_1$
|
|
469
|
-
var templateObject_1$
|
|
468
|
+
var ButtonsRow$2 = styled.div(templateObject_1$U || (templateObject_1$U = __makeTemplateObject(["\n display: flex;\n gap: 0 15px;\n justify-content: center;\n text-align: left;\n"], ["\n display: flex;\n gap: 0 15px;\n justify-content: center;\n text-align: left;\n"])));
|
|
469
|
+
var templateObject_1$U;
|
|
470
470
|
|
|
471
|
-
var GuidanceMessageContainerDiv = styled.div(templateObject_1$
|
|
471
|
+
var GuidanceMessageContainerDiv = styled.div(templateObject_1$T || (templateObject_1$T = __makeTemplateObject(["\n position: absolute;\n top: calc(", ");\n ", "\n font-weight: bold;\n width: 100%;\n display: flex;\n padding: 0 10%;\n box-sizing: border-box;\n"], ["\n position: absolute;\n top: calc(", ");\n ", "\n font-weight: bold;\n width: 100%;\n display: flex;\n padding: 0 10%;\n box-sizing: border-box;\n"])), function (_a) {
|
|
472
472
|
var $top = _a.$top;
|
|
473
473
|
return $top !== null && $top !== void 0 ? $top : '10%';
|
|
474
474
|
}, function (_a) {
|
|
@@ -481,38 +481,38 @@
|
|
|
481
481
|
if (!portalLocation) return element;
|
|
482
482
|
return /*#__PURE__*/reactDom.createPortal(element, portalLocation);
|
|
483
483
|
};
|
|
484
|
-
var GuidanceMessage = styled.div(templateObject_2$
|
|
484
|
+
var GuidanceMessage = styled.div(templateObject_2$O || (templateObject_2$O = __makeTemplateObject(["\n margin-left: auto;\n margin-right: auto;\n background: ", ";\n color: ", ";\n border-radius: 8px;\n z-index: 10001;\n padding: 16px 24px;\n font-size: 18px;\n font-weight: bold;\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n"], ["\n margin-left: auto;\n margin-right: auto;\n background: ", ";\n color: ", ";\n border-radius: 8px;\n z-index: 10001;\n padding: 16px 24px;\n font-size: 18px;\n font-weight: bold;\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n"])), function (props) {
|
|
485
485
|
var _a, _b, _c, _d, _e, _f;
|
|
486
486
|
return (_f = (_a = props.$background) !== null && _a !== void 0 ? _a : (_e = (_c = (_b = props.theme) === null || _b === void 0 ? void 0 : _b.guidanceMessages) === null || _c === void 0 ? void 0 : _c[(_d = props.$variant) !== null && _d !== void 0 ? _d : 'default']) === null || _e === void 0 ? void 0 : _e.backgroundColor) !== null && _f !== void 0 ? _f : 'white';
|
|
487
487
|
}, function (props) {
|
|
488
488
|
var _a, _b, _c, _d, _e, _f;
|
|
489
489
|
return (_f = (_a = props.$textColor) !== null && _a !== void 0 ? _a : (_e = (_c = (_b = props.theme) === null || _b === void 0 ? void 0 : _b.guidanceMessages) === null || _c === void 0 ? void 0 : _c[(_d = props.$variant) !== null && _d !== void 0 ? _d : 'default']) === null || _e === void 0 ? void 0 : _e.textColor) !== null && _f !== void 0 ? _f : 'black';
|
|
490
490
|
});
|
|
491
|
-
var templateObject_1$
|
|
491
|
+
var templateObject_1$T, templateObject_2$O;
|
|
492
492
|
|
|
493
|
-
var wavesAnimation = styled.keyframes(templateObject_1$
|
|
494
|
-
var progressBarAnimation = styled.keyframes(templateObject_2$
|
|
495
|
-
var dualRingSpinnerAnimation = styled.keyframes(templateObject_3$
|
|
496
|
-
var progressBorderAnimation = styled.keyframes(templateObject_4$
|
|
497
|
-
var templateObject_1$
|
|
493
|
+
var wavesAnimation = styled.keyframes(templateObject_1$S || (templateObject_1$S = __makeTemplateObject(["\n 0% {\n opacity: 0;\n transform: scale3d(1, 1, 1);\n }\n 80% {\n opacity: 1;\n }\n 100% {\n transform: scale3d(2, 2, 1);\n opacity: 0;\n }\n"], ["\n 0% {\n opacity: 0;\n transform: scale3d(1, 1, 1);\n }\n 80% {\n opacity: 1;\n }\n 100% {\n transform: scale3d(2, 2, 1);\n opacity: 0;\n }\n"])));
|
|
494
|
+
var progressBarAnimation = styled.keyframes(templateObject_2$N || (templateObject_2$N = __makeTemplateObject(["\n 0% {\n width: 0;\n }\n 100% {\n width: 100%;\n }\n"], ["\n 0% {\n width: 0;\n }\n 100% {\n width: 100%;\n }\n"])));
|
|
495
|
+
var dualRingSpinnerAnimation = styled.keyframes(templateObject_3$z || (templateObject_3$z = __makeTemplateObject(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"], ["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"])));
|
|
496
|
+
var progressBorderAnimation = styled.keyframes(templateObject_4$t || (templateObject_4$t = __makeTemplateObject(["\n to {\n stroke-dashoffset: 0;\n }\n"], ["\n to {\n stroke-dashoffset: 0;\n }\n"])));
|
|
497
|
+
var templateObject_1$S, templateObject_2$N, templateObject_3$z, templateObject_4$t;
|
|
498
498
|
|
|
499
|
-
var OverlayContainer = styled.div(templateObject_1$
|
|
499
|
+
var OverlayContainer = styled.div(templateObject_1$R || (templateObject_1$R = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n\n display: flex;\n flex-direction: column;\n\n overflow-x: hidden;\n overflow-y: auto;\n\n background: ", ";\n ", "\n\n z-index: 10000;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n\n display: flex;\n flex-direction: column;\n\n overflow-x: hidden;\n overflow-y: auto;\n\n background: ", ";\n ", "\n\n z-index: 10000;\n"])), function (props) {
|
|
500
500
|
return props.theme.background ? "".concat(props.theme.background) : "white";
|
|
501
501
|
}, function (props) {
|
|
502
502
|
return props.theme.textColor ? "color: ".concat(props.theme.textColor, ";") : "";
|
|
503
503
|
});
|
|
504
|
-
var OverlayInner$2 = styled.div(templateObject_2$
|
|
504
|
+
var OverlayInner$2 = styled.div(templateObject_2$M || (templateObject_2$M = __makeTemplateObject(["\n text-align: ", ";\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n width: 100%;\n height: 100%;\n ", "\n"], ["\n text-align: ", ";\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n width: 100%;\n height: 100%;\n ", "\n"])), function (props) {
|
|
505
505
|
var _a;
|
|
506
506
|
return (_a = props.theme.textAlign) !== null && _a !== void 0 ? _a : 'center';
|
|
507
507
|
}, function (props) {
|
|
508
508
|
return props.theme.padding ? "box-sizing: border-box; padding: ".concat(props.theme.padding, ";") : "";
|
|
509
509
|
});
|
|
510
|
-
var OverlayImageContainer = styled.div(templateObject_3$
|
|
511
|
-
var OverlayImageRow = styled.div(templateObject_4$
|
|
512
|
-
var GrayOverlayContainer = styled(OverlayContainer)(templateObject_5$
|
|
513
|
-
var ButtonsColumn = styled.div(templateObject_6$
|
|
514
|
-
var WideButton = styled(LoaderButton)(templateObject_7$
|
|
515
|
-
var WideBorderButton = styled(WideButton)(templateObject_8$
|
|
510
|
+
var OverlayImageContainer = styled.div(templateObject_3$y || (templateObject_3$y = __makeTemplateObject(["\n position: relative;\n display: flex;\n flex-grow: 1;\n padding-bottom: 25px;\n overflow: hidden;\n\n & > img,\n & > svg {\n margin: 0 auto;\n width: max-content;\n max-width: 100%;\n max-height: 100%;\n aspect-ratio: initial;\n object-fit: contain;\n display: block;\n }\n"], ["\n position: relative;\n display: flex;\n flex-grow: 1;\n padding-bottom: 25px;\n overflow: hidden;\n\n & > img,\n & > svg {\n margin: 0 auto;\n width: max-content;\n max-width: 100%;\n max-height: 100%;\n aspect-ratio: initial;\n object-fit: contain;\n display: block;\n }\n"])));
|
|
511
|
+
var OverlayImageRow = styled.div(templateObject_4$s || (templateObject_4$s = __makeTemplateObject(["\n display: flex;\n margin: auto;\n\n & > div {\n max-height: calc(100% - 320px);\n\n & > img {\n width: 100%;\n max-height: 100%;\n height: auto;\n object-fit: contain;\n }\n }\n"], ["\n display: flex;\n margin: auto;\n\n & > div {\n max-height: calc(100% - 320px);\n\n & > img {\n width: 100%;\n max-height: 100%;\n height: auto;\n object-fit: contain;\n }\n }\n"])));
|
|
512
|
+
var GrayOverlayContainer = styled(OverlayContainer)(templateObject_5$l || (templateObject_5$l = __makeTemplateObject(["\n background: #f7f6fb;\n"], ["\n background: #f7f6fb;\n"])));
|
|
513
|
+
var ButtonsColumn = styled.div(templateObject_6$d || (templateObject_6$d = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 15px 0;\n justify-content: center;\n margin-top: 24px;\n"], ["\n display: flex;\n flex-direction: column;\n gap: 15px 0;\n justify-content: center;\n margin-top: 24px;\n"])));
|
|
514
|
+
var WideButton = styled(LoaderButton)(templateObject_7$9 || (templateObject_7$9 = __makeTemplateObject(["\n width: 100%;\n border-radius: 30px;\n"], ["\n width: 100%;\n border-radius: 30px;\n"])));
|
|
515
|
+
var WideBorderButton = styled(WideButton)(templateObject_8$8 || (templateObject_8$8 = __makeTemplateObject(["\n color: ", ";\n background: ", ";\n border: 1px solid\n ", ";\n box-sizing: border-box;\n"], ["\n color: ", ";\n background: ", ";\n border: 1px solid\n ", ";\n box-sizing: border-box;\n"])), function (props) {
|
|
516
516
|
var _a, _b;
|
|
517
517
|
return (_b = (_a = props.colors) === null || _a === void 0 ? void 0 : _a.textColor) !== null && _b !== void 0 ? _b : 'black';
|
|
518
518
|
}, function (props) {
|
|
@@ -522,34 +522,34 @@
|
|
|
522
522
|
var _a, _b;
|
|
523
523
|
return (_b = (_a = props.colors) === null || _a === void 0 ? void 0 : _a.borderColor) !== null && _b !== void 0 ? _b : 'var(--idm-color-secondary-500)';
|
|
524
524
|
});
|
|
525
|
-
var LoadingOverlayInner = styled(OverlayInner$2)(templateObject_9$
|
|
526
|
-
var LoadingOverlayHeader = styled.div(templateObject_10$
|
|
525
|
+
var LoadingOverlayInner = styled(OverlayInner$2)(templateObject_9$6 || (templateObject_9$6 = __makeTemplateObject(["\n position: relative;\n height: 100%;\n display: flex;\n flex-direction: column;\n padding: 0;\n"], ["\n position: relative;\n height: 100%;\n display: flex;\n flex-direction: column;\n padding: 0;\n"])));
|
|
526
|
+
var LoadingOverlayHeader = styled.div(templateObject_10$5 || (templateObject_10$5 = __makeTemplateObject(["\n text-align: ", ";\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n ", "\n padding-bottom: 0;\n"], ["\n text-align: ", ";\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n ", "\n padding-bottom: 0;\n"])), function (props) {
|
|
527
527
|
var _a;
|
|
528
528
|
return (_a = props.theme.textAlign) !== null && _a !== void 0 ? _a : 'center';
|
|
529
529
|
}, function (props) {
|
|
530
530
|
return props.theme.padding ? "box-sizing: border-box; padding: ".concat(props.theme.padding, ";") : "";
|
|
531
531
|
});
|
|
532
|
-
var LoadingOverlayGuidanceMessage = styled(GuidanceMessage)(templateObject_11$
|
|
533
|
-
var LoadingOverlayImageContainer = styled(OverlayImageContainer)(templateObject_12$
|
|
532
|
+
var LoadingOverlayGuidanceMessage = styled(GuidanceMessage)(templateObject_11$5 || (templateObject_11$5 = __makeTemplateObject(["\n padding: 16px 24px;\n margin-top: 16px;\n font-size: 18px;\n font-weight: bold;\n"], ["\n padding: 16px 24px;\n margin-top: 16px;\n font-size: 18px;\n font-weight: bold;\n"])));
|
|
533
|
+
var LoadingOverlayImageContainer = styled(OverlayImageContainer)(templateObject_12$5 || (templateObject_12$5 = __makeTemplateObject(["\n padding: 0;\n max-height: 100%;\n pointer-events: none;\n"], ["\n padding: 0;\n max-height: 100%;\n pointer-events: none;\n"])));
|
|
534
534
|
var LoadingOverlayProgressBarBackground = styled.div.attrs({
|
|
535
535
|
className: 'loading-overlay-progress-bar-background'
|
|
536
|
-
})(templateObject_13$
|
|
536
|
+
})(templateObject_13$5 || (templateObject_13$5 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"])));
|
|
537
537
|
var LoadingOverlayProgressBar = styled.span.attrs({
|
|
538
538
|
className: 'loading-overlay-progress-bar'
|
|
539
|
-
})(templateObject_14$
|
|
539
|
+
})(templateObject_14$2 || (templateObject_14$2 = __makeTemplateObject(["\n display: block;\n width: ", "%;\n height: 100%;\n left: 0;\n top: 0;\n position: absolute;\n"], ["\n display: block;\n width: ", "%;\n height: 100%;\n left: 0;\n top: 0;\n position: absolute;\n"])), function (props) {
|
|
540
540
|
return props.$progress;
|
|
541
541
|
});
|
|
542
542
|
var LoadingOverlayProgressIndicator = styled.span.attrs({
|
|
543
543
|
className: 'loading-overlay-progress-indicator'
|
|
544
|
-
})(templateObject_15$
|
|
545
|
-
var LoadingOverlayButtonsRow = styled(ButtonsRow$2)(templateObject_16$
|
|
546
|
-
var LoadingOverlayLoadingListContainer = styled.div(templateObject_17$
|
|
547
|
-
var LoadingOverlayLoadingList = styled.ul(templateObject_18$
|
|
548
|
-
var LoadingOverlayLoadingListItem = styled.li(templateObject_19$
|
|
549
|
-
var LoadingOverlayProgressContainer = styled.div(templateObject_20$
|
|
550
|
-
var LoadingOverlayCustomLoadingGraphic = styled.img(templateObject_21$
|
|
551
|
-
var LoadingOverlayContinueButtonContainer = styled.div(templateObject_22$
|
|
552
|
-
var templateObject_1$
|
|
544
|
+
})(templateObject_15$2 || (templateObject_15$2 = __makeTemplateObject(["\n display: block;\n height: 100%;\n animation: ", " 3s ease-in-out;\n animation-fill-mode: both;\n"], ["\n display: block;\n height: 100%;\n animation: ", " 3s ease-in-out;\n animation-fill-mode: both;\n"])), progressBarAnimation);
|
|
545
|
+
var LoadingOverlayButtonsRow = styled(ButtonsRow$2)(templateObject_16$2 || (templateObject_16$2 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n padding: 15px 25px;\n min-height: 100px;\n width: 100%;\n box-sizing: border-box;\n position: relative;\n"], ["\n display: flex;\n flex-direction: row;\n padding: 15px 25px;\n min-height: 100px;\n width: 100%;\n box-sizing: border-box;\n position: relative;\n"])));
|
|
546
|
+
var LoadingOverlayLoadingListContainer = styled.div(templateObject_17$2 || (templateObject_17$2 = __makeTemplateObject(["\n display: flex;\n position: relative;\n z-index: 2;\n"], ["\n display: flex;\n position: relative;\n z-index: 2;\n"])));
|
|
547
|
+
var LoadingOverlayLoadingList = styled.ul(templateObject_18$2 || (templateObject_18$2 = __makeTemplateObject(["\n display: block;\n margin: auto;\n list-style: none;\n padding: 0;\n"], ["\n display: block;\n margin: auto;\n list-style: none;\n padding: 0;\n"])));
|
|
548
|
+
var LoadingOverlayLoadingListItem = styled.li(templateObject_19$2 || (templateObject_19$2 = __makeTemplateObject(["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n padding: 2px 1.25rem 2px 0;\n line-height: 1rem;\n"], ["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n padding: 2px 1.25rem 2px 0;\n line-height: 1rem;\n"])));
|
|
549
|
+
var LoadingOverlayProgressContainer = styled.div(templateObject_20$2 || (templateObject_20$2 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"])));
|
|
550
|
+
var LoadingOverlayCustomLoadingGraphic = styled.img(templateObject_21$2 || (templateObject_21$2 = __makeTemplateObject(["\n transform-style: preserve-3d;\n"], ["\n transform-style: preserve-3d;\n"])));
|
|
551
|
+
var LoadingOverlayContinueButtonContainer = styled.div(templateObject_22$2 || (templateObject_22$2 = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
552
|
+
var templateObject_1$R, templateObject_2$M, templateObject_3$y, templateObject_4$s, templateObject_5$l, templateObject_6$d, templateObject_7$9, templateObject_8$8, templateObject_9$6, templateObject_10$5, templateObject_11$5, templateObject_12$5, templateObject_13$5, templateObject_14$2, templateObject_15$2, templateObject_16$2, templateObject_17$2, templateObject_18$2, templateObject_19$2, templateObject_20$2, templateObject_21$2, templateObject_22$2;
|
|
553
553
|
|
|
554
554
|
function _extends() {
|
|
555
555
|
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
@@ -1093,20 +1093,20 @@
|
|
|
1093
1093
|
onClick: onRetry
|
|
1094
1094
|
}, retryText))));
|
|
1095
1095
|
};
|
|
1096
|
-
var ErrorContainer = styled.div(templateObject_1$
|
|
1097
|
-
var ErrorIcon = styled.div(templateObject_2$
|
|
1098
|
-
var Heading$b = styled.h3(templateObject_3$
|
|
1099
|
-
var Message$1 = styled.p(templateObject_4$
|
|
1100
|
-
var StatusBadge$1 = styled.div(templateObject_5$
|
|
1101
|
-
var StatusLabel = styled.span(templateObject_6$
|
|
1102
|
-
var StatusValue = styled.span(templateObject_7$
|
|
1103
|
-
var DetailsSection = styled.div(templateObject_8$
|
|
1104
|
-
var DetailsHeader = styled.div(templateObject_9$
|
|
1105
|
-
var DetailsLabel = styled.span(templateObject_10$
|
|
1106
|
-
var CopyButton = styled.button(templateObject_11$
|
|
1107
|
-
var CodeBlock = styled.pre(templateObject_12$
|
|
1108
|
-
var RetryContainer = styled.div(templateObject_13$
|
|
1109
|
-
var templateObject_1$
|
|
1096
|
+
var ErrorContainer = styled.div(templateObject_1$Q || (templateObject_1$Q = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n max-width: 600px;\n width: 100%;\n padding: 24px;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,\n Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n max-width: 600px;\n width: 100%;\n padding: 24px;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,\n Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n"])));
|
|
1097
|
+
var ErrorIcon = styled.div(templateObject_2$L || (templateObject_2$L = __makeTemplateObject(["\n width: 48px;\n height: 48px;\n border-radius: 50%;\n background-color: #fee2e2;\n color: #dc2626;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 24px;\n font-weight: bold;\n margin-bottom: 16px;\n"], ["\n width: 48px;\n height: 48px;\n border-radius: 50%;\n background-color: #fee2e2;\n color: #dc2626;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 24px;\n font-weight: bold;\n margin-bottom: 16px;\n"])));
|
|
1098
|
+
var Heading$b = styled.h3(templateObject_3$x || (templateObject_3$x = __makeTemplateObject(["\n margin: 0 0 16px 0;\n font-size: 1.25rem;\n font-weight: 600;\n color: #1f2937;\n text-align: center;\n"], ["\n margin: 0 0 16px 0;\n font-size: 1.25rem;\n font-weight: 600;\n color: #1f2937;\n text-align: center;\n"])));
|
|
1099
|
+
var Message$1 = styled.p(templateObject_4$r || (templateObject_4$r = __makeTemplateObject(["\n margin: 0 0 16px 0;\n color: #6b7280;\n text-align: center;\n line-height: 1.5;\n"], ["\n margin: 0 0 16px 0;\n color: #6b7280;\n text-align: center;\n line-height: 1.5;\n"])));
|
|
1100
|
+
var StatusBadge$1 = styled.div(templateObject_5$k || (templateObject_5$k = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n gap: 8px;\n background-color: #fef2f2;\n border: 1px solid #fecaca;\n border-radius: 6px;\n padding: 6px 12px;\n margin-bottom: 20px;\n"], ["\n display: inline-flex;\n align-items: center;\n gap: 8px;\n background-color: #fef2f2;\n border: 1px solid #fecaca;\n border-radius: 6px;\n padding: 6px 12px;\n margin-bottom: 20px;\n"])));
|
|
1101
|
+
var StatusLabel = styled.span(templateObject_6$c || (templateObject_6$c = __makeTemplateObject(["\n font-size: 0.75rem;\n font-weight: 500;\n color: #991b1b;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n"], ["\n font-size: 0.75rem;\n font-weight: 500;\n color: #991b1b;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n"])));
|
|
1102
|
+
var StatusValue = styled.span(templateObject_7$8 || (templateObject_7$8 = __makeTemplateObject(["\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n font-size: 0.875rem;\n font-weight: 600;\n color: #dc2626;\n"], ["\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n font-size: 0.875rem;\n font-weight: 600;\n color: #dc2626;\n"])));
|
|
1103
|
+
var DetailsSection = styled.div(templateObject_8$7 || (templateObject_8$7 = __makeTemplateObject(["\n width: 100%;\n margin-bottom: 16px;\n"], ["\n width: 100%;\n margin-bottom: 16px;\n"])));
|
|
1104
|
+
var DetailsHeader = styled.div(templateObject_9$5 || (templateObject_9$5 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 8px;\n"], ["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 8px;\n"])));
|
|
1105
|
+
var DetailsLabel = styled.span(templateObject_10$4 || (templateObject_10$4 = __makeTemplateObject(["\n font-size: 0.75rem;\n font-weight: 500;\n color: #6b7280;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n"], ["\n font-size: 0.75rem;\n font-weight: 500;\n color: #6b7280;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n"])));
|
|
1106
|
+
var CopyButton = styled.button(templateObject_11$4 || (templateObject_11$4 = __makeTemplateObject(["\n background-color: #f3f4f6;\n border: 1px solid #d1d5db;\n border-radius: 4px;\n padding: 4px 10px;\n font-size: 0.75rem;\n font-weight: 500;\n color: #374151;\n cursor: pointer;\n transition: all 0.15s ease;\n\n &:hover {\n background-color: #e5e7eb;\n border-color: #9ca3af;\n }\n\n &:active {\n background-color: #d1d5db;\n }\n"], ["\n background-color: #f3f4f6;\n border: 1px solid #d1d5db;\n border-radius: 4px;\n padding: 4px 10px;\n font-size: 0.75rem;\n font-weight: 500;\n color: #374151;\n cursor: pointer;\n transition: all 0.15s ease;\n\n &:hover {\n background-color: #e5e7eb;\n border-color: #9ca3af;\n }\n\n &:active {\n background-color: #d1d5db;\n }\n"])));
|
|
1107
|
+
var CodeBlock = styled.pre(templateObject_12$4 || (templateObject_12$4 = __makeTemplateObject(["\n background-color: #1f2937;\n border-radius: 8px;\n padding: 16px;\n margin: 0;\n overflow-x: auto;\n max-height: 300px;\n overflow-y: auto;\n text-align: left;\n\n code {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n font-size: 0.8125rem;\n line-height: 1.6;\n color: #e5e7eb;\n white-space: pre-wrap;\n word-break: break-word;\n display: block;\n text-align: left;\n }\n"], ["\n background-color: #1f2937;\n border-radius: 8px;\n padding: 16px;\n margin: 0;\n overflow-x: auto;\n max-height: 300px;\n overflow-y: auto;\n text-align: left;\n\n code {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n font-size: 0.8125rem;\n line-height: 1.6;\n color: #e5e7eb;\n white-space: pre-wrap;\n word-break: break-word;\n display: block;\n text-align: left;\n }\n"])));
|
|
1108
|
+
var RetryContainer = styled.div(templateObject_13$4 || (templateObject_13$4 = __makeTemplateObject(["\n margin-top: 24px;\n"], ["\n margin-top: 24px;\n"])));
|
|
1109
|
+
var templateObject_1$Q, templateObject_2$L, templateObject_3$x, templateObject_4$r, templateObject_5$k, templateObject_6$c, templateObject_7$8, templateObject_8$7, templateObject_9$5, templateObject_10$4, templateObject_11$4, templateObject_12$4, templateObject_13$4;
|
|
1110
1110
|
|
|
1111
1111
|
var SessionIdMissingOverlay = function SessionIdMissingOverlay() {
|
|
1112
1112
|
return /*#__PURE__*/React.createElement(OverlayContainer, null, /*#__PURE__*/React.createElement(OverlayInner$2, {
|
|
@@ -9152,6 +9152,11 @@
|
|
|
9152
9152
|
};
|
|
9153
9153
|
});
|
|
9154
9154
|
}), function (obj) {
|
|
9155
|
+
// Skip boundary filtering for PDF417 - barcodes can be anywhere in frame,
|
|
9156
|
+
// especially during recapture when user zooms in on the barcode
|
|
9157
|
+
if (obj.label === 'PDF417') {
|
|
9158
|
+
return true;
|
|
9159
|
+
}
|
|
9155
9160
|
var _a = obj.box,
|
|
9156
9161
|
xMin = _a.xMin,
|
|
9157
9162
|
yMin = _a.yMin,
|
|
@@ -9313,8 +9318,8 @@
|
|
|
9313
9318
|
return [frameWidth, frameHeight];
|
|
9314
9319
|
}
|
|
9315
9320
|
|
|
9316
|
-
var InvisibleCanvasContainer = styled.div(templateObject_1$
|
|
9317
|
-
var InvisibleCanvas = styled.canvas(templateObject_2$
|
|
9321
|
+
var InvisibleCanvasContainer = styled.div(templateObject_1$P || (templateObject_1$P = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n user-select: none;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n user-select: none;\n"])));
|
|
9322
|
+
var InvisibleCanvas = styled.canvas(templateObject_2$K || (templateObject_2$K = __makeTemplateObject(["\n display: none;\n"], ["\n display: none;\n"])));
|
|
9318
9323
|
function drawToCanvas(canvas, frame, width, height) {
|
|
9319
9324
|
if (!canvas) return;
|
|
9320
9325
|
var ctx = canvas.getContext('2d');
|
|
@@ -9334,7 +9339,7 @@
|
|
|
9334
9339
|
var _a;
|
|
9335
9340
|
(_a = canvas === null || canvas === void 0 ? void 0 : canvas.getContext('2d')) === null || _a === void 0 ? void 0 : _a.clearRect(0, 0, canvas === null || canvas === void 0 ? void 0 : canvas.width, canvas === null || canvas === void 0 ? void 0 : canvas.height);
|
|
9336
9341
|
}
|
|
9337
|
-
var templateObject_1$
|
|
9342
|
+
var templateObject_1$P, templateObject_2$K;
|
|
9338
9343
|
|
|
9339
9344
|
function useFrameLoop(fn, options) {
|
|
9340
9345
|
if (options === void 0) {
|
|
@@ -9723,7 +9728,7 @@
|
|
|
9723
9728
|
}
|
|
9724
9729
|
return hasLocalStorageSupport;
|
|
9725
9730
|
};
|
|
9726
|
-
var localStorage = {
|
|
9731
|
+
var localStorage$1 = {
|
|
9727
9732
|
name: 'localStorage',
|
|
9728
9733
|
lookup: function lookup(options) {
|
|
9729
9734
|
var found;
|
|
@@ -9882,7 +9887,7 @@
|
|
|
9882
9887
|
this.i18nOptions = i18nOptions;
|
|
9883
9888
|
this.addDetector(cookie$1);
|
|
9884
9889
|
this.addDetector(querystring);
|
|
9885
|
-
this.addDetector(localStorage);
|
|
9890
|
+
this.addDetector(localStorage$1);
|
|
9886
9891
|
this.addDetector(sessionStorage);
|
|
9887
9892
|
this.addDetector(navigator$1);
|
|
9888
9893
|
this.addDetector(htmlTag);
|
|
@@ -13546,8 +13551,13 @@
|
|
|
13546
13551
|
if (!selectedVideoStreamId) return;
|
|
13547
13552
|
var srcObject = e.currentTarget.srcObject;
|
|
13548
13553
|
if (srcObject.id === selectedVideoStreamId) {
|
|
13554
|
+
var _a = e.currentTarget,
|
|
13555
|
+
videoWidth = _a.videoWidth,
|
|
13556
|
+
videoHeight = _a.videoHeight;
|
|
13549
13557
|
set({
|
|
13550
|
-
videoLoaded: true
|
|
13558
|
+
videoLoaded: true,
|
|
13559
|
+
videoWidth: videoWidth,
|
|
13560
|
+
videoHeight: videoHeight
|
|
13551
13561
|
});
|
|
13552
13562
|
} else {
|
|
13553
13563
|
set({
|
|
@@ -13860,26 +13870,25 @@
|
|
|
13860
13870
|
};
|
|
13861
13871
|
var CameraStoreContext = /*#__PURE__*/React.createContext(undefined);
|
|
13862
13872
|
function CameraStoreProvider(_a) {
|
|
13863
|
-
var _b;
|
|
13864
13873
|
var children = _a.children,
|
|
13865
|
-
|
|
13866
|
-
requestAccessAutomatically =
|
|
13867
|
-
|
|
13868
|
-
preferIphoneContinuityCamera =
|
|
13869
|
-
|
|
13870
|
-
preferFrontFacingCamera =
|
|
13871
|
-
|
|
13872
|
-
maxVideoWidth =
|
|
13874
|
+
_b = _a.requestAccessAutomatically,
|
|
13875
|
+
requestAccessAutomatically = _b === void 0 ? true : _b,
|
|
13876
|
+
_c = _a.preferIphoneContinuityCamera,
|
|
13877
|
+
preferIphoneContinuityCamera = _c === void 0 ? true : _c,
|
|
13878
|
+
_d = _a.preferFrontFacingCamera,
|
|
13879
|
+
preferFrontFacingCamera = _d === void 0 ? false : _d,
|
|
13880
|
+
_e = _a.maxVideoWidth,
|
|
13881
|
+
maxVideoWidth = _e === void 0 ? 1920 : _e,
|
|
13873
13882
|
maxFps = _a.maxFps,
|
|
13874
13883
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
13875
13884
|
onCameraTamperingDetected = _a.onCameraTamperingDetected,
|
|
13876
13885
|
onMicrophoneAccessDenied = _a.onMicrophoneAccessDenied,
|
|
13877
|
-
|
|
13878
|
-
requireMicrophoneAccess =
|
|
13879
|
-
|
|
13880
|
-
classNames =
|
|
13881
|
-
|
|
13882
|
-
verbiage =
|
|
13886
|
+
_f = _a.requireMicrophoneAccess,
|
|
13887
|
+
requireMicrophoneAccess = _f === void 0 ? false : _f,
|
|
13888
|
+
_g = _a.classNames,
|
|
13889
|
+
classNames = _g === void 0 ? {} : _g,
|
|
13890
|
+
_h = _a.verbiage,
|
|
13891
|
+
verbiage = _h === void 0 ? {} : _h;
|
|
13883
13892
|
var videoRef = React.useRef(null);
|
|
13884
13893
|
var store = React.useRef(undefined);
|
|
13885
13894
|
store.current || (store.current = createCameraStore({
|
|
@@ -13893,16 +13902,6 @@
|
|
|
13893
13902
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
13894
13903
|
requireMicrophoneAccess: requireMicrophoneAccess
|
|
13895
13904
|
}));
|
|
13896
|
-
var _k = (_b = videoRef.current) !== null && _b !== void 0 ? _b : {},
|
|
13897
|
-
videoWidth = _k.videoWidth,
|
|
13898
|
-
videoHeight = _k.videoHeight;
|
|
13899
|
-
React.useEffect(function () {
|
|
13900
|
-
var _a;
|
|
13901
|
-
(_a = store.current) === null || _a === void 0 ? void 0 : _a.setState({
|
|
13902
|
-
videoWidth: videoWidth,
|
|
13903
|
-
videoHeight: videoHeight
|
|
13904
|
-
});
|
|
13905
|
-
}, [videoWidth, videoHeight]);
|
|
13906
13905
|
React.useEffect(function () {
|
|
13907
13906
|
var _a, _b, _c;
|
|
13908
13907
|
var state = (_a = store.current) === null || _a === void 0 ? void 0 : _a.getState();
|
|
@@ -13991,14 +13990,14 @@
|
|
|
13991
13990
|
className: classNames.message
|
|
13992
13991
|
}, messageText)));
|
|
13993
13992
|
}
|
|
13994
|
-
var StyledOverlayInner$4 = styled(OverlayInner$2)(templateObject_1$
|
|
13995
|
-
var StyledOverlayHeading = styled.h3(templateObject_2$
|
|
13993
|
+
var StyledOverlayInner$4 = styled(OverlayInner$2)(templateObject_1$O || (templateObject_1$O = __makeTemplateObject(["\n justify-content: center;\n"], ["\n justify-content: center;\n"])));
|
|
13994
|
+
var StyledOverlayHeading = styled.h3(templateObject_2$J || (templateObject_2$J = __makeTemplateObject(["\n margin-bottom: 8px;\n"], ["\n margin-bottom: 8px;\n"])));
|
|
13996
13995
|
function useCameraStore(selector) {
|
|
13997
13996
|
var store = React.useContext(CameraStoreContext);
|
|
13998
13997
|
if (!store) throw new Error('useCameraStore cannot be used without Provider');
|
|
13999
13998
|
return useStore(store, selector);
|
|
14000
13999
|
}
|
|
14001
|
-
var templateObject_1$
|
|
14000
|
+
var templateObject_1$O, templateObject_2$J;
|
|
14002
14001
|
|
|
14003
14002
|
var DocumentDetectionModelContext = /*#__PURE__*/React.createContext({
|
|
14004
14003
|
startDocumentDetection: function startDocumentDetection() {
|
|
@@ -14837,9 +14836,9 @@
|
|
|
14837
14836
|
function analyzeBarcodeReadability(prediction, lastPredictionCanvas, croppedDocumentCanvas, bestBarcodeCanvas, currentBestBarcodeScore, documentDetectionThresholds, makeBarcodeReadabilityPrediction, barcodeReadabilityThreshold) {
|
|
14838
14837
|
return __awaiter(this, void 0, void 0, function () {
|
|
14839
14838
|
var pdf417PredictionTime, pdf417PredictionScore, pdf417PredictionThresholdMet, newBestBarcodeScore, newBestBarcodeDetails, documentCroppedPrediction, processedCroppedPrediction, pdf417Prediction;
|
|
14840
|
-
var _a;
|
|
14841
|
-
return __generator(this, function (
|
|
14842
|
-
switch (
|
|
14839
|
+
var _a, _b;
|
|
14840
|
+
return __generator(this, function (_c) {
|
|
14841
|
+
switch (_c.label) {
|
|
14843
14842
|
case 0:
|
|
14844
14843
|
pdf417PredictionTime = 0;
|
|
14845
14844
|
pdf417PredictionScore = 0;
|
|
@@ -14850,7 +14849,8 @@
|
|
|
14850
14849
|
pdf417PredictionScore: pdf417PredictionScore,
|
|
14851
14850
|
pdf417PredictionThresholdMet: pdf417PredictionThresholdMet,
|
|
14852
14851
|
newBestBarcodeScore: newBestBarcodeScore,
|
|
14853
|
-
newBestBarcodeDetails: newBestBarcodeDetails
|
|
14852
|
+
newBestBarcodeDetails: newBestBarcodeDetails,
|
|
14853
|
+
processedBarcodeBoundingBox: undefined
|
|
14854
14854
|
}];
|
|
14855
14855
|
}
|
|
14856
14856
|
/**
|
|
@@ -14860,7 +14860,7 @@
|
|
|
14860
14860
|
cropToDetectedObjectBox(lastPredictionCanvas, prediction.bestDocument.box, croppedDocumentCanvas);
|
|
14861
14861
|
return [4 /*yield*/, makeDocumentDetectorPrediction(croppedDocumentCanvas)];
|
|
14862
14862
|
case 1:
|
|
14863
|
-
documentCroppedPrediction =
|
|
14863
|
+
documentCroppedPrediction = _c.sent();
|
|
14864
14864
|
if (!documentCroppedPrediction) {
|
|
14865
14865
|
// error occurred during prediction (error logged by callee)
|
|
14866
14866
|
return [2 /*return*/, {
|
|
@@ -14868,7 +14868,8 @@
|
|
|
14868
14868
|
pdf417PredictionScore: pdf417PredictionScore,
|
|
14869
14869
|
pdf417PredictionThresholdMet: pdf417PredictionThresholdMet,
|
|
14870
14870
|
newBestBarcodeScore: newBestBarcodeScore,
|
|
14871
|
-
newBestBarcodeDetails: newBestBarcodeDetails
|
|
14871
|
+
newBestBarcodeDetails: newBestBarcodeDetails,
|
|
14872
|
+
processedBarcodeBoundingBox: undefined
|
|
14872
14873
|
}];
|
|
14873
14874
|
}
|
|
14874
14875
|
processedCroppedPrediction = processDocumentDetectorPrediction(documentCroppedPrediction, documentDetectionThresholds);
|
|
@@ -14898,7 +14899,9 @@
|
|
|
14898
14899
|
pdf417PredictionScore: pdf417PredictionScore,
|
|
14899
14900
|
pdf417PredictionThresholdMet: pdf417PredictionThresholdMet,
|
|
14900
14901
|
newBestBarcodeScore: newBestBarcodeScore,
|
|
14901
|
-
newBestBarcodeDetails: newBestBarcodeDetails
|
|
14902
|
+
newBestBarcodeDetails: newBestBarcodeDetails,
|
|
14903
|
+
// Return processed barcode bounding box for recapture tracking (valid even when not a new best)
|
|
14904
|
+
processedBarcodeBoundingBox: (_b = processedCroppedPrediction === null || processedCroppedPrediction === void 0 ? void 0 : processedCroppedPrediction.bestPDF417) === null || _b === void 0 ? void 0 : _b.box
|
|
14902
14905
|
}];
|
|
14903
14906
|
}
|
|
14904
14907
|
});
|
|
@@ -14989,6 +14992,18 @@
|
|
|
14989
14992
|
getBestBarcode: function getBestBarcode() {
|
|
14990
14993
|
return null;
|
|
14991
14994
|
},
|
|
14995
|
+
resetBestBarcode: function resetBestBarcode() {
|
|
14996
|
+
return null;
|
|
14997
|
+
},
|
|
14998
|
+
startBarcodeRecapturePhase: function startBarcodeRecapturePhase() {
|
|
14999
|
+
return null;
|
|
15000
|
+
},
|
|
15001
|
+
getInitialCaptureBestBarcode: function getInitialCaptureBestBarcode() {
|
|
15002
|
+
return null;
|
|
15003
|
+
},
|
|
15004
|
+
getRecaptureBestBarcode: function getRecaptureBestBarcode() {
|
|
15005
|
+
return null;
|
|
15006
|
+
},
|
|
14992
15007
|
requiredDocumentType: 'none',
|
|
14993
15008
|
setRequiredDocumentType: function setRequiredDocumentType() {
|
|
14994
15009
|
return null;
|
|
@@ -15048,6 +15063,14 @@
|
|
|
15048
15063
|
var bestBarcodeScore = React.useRef(0);
|
|
15049
15064
|
var stopDetection = React.useRef(0);
|
|
15050
15065
|
var analyzeBarcodeReadability = useBarcodeReadabilityAnalysis();
|
|
15066
|
+
// Barcode recapture tracking - separate canvases for initial and recapture sequences
|
|
15067
|
+
var initialCaptureBarcodeCanvas = React.useRef(null);
|
|
15068
|
+
var initialCaptureBarcodeDetails = React.useRef(null);
|
|
15069
|
+
var initialCaptureBarcodeScore = React.useRef(0);
|
|
15070
|
+
var recaptureBarcodeCanvas = React.useRef(null);
|
|
15071
|
+
var recaptureBarcodeDetails = React.useRef(null);
|
|
15072
|
+
var recaptureBarcodeScore = React.useRef(0);
|
|
15073
|
+
var isRecapturePhase = React.useRef(false);
|
|
15051
15074
|
var _h = React.useState('none'),
|
|
15052
15075
|
requiredDocumentType = _h[0],
|
|
15053
15076
|
setRequiredDocumentType = _h[1];
|
|
@@ -15072,10 +15095,10 @@
|
|
|
15072
15095
|
var _this = this;
|
|
15073
15096
|
onDocumentDetected(function (prediction) {
|
|
15074
15097
|
return __awaiter(_this, void 0, void 0, function () {
|
|
15075
|
-
var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, pdf417PredictionTime, pdf417PredictionScore, pdf417PredictionThresholdMet, isSinglePage, isRequiredDocumentType, focusPrediction, focusThresholdSet, focusThreshold, barcodeAnalysisResult;
|
|
15076
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
15077
|
-
return __generator(this, function (
|
|
15078
|
-
switch (
|
|
15098
|
+
var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, pdf417PredictionTime, pdf417PredictionScore, pdf417PredictionThresholdMet, isSinglePage, isRequiredDocumentType, isInRecapturePhase, shouldRunBarcodeAnalysisDuringRecapture, shouldRunBarcodeOnlyAnalysisDuringRecapture, focusPrediction, focusThresholdSet, focusThreshold, barcodeAnalysisResult, barcodeAnalysisResult, startTime, barcodeReadabilityResult;
|
|
15099
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
15100
|
+
return __generator(this, function (_m) {
|
|
15101
|
+
switch (_m.label) {
|
|
15079
15102
|
case 0:
|
|
15080
15103
|
if (!lastPredictionCanvas.current) return [2 /*return*/];
|
|
15081
15104
|
stopDetectionAtStart = stopDetection.current;
|
|
@@ -15089,21 +15112,28 @@
|
|
|
15089
15112
|
prediction.singlePageDetectionThresholdMet = false;
|
|
15090
15113
|
}
|
|
15091
15114
|
isRequiredDocumentType = requiredDocumentType === 'none' || prediction.detectedDocumentType === requiredDocumentType || ((_a = requiredDocumentType.includes) === null || _a === void 0 ? void 0 : _a.call(requiredDocumentType, prediction.detectedDocumentType)) || allowSinglePageIdCapture && isSinglePage && ((_b = requiredDocumentType.includes) === null || _b === void 0 ? void 0 : _b.call(requiredDocumentType, 'idCardFront'));
|
|
15092
|
-
|
|
15093
|
-
|
|
15115
|
+
isInRecapturePhase = isRecapturePhase.current;
|
|
15116
|
+
shouldRunBarcodeAnalysisDuringRecapture = isInRecapturePhase && isRequiredDocumentType && prediction.detectedDocumentType !== 'none' && prediction.detectionThresholdMet && prediction.bestDocument && prediction.bestPDF417;
|
|
15117
|
+
shouldRunBarcodeOnlyAnalysisDuringRecapture = isInRecapturePhase && !prediction.bestDocument && ((_c = prediction.bestPDF417) === null || _c === void 0 ? void 0 : _c.box);
|
|
15118
|
+
// Debug logging for recapture conditions
|
|
15119
|
+
if (isInRecapturePhase && ((_d = prediction.bestPDF417) === null || _d === void 0 ? void 0 : _d.box)) {
|
|
15120
|
+
log("[IdCaptureModelsProvider] Recapture debug: isRecapture=".concat(isInRecapturePhase, ", bestDocument=").concat(!!prediction.bestDocument, ", bestPDF417=").concat(!!((_e = prediction.bestPDF417) === null || _e === void 0 ? void 0 : _e.box), ", shouldRunBarcodeOnly=").concat(shouldRunBarcodeOnlyAnalysisDuringRecapture, ", shouldRunRelaxed=").concat(shouldRunBarcodeAnalysisDuringRecapture));
|
|
15121
|
+
}
|
|
15122
|
+
if (!(isRequiredDocumentType && prediction.detectedDocumentType !== 'none' && prediction.detectionThresholdMet && prediction.documentInBounds && !prediction.documentTooClose && prediction.documentIsStable)) return [3 /*break*/, 3];
|
|
15123
|
+
focusPrediction = makeFocusPrediction(lastPredictionCanvas.current, (_f = prediction.bestDocument) === null || _f === void 0 ? void 0 : _f.box);
|
|
15094
15124
|
if (focusPrediction) {
|
|
15095
15125
|
focusScore = focusPrediction.score;
|
|
15096
15126
|
focusPredictionTime = focusPrediction.predictionTime;
|
|
15097
15127
|
}
|
|
15098
|
-
focusThresholdSet = (
|
|
15099
|
-
focusThreshold = (
|
|
15128
|
+
focusThresholdSet = (_g = thresholds.focus) === null || _g === void 0 ? void 0 : _g[prediction.detectedDocumentType];
|
|
15129
|
+
focusThreshold = (_h = onMobile ? focusThresholdSet === null || focusThresholdSet === void 0 ? void 0 : focusThresholdSet.mobile : focusThresholdSet === null || focusThresholdSet === void 0 ? void 0 : focusThresholdSet.desktop) !== null && _h !== void 0 ? _h : 0;
|
|
15100
15130
|
focusThresholdMet = focusScore >= focusThreshold;
|
|
15101
15131
|
if (!(stopDetectionAtStart === stopDetection.current)) return [3 /*break*/, 2];
|
|
15102
15132
|
if (bestFocusScore.current <= focusScore) {
|
|
15103
15133
|
bestFocusScore.current = focusScore;
|
|
15104
15134
|
drawToCanvas(bestPredictionCanvas.current, lastPredictionCanvas.current);
|
|
15105
15135
|
bestFrameDetails.current = {
|
|
15106
|
-
boundingBox: (
|
|
15136
|
+
boundingBox: (_j = prediction.bestDocument) === null || _j === void 0 ? void 0 : _j.box,
|
|
15107
15137
|
documentType: prediction.detectedDocumentType,
|
|
15108
15138
|
detectionScore: prediction.detectionScore,
|
|
15109
15139
|
focusScore: focusScore
|
|
@@ -15112,7 +15142,7 @@
|
|
|
15112
15142
|
if (!(enableBarcodeReadabilityModel && prediction.bestDocument && prediction.bestPDF417 && croppedDocumentCanvas.current)) return [3 /*break*/, 2];
|
|
15113
15143
|
return [4 /*yield*/, analyzeBarcodeReadability(prediction, lastPredictionCanvas.current, croppedDocumentCanvas.current, bestBarcodeCanvas.current, bestBarcodeScore.current)];
|
|
15114
15144
|
case 1:
|
|
15115
|
-
barcodeAnalysisResult =
|
|
15145
|
+
barcodeAnalysisResult = _m.sent();
|
|
15116
15146
|
pdf417PredictionTime = barcodeAnalysisResult.pdf417PredictionTime;
|
|
15117
15147
|
pdf417PredictionScore = barcodeAnalysisResult.pdf417PredictionScore;
|
|
15118
15148
|
pdf417PredictionThresholdMet = barcodeAnalysisResult.pdf417PredictionThresholdMet;
|
|
@@ -15122,15 +15152,98 @@
|
|
|
15122
15152
|
if (barcodeAnalysisResult.newBestBarcodeDetails) {
|
|
15123
15153
|
bestBarcodeDetails.current = barcodeAnalysisResult.newBestBarcodeDetails;
|
|
15124
15154
|
}
|
|
15125
|
-
|
|
15155
|
+
// During recapture phase, also track best barcode separately for recapture sequence
|
|
15156
|
+
if (isRecapturePhase.current && recaptureBarcodeCanvas.current && pdf417PredictionScore > recaptureBarcodeScore.current) {
|
|
15157
|
+
log("[IdCaptureModelsProvider] Recapture tracking: new best score ".concat(pdf417PredictionScore, " (was ").concat(recaptureBarcodeScore.current, ")"));
|
|
15158
|
+
recaptureBarcodeScore.current = pdf417PredictionScore;
|
|
15159
|
+
// Create details directly from current prediction (not newBestBarcodeDetails which
|
|
15160
|
+
// is only set when score beats overall best, not just recapture best)
|
|
15161
|
+
recaptureBarcodeDetails.current = {
|
|
15162
|
+
boundingBox: prediction.bestPDF417.box,
|
|
15163
|
+
score: pdf417PredictionScore
|
|
15164
|
+
};
|
|
15165
|
+
// Crop barcode from croppedDocumentCanvas using the processed bounding box
|
|
15166
|
+
// (can't use bestBarcodeCanvas since it's only updated for overall best)
|
|
15167
|
+
if (croppedDocumentCanvas.current && barcodeAnalysisResult.processedBarcodeBoundingBox) {
|
|
15168
|
+
cropToDetectedObjectBox(croppedDocumentCanvas.current, barcodeAnalysisResult.processedBarcodeBoundingBox, recaptureBarcodeCanvas.current, 16);
|
|
15169
|
+
} else {
|
|
15170
|
+
log("[IdCaptureModelsProvider] Recapture tracking: could not crop barcode - croppedDocumentCanvas=".concat(!!croppedDocumentCanvas.current, ", processedBarcodeBoundingBox=").concat(!!barcodeAnalysisResult.processedBarcodeBoundingBox));
|
|
15171
|
+
}
|
|
15172
|
+
}
|
|
15173
|
+
_m.label = 2;
|
|
15126
15174
|
case 2:
|
|
15175
|
+
return [3 /*break*/, 7];
|
|
15176
|
+
case 3:
|
|
15177
|
+
if (!shouldRunBarcodeAnalysisDuringRecapture) return [3 /*break*/, 6];
|
|
15178
|
+
if (!(enableBarcodeReadabilityModel && croppedDocumentCanvas.current && stopDetectionAtStart === stopDetection.current)) return [3 /*break*/, 5];
|
|
15179
|
+
return [4 /*yield*/, analyzeBarcodeReadability(prediction, lastPredictionCanvas.current, croppedDocumentCanvas.current, bestBarcodeCanvas.current, bestBarcodeScore.current)];
|
|
15180
|
+
case 4:
|
|
15181
|
+
barcodeAnalysisResult = _m.sent();
|
|
15182
|
+
pdf417PredictionTime = barcodeAnalysisResult.pdf417PredictionTime;
|
|
15183
|
+
pdf417PredictionScore = barcodeAnalysisResult.pdf417PredictionScore;
|
|
15184
|
+
pdf417PredictionThresholdMet = barcodeAnalysisResult.pdf417PredictionThresholdMet;
|
|
15185
|
+
if (barcodeAnalysisResult.newBestBarcodeScore) {
|
|
15186
|
+
bestBarcodeScore.current = barcodeAnalysisResult.newBestBarcodeScore;
|
|
15187
|
+
}
|
|
15188
|
+
if (barcodeAnalysisResult.newBestBarcodeDetails) {
|
|
15189
|
+
bestBarcodeDetails.current = barcodeAnalysisResult.newBestBarcodeDetails;
|
|
15190
|
+
}
|
|
15191
|
+
// Track best barcode separately for recapture sequence
|
|
15192
|
+
if (recaptureBarcodeCanvas.current && pdf417PredictionScore > recaptureBarcodeScore.current) {
|
|
15193
|
+
log("[IdCaptureModelsProvider] Recapture tracking (relaxed): new best score ".concat(pdf417PredictionScore, " (was ").concat(recaptureBarcodeScore.current, ")"));
|
|
15194
|
+
recaptureBarcodeScore.current = pdf417PredictionScore;
|
|
15195
|
+
// Create details directly from current prediction (not newBestBarcodeDetails which
|
|
15196
|
+
// is only set when score beats overall best, not just recapture best)
|
|
15197
|
+
recaptureBarcodeDetails.current = {
|
|
15198
|
+
boundingBox: prediction.bestPDF417.box,
|
|
15199
|
+
score: pdf417PredictionScore
|
|
15200
|
+
};
|
|
15201
|
+
// Crop barcode from croppedDocumentCanvas using the processed bounding box
|
|
15202
|
+
// (can't use bestBarcodeCanvas since it's only updated for overall best)
|
|
15203
|
+
if (croppedDocumentCanvas.current && barcodeAnalysisResult.processedBarcodeBoundingBox) {
|
|
15204
|
+
cropToDetectedObjectBox(croppedDocumentCanvas.current, barcodeAnalysisResult.processedBarcodeBoundingBox, recaptureBarcodeCanvas.current, 16);
|
|
15205
|
+
} else {
|
|
15206
|
+
log("[IdCaptureModelsProvider] Recapture tracking (relaxed): could not crop barcode - croppedDocumentCanvas=".concat(!!croppedDocumentCanvas.current, ", processedBarcodeBoundingBox=").concat(!!barcodeAnalysisResult.processedBarcodeBoundingBox));
|
|
15207
|
+
}
|
|
15208
|
+
}
|
|
15209
|
+
_m.label = 5;
|
|
15210
|
+
case 5:
|
|
15211
|
+
return [3 /*break*/, 7];
|
|
15212
|
+
case 6:
|
|
15213
|
+
if (shouldRunBarcodeOnlyAnalysisDuringRecapture) {
|
|
15214
|
+
// During recapture when only PDF417 is detected (no document),
|
|
15215
|
+
// run barcode readability directly on the PDF417 box from the full frame
|
|
15216
|
+
log("[IdCaptureModelsProvider] Barcode-only recapture path: enableBarcodeReadabilityModel=".concat(enableBarcodeReadabilityModel, ", hasCanvas=").concat(!!lastPredictionCanvas.current, ", stopMatch=").concat(stopDetectionAtStart === stopDetection.current));
|
|
15217
|
+
if (enableBarcodeReadabilityModel && lastPredictionCanvas.current && stopDetectionAtStart === stopDetection.current) {
|
|
15218
|
+
startTime = performance.now();
|
|
15219
|
+
barcodeReadabilityResult = makeBarcodeReadabilityPrediction(lastPredictionCanvas.current, prediction.bestPDF417.box);
|
|
15220
|
+
log("[IdCaptureModelsProvider] Barcode-only readability result: ".concat((_k = barcodeReadabilityResult === null || barcodeReadabilityResult === void 0 ? void 0 : barcodeReadabilityResult.score) !== null && _k !== void 0 ? _k : 'null'));
|
|
15221
|
+
if (barcodeReadabilityResult) {
|
|
15222
|
+
pdf417PredictionTime = performance.now() - startTime;
|
|
15223
|
+
pdf417PredictionScore = barcodeReadabilityResult.score;
|
|
15224
|
+
// Track best barcode for recapture sequence
|
|
15225
|
+
if (recaptureBarcodeCanvas.current && pdf417PredictionScore > recaptureBarcodeScore.current) {
|
|
15226
|
+
log("[IdCaptureModelsProvider] Recapture tracking (barcode-only): new best score ".concat(pdf417PredictionScore, " (was ").concat(recaptureBarcodeScore.current, ")"));
|
|
15227
|
+
recaptureBarcodeScore.current = pdf417PredictionScore;
|
|
15228
|
+
recaptureBarcodeDetails.current = {
|
|
15229
|
+
boundingBox: prediction.bestPDF417.box,
|
|
15230
|
+
score: pdf417PredictionScore
|
|
15231
|
+
};
|
|
15232
|
+
// Crop barcode directly from full frame
|
|
15233
|
+
cropToDetectedObjectBox(lastPredictionCanvas.current, prediction.bestPDF417.box, recaptureBarcodeCanvas.current, 16);
|
|
15234
|
+
}
|
|
15235
|
+
}
|
|
15236
|
+
}
|
|
15237
|
+
}
|
|
15238
|
+
_m.label = 7;
|
|
15239
|
+
case 7:
|
|
15127
15240
|
/**
|
|
15128
15241
|
* @note
|
|
15129
15242
|
* This should ALWAYS be called.
|
|
15130
15243
|
* Do not return early from this function unless
|
|
15131
15244
|
* lastPredictionCanvas.current is not set
|
|
15132
15245
|
*/
|
|
15133
|
-
(
|
|
15246
|
+
(_l = onPredictionHandler.current) === null || _l === void 0 ? void 0 : _l.call(onPredictionHandler, _assign(_assign({}, prediction), {
|
|
15134
15247
|
focusScore: focusScore,
|
|
15135
15248
|
focusPredictionTime: focusPredictionTime,
|
|
15136
15249
|
focusThresholdMet: focusThresholdMet,
|
|
@@ -15163,19 +15276,80 @@
|
|
|
15163
15276
|
canvas: bestBarcodeCanvas.current
|
|
15164
15277
|
});
|
|
15165
15278
|
}, []);
|
|
15279
|
+
var resetBestBarcode = React.useCallback(function () {
|
|
15280
|
+
// Light-weight reset that only clears barcode tracking without disrupting detection
|
|
15281
|
+
bestBarcodeScore.current = 0;
|
|
15282
|
+
bestBarcodeDetails.current = null;
|
|
15283
|
+
// Also reset recapture tracking so early frames during move-closer window are ignored
|
|
15284
|
+
recaptureBarcodeScore.current = 0;
|
|
15285
|
+
recaptureBarcodeDetails.current = null;
|
|
15286
|
+
// Clear the canvas content but don't recreate it
|
|
15287
|
+
if (bestBarcodeCanvas.current) {
|
|
15288
|
+
var ctx = bestBarcodeCanvas.current.getContext('2d');
|
|
15289
|
+
if (ctx) {
|
|
15290
|
+
ctx.clearRect(0, 0, bestBarcodeCanvas.current.width, bestBarcodeCanvas.current.height);
|
|
15291
|
+
}
|
|
15292
|
+
}
|
|
15293
|
+
if (recaptureBarcodeCanvas.current) {
|
|
15294
|
+
var ctx = recaptureBarcodeCanvas.current.getContext('2d');
|
|
15295
|
+
if (ctx) {
|
|
15296
|
+
ctx.clearRect(0, 0, recaptureBarcodeCanvas.current.width, recaptureBarcodeCanvas.current.height);
|
|
15297
|
+
}
|
|
15298
|
+
}
|
|
15299
|
+
}, []);
|
|
15300
|
+
var startBarcodeRecapturePhase = React.useCallback(function () {
|
|
15301
|
+
log("[IdCaptureModelsProvider] Starting barcode recapture phase. Initial best score: ".concat(bestBarcodeScore.current));
|
|
15302
|
+
// Snapshot current best barcode to initial capture canvas
|
|
15303
|
+
if (bestBarcodeCanvas.current && initialCaptureBarcodeCanvas.current) {
|
|
15304
|
+
var ctx = initialCaptureBarcodeCanvas.current.getContext('2d');
|
|
15305
|
+
if (ctx) {
|
|
15306
|
+
initialCaptureBarcodeCanvas.current.width = bestBarcodeCanvas.current.width;
|
|
15307
|
+
initialCaptureBarcodeCanvas.current.height = bestBarcodeCanvas.current.height;
|
|
15308
|
+
ctx.drawImage(bestBarcodeCanvas.current, 0, 0);
|
|
15309
|
+
}
|
|
15310
|
+
}
|
|
15311
|
+
initialCaptureBarcodeDetails.current = bestBarcodeDetails.current ? _assign({}, bestBarcodeDetails.current) : null;
|
|
15312
|
+
initialCaptureBarcodeScore.current = bestBarcodeScore.current;
|
|
15313
|
+
// Reset recapture tracking
|
|
15314
|
+
recaptureBarcodeScore.current = 0;
|
|
15315
|
+
recaptureBarcodeDetails.current = null;
|
|
15316
|
+
// Enter recapture phase
|
|
15317
|
+
isRecapturePhase.current = true;
|
|
15318
|
+
}, []);
|
|
15319
|
+
var getInitialCaptureBestBarcode = React.useCallback(function () {
|
|
15320
|
+
if (!initialCaptureBarcodeDetails.current || !initialCaptureBarcodeCanvas.current) return null;
|
|
15321
|
+
return _assign(_assign({}, initialCaptureBarcodeDetails.current), {
|
|
15322
|
+
canvas: initialCaptureBarcodeCanvas.current
|
|
15323
|
+
});
|
|
15324
|
+
}, []);
|
|
15325
|
+
var getRecaptureBestBarcode = React.useCallback(function () {
|
|
15326
|
+
if (!recaptureBarcodeDetails.current || !recaptureBarcodeCanvas.current) return null;
|
|
15327
|
+
return _assign(_assign({}, recaptureBarcodeDetails.current), {
|
|
15328
|
+
canvas: recaptureBarcodeCanvas.current
|
|
15329
|
+
});
|
|
15330
|
+
}, []);
|
|
15166
15331
|
var _j = React.useState(0),
|
|
15167
15332
|
canvasKey = _j[0],
|
|
15168
15333
|
setCanvasKey = _j[1];
|
|
15169
15334
|
var resetBestFrame = React.useCallback(function () {
|
|
15335
|
+
// During recapture phase, preserve all canvas state to avoid race conditions
|
|
15336
|
+
// that could result in black/empty barcode images on slow devices
|
|
15337
|
+
if (isRecapturePhase.current) {
|
|
15338
|
+
return;
|
|
15339
|
+
}
|
|
15170
15340
|
stopDetection.current += 1;
|
|
15171
|
-
setCanvasKey(function (n) {
|
|
15172
|
-
return n + 1;
|
|
15173
|
-
});
|
|
15174
15341
|
clearDocumentDetectionLastPredictionCanvas();
|
|
15175
15342
|
bestFrameDetails.current = null;
|
|
15176
15343
|
bestFocusScore.current = 0;
|
|
15177
15344
|
bestBarcodeScore.current = 0;
|
|
15178
15345
|
bestBarcodeDetails.current = null;
|
|
15346
|
+
setCanvasKey(function (n) {
|
|
15347
|
+
return n + 1;
|
|
15348
|
+
});
|
|
15349
|
+
initialCaptureBarcodeScore.current = 0;
|
|
15350
|
+
initialCaptureBarcodeDetails.current = null;
|
|
15351
|
+
recaptureBarcodeScore.current = 0;
|
|
15352
|
+
recaptureBarcodeDetails.current = null;
|
|
15179
15353
|
}, [clearDocumentDetectionLastPredictionCanvas]);
|
|
15180
15354
|
React.useEffect(function () {
|
|
15181
15355
|
if (requiredDocumentType) resetBestFrame();
|
|
@@ -15241,10 +15415,14 @@
|
|
|
15241
15415
|
bestFrameDetails: bestFrameDetails,
|
|
15242
15416
|
bestBarcodeDetails: bestBarcodeDetails,
|
|
15243
15417
|
getBestBarcode: getBestBarcode,
|
|
15418
|
+
resetBestBarcode: resetBestBarcode,
|
|
15419
|
+
startBarcodeRecapturePhase: startBarcodeRecapturePhase,
|
|
15420
|
+
getInitialCaptureBestBarcode: getInitialCaptureBestBarcode,
|
|
15421
|
+
getRecaptureBestBarcode: getRecaptureBestBarcode,
|
|
15244
15422
|
requiredDocumentType: requiredDocumentType,
|
|
15245
15423
|
setRequiredDocumentType: setRequiredDocumentType
|
|
15246
15424
|
};
|
|
15247
|
-
}, [ready, modelDownloadProgress, modelLoadState, modelWarmingStartedAt, modelError, startDocumentDetection, stopDocumentDetection, load, thresholds, setThresholds, documentDetectionBoundaries, setDocumentDetectionBoundaries, onPredictionMade, detectionTime, focusPredictionTime, barcodeReadabilityPredictionTime, getBestFrame, resetBestFrame, getBestBarcode, requiredDocumentType]);
|
|
15425
|
+
}, [ready, modelDownloadProgress, modelLoadState, modelWarmingStartedAt, modelError, startDocumentDetection, stopDocumentDetection, load, thresholds, setThresholds, documentDetectionBoundaries, setDocumentDetectionBoundaries, onPredictionMade, detectionTime, focusPredictionTime, barcodeReadabilityPredictionTime, getBestFrame, resetBestFrame, getBestBarcode, resetBestBarcode, startBarcodeRecapturePhase, getInitialCaptureBestBarcode, getRecaptureBestBarcode, requiredDocumentType]);
|
|
15248
15426
|
return /*#__PURE__*/React.createElement(IdCaptureModelsContext.Provider, {
|
|
15249
15427
|
value: value
|
|
15250
15428
|
}, /*#__PURE__*/React.createElement(InvisibleCanvasContainer, null, /*#__PURE__*/React.createElement(InvisibleCanvas, {
|
|
@@ -15256,6 +15434,12 @@
|
|
|
15256
15434
|
}), /*#__PURE__*/React.createElement(InvisibleCanvas, {
|
|
15257
15435
|
key: "cd-".concat(canvasKey),
|
|
15258
15436
|
ref: croppedDocumentCanvas
|
|
15437
|
+
}), /*#__PURE__*/React.createElement(InvisibleCanvas, {
|
|
15438
|
+
key: "icb-".concat(canvasKey),
|
|
15439
|
+
ref: initialCaptureBarcodeCanvas
|
|
15440
|
+
}), /*#__PURE__*/React.createElement(InvisibleCanvas, {
|
|
15441
|
+
key: "rcb-".concat(canvasKey),
|
|
15442
|
+
ref: recaptureBarcodeCanvas
|
|
15259
15443
|
})), children);
|
|
15260
15444
|
}
|
|
15261
15445
|
function IdCaptureModelsProvider(_a) {
|
|
@@ -15713,6 +15897,8 @@
|
|
|
15713
15897
|
singlePageDetectionThresholdMet: false,
|
|
15714
15898
|
focusScore: 0,
|
|
15715
15899
|
focusThresholdMet: false,
|
|
15900
|
+
pdf417PredictionScore: 0,
|
|
15901
|
+
pdf417PredictionThresholdMet: false,
|
|
15716
15902
|
isGoodFrame: false,
|
|
15717
15903
|
goodFramesCount: 0,
|
|
15718
15904
|
goodFramesThreshold: 3,
|
|
@@ -15734,30 +15920,47 @@
|
|
|
15734
15920
|
uploadingDocumentsType: null,
|
|
15735
15921
|
operationStartedAt: null,
|
|
15736
15922
|
captureStartedAt: null,
|
|
15923
|
+
barcodeRecaptureStartedAt: null,
|
|
15924
|
+
initialBarcodeScore: 0,
|
|
15925
|
+
recaptureBarcodeScore: null,
|
|
15926
|
+
barcodeRecaptureThreshold: 0,
|
|
15927
|
+
barcodeRecaptureTimeoutMs: 5000,
|
|
15928
|
+
initialCaptureBarcodeImage: null,
|
|
15929
|
+
recaptureBarcodeImage: null,
|
|
15930
|
+
clientBarcodeScanEnabled: false,
|
|
15931
|
+
clientBarcodeScanActive: false,
|
|
15932
|
+
clientBarcodeDecodeResult: null,
|
|
15933
|
+
nativeBarcodeDecodeResult: null,
|
|
15934
|
+
nativeBarcodeDecoding: false,
|
|
15737
15935
|
dispatch: function dispatch() {
|
|
15738
15936
|
return null;
|
|
15739
15937
|
}
|
|
15740
15938
|
};
|
|
15741
15939
|
var _reducer = function reducer(state, action) {
|
|
15742
15940
|
var _a;
|
|
15941
|
+
var _b, _c;
|
|
15743
15942
|
switch (action.type) {
|
|
15744
15943
|
case 'configureWizard':
|
|
15745
15944
|
{
|
|
15746
|
-
var
|
|
15747
|
-
captureRequirement =
|
|
15748
|
-
precapturedDocuments =
|
|
15749
|
-
allowSinglePageIdCapture =
|
|
15750
|
-
allowIdCardBackToFrontCapture =
|
|
15751
|
-
enableOverrideWrongDocumentTypeDialog =
|
|
15752
|
-
allowOverrideWrongDocumentTypeAfterMs =
|
|
15753
|
-
allowUploadingDocumentsFromStorage =
|
|
15945
|
+
var _d = action.payload,
|
|
15946
|
+
captureRequirement = _d.captureRequirement,
|
|
15947
|
+
precapturedDocuments = _d.precapturedDocuments,
|
|
15948
|
+
allowSinglePageIdCapture = _d.allowSinglePageIdCapture,
|
|
15949
|
+
allowIdCardBackToFrontCapture = _d.allowIdCardBackToFrontCapture,
|
|
15950
|
+
enableOverrideWrongDocumentTypeDialog = _d.enableOverrideWrongDocumentTypeDialog,
|
|
15951
|
+
allowOverrideWrongDocumentTypeAfterMs = _d.allowOverrideWrongDocumentTypeAfterMs,
|
|
15952
|
+
allowUploadingDocumentsFromStorage = _d.allowUploadingDocumentsFromStorage,
|
|
15953
|
+
barcodeRecaptureThreshold = _d.barcodeRecaptureThreshold,
|
|
15954
|
+
barcodeRecaptureTimeoutMs = _d.barcodeRecaptureTimeoutMs;
|
|
15754
15955
|
var newState = _assign(_assign({}, state), {
|
|
15755
15956
|
captureRequirement: captureRequirement,
|
|
15756
15957
|
allowSinglePageIdCapture: allowSinglePageIdCapture !== null && allowSinglePageIdCapture !== void 0 ? allowSinglePageIdCapture : false,
|
|
15757
15958
|
allowIdCardBackToFrontCapture: allowIdCardBackToFrontCapture !== null && allowIdCardBackToFrontCapture !== void 0 ? allowIdCardBackToFrontCapture : false,
|
|
15758
15959
|
enableOverrideWrongDocumentTypeDialog: enableOverrideWrongDocumentTypeDialog,
|
|
15759
15960
|
allowOverrideWrongDocumentTypeAfterMs: allowOverrideWrongDocumentTypeAfterMs,
|
|
15760
|
-
allowUploadingDocumentsFromStorage: allowUploadingDocumentsFromStorage
|
|
15961
|
+
allowUploadingDocumentsFromStorage: allowUploadingDocumentsFromStorage,
|
|
15962
|
+
barcodeRecaptureThreshold: barcodeRecaptureThreshold !== null && barcodeRecaptureThreshold !== void 0 ? barcodeRecaptureThreshold : 0,
|
|
15963
|
+
barcodeRecaptureTimeoutMs: barcodeRecaptureTimeoutMs !== null && barcodeRecaptureTimeoutMs !== void 0 ? barcodeRecaptureTimeoutMs : 5000
|
|
15761
15964
|
});
|
|
15762
15965
|
if (captureRequirement === 'idCardBack') newState.requestedDocumentType = 'idCardBack';
|
|
15763
15966
|
if (captureRequirement === 'passport') newState.requestedDocumentType = 'passport';
|
|
@@ -15814,26 +16017,28 @@
|
|
|
15814
16017
|
});
|
|
15815
16018
|
case 'objectsDetected':
|
|
15816
16019
|
{
|
|
15817
|
-
var
|
|
15818
|
-
detectedObjects =
|
|
15819
|
-
detectionThresholdMet =
|
|
15820
|
-
detectedDocumentType =
|
|
15821
|
-
idCardFrontDetectionScore =
|
|
15822
|
-
idCardFrontDetectionThresholdMet =
|
|
15823
|
-
idCardBackDetectionScore =
|
|
15824
|
-
idCardBackDetectionThresholdMet =
|
|
15825
|
-
passportDetectionScore =
|
|
15826
|
-
passportDetectionThresholdMet =
|
|
15827
|
-
singlePageDetectionScore =
|
|
15828
|
-
singlePageDetectionThresholdMet =
|
|
15829
|
-
bestDocument =
|
|
15830
|
-
documentInBounds =
|
|
15831
|
-
documentTooClose =
|
|
15832
|
-
documentIsStable =
|
|
15833
|
-
focusScore =
|
|
15834
|
-
focusThresholdMet =
|
|
15835
|
-
|
|
15836
|
-
|
|
16020
|
+
var _e = action.payload.prediction,
|
|
16021
|
+
detectedObjects = _e.detectedObjects,
|
|
16022
|
+
detectionThresholdMet = _e.detectionThresholdMet,
|
|
16023
|
+
detectedDocumentType = _e.detectedDocumentType,
|
|
16024
|
+
idCardFrontDetectionScore = _e.idCardFrontDetectionScore,
|
|
16025
|
+
idCardFrontDetectionThresholdMet = _e.idCardFrontDetectionThresholdMet,
|
|
16026
|
+
idCardBackDetectionScore = _e.idCardBackDetectionScore,
|
|
16027
|
+
idCardBackDetectionThresholdMet = _e.idCardBackDetectionThresholdMet,
|
|
16028
|
+
passportDetectionScore = _e.passportDetectionScore,
|
|
16029
|
+
passportDetectionThresholdMet = _e.passportDetectionThresholdMet,
|
|
16030
|
+
singlePageDetectionScore = _e.singlePageDetectionScore,
|
|
16031
|
+
singlePageDetectionThresholdMet = _e.singlePageDetectionThresholdMet,
|
|
16032
|
+
bestDocument = _e.bestDocument,
|
|
16033
|
+
documentInBounds = _e.documentInBounds,
|
|
16034
|
+
documentTooClose = _e.documentTooClose,
|
|
16035
|
+
documentIsStable = _e.documentIsStable,
|
|
16036
|
+
focusScore = _e.focusScore,
|
|
16037
|
+
focusThresholdMet = _e.focusThresholdMet,
|
|
16038
|
+
pdf417PredictionScore = _e.pdf417PredictionScore,
|
|
16039
|
+
pdf417PredictionThresholdMet = _e.pdf417PredictionThresholdMet,
|
|
16040
|
+
frameWidth = _e.frameWidth,
|
|
16041
|
+
frameHeight = _e.frameHeight;
|
|
15837
16042
|
var frameCapturedAt = new Date();
|
|
15838
16043
|
var frameCaptureRate = 0;
|
|
15839
16044
|
var goodFramesThreshold = state.goodFramesThreshold;
|
|
@@ -15913,6 +16118,8 @@
|
|
|
15913
16118
|
singlePageDetectionThresholdMet: singlePageDetectionThresholdMet,
|
|
15914
16119
|
focusScore: focusScore,
|
|
15915
16120
|
focusThresholdMet: focusThresholdMet,
|
|
16121
|
+
pdf417PredictionScore: pdf417PredictionScore,
|
|
16122
|
+
pdf417PredictionThresholdMet: pdf417PredictionThresholdMet,
|
|
15916
16123
|
isGoodFrame: isGoodFrame,
|
|
15917
16124
|
goodFramesCount: goodFramesCount,
|
|
15918
16125
|
goodFramesThreshold: goodFramesThreshold,
|
|
@@ -15966,7 +16173,21 @@
|
|
|
15966
16173
|
});
|
|
15967
16174
|
var remainingRequirements = remainingIdCaptureRequirements(state.captureRequirement, newState.capturedDocuments, state.requestedDocumentType);
|
|
15968
16175
|
if (remainingRequirements.length === 0) {
|
|
15969
|
-
|
|
16176
|
+
// Check if we just captured ID back and need barcode recapture
|
|
16177
|
+
var justCapturedIdBack = action.payload.documentType === 'idCardBack';
|
|
16178
|
+
var barcodeScore = (_c = (_b = state.capturedDocuments.idBarcodeImage) === null || _b === void 0 ? void 0 : _b.barcodeReadabilityScore) !== null && _c !== void 0 ? _c : 0;
|
|
16179
|
+
// Note: We no longer skip recapture when Dynamsoft has decoded a barcode.
|
|
16180
|
+
// This allows the recapture flow to continue and capture a good barcode
|
|
16181
|
+
// image for comparison with native decoder results.
|
|
16182
|
+
var needsBarcodeRecapture = justCapturedIdBack && state.barcodeRecaptureThreshold > 0 && barcodeScore < state.barcodeRecaptureThreshold;
|
|
16183
|
+
if (needsBarcodeRecapture) {
|
|
16184
|
+
// Skip 'complete' and go directly to barcode recapture
|
|
16185
|
+
newState.captureState = 'requestingBetterBarcode';
|
|
16186
|
+
newState.barcodeRecaptureStartedAt = new Date();
|
|
16187
|
+
newState.initialBarcodeScore = barcodeScore;
|
|
16188
|
+
} else {
|
|
16189
|
+
newState.captureState = 'complete';
|
|
16190
|
+
}
|
|
15970
16191
|
} else {
|
|
15971
16192
|
newState.requestedDocumentType = remainingRequirements[0];
|
|
15972
16193
|
if (state.requestedDocumentType === 'idCardFront' && newState.requestedDocumentType === 'idCardBack' || state.requestedDocumentType === 'idCardBack' && newState.requestedDocumentType === 'idCardFront') {
|
|
@@ -15993,8 +16214,8 @@
|
|
|
15993
16214
|
case 'documentsCaptured':
|
|
15994
16215
|
{
|
|
15995
16216
|
var newState = _assign({}, state);
|
|
15996
|
-
for (var
|
|
15997
|
-
var doc =
|
|
16217
|
+
for (var _f = 0, _g = action.payload; _f < _g.length; _f++) {
|
|
16218
|
+
var doc = _g[_f];
|
|
15998
16219
|
newState = _reducer(newState, {
|
|
15999
16220
|
type: 'documentCaptured',
|
|
16000
16221
|
payload: doc
|
|
@@ -16044,13 +16265,91 @@
|
|
|
16044
16265
|
requestedDocumentType: requestedDocumentType
|
|
16045
16266
|
});
|
|
16046
16267
|
}
|
|
16268
|
+
case 'barcodeRecaptureStarted':
|
|
16269
|
+
return _assign(_assign({}, state), {
|
|
16270
|
+
captureState: 'requestingBetterBarcode',
|
|
16271
|
+
barcodeRecaptureStartedAt: new Date(),
|
|
16272
|
+
initialBarcodeScore: action.payload.initialBarcodeScore,
|
|
16273
|
+
initialCaptureBarcodeImage: action.payload.initialCaptureBarcodeImage,
|
|
16274
|
+
recaptureBarcodeScore: null,
|
|
16275
|
+
recaptureBarcodeImage: null,
|
|
16276
|
+
goodFramesCount: 0,
|
|
16277
|
+
capturing: false
|
|
16278
|
+
});
|
|
16279
|
+
case 'barcodeRecaptureScoreUpdated':
|
|
16280
|
+
return _assign(_assign({}, state), {
|
|
16281
|
+
recaptureBarcodeScore: action.payload.recaptureBarcodeScore
|
|
16282
|
+
});
|
|
16283
|
+
case 'recaptureBarcodeImageCaptured':
|
|
16284
|
+
return _assign(_assign({}, state), {
|
|
16285
|
+
recaptureBarcodeImage: action.payload.recaptureBarcodeImage
|
|
16286
|
+
});
|
|
16287
|
+
case 'barcodeRecaptureCompleted':
|
|
16288
|
+
return _assign(_assign({}, state), {
|
|
16289
|
+
captureState: 'complete',
|
|
16290
|
+
barcodeRecaptureStartedAt: null
|
|
16291
|
+
});
|
|
16047
16292
|
case 'resetWizard':
|
|
16048
16293
|
return _assign(_assign({}, initialState$5), {
|
|
16049
16294
|
dispatch: state.dispatch,
|
|
16295
|
+
// Preserve all configuration values
|
|
16296
|
+
captureRequirement: state.captureRequirement,
|
|
16297
|
+
allowSinglePageIdCapture: state.allowSinglePageIdCapture,
|
|
16298
|
+
allowIdCardBackToFrontCapture: state.allowIdCardBackToFrontCapture,
|
|
16299
|
+
enableOverrideWrongDocumentTypeDialog: state.enableOverrideWrongDocumentTypeDialog,
|
|
16300
|
+
allowOverrideWrongDocumentTypeAfterMs: state.allowOverrideWrongDocumentTypeAfterMs,
|
|
16050
16301
|
allowUploadingDocumentsFromStorage: state.allowUploadingDocumentsFromStorage,
|
|
16302
|
+
barcodeRecaptureThreshold: state.barcodeRecaptureThreshold,
|
|
16303
|
+
barcodeRecaptureTimeoutMs: state.barcodeRecaptureTimeoutMs,
|
|
16304
|
+
clientBarcodeScanEnabled: state.clientBarcodeScanEnabled,
|
|
16305
|
+
// Reset capture-specific state
|
|
16051
16306
|
captureState: state.allowUploadingDocumentsFromStorage ? 'initializing' : 'capturing',
|
|
16052
|
-
|
|
16053
|
-
|
|
16307
|
+
barcodeRecaptureStartedAt: null,
|
|
16308
|
+
initialBarcodeScore: 0,
|
|
16309
|
+
recaptureBarcodeScore: null,
|
|
16310
|
+
initialCaptureBarcodeImage: null,
|
|
16311
|
+
recaptureBarcodeImage: null,
|
|
16312
|
+
clientBarcodeScanActive: false,
|
|
16313
|
+
clientBarcodeDecodeResult: null,
|
|
16314
|
+
nativeBarcodeDecodeResult: null,
|
|
16315
|
+
nativeBarcodeDecoding: false
|
|
16316
|
+
});
|
|
16317
|
+
case 'configureClientBarcodeScan':
|
|
16318
|
+
return _assign(_assign({}, state), {
|
|
16319
|
+
clientBarcodeScanEnabled: action.payload.enabled
|
|
16320
|
+
});
|
|
16321
|
+
case 'clientBarcodeScanStarted':
|
|
16322
|
+
return _assign(_assign({}, state), {
|
|
16323
|
+
clientBarcodeScanActive: true,
|
|
16324
|
+
clientBarcodeDecodeResult: null
|
|
16325
|
+
});
|
|
16326
|
+
case 'clientBarcodeScanStopped':
|
|
16327
|
+
return _assign(_assign({}, state), {
|
|
16328
|
+
clientBarcodeScanActive: false
|
|
16329
|
+
});
|
|
16330
|
+
case 'clientBarcodeDecoded':
|
|
16331
|
+
return _assign(_assign({}, state), {
|
|
16332
|
+
clientBarcodeDecodeResult: action.payload,
|
|
16333
|
+
clientBarcodeScanActive: false
|
|
16334
|
+
});
|
|
16335
|
+
case 'clientBarcodeDecodeReset':
|
|
16336
|
+
return _assign(_assign({}, state), {
|
|
16337
|
+
clientBarcodeDecodeResult: null
|
|
16338
|
+
});
|
|
16339
|
+
case 'nativeBarcodeDecodeStarted':
|
|
16340
|
+
return _assign(_assign({}, state), {
|
|
16341
|
+
nativeBarcodeDecoding: true,
|
|
16342
|
+
nativeBarcodeDecodeResult: null
|
|
16343
|
+
});
|
|
16344
|
+
case 'nativeBarcodeDecoded':
|
|
16345
|
+
return _assign(_assign({}, state), {
|
|
16346
|
+
nativeBarcodeDecoding: false,
|
|
16347
|
+
nativeBarcodeDecodeResult: action.payload
|
|
16348
|
+
});
|
|
16349
|
+
case 'nativeBarcodeDecodeFailed':
|
|
16350
|
+
return _assign(_assign({}, state), {
|
|
16351
|
+
nativeBarcodeDecoding: false,
|
|
16352
|
+
nativeBarcodeDecodeResult: null
|
|
16054
16353
|
});
|
|
16055
16354
|
default:
|
|
16056
16355
|
return state;
|
|
@@ -16106,12 +16405,12 @@
|
|
|
16106
16405
|
if (!portalLocation) return element;
|
|
16107
16406
|
return /*#__PURE__*/reactDom.createPortal(element, portalLocation);
|
|
16108
16407
|
}
|
|
16109
|
-
var DebugStatsPaneDiv = styled.span(templateObject_1$
|
|
16110
|
-
var ObjectDetectionDebugOverlayDiv = styled.div(templateObject_2$
|
|
16408
|
+
var DebugStatsPaneDiv = styled.span(templateObject_1$N || (templateObject_1$N = __makeTemplateObject(["\n font-size: 16px;\n font-family: monospace;\n position: absolute;\n left: 20px;\n bottom: 20px;\n margin-right: 20px;\n padding: 8px;\n color: limegreen;\n background: rgba(0, 0, 0, 0.5);\n z-index: 10002;\n pointer-events: none;\n"], ["\n font-size: 16px;\n font-family: monospace;\n position: absolute;\n left: 20px;\n bottom: 20px;\n margin-right: 20px;\n padding: 8px;\n color: limegreen;\n background: rgba(0, 0, 0, 0.5);\n z-index: 10002;\n pointer-events: none;\n"])));
|
|
16409
|
+
var ObjectDetectionDebugOverlayDiv = styled.div(templateObject_2$I || (templateObject_2$I = __makeTemplateObject(["\n position: absolute;\n z-index: 1001;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n max-width: 100%;\n max-height: 100%;\n overflow: hidden;\n pointer-events: none;\n ", "\n transform-style: preserve-3d;\n"], ["\n position: absolute;\n z-index: 1001;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n max-width: 100%;\n max-height: 100%;\n overflow: hidden;\n pointer-events: none;\n ", "\n transform-style: preserve-3d;\n"])), function (_a) {
|
|
16111
16410
|
var $flipX = _a.$flipX;
|
|
16112
16411
|
return $flipX ? 'transform: scaleX(-1);' : '';
|
|
16113
16412
|
});
|
|
16114
|
-
var ObjectDetectionDebugBox = styled.div(templateObject_3$
|
|
16413
|
+
var ObjectDetectionDebugBox = styled.div(templateObject_3$w || (templateObject_3$w = __makeTemplateObject(["\n font: 10px monospace;\n position: absolute;\n border: 3px solid ", ";\n color: ", ";\n ", "\n transform-style: preserve-3d;\n"], ["\n font: 10px monospace;\n position: absolute;\n border: 3px solid ", ";\n color: ", ";\n ", "\n transform-style: preserve-3d;\n"])), function (_a) {
|
|
16115
16414
|
var $color = _a.$color;
|
|
16116
16415
|
return $color !== null && $color !== void 0 ? $color : 'green';
|
|
16117
16416
|
}, function (_a) {
|
|
@@ -16121,7 +16420,11 @@
|
|
|
16121
16420
|
var $flipX = _a.$flipX;
|
|
16122
16421
|
return $flipX ? 'transform: scaleX(-1);' : '';
|
|
16123
16422
|
});
|
|
16124
|
-
var
|
|
16423
|
+
var ObjectDetectionDebugLabel = styled.span(templateObject_4$q || (templateObject_4$q = __makeTemplateObject(["\n position: absolute;\n top: -1px;\n left: -1px;\n background: ", ";\n color: black;\n font: bold 9px monospace;\n padding: 1px 3px;\n white-space: nowrap;\n transform: translateY(-100%);\n"], ["\n position: absolute;\n top: -1px;\n left: -1px;\n background: ", ";\n color: black;\n font: bold 9px monospace;\n padding: 1px 3px;\n white-space: nowrap;\n transform: translateY(-100%);\n"])), function (_a) {
|
|
16424
|
+
var $color = _a.$color;
|
|
16425
|
+
return $color !== null && $color !== void 0 ? $color : 'green';
|
|
16426
|
+
});
|
|
16427
|
+
var FaceDetectionKeypointMarker = styled.div(templateObject_5$j || (templateObject_5$j = __makeTemplateObject(["\n position: absolute;\n width: 4px;\n height: 4px;\n border: 2px solid ", ";\n font: 10px monospace;\n color: ", ";\n border-radius: 50%;\n ", "\n transform-style: preserve-3d;\n"], ["\n position: absolute;\n width: 4px;\n height: 4px;\n border: 2px solid ", ";\n font: 10px monospace;\n color: ", ";\n border-radius: 50%;\n ", "\n transform-style: preserve-3d;\n"])), function (_a) {
|
|
16125
16428
|
var $color = _a.$color;
|
|
16126
16429
|
return $color !== null && $color !== void 0 ? $color : 'red';
|
|
16127
16430
|
}, function (_a) {
|
|
@@ -16233,7 +16536,9 @@
|
|
|
16233
16536
|
width: width,
|
|
16234
16537
|
height: height
|
|
16235
16538
|
}
|
|
16236
|
-
}
|
|
16539
|
+
}, /*#__PURE__*/React.createElement(ObjectDetectionDebugLabel, {
|
|
16540
|
+
"$color": color
|
|
16541
|
+
}, obj.label, " ", obj.score.toFixed(2)));
|
|
16237
16542
|
}
|
|
16238
16543
|
function SelfieCaptureFaceDebugBox(_a) {
|
|
16239
16544
|
var face = _a.face,
|
|
@@ -16319,7 +16624,7 @@
|
|
|
16319
16624
|
}
|
|
16320
16625
|
});
|
|
16321
16626
|
}
|
|
16322
|
-
var templateObject_1$
|
|
16627
|
+
var templateObject_1$N, templateObject_2$I, templateObject_3$w, templateObject_4$q, templateObject_5$j;
|
|
16323
16628
|
|
|
16324
16629
|
function OverrideWrongDocumentTypeGuidanceDialog(_a) {
|
|
16325
16630
|
var _b = _a.classNames,
|
|
@@ -16342,7 +16647,7 @@
|
|
|
16342
16647
|
className: classNames.message
|
|
16343
16648
|
}, verbiage.messageText), /*#__PURE__*/React.createElement(ButtonContainer, {
|
|
16344
16649
|
className: classNames.buttonContainer
|
|
16345
|
-
}, /*#__PURE__*/React.createElement(Button$
|
|
16650
|
+
}, /*#__PURE__*/React.createElement(Button$2, {
|
|
16346
16651
|
variant: "positive",
|
|
16347
16652
|
className: classNames.button,
|
|
16348
16653
|
onClick: function onClick() {
|
|
@@ -16352,18 +16657,18 @@
|
|
|
16352
16657
|
}
|
|
16353
16658
|
}, verbiage.buttonText))));
|
|
16354
16659
|
}
|
|
16355
|
-
var Container$7 = styled.div(templateObject_1$
|
|
16660
|
+
var Container$7 = styled.div(templateObject_1$M || (templateObject_1$M = __makeTemplateObject(["\n position: fixed;\n left: 0;\n bottom: 0;\n width: 100%;\n background: ", ";\n color: ", ";\n display: flex;\n z-index: 100001;\n"], ["\n position: fixed;\n left: 0;\n bottom: 0;\n width: 100%;\n background: ", ";\n color: ", ";\n display: flex;\n z-index: 100001;\n"])), function (props) {
|
|
16356
16661
|
var _a, _b, _c;
|
|
16357
16662
|
return (_c = (_b = (_a = props.theme.idCapture) === null || _a === void 0 ? void 0 : _a.overrideWrongDocumentTypeGuidance) === null || _b === void 0 ? void 0 : _b.backgroundColor) !== null && _c !== void 0 ? _c : '#eed202';
|
|
16358
16663
|
}, function (props) {
|
|
16359
16664
|
var _a, _b, _c;
|
|
16360
16665
|
return (_c = (_b = (_a = props.theme.idCapture) === null || _a === void 0 ? void 0 : _a.overrideWrongDocumentTypeGuidance) === null || _b === void 0 ? void 0 : _b.textColor) !== null && _c !== void 0 ? _c : 'black';
|
|
16361
16666
|
});
|
|
16362
|
-
var InnerContainer = styled.div(templateObject_2$
|
|
16363
|
-
var Message = styled.span(templateObject_3$
|
|
16364
|
-
var ButtonContainer = styled.div(templateObject_4$
|
|
16365
|
-
var Button$
|
|
16366
|
-
var templateObject_1$
|
|
16667
|
+
var InnerContainer = styled.div(templateObject_2$H || (templateObject_2$H = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n padding: 16px 24px;\n margin: auto 0;\n width: 100%;\n"], ["\n display: flex;\n flex-direction: row;\n padding: 16px 24px;\n margin: auto 0;\n width: 100%;\n"])));
|
|
16668
|
+
var Message = styled.span(templateObject_3$v || (templateObject_3$v = __makeTemplateObject(["\n display: block;\n margin: auto 12px auto 0;\n"], ["\n display: block;\n margin: auto 12px auto 0;\n"])));
|
|
16669
|
+
var ButtonContainer = styled.div(templateObject_4$p || (templateObject_4$p = __makeTemplateObject(["\n display: flex;\n margin-left: auto;\n"], ["\n display: flex;\n margin-left: auto;\n"])));
|
|
16670
|
+
var Button$2 = styled(LoaderButton)(templateObject_5$i || (templateObject_5$i = __makeTemplateObject(["\n white-space: nowrap;\n margin: auto;\n"], ["\n white-space: nowrap;\n margin: auto;\n"])));
|
|
16671
|
+
var templateObject_1$M, templateObject_2$H, templateObject_3$v, templateObject_4$p, templateObject_5$i;
|
|
16367
16672
|
|
|
16368
16673
|
// This is a simplified version of https://github.com/ZeeCoder/use-resize-observer.
|
|
16369
16674
|
// We have removed all options and made it compliant with React Compiler/React 19.
|
|
@@ -16482,36 +16787,36 @@
|
|
|
16482
16787
|
}
|
|
16483
16788
|
|
|
16484
16789
|
var IdCapture = function IdCapture(_a) {
|
|
16485
|
-
var _b, _c, _d, _e, _f, _g;
|
|
16790
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
16486
16791
|
var requiredDocumentType = _a.requiredDocumentType,
|
|
16487
|
-
|
|
16488
|
-
thresholds =
|
|
16792
|
+
_k = _a.thresholds,
|
|
16793
|
+
thresholds = _k === void 0 ? defaultIdCaptureThresholds : _k,
|
|
16489
16794
|
guidanceMessage = _a.guidanceMessage,
|
|
16490
16795
|
guidanceSatisfied = _a.guidanceSatisfied,
|
|
16491
16796
|
onCapture = _a.onCapture,
|
|
16492
|
-
|
|
16493
|
-
classNames =
|
|
16494
|
-
|
|
16495
|
-
colors =
|
|
16496
|
-
|
|
16497
|
-
rawVerbiage =
|
|
16498
|
-
|
|
16499
|
-
debugMode =
|
|
16500
|
-
var
|
|
16501
|
-
ref =
|
|
16502
|
-
|
|
16503
|
-
width =
|
|
16504
|
-
|
|
16505
|
-
height =
|
|
16797
|
+
_l = _a.classNames,
|
|
16798
|
+
classNames = _l === void 0 ? {} : _l,
|
|
16799
|
+
_m = _a.colors,
|
|
16800
|
+
colors = _m === void 0 ? {} : _m,
|
|
16801
|
+
_o = _a.verbiage,
|
|
16802
|
+
rawVerbiage = _o === void 0 ? {} : _o,
|
|
16803
|
+
_p = _a.debugMode,
|
|
16804
|
+
debugMode = _p === void 0 ? false : _p;
|
|
16805
|
+
var _q = useResizeObserver(),
|
|
16806
|
+
ref = _q.ref,
|
|
16807
|
+
_r = _q.width,
|
|
16808
|
+
width = _r === void 0 ? 1 : _r,
|
|
16809
|
+
_s = _q.height,
|
|
16810
|
+
height = _s === void 0 ? 1 : _s;
|
|
16506
16811
|
var state = useIdCaptureStore();
|
|
16507
16812
|
var isRearFacing = useCameraStore().isRearFacing;
|
|
16508
|
-
var
|
|
16509
|
-
modelsReady =
|
|
16510
|
-
setThresholds =
|
|
16511
|
-
detectionTime =
|
|
16512
|
-
focusPredictionTime =
|
|
16513
|
-
getBestFrame =
|
|
16514
|
-
getBestBarcode =
|
|
16813
|
+
var _t = useIdCaptureModelsContext(),
|
|
16814
|
+
modelsReady = _t.ready,
|
|
16815
|
+
setThresholds = _t.setThresholds,
|
|
16816
|
+
detectionTime = _t.detectionTime,
|
|
16817
|
+
focusPredictionTime = _t.focusPredictionTime,
|
|
16818
|
+
getBestFrame = _t.getBestFrame,
|
|
16819
|
+
getBestBarcode = _t.getBestBarcode;
|
|
16515
16820
|
React.useEffect(function () {
|
|
16516
16821
|
return dispatchIdCaptureAction({
|
|
16517
16822
|
type: 'captureInitialized'
|
|
@@ -16536,7 +16841,7 @@
|
|
|
16536
16841
|
}
|
|
16537
16842
|
});
|
|
16538
16843
|
}, [height, width]);
|
|
16539
|
-
var shouldCapture = state.goodFramesThresholdMet && !state.capturing && timeSince(state.captureStartedAt) >= 3000;
|
|
16844
|
+
var shouldCapture = state.captureState === 'capturing' && state.goodFramesThresholdMet && !state.capturing && timeSince(state.captureStartedAt) >= 3000;
|
|
16540
16845
|
React.useEffect(function () {
|
|
16541
16846
|
if (!shouldCapture) return;
|
|
16542
16847
|
dispatchIdCaptureAction({
|
|
@@ -16552,10 +16857,11 @@
|
|
|
16552
16857
|
}
|
|
16553
16858
|
var bestBarcode = getBestBarcode();
|
|
16554
16859
|
if (bestBarcode) {
|
|
16860
|
+
var barcodeImageUrl = bestBarcode.canvas.toDataURL('image/jpeg', 0.95);
|
|
16555
16861
|
dispatchIdCaptureAction({
|
|
16556
16862
|
type: 'barcodeCaptured',
|
|
16557
16863
|
payload: {
|
|
16558
|
-
imageUrl:
|
|
16864
|
+
imageUrl: barcodeImageUrl,
|
|
16559
16865
|
barcodeReadabilityScore: bestBarcode.score
|
|
16560
16866
|
}
|
|
16561
16867
|
});
|
|
@@ -16636,13 +16942,18 @@
|
|
|
16636
16942
|
"$flipX": !isRearFacing,
|
|
16637
16943
|
scaling: debugScalingDetails
|
|
16638
16944
|
}, state.detectedObjects.map(function (obj, i) {
|
|
16945
|
+
// During barcode recapture, render PDF417 barcodes with green color
|
|
16946
|
+
var isBarcodeRecapture = state.captureState === 'requestingBetterBarcode';
|
|
16947
|
+
var isBarcode = obj.label === 'PDF417';
|
|
16948
|
+
var color = isBarcodeRecapture && isBarcode ? 'green' : undefined;
|
|
16639
16949
|
return /*#__PURE__*/React.createElement(IdCaptureDetectedObjectDebugBox, {
|
|
16640
16950
|
key: i,
|
|
16641
16951
|
obj: obj,
|
|
16642
16952
|
scaling: debugScalingDetails,
|
|
16643
|
-
flipX: !isRearFacing
|
|
16953
|
+
flipX: !isRearFacing,
|
|
16954
|
+
color: color
|
|
16644
16955
|
});
|
|
16645
|
-
}))), debugMode && (/*#__PURE__*/React.createElement(DebugStatsPane, null, camera ? (/*#__PURE__*/React.createElement(React.Fragment, null, "\u2705 Camera: ", camera.label, " (", camera.width, "x", camera.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React.createElement("br", null), state.frameCaptureRate > 0.75 ? '✅' : '👎', " Frame Rate:", ' ', Math.round((state.frameCaptureRate + Number.EPSILON) * 1000) / 1000, ' ', "fps (", detectionTime, "ms doc detect, ", focusPredictionTime, "ms focus)", /*#__PURE__*/React.createElement("br", null), modelsReady ? (/*#__PURE__*/React.createElement(React.Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React.createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.singlePageDetectionThresholdMet ? '✅' : '❌', " Single Page Score: ", state.singlePageDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React.createElement("br", null), state.documentIsStable ? '✅' : '❌', " Document Is Stable", /*#__PURE__*/React.createElement("br", null), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold)) : (/*#__PURE__*/React.createElement(React.Fragment, null, "\u274C Models not ready")))));
|
|
16956
|
+
}))), debugMode && (/*#__PURE__*/React.createElement(DebugStatsPane, null, camera ? (/*#__PURE__*/React.createElement(React.Fragment, null, "\u2705 Camera: ", camera.label, " (", camera.width, "x", camera.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React.createElement("br", null), state.frameCaptureRate > 0.75 ? '✅' : '👎', " Frame Rate:", ' ', Math.round((state.frameCaptureRate + Number.EPSILON) * 1000) / 1000, ' ', "fps (", detectionTime, "ms doc detect, ", focusPredictionTime, "ms focus)", /*#__PURE__*/React.createElement("br", null), modelsReady ? (/*#__PURE__*/React.createElement(React.Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React.createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.singlePageDetectionThresholdMet ? '✅' : '❌', " Single Page Score: ", state.singlePageDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.pdf417PredictionThresholdMet ? '✅' : '❌', " Current Barcode Score: ", state.pdf417PredictionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), getBestBarcode() ? '✅' : '❌', " Best Barcode Score:", ' ', (_j = (_h = getBestBarcode()) === null || _h === void 0 ? void 0 : _h.score.toFixed(3)) !== null && _j !== void 0 ? _j : 'N/A', /*#__PURE__*/React.createElement("br", null), state.clientBarcodeDecodeResult ? '✅' : '⏳', " Client Barcode:", ' ', state.clientBarcodeDecodeResult ? "".concat(state.clientBarcodeDecodeResult.format, " (").concat(state.clientBarcodeDecodeResult.text.length, " chars)") : 'Not decoded', /*#__PURE__*/React.createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React.createElement("br", null), state.documentIsStable ? '✅' : '❌', " Document Is Stable", /*#__PURE__*/React.createElement("br", null), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold)) : (/*#__PURE__*/React.createElement(React.Fragment, null, "\u274C Models not ready")))));
|
|
16646
16957
|
};
|
|
16647
16958
|
var timeSince = function timeSince(t) {
|
|
16648
16959
|
if (!t) return 0;
|
|
@@ -16695,7 +17006,7 @@
|
|
|
16695
17006
|
className: classNames.image
|
|
16696
17007
|
})), /*#__PURE__*/React.createElement("h3", {
|
|
16697
17008
|
className: classNames.heading
|
|
16698
|
-
}, verbiage.headingText), /*#__PURE__*/React.createElement(Description$
|
|
17009
|
+
}, verbiage.headingText), /*#__PURE__*/React.createElement(Description$5, {
|
|
16699
17010
|
className: classNames.description
|
|
16700
17011
|
}, verbiage.descriptionText), /*#__PURE__*/React.createElement(RetryButton$1, {
|
|
16701
17012
|
variant: "warning",
|
|
@@ -16705,13 +17016,13 @@
|
|
|
16705
17016
|
finished: true
|
|
16706
17017
|
}, verbiage.retryBtnText)));
|
|
16707
17018
|
};
|
|
16708
|
-
var StyledOverlayInner$3 = styled(OverlayInner$2)(templateObject_1$
|
|
16709
|
-
var StyledOverlayImageContainer$1 = styled(OverlayImageContainer)(templateObject_2$
|
|
16710
|
-
var Description$
|
|
16711
|
-
var RetryButton$1 = styled(LoaderButton)(templateObject_4$
|
|
16712
|
-
var templateObject_1$
|
|
17019
|
+
var StyledOverlayInner$3 = styled(OverlayInner$2)(templateObject_1$L || (templateObject_1$L = __makeTemplateObject(["\n max-width: 500px;\n height: auto;\n margin: auto;\n"], ["\n max-width: 500px;\n height: auto;\n margin: auto;\n"])));
|
|
17020
|
+
var StyledOverlayImageContainer$1 = styled(OverlayImageContainer)(templateObject_2$G || (templateObject_2$G = __makeTemplateObject(["\n flex-grow: 0;\n"], ["\n flex-grow: 0;\n"])));
|
|
17021
|
+
var Description$5 = styled.p(templateObject_3$u || (templateObject_3$u = __makeTemplateObject(["\n line-height: 1.5;\n margin-bottom: 50px;\n"], ["\n line-height: 1.5;\n margin-bottom: 50px;\n"])));
|
|
17022
|
+
var RetryButton$1 = styled(LoaderButton)(templateObject_4$o || (templateObject_4$o = __makeTemplateObject(["\n width: 200px;\n margin: 0 auto;\n"], ["\n width: 200px;\n margin: 0 auto;\n"])));
|
|
17023
|
+
var templateObject_1$L, templateObject_2$G, templateObject_3$u, templateObject_4$o;
|
|
16713
17024
|
|
|
16714
|
-
var ExitCaptureStyledButton = styled.button(templateObject_1$
|
|
17025
|
+
var ExitCaptureStyledButton = styled.button(templateObject_1$K || (templateObject_1$K = __makeTemplateObject(["\n position: absolute;\n top: 12px;\n right: 12px;\n font-size: 20px;\n width: 32px;\n height: 32px;\n font-family: monospace;\n z-index: 10002;\n border: none;\n border-radius: 4px;\n background: var(--idm-color-secondary-200);\n cursor: pointer;\n padding: 8px;\n box-sizing: border-box;\n display: flex;\n\n &:hover {\n background: #ddd;\n }\n\n & > svg {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n"], ["\n position: absolute;\n top: 12px;\n right: 12px;\n font-size: 20px;\n width: 32px;\n height: 32px;\n font-family: monospace;\n z-index: 10002;\n border: none;\n border-radius: 4px;\n background: var(--idm-color-secondary-200);\n cursor: pointer;\n padding: 8px;\n box-sizing: border-box;\n display: flex;\n\n &:hover {\n background: #ddd;\n }\n\n & > svg {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n"])));
|
|
16715
17026
|
var ExitCaptureButton = function ExitCaptureButton(_a) {
|
|
16716
17027
|
var onClick = _a.onClick,
|
|
16717
17028
|
className = _a.className;
|
|
@@ -16755,7 +17066,7 @@
|
|
|
16755
17066
|
y2: "19.75"
|
|
16756
17067
|
}))));
|
|
16757
17068
|
};
|
|
16758
|
-
var templateObject_1$
|
|
17069
|
+
var templateObject_1$K;
|
|
16759
17070
|
|
|
16760
17071
|
function IdCaptureLoadingGraphic(props) {
|
|
16761
17072
|
var isMobile = window.innerHeight > window.innerWidth;
|
|
@@ -17230,21 +17541,21 @@
|
|
|
17230
17541
|
fill: "white"
|
|
17231
17542
|
}))));
|
|
17232
17543
|
}
|
|
17233
|
-
var LoadingGraphicWrapper = styled.div(templateObject_1$
|
|
17234
|
-
var LoadingGraphicSvg = styled.svg(templateObject_2$
|
|
17544
|
+
var LoadingGraphicWrapper = styled.div(templateObject_1$J || (templateObject_1$J = __makeTemplateObject(["\n display: flex;\n width: 100%;\n height: 100%;\n"], ["\n display: flex;\n width: 100%;\n height: 100%;\n"])));
|
|
17545
|
+
var LoadingGraphicSvg = styled.svg(templateObject_2$F || (templateObject_2$F = __makeTemplateObject(["\n margin: auto;\n transform: scale(\n ", "\n );\n transform-style: preserve-3d;\n transition:\n transform 0.2s linear,\n border-width 0.2s linear;\n border: ", "px solid\n ", ";\n max-height: 80%;\n max-width: 80%;\n"], ["\n margin: auto;\n transform: scale(\n ", "\n );\n transform-style: preserve-3d;\n transition:\n transform 0.2s linear,\n border-width 0.2s linear;\n border: ", "px solid\n ", ";\n max-height: 80%;\n max-width: 80%;\n"])), function (props) {
|
|
17235
17546
|
return props.$frame > 1 ? 1 : props.$frame === 1 ? 1.25 : 0.75;
|
|
17236
17547
|
}, function (props) {
|
|
17237
17548
|
return props.$frame >= 5 ? 10 : 0;
|
|
17238
17549
|
}, function (props) {
|
|
17239
17550
|
return props.$borderColor;
|
|
17240
17551
|
});
|
|
17241
|
-
var LoadingGraphicCardGroup = styled.g(templateObject_3$
|
|
17552
|
+
var LoadingGraphicCardGroup = styled.g(templateObject_3$t || (templateObject_3$t = __makeTemplateObject(["\n transform: translate(", ", 0);\n transform-style: preserve-3d;\n transition: transform 0.3s linear;\n"], ["\n transform: translate(", ", 0);\n transform-style: preserve-3d;\n transition: transform 0.3s linear;\n"])), function (props) {
|
|
17242
17553
|
return props.$offScreen ? '-500px' : '0';
|
|
17243
17554
|
});
|
|
17244
|
-
var LoadingGraphicPhoneGroup = styled.g(templateObject_4$
|
|
17555
|
+
var LoadingGraphicPhoneGroup = styled.g(templateObject_4$n || (templateObject_4$n = __makeTemplateObject(["\n transform: translate(", ", 0);\n transform-style: preserve-3d;\n transition: transform 0.3s linear;\n"], ["\n transform: translate(", ", 0);\n transform-style: preserve-3d;\n transition: transform 0.3s linear;\n"])), function (props) {
|
|
17245
17556
|
return props.$offScreen ? '40px' : '0';
|
|
17246
17557
|
});
|
|
17247
|
-
var templateObject_1$
|
|
17558
|
+
var templateObject_1$J, templateObject_2$F, templateObject_3$t, templateObject_4$n;
|
|
17248
17559
|
|
|
17249
17560
|
function LoadingListItemIndicator(_a) {
|
|
17250
17561
|
var _b = _a.state,
|
|
@@ -17513,35 +17824,35 @@
|
|
|
17513
17824
|
}
|
|
17514
17825
|
}, ready ? verbiage.continueText : verbiage.pleaseWaitText))))));
|
|
17515
17826
|
};
|
|
17516
|
-
var OverlayInner$1 = styled(LoadingOverlayInner)(templateObject_1$
|
|
17827
|
+
var OverlayInner$1 = styled(LoadingOverlayInner)(templateObject_1$I || (templateObject_1$I = __makeTemplateObject(["\n background: ", ";\n color: ", ";\n"], ["\n background: ", ";\n color: ", ";\n"])), function (props) {
|
|
17517
17828
|
var _a, _b, _c, _d;
|
|
17518
17829
|
return (_d = (_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.idCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.backgroundColor) !== null && _d !== void 0 ? _d : '#ecedf3';
|
|
17519
17830
|
}, function (props) {
|
|
17520
17831
|
var _a, _b, _c, _d;
|
|
17521
17832
|
return (_d = (_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.idCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.textColor) !== null && _d !== void 0 ? _d : 'black';
|
|
17522
17833
|
});
|
|
17523
|
-
var ContinuityCameraCheckboxContainer$1 = styled.div(templateObject_2$
|
|
17524
|
-
var ContinuityCameraCheckboxInner = styled(GuidanceMessage)(templateObject_3$
|
|
17525
|
-
var ContinuityCameraCheckbox$1 = styled.input(templateObject_4$
|
|
17526
|
-
var ButtonsRow$1 = styled(LoadingOverlayButtonsRow)(templateObject_5$
|
|
17834
|
+
var ContinuityCameraCheckboxContainer$1 = styled.div(templateObject_2$E || (templateObject_2$E = __makeTemplateObject(["\n position: absolute;\n bottom: 120px;\n width: 100%;\n display: flex;\n"], ["\n position: absolute;\n bottom: 120px;\n width: 100%;\n display: flex;\n"])));
|
|
17835
|
+
var ContinuityCameraCheckboxInner = styled(GuidanceMessage)(templateObject_3$s || (templateObject_3$s = __makeTemplateObject(["\n display: flex;\n gap: 8px;\n align-items: center;\n padding: 12px 18px;\n margin: 0 auto;\n font-size: 14px;\n font-weight: bold;\n background: white;\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n"], ["\n display: flex;\n gap: 8px;\n align-items: center;\n padding: 12px 18px;\n margin: 0 auto;\n font-size: 14px;\n font-weight: bold;\n background: white;\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n"])));
|
|
17836
|
+
var ContinuityCameraCheckbox$1 = styled.input(templateObject_4$m || (templateObject_4$m = __makeTemplateObject(["\n margin: 0;\n"], ["\n margin: 0;\n"])));
|
|
17837
|
+
var ButtonsRow$1 = styled(LoadingOverlayButtonsRow)(templateObject_5$h || (templateObject_5$h = __makeTemplateObject(["\n color: ", ";\n ", "\n"], ["\n color: ", ";\n ", "\n"])), function (props) {
|
|
17527
17838
|
var _a, _b, _c, _d;
|
|
17528
17839
|
return (_d = (_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.idCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.progressBarTextColor) !== null && _d !== void 0 ? _d : 'white';
|
|
17529
17840
|
}, function (props) {
|
|
17530
17841
|
var _a, _b, _c, _d, _e, _f;
|
|
17531
17842
|
return ((_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.idCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.progressBarFontSize) ? "font-size: ".concat((_f = (_e = (_d = props.theme) === null || _d === void 0 ? void 0 : _d.idCapture) === null || _e === void 0 ? void 0 : _e.loadingOverlay) === null || _f === void 0 ? void 0 : _f.progressBarFontSize, ";") : '';
|
|
17532
17843
|
});
|
|
17533
|
-
var ProgressBarBackground$1 = styled(LoadingOverlayProgressBarBackground)(templateObject_6$
|
|
17844
|
+
var ProgressBarBackground$1 = styled(LoadingOverlayProgressBarBackground)(templateObject_6$b || (templateObject_6$b = __makeTemplateObject(["\n background: ", ";\n opacity: ", ";\n"], ["\n background: ", ";\n opacity: ", ";\n"])), function (props) {
|
|
17534
17845
|
var _a, _b, _c, _d;
|
|
17535
17846
|
return (_d = (_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.idCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.progressBarBackgroundColor) !== null && _d !== void 0 ? _d : 'var(--idm-color-positive-600)';
|
|
17536
17847
|
}, function (props) {
|
|
17537
17848
|
var _a, _b, _c, _d;
|
|
17538
17849
|
return (_d = (_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.idCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.progressBarBackgroundOpacity) !== null && _d !== void 0 ? _d : 0.75;
|
|
17539
17850
|
});
|
|
17540
|
-
var ProgressIndicator$1 = styled(LoadingOverlayProgressIndicator)(templateObject_7$
|
|
17851
|
+
var ProgressIndicator$1 = styled(LoadingOverlayProgressIndicator)(templateObject_7$7 || (templateObject_7$7 = __makeTemplateObject(["\n background: ", ";\n"], ["\n background: ", ";\n"])), function (props) {
|
|
17541
17852
|
var _a, _b, _c, _d;
|
|
17542
17853
|
return (_d = (_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.idCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.progressBarIndicatorColor) !== null && _d !== void 0 ? _d : 'var(--idm-color-primary-500)';
|
|
17543
17854
|
});
|
|
17544
|
-
var ContinueButton$1 = styled(LoaderButton)(templateObject_8$
|
|
17855
|
+
var ContinueButton$1 = styled(LoaderButton)(templateObject_8$6 || (templateObject_8$6 = __makeTemplateObject(["\n margin: auto;\n white-space: nowrap;\n ", "\n ", "\n \n &:focus-visible {\n ", "\n box-shadow: none;\n }\n\n &.disabled {\n background: ", ";\n color: ", ";\n border: ", ";\n }\n"], ["\n margin: auto;\n white-space: nowrap;\n ", "\n ", "\n \n &:focus-visible {\n ", "\n box-shadow: none;\n }\n\n &.disabled {\n background: ", ";\n color: ", ";\n border: ", ";\n }\n"])), function (props) {
|
|
17545
17856
|
var _a, _b, _c, _d, _e, _f;
|
|
17546
17857
|
return ((_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.idCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.progressBarFontSize) ? "font-size: ".concat((_f = (_e = (_d = props.theme) === null || _d === void 0 ? void 0 : _d.idCapture) === null || _e === void 0 ? void 0 : _e.loadingOverlay) === null || _f === void 0 ? void 0 : _f.progressBarFontSize, ";") : '';
|
|
17547
17858
|
}, function (props) {
|
|
@@ -17560,10 +17871,10 @@
|
|
|
17560
17871
|
var _a, _b, _c, _d;
|
|
17561
17872
|
return (_d = (_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.idCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.continueBtnDisabledBorder) !== null && _d !== void 0 ? _d : 'none';
|
|
17562
17873
|
});
|
|
17563
|
-
var templateObject_1$
|
|
17874
|
+
var templateObject_1$I, templateObject_2$E, templateObject_3$s, templateObject_4$m, templateObject_5$h, templateObject_6$b, templateObject_7$7, templateObject_8$6;
|
|
17564
17875
|
|
|
17565
|
-
var ContinuityCameraCheckboxContainer = styled.div(templateObject_1$
|
|
17566
|
-
var ContinuityCameraCheckbox = styled.input(templateObject_2$
|
|
17876
|
+
var ContinuityCameraCheckboxContainer = styled.div(templateObject_1$H || (templateObject_1$H = __makeTemplateObject(["\n margin-top: 15px;\n margin-bottom: 15px;\n"], ["\n margin-top: 15px;\n margin-bottom: 15px;\n"])));
|
|
17877
|
+
var ContinuityCameraCheckbox = styled.input(templateObject_2$D || (templateObject_2$D = __makeTemplateObject(["\n margin-right: 8px;\n"], ["\n margin-right: 8px;\n"])));
|
|
17567
17878
|
var IdCaptureLoadingOverlayLegacy = function IdCaptureLoadingOverlayLegacy(_a) {
|
|
17568
17879
|
var _b, _c, _d, _e;
|
|
17569
17880
|
var onDismissed = _a.onDismissed,
|
|
@@ -17684,7 +17995,7 @@
|
|
|
17684
17995
|
}
|
|
17685
17996
|
}, ready ? verbiage.continueText : modelsReady ? verbiage.cameraInitializingText : modelDownloadProgress >= 100 ? verbiage.modelsWarmingUpText : "".concat(verbiage.downloadingText, " (").concat(modelDownloadProgress, "%)"))));
|
|
17686
17997
|
};
|
|
17687
|
-
var templateObject_1$
|
|
17998
|
+
var templateObject_1$H, templateObject_2$D;
|
|
17688
17999
|
|
|
17689
18000
|
var components$1 = {
|
|
17690
18001
|
"default": IdCaptureLoadingOverlayDefault,
|
|
@@ -17742,11 +18053,205 @@
|
|
|
17742
18053
|
});
|
|
17743
18054
|
};
|
|
17744
18055
|
|
|
17745
|
-
var Card = styled.div(templateObject_1$
|
|
17746
|
-
var FlexCard = styled(Card)(templateObject_2$
|
|
17747
|
-
var templateObject_1$
|
|
18056
|
+
var Card = styled.div(templateObject_1$G || (templateObject_1$G = __makeTemplateObject(["\n background: white;\n border-radius: 8px;\n padding: 24px;\n box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);\n margin: auto;\n max-width: min(500px, 100% - 48px);\n max-height: 100%;\n overflow: auto;\n box-sizing: border-box;\n"], ["\n background: white;\n border-radius: 8px;\n padding: 24px;\n box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);\n margin: auto;\n max-width: min(500px, 100% - 48px);\n max-height: 100%;\n overflow: auto;\n box-sizing: border-box;\n"])));
|
|
18057
|
+
var FlexCard = styled(Card)(templateObject_2$C || (templateObject_2$C = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
|
|
18058
|
+
var templateObject_1$G, templateObject_2$C;
|
|
18059
|
+
|
|
18060
|
+
/**
|
|
18061
|
+
* Parser for AAMVA (American Association of Motor Vehicle Administrators)
|
|
18062
|
+
* PDF417 barcode data found on US and Canadian driver's licenses.
|
|
18063
|
+
*/
|
|
18064
|
+
// AAMVA field codes to human-readable labels
|
|
18065
|
+
var AAMVA_FIELD_LABELS = {
|
|
18066
|
+
// Required fields
|
|
18067
|
+
DCS: 'Last Name',
|
|
18068
|
+
DAC: 'First Name',
|
|
18069
|
+
DAD: 'Middle Name',
|
|
18070
|
+
DBB: 'Date of Birth',
|
|
18071
|
+
DBC: 'Sex',
|
|
18072
|
+
DAY: 'Eye Color',
|
|
18073
|
+
DAU: 'Height',
|
|
18074
|
+
DAG: 'Street Address',
|
|
18075
|
+
DAI: 'City',
|
|
18076
|
+
DAJ: 'State',
|
|
18077
|
+
DAK: 'ZIP Code',
|
|
18078
|
+
DAQ: 'License Number',
|
|
18079
|
+
DCF: 'Document Discriminator',
|
|
18080
|
+
DCG: 'Country',
|
|
18081
|
+
DDE: 'Last Name Truncation',
|
|
18082
|
+
DDF: 'First Name Truncation',
|
|
18083
|
+
DDG: 'Middle Name Truncation',
|
|
18084
|
+
// Optional fields
|
|
18085
|
+
DBD: 'Document Issue Date',
|
|
18086
|
+
DBA: 'Document Expiration Date',
|
|
18087
|
+
DCD: 'Jurisdiction Restriction Codes',
|
|
18088
|
+
DCB: 'Jurisdiction Endorsement Codes',
|
|
18089
|
+
DCA: 'Vehicle Class',
|
|
18090
|
+
DCE: 'Weight Range',
|
|
18091
|
+
DCL: 'Race/Ethnicity',
|
|
18092
|
+
DCM: 'Standard Vehicle Classification',
|
|
18093
|
+
DCN: 'Standard Endorsement Code',
|
|
18094
|
+
DCO: 'Standard Restriction Code',
|
|
18095
|
+
DCP: 'Jurisdiction Vehicle Class Description',
|
|
18096
|
+
DCQ: 'Jurisdiction Endorsement Code Description',
|
|
18097
|
+
DCR: 'Jurisdiction Restriction Code Description',
|
|
18098
|
+
DDA: 'Compliance Type',
|
|
18099
|
+
DDB: 'Card Revision Date',
|
|
18100
|
+
DDC: 'HAZMAT Endorsement Expiration Date',
|
|
18101
|
+
DDD: 'Limited Duration Document Indicator',
|
|
18102
|
+
DDH: 'Under 18 Until',
|
|
18103
|
+
DDI: 'Under 19 Until',
|
|
18104
|
+
DDJ: 'Under 21 Until',
|
|
18105
|
+
DDK: 'Organ Donor Indicator',
|
|
18106
|
+
DDL: 'Veteran Indicator',
|
|
18107
|
+
DAW: 'Weight (lbs)',
|
|
18108
|
+
DAX: 'Weight (kg)',
|
|
18109
|
+
DAZ: 'Hair Color',
|
|
18110
|
+
DBN: 'Alias/AKA Last Name',
|
|
18111
|
+
DBG: 'Alias/AKA First Name',
|
|
18112
|
+
DBS: 'Alias/AKA Suffix',
|
|
18113
|
+
DCU: 'Name Suffix',
|
|
18114
|
+
DCT: 'First Name Alias',
|
|
18115
|
+
DAH: 'Street Address Line 2',
|
|
18116
|
+
DAL: 'Residence Street Address',
|
|
18117
|
+
DAN: 'Residence City',
|
|
18118
|
+
DAO: 'Residence State',
|
|
18119
|
+
DAP: 'Residence ZIP'
|
|
18120
|
+
};
|
|
18121
|
+
// Sex code mappings
|
|
18122
|
+
var SEX_CODES = {
|
|
18123
|
+
'1': 'Male',
|
|
18124
|
+
'2': 'Female',
|
|
18125
|
+
'9': 'Not Specified'
|
|
18126
|
+
};
|
|
18127
|
+
// Eye color code mappings
|
|
18128
|
+
var EYE_COLOR_CODES = {
|
|
18129
|
+
BLK: 'Black',
|
|
18130
|
+
BLU: 'Blue',
|
|
18131
|
+
BRO: 'Brown',
|
|
18132
|
+
GRY: 'Gray',
|
|
18133
|
+
GRN: 'Green',
|
|
18134
|
+
HAZ: 'Hazel',
|
|
18135
|
+
MAR: 'Maroon',
|
|
18136
|
+
PNK: 'Pink',
|
|
18137
|
+
DIC: 'Dichromatic',
|
|
18138
|
+
UNK: 'Unknown'
|
|
18139
|
+
};
|
|
18140
|
+
// Hair color code mappings
|
|
18141
|
+
var HAIR_COLOR_CODES = {
|
|
18142
|
+
BAL: 'Bald',
|
|
18143
|
+
BLK: 'Black',
|
|
18144
|
+
BLN: 'Blond',
|
|
18145
|
+
BRO: 'Brown',
|
|
18146
|
+
GRY: 'Gray',
|
|
18147
|
+
RED: 'Red/Auburn',
|
|
18148
|
+
SDY: 'Sandy',
|
|
18149
|
+
WHI: 'White',
|
|
18150
|
+
UNK: 'Unknown'
|
|
18151
|
+
};
|
|
18152
|
+
/**
|
|
18153
|
+
* Formats a date string from AAMVA format (MMDDYYYY) to readable format
|
|
18154
|
+
*/
|
|
18155
|
+
function formatDate(value) {
|
|
18156
|
+
if (value.length !== 8) return value;
|
|
18157
|
+
var month = value.substring(0, 2);
|
|
18158
|
+
var day = value.substring(2, 4);
|
|
18159
|
+
var year = value.substring(4, 8);
|
|
18160
|
+
return "".concat(month, "/").concat(day, "/").concat(year);
|
|
18161
|
+
}
|
|
18162
|
+
/**
|
|
18163
|
+
* Formats a value based on its field code
|
|
18164
|
+
*/
|
|
18165
|
+
function formatValue$1(code, value) {
|
|
18166
|
+
// Date fields
|
|
18167
|
+
if (['DBB', 'DBD', 'DBA', 'DDB', 'DDC', 'DDH', 'DDI', 'DDJ'].includes(code)) {
|
|
18168
|
+
return formatDate(value);
|
|
18169
|
+
}
|
|
18170
|
+
// Sex field
|
|
18171
|
+
if (code === 'DBC') {
|
|
18172
|
+
return SEX_CODES[value] || value;
|
|
18173
|
+
}
|
|
18174
|
+
// Eye color
|
|
18175
|
+
if (code === 'DAY') {
|
|
18176
|
+
return EYE_COLOR_CODES[value] || value;
|
|
18177
|
+
}
|
|
18178
|
+
// Hair color
|
|
18179
|
+
if (code === 'DAZ') {
|
|
18180
|
+
return HAIR_COLOR_CODES[value] || value;
|
|
18181
|
+
}
|
|
18182
|
+
// Height - format as feet and inches
|
|
18183
|
+
if (code === 'DAU') {
|
|
18184
|
+
// Format is typically "XXX in" or "FT IN"
|
|
18185
|
+
var match = value.match(/^(\d{3})/);
|
|
18186
|
+
if (match) {
|
|
18187
|
+
var inches = parseInt(match[1], 10);
|
|
18188
|
+
var feet = Math.floor(inches / 12);
|
|
18189
|
+
var remainingInches = inches % 12;
|
|
18190
|
+
return "".concat(feet, "'").concat(remainingInches, "\"");
|
|
18191
|
+
}
|
|
18192
|
+
return value;
|
|
18193
|
+
}
|
|
18194
|
+
// ZIP code - format with hyphen if 9 digits
|
|
18195
|
+
if (code === 'DAK' && value.length === 9) {
|
|
18196
|
+
return "".concat(value.substring(0, 5), "-").concat(value.substring(5));
|
|
18197
|
+
}
|
|
18198
|
+
return value.trim();
|
|
18199
|
+
}
|
|
18200
|
+
/**
|
|
18201
|
+
* Parses AAMVA PDF417 barcode data into structured fields
|
|
18202
|
+
*/
|
|
18203
|
+
function parseAAMVABarcode(rawData) {
|
|
18204
|
+
var result = {
|
|
18205
|
+
fields: [],
|
|
18206
|
+
rawData: rawData
|
|
18207
|
+
};
|
|
18208
|
+
// Clean up the data - remove control characters but keep newlines for parsing
|
|
18209
|
+
// AAMVA uses various separators: \n, \r, record separator (0x1E), etc.
|
|
18210
|
+
// eslint-disable-next-line no-control-regex
|
|
18211
|
+
var controlCharRegex = /[\x00-\x09\x0B\x0C\x0E-\x1F]/g;
|
|
18212
|
+
var cleanData = rawData.replace(controlCharRegex, '\n') // Replace control chars with newlines
|
|
18213
|
+
.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
|
|
18214
|
+
// Split into lines
|
|
18215
|
+
var lines = cleanData.split('\n').filter(function (line) {
|
|
18216
|
+
return line.trim();
|
|
18217
|
+
});
|
|
18218
|
+
// Extract fields using regex - AAMVA fields are 3-letter codes followed by data
|
|
18219
|
+
var fieldRegex = /^([A-Z]{3})(.*)$/;
|
|
18220
|
+
for (var _i = 0, lines_1 = lines; _i < lines_1.length; _i++) {
|
|
18221
|
+
var line = lines_1[_i];
|
|
18222
|
+
var match = line.match(fieldRegex);
|
|
18223
|
+
if (match) {
|
|
18224
|
+
var code = match[1],
|
|
18225
|
+
rawValue = match[2];
|
|
18226
|
+
var value = rawValue.trim();
|
|
18227
|
+
// Skip empty values and header/version info
|
|
18228
|
+
if (!value || code === 'ANS') continue;
|
|
18229
|
+
var label = AAMVA_FIELD_LABELS[code] || code;
|
|
18230
|
+
var formattedValue = formatValue$1(code, value);
|
|
18231
|
+
result.fields.push({
|
|
18232
|
+
code: code,
|
|
18233
|
+
label: label,
|
|
18234
|
+
value: formattedValue
|
|
18235
|
+
});
|
|
18236
|
+
}
|
|
18237
|
+
}
|
|
18238
|
+
// Try to extract version and jurisdiction from header
|
|
18239
|
+
var headerMatch = rawData.match(/ANSI\s*(\d+)/);
|
|
18240
|
+
if (headerMatch) {
|
|
18241
|
+
result.jurisdictionId = headerMatch[1].substring(0, 6);
|
|
18242
|
+
}
|
|
18243
|
+
return result;
|
|
18244
|
+
}
|
|
17748
18245
|
|
|
17749
18246
|
var imageDisplayOrder = ['idCardFront', 'idCardBack', 'idBarcodeImage', 'passport', 'singlePage', 'idFrontIrImage', 'idBackIrImage', 'idFrontUvImage', 'idBackUvImage'];
|
|
18247
|
+
var downloadImage = function downloadImage(dataUrl, filename) {
|
|
18248
|
+
var link = document.createElement('a');
|
|
18249
|
+
link.href = dataUrl;
|
|
18250
|
+
link.download = filename;
|
|
18251
|
+
document.body.appendChild(link);
|
|
18252
|
+
link.click();
|
|
18253
|
+
document.body.removeChild(link);
|
|
18254
|
+
};
|
|
17750
18255
|
var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
17751
18256
|
var capturedDocuments = _a.capturedDocuments,
|
|
17752
18257
|
onSubmitClick = _a.onSubmitClick,
|
|
@@ -17758,7 +18263,13 @@
|
|
|
17758
18263
|
_d = _a.verbiage,
|
|
17759
18264
|
rawVerbiage = _d === void 0 ? {} : _d,
|
|
17760
18265
|
_e = _a.debugMode,
|
|
17761
|
-
debugMode = _e === void 0 ? false : _e
|
|
18266
|
+
debugMode = _e === void 0 ? false : _e,
|
|
18267
|
+
initialBarcodeScore = _a.initialBarcodeScore,
|
|
18268
|
+
recaptureBarcodeScore = _a.recaptureBarcodeScore,
|
|
18269
|
+
initialCaptureBarcodeImage = _a.initialCaptureBarcodeImage,
|
|
18270
|
+
recaptureBarcodeImage = _a.recaptureBarcodeImage,
|
|
18271
|
+
clientBarcodeDecodeResult = _a.clientBarcodeDecodeResult,
|
|
18272
|
+
nativeBarcodeDecodeResult = _a.nativeBarcodeDecodeResult;
|
|
17762
18273
|
var submissionStatus = React.useContext(SubmissionContext).submissionStatus;
|
|
17763
18274
|
var sessionCheckState = useAuthContext()[0].sessionCheckState;
|
|
17764
18275
|
var sessionReady = sessionCheckState === 'PASSED';
|
|
@@ -17770,12 +18281,50 @@
|
|
|
17770
18281
|
(_a = submitButtonRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
17771
18282
|
}
|
|
17772
18283
|
}, [sessionReady, submissionStatus]);
|
|
18284
|
+
if (debugMode) {
|
|
18285
|
+
log('[IdCaptureSuccess] Debug info:', {
|
|
18286
|
+
debugMode: debugMode,
|
|
18287
|
+
initialBarcodeScore: initialBarcodeScore,
|
|
18288
|
+
recaptureBarcodeScore: recaptureBarcodeScore,
|
|
18289
|
+
shouldShow: debugMode && initialBarcodeScore !== undefined,
|
|
18290
|
+
condition1: debugMode,
|
|
18291
|
+
condition2: initialBarcodeScore !== undefined
|
|
18292
|
+
});
|
|
18293
|
+
}
|
|
17773
18294
|
var verbiage = useTranslations(rawVerbiage, {
|
|
17774
18295
|
headingText: 'ID Capture Successful',
|
|
17775
18296
|
retryText: 'Retry',
|
|
17776
18297
|
submittingText: 'Submitting...',
|
|
17777
18298
|
submitText: 'Done'
|
|
17778
18299
|
});
|
|
18300
|
+
// Parse AAMVA barcode data if available (Dynamsoft/client-side)
|
|
18301
|
+
var parsedBarcodeData = React.useMemo(function () {
|
|
18302
|
+
if (!(clientBarcodeDecodeResult === null || clientBarcodeDecodeResult === void 0 ? void 0 : clientBarcodeDecodeResult.text)) return null;
|
|
18303
|
+
try {
|
|
18304
|
+
return parseAAMVABarcode(clientBarcodeDecodeResult.text);
|
|
18305
|
+
} catch (_a) {
|
|
18306
|
+
return null;
|
|
18307
|
+
}
|
|
18308
|
+
}, [clientBarcodeDecodeResult]);
|
|
18309
|
+
// Parse AAMVA barcode data from native decoder
|
|
18310
|
+
var parsedNativeBarcodeData = React.useMemo(function () {
|
|
18311
|
+
if (!(nativeBarcodeDecodeResult === null || nativeBarcodeDecodeResult === void 0 ? void 0 : nativeBarcodeDecodeResult.text)) return null;
|
|
18312
|
+
try {
|
|
18313
|
+
return parseAAMVABarcode(nativeBarcodeDecodeResult.text);
|
|
18314
|
+
} catch (_a) {
|
|
18315
|
+
return null;
|
|
18316
|
+
}
|
|
18317
|
+
}, [nativeBarcodeDecodeResult]);
|
|
18318
|
+
// Compare native vs Dynamsoft results
|
|
18319
|
+
var barcodeComparisonResult = React.useMemo(function () {
|
|
18320
|
+
if (!(clientBarcodeDecodeResult === null || clientBarcodeDecodeResult === void 0 ? void 0 : clientBarcodeDecodeResult.text) || !(nativeBarcodeDecodeResult === null || nativeBarcodeDecodeResult === void 0 ? void 0 : nativeBarcodeDecodeResult.text)) {
|
|
18321
|
+
return null;
|
|
18322
|
+
}
|
|
18323
|
+
var match = clientBarcodeDecodeResult.text === nativeBarcodeDecodeResult.text;
|
|
18324
|
+
return {
|
|
18325
|
+
match: match
|
|
18326
|
+
};
|
|
18327
|
+
}, [clientBarcodeDecodeResult, nativeBarcodeDecodeResult]);
|
|
17779
18328
|
return /*#__PURE__*/React.createElement(GrayOverlayContainer, {
|
|
17780
18329
|
className: classNames.container
|
|
17781
18330
|
}, /*#__PURE__*/React.createElement(OverlayInner$2, {
|
|
@@ -17789,6 +18338,7 @@
|
|
|
17789
18338
|
}, /*#__PURE__*/React.createElement(ImageRow, {
|
|
17790
18339
|
className: classNames.imageRow
|
|
17791
18340
|
}, imageDisplayOrder.map(function (name) {
|
|
18341
|
+
var _a, _b, _c, _d, _e, _f;
|
|
17792
18342
|
var doc = capturedDocuments[name];
|
|
17793
18343
|
if (!doc) return null;
|
|
17794
18344
|
return /*#__PURE__*/React.createElement(ImageCol$1, {
|
|
@@ -17798,8 +18348,68 @@
|
|
|
17798
18348
|
image: doc,
|
|
17799
18349
|
className: classNames.image,
|
|
17800
18350
|
alt: doc.documentType
|
|
17801
|
-
}), debugMode && (/*#__PURE__*/React.createElement(
|
|
17802
|
-
|
|
18351
|
+
}), debugMode && (/*#__PURE__*/React.createElement(DebugInfoContainer, null, name === 'idBarcodeImage' ? (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DebugSection, null, /*#__PURE__*/React.createElement(DebugLabel, null, "Document Type:"), /*#__PURE__*/React.createElement(DebugValue, null, doc.documentType)), /*#__PURE__*/React.createElement(DebugSection, null, /*#__PURE__*/React.createElement(DebugLabel, null, "Readability Score:"), /*#__PURE__*/React.createElement(ScoreBadge, {
|
|
18352
|
+
"$score": (_a = doc.barcodeReadabilityScore) !== null && _a !== void 0 ? _a : 0,
|
|
18353
|
+
"$type": "readability"
|
|
18354
|
+
}, ((_b = doc.barcodeReadabilityScore) !== null && _b !== void 0 ? _b : 0).toFixed(3))), initialBarcodeScore !== undefined && (recaptureBarcodeScore !== null && recaptureBarcodeScore !== undefined ? (/*#__PURE__*/React.createElement(BarcodeComparisonCard, null, /*#__PURE__*/React.createElement(ComparisonHeader, null, "\uD83D\uDCCA Barcode Recapture Analysis"), /*#__PURE__*/React.createElement(ComparisonRow, null, /*#__PURE__*/React.createElement(ComparisonLabel, null, "Initial Capture:"), /*#__PURE__*/React.createElement(ComparisonScoreBadge, null, initialBarcodeScore.toFixed(3))), /*#__PURE__*/React.createElement(ComparisonRow, null, /*#__PURE__*/React.createElement(ComparisonLabel, null, "After Recapture:"), /*#__PURE__*/React.createElement(ComparisonScoreBadge, null, recaptureBarcodeScore.toFixed(3))), /*#__PURE__*/React.createElement(ComparisonDivider, null), /*#__PURE__*/React.createElement(ComparisonRow, null, /*#__PURE__*/React.createElement(ComparisonLabel, null, "Improvement:"), /*#__PURE__*/React.createElement(ImprovementBadge, {
|
|
18355
|
+
"$improved": recaptureBarcodeScore > initialBarcodeScore
|
|
18356
|
+
}, recaptureBarcodeScore > initialBarcodeScore ? '↑' : '→', ' ', Math.abs(recaptureBarcodeScore - initialBarcodeScore).toFixed(3), ' ', "(", recaptureBarcodeScore > initialBarcodeScore ? 'Better' : 'Same/Worse', ")")), (initialCaptureBarcodeImage || recaptureBarcodeImage) && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ComparisonDivider, null), /*#__PURE__*/React.createElement(ComparisonHeader, {
|
|
18357
|
+
style: {
|
|
18358
|
+
marginTop: '0.25rem'
|
|
18359
|
+
}
|
|
18360
|
+
}, "\uD83D\uDD0D Visual Comparison"), /*#__PURE__*/React.createElement(BarcodeComparisonImagesContainer, null, initialCaptureBarcodeImage && (/*#__PURE__*/React.createElement(BarcodeComparisonImageWrapper, null, /*#__PURE__*/React.createElement(BarcodeComparisonImageLabel, null, "Initial Capture"), /*#__PURE__*/React.createElement(BarcodeComparisonImage, {
|
|
18361
|
+
src: initialCaptureBarcodeImage,
|
|
18362
|
+
alt: "Initial capture barcode",
|
|
18363
|
+
onDoubleClick: function onDoubleClick() {
|
|
18364
|
+
return downloadImage(initialCaptureBarcodeImage, "barcode-initial-".concat(initialBarcodeScore.toFixed(3), ".jpg"));
|
|
18365
|
+
},
|
|
18366
|
+
title: "Double-click to download"
|
|
18367
|
+
}), /*#__PURE__*/React.createElement(BarcodeComparisonScoreLabel, {
|
|
18368
|
+
"$isHigher": initialBarcodeScore >= recaptureBarcodeScore
|
|
18369
|
+
}, initialBarcodeScore.toFixed(3)))), recaptureBarcodeImage && (/*#__PURE__*/React.createElement(BarcodeComparisonImageWrapper, null, /*#__PURE__*/React.createElement(BarcodeComparisonImageLabel, null, "Recapture"), /*#__PURE__*/React.createElement(BarcodeComparisonImage, {
|
|
18370
|
+
src: recaptureBarcodeImage,
|
|
18371
|
+
alt: "Recapture barcode",
|
|
18372
|
+
onDoubleClick: function onDoubleClick() {
|
|
18373
|
+
return downloadImage(recaptureBarcodeImage, "barcode-recapture-".concat(recaptureBarcodeScore.toFixed(3), ".jpg"));
|
|
18374
|
+
},
|
|
18375
|
+
title: "Double-click to download"
|
|
18376
|
+
}), /*#__PURE__*/React.createElement(BarcodeComparisonScoreLabel, {
|
|
18377
|
+
"$isHigher": recaptureBarcodeScore > initialBarcodeScore
|
|
18378
|
+
}, recaptureBarcodeScore.toFixed(3))))))))) : (/*#__PURE__*/React.createElement(BarcodeComparisonCard, null, /*#__PURE__*/React.createElement(ComparisonHeader, null, "\u26A0\uFE0F Recapture Attempted"), /*#__PURE__*/React.createElement(ComparisonRow, null, /*#__PURE__*/React.createElement(ComparisonLabel, null, "Initial Score:"), /*#__PURE__*/React.createElement(ComparisonScoreBadge, null, initialBarcodeScore.toFixed(3))), /*#__PURE__*/React.createElement(ComparisonRow, null, /*#__PURE__*/React.createElement(ComparisonLabel, null, "Recapture Result:"), /*#__PURE__*/React.createElement(ComparisonValue, null, "No barcode found")), initialCaptureBarcodeImage && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ComparisonDivider, null), /*#__PURE__*/React.createElement(ComparisonHeader, {
|
|
18379
|
+
style: {
|
|
18380
|
+
marginTop: '0.25rem'
|
|
18381
|
+
}
|
|
18382
|
+
}, "\uD83D\uDD0D Barcode Image (kept)"), /*#__PURE__*/React.createElement(BarcodeComparisonImagesContainer, {
|
|
18383
|
+
style: {
|
|
18384
|
+
gridTemplateColumns: '1fr'
|
|
18385
|
+
}
|
|
18386
|
+
}, /*#__PURE__*/React.createElement(BarcodeComparisonImageWrapper, null, /*#__PURE__*/React.createElement(BarcodeComparisonImageLabel, null, "Initial Capture"), /*#__PURE__*/React.createElement(BarcodeComparisonImage, {
|
|
18387
|
+
src: initialCaptureBarcodeImage,
|
|
18388
|
+
alt: "Initial capture barcode",
|
|
18389
|
+
onDoubleClick: function onDoubleClick() {
|
|
18390
|
+
return downloadImage(initialCaptureBarcodeImage, "barcode-initial-".concat(initialBarcodeScore.toFixed(3), ".jpg"));
|
|
18391
|
+
},
|
|
18392
|
+
title: "Double-click to download"
|
|
18393
|
+
}), /*#__PURE__*/React.createElement(BarcodeComparisonScoreLabel, {
|
|
18394
|
+
"$isHigher": true
|
|
18395
|
+
}, initialBarcodeScore.toFixed(3))))))))))) : (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DebugSection, null, /*#__PURE__*/React.createElement(DebugLabel, null, "Document Type:"), /*#__PURE__*/React.createElement(DebugValue, null, doc.documentType)), /*#__PURE__*/React.createElement(DebugSection, null, /*#__PURE__*/React.createElement(DebugLabel, null, "Detection Score:"), /*#__PURE__*/React.createElement(ScoreBadge, {
|
|
18396
|
+
"$score": (_c = doc.detectionScore) !== null && _c !== void 0 ? _c : 0,
|
|
18397
|
+
"$type": "detection"
|
|
18398
|
+
}, ((_d = doc.detectionScore) !== null && _d !== void 0 ? _d : 0).toFixed(3))), /*#__PURE__*/React.createElement(DebugSection, null, /*#__PURE__*/React.createElement(DebugLabel, null, "Focus Score:"), /*#__PURE__*/React.createElement(ScoreBadge, {
|
|
18399
|
+
"$score": (_e = doc.focusScore) !== null && _e !== void 0 ? _e : 0,
|
|
18400
|
+
"$type": "focus"
|
|
18401
|
+
}, ((_f = doc.focusScore) !== null && _f !== void 0 ? _f : 0).toFixed(3))), /*#__PURE__*/React.createElement(DebugSection, null, /*#__PURE__*/React.createElement(DebugLabel, null, "Bounding Box:"), /*#__PURE__*/React.createElement(DebugValue, null, JSON.stringify(doc.boundingBox, null, 2))))))));
|
|
18402
|
+
}), (clientBarcodeDecodeResult || nativeBarcodeDecodeResult || !capturedDocuments.idBarcodeImage) && (/*#__PURE__*/React.createElement(BarcodeResultsSection, null, !capturedDocuments.idBarcodeImage && (/*#__PURE__*/React.createElement(NoPDF417Warning, null, "\u26A0\uFE0F No PDF417 barcode detected during capture")), clientBarcodeDecodeResult && (/*#__PURE__*/React.createElement(ClientBarcodeResultCard, null, /*#__PURE__*/React.createElement(ClientBarcodeHeader, null, "\u2705 Dynamsoft (", clientBarcodeDecodeResult.format, ")"), parsedBarcodeData && parsedBarcodeData.fields.length > 0 ? (/*#__PURE__*/React.createElement(ClientBarcodeFieldsTable, null, /*#__PURE__*/React.createElement("tbody", null, parsedBarcodeData.fields.map(function (field) {
|
|
18403
|
+
return /*#__PURE__*/React.createElement(ClientBarcodeFieldTableRow, {
|
|
18404
|
+
key: field.code
|
|
18405
|
+
}, /*#__PURE__*/React.createElement(ClientBarcodeFieldLabelCell, null, field.label), /*#__PURE__*/React.createElement(ClientBarcodeFieldValueCell, null, field.value));
|
|
18406
|
+
})))) : (/*#__PURE__*/React.createElement(ClientBarcodeRow, null, /*#__PURE__*/React.createElement(ClientBarcodeLabel, null, "Raw Data:"), /*#__PURE__*/React.createElement(ClientBarcodeData, null, clientBarcodeDecodeResult.text))))), barcodeComparisonResult && (/*#__PURE__*/React.createElement(BarcodeComparisonBadge, {
|
|
18407
|
+
"$match": barcodeComparisonResult.match
|
|
18408
|
+
}, barcodeComparisonResult.match ? (/*#__PURE__*/React.createElement(React.Fragment, null, "\u2705 Results Match")) : (/*#__PURE__*/React.createElement(React.Fragment, null, "\u26A0\uFE0F Results Differ")))), nativeBarcodeDecodeResult && (/*#__PURE__*/React.createElement(NativeBarcodeResultCard, null, /*#__PURE__*/React.createElement(NativeBarcodeHeader, null, "\uD83D\uDD0D Native Decode (", nativeBarcodeDecodeResult.method === 'native' ? 'BarcodeDetector API' : 'zxing-js', ")"), parsedNativeBarcodeData && parsedNativeBarcodeData.fields.length > 0 ? (/*#__PURE__*/React.createElement(NativeBarcodeFieldsTable, null, /*#__PURE__*/React.createElement("tbody", null, parsedNativeBarcodeData.fields.map(function (field) {
|
|
18409
|
+
return /*#__PURE__*/React.createElement(NativeBarcodeFieldTableRow, {
|
|
18410
|
+
key: field.code
|
|
18411
|
+
}, /*#__PURE__*/React.createElement(NativeBarcodeFieldLabelCell, null, field.label), /*#__PURE__*/React.createElement(NativeBarcodeFieldValueCell, null, field.value));
|
|
18412
|
+
})))) : (/*#__PURE__*/React.createElement(NativeBarcodeRow, null, /*#__PURE__*/React.createElement(NativeBarcodeLabel, null, "Raw Data:"), /*#__PURE__*/React.createElement(NativeBarcodeData, null, nativeBarcodeDecodeResult.text))))))))), /*#__PURE__*/React.createElement(ButtonsColumn, {
|
|
17803
18413
|
className: classNames.buttonsRow
|
|
17804
18414
|
}, /*#__PURE__*/React.createElement(WideButton, {
|
|
17805
18415
|
ref: submitButtonRef,
|
|
@@ -17817,13 +18427,138 @@
|
|
|
17817
18427
|
finished: true
|
|
17818
18428
|
}, verbiage.retryText)))));
|
|
17819
18429
|
};
|
|
17820
|
-
var Heading$a = styled.h1(templateObject_1$
|
|
17821
|
-
var ImagesContainer = styled(OverlayImageContainer)(templateObject_2$
|
|
17822
|
-
var ImageRow = styled(OverlayImageRow)(templateObject_3$
|
|
17823
|
-
var ImageCol$1 = styled.div(templateObject_4$
|
|
17824
|
-
var StyledImage = styled(CapturedDocumentImg)(templateObject_5$
|
|
17825
|
-
var
|
|
17826
|
-
var
|
|
18430
|
+
var Heading$a = styled.h1(templateObject_1$F || (templateObject_1$F = __makeTemplateObject(["\n font-size: 1.5rem;\n margin-top: 0;\n margin-bottom: 1.5rem;\n"], ["\n font-size: 1.5rem;\n margin-top: 0;\n margin-bottom: 1.5rem;\n"])));
|
|
18431
|
+
var ImagesContainer = styled(OverlayImageContainer)(templateObject_2$B || (templateObject_2$B = __makeTemplateObject(["\n flex-grow: 1;\n overflow-y: auto;\n padding-bottom: 0;\n max-width: 100%;\n"], ["\n flex-grow: 1;\n overflow-y: auto;\n padding-bottom: 0;\n max-width: 100%;\n"])));
|
|
18432
|
+
var ImageRow = styled(OverlayImageRow)(templateObject_3$r || (templateObject_3$r = __makeTemplateObject(["\n max-width: 100%;\n flex-direction: column;\n position: relative;\n width: 100%;\n"], ["\n max-width: 100%;\n flex-direction: column;\n position: relative;\n width: 100%;\n"])));
|
|
18433
|
+
var ImageCol$1 = styled.div(templateObject_4$l || (templateObject_4$l = __makeTemplateObject(["\n width: 450px;\n max-width: 100%;\n max-height: none !important;\n"], ["\n width: 450px;\n max-width: 100%;\n max-height: none !important;\n"])));
|
|
18434
|
+
var StyledImage = styled(CapturedDocumentImg)(templateObject_5$g || (templateObject_5$g = __makeTemplateObject(["\n width: 100%;\n border-radius: 12px;\n"], ["\n width: 100%;\n border-radius: 12px;\n"])));
|
|
18435
|
+
var DebugInfoContainer = styled.div(templateObject_6$a || (templateObject_6$a = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 0.375rem;\n margin-top: 0.5rem;\n margin-bottom: 1rem;\n padding: 0.625rem;\n background: #f8f9fa;\n border-radius: 6px;\n border: 1px solid #e9ecef;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 0.8125rem;\n line-height: 1.35;\n text-align: left;\n"], ["\n display: flex;\n flex-direction: column;\n gap: 0.375rem;\n margin-top: 0.5rem;\n margin-bottom: 1rem;\n padding: 0.625rem;\n background: #f8f9fa;\n border-radius: 6px;\n border: 1px solid #e9ecef;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 0.8125rem;\n line-height: 1.35;\n text-align: left;\n"])));
|
|
18436
|
+
var DebugSection = styled.div(templateObject_7$6 || (templateObject_7$6 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 0.5rem;\n margin: 0;\n"], ["\n display: flex;\n align-items: center;\n gap: 0.5rem;\n margin: 0;\n"])));
|
|
18437
|
+
var DebugLabel = styled.span(templateObject_8$5 || (templateObject_8$5 = __makeTemplateObject(["\n font-weight: 600;\n color: #495057;\n font-size: 0.8125rem;\n flex-shrink: 0;\n width: 110px;\n"], ["\n font-weight: 600;\n color: #495057;\n font-size: 0.8125rem;\n flex-shrink: 0;\n width: 110px;\n"])));
|
|
18438
|
+
var DebugValue = styled.span(templateObject_9$4 || (templateObject_9$4 = __makeTemplateObject(["\n color: #212529;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 0.8125rem;\n"], ["\n color: #212529;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 0.8125rem;\n"])));
|
|
18439
|
+
var ScoreBadge = styled.span(templateObject_10$3 || (templateObject_10$3 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n padding: 0.1875rem 0.5rem;\n border-radius: 4px;\n font-weight: 600;\n font-size: 0.75rem;\n background: ", ";\n color: ", ";\n border: 1px solid\n ", ";\n"], ["\n display: inline-flex;\n align-items: center;\n padding: 0.1875rem 0.5rem;\n border-radius: 4px;\n font-weight: 600;\n font-size: 0.75rem;\n background: ", ";\n color: ", ";\n border: 1px solid\n ", ";\n"])), function (_a) {
|
|
18440
|
+
var $score = _a.$score,
|
|
18441
|
+
$type = _a.$type;
|
|
18442
|
+
var thresholds = $type === 'readability' ? {
|
|
18443
|
+
good: 0.5,
|
|
18444
|
+
medium: 0.2
|
|
18445
|
+
} : $type === 'detection' ? {
|
|
18446
|
+
good: 0.7,
|
|
18447
|
+
medium: 0.4
|
|
18448
|
+
} : {
|
|
18449
|
+
good: 0.7,
|
|
18450
|
+
medium: 0.4
|
|
18451
|
+
};
|
|
18452
|
+
if ($score >= thresholds.good) return '#d4edda';
|
|
18453
|
+
if ($score >= thresholds.medium) return '#fff3cd';
|
|
18454
|
+
return '#f8d7da';
|
|
18455
|
+
}, function (_a) {
|
|
18456
|
+
var $score = _a.$score,
|
|
18457
|
+
$type = _a.$type;
|
|
18458
|
+
var thresholds = $type === 'readability' ? {
|
|
18459
|
+
good: 0.5,
|
|
18460
|
+
medium: 0.2
|
|
18461
|
+
} : $type === 'detection' ? {
|
|
18462
|
+
good: 0.7,
|
|
18463
|
+
medium: 0.4
|
|
18464
|
+
} : {
|
|
18465
|
+
good: 0.7,
|
|
18466
|
+
medium: 0.4
|
|
18467
|
+
};
|
|
18468
|
+
if ($score >= thresholds.good) return '#155724';
|
|
18469
|
+
if ($score >= thresholds.medium) return '#856404';
|
|
18470
|
+
return '#721c24';
|
|
18471
|
+
}, function (_a) {
|
|
18472
|
+
var $score = _a.$score,
|
|
18473
|
+
$type = _a.$type;
|
|
18474
|
+
var thresholds = $type === 'readability' ? {
|
|
18475
|
+
good: 0.5,
|
|
18476
|
+
medium: 0.2
|
|
18477
|
+
} : $type === 'detection' ? {
|
|
18478
|
+
good: 0.7,
|
|
18479
|
+
medium: 0.4
|
|
18480
|
+
} : {
|
|
18481
|
+
good: 0.7,
|
|
18482
|
+
medium: 0.4
|
|
18483
|
+
};
|
|
18484
|
+
if ($score >= thresholds.good) return '#c3e6cb';
|
|
18485
|
+
if ($score >= thresholds.medium) return '#ffeaa7';
|
|
18486
|
+
return '#f5c6cb';
|
|
18487
|
+
});
|
|
18488
|
+
var BarcodeComparisonCard = styled.div(templateObject_11$3 || (templateObject_11$3 = __makeTemplateObject(["\n margin-top: 0.375rem;\n padding: 0.625rem;\n background: #e7f3ff;\n border-radius: 6px;\n border: 1px solid #b3d9ff;\n"], ["\n margin-top: 0.375rem;\n padding: 0.625rem;\n background: #e7f3ff;\n border-radius: 6px;\n border: 1px solid #b3d9ff;\n"])));
|
|
18489
|
+
var ComparisonHeader = styled.div(templateObject_12$3 || (templateObject_12$3 = __makeTemplateObject(["\n font-size: 0.8125rem;\n font-weight: 700;\n margin-bottom: 0.375rem;\n display: flex;\n align-items: center;\n gap: 0.375rem;\n color: #004085;\n"], ["\n font-size: 0.8125rem;\n font-weight: 700;\n margin-bottom: 0.375rem;\n display: flex;\n align-items: center;\n gap: 0.375rem;\n color: #004085;\n"])));
|
|
18490
|
+
var ComparisonRow = styled.div(templateObject_13$3 || (templateObject_13$3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 0.25rem;\n gap: 0.75rem;\n font-size: 0.8125rem;\n\n &:last-child {\n margin-bottom: 0;\n }\n"], ["\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 0.25rem;\n gap: 0.75rem;\n font-size: 0.8125rem;\n\n &:last-child {\n margin-bottom: 0;\n }\n"])));
|
|
18491
|
+
var ComparisonLabel = styled.span(templateObject_14$1 || (templateObject_14$1 = __makeTemplateObject(["\n font-weight: 500;\n color: #495057;\n"], ["\n font-weight: 500;\n color: #495057;\n"])));
|
|
18492
|
+
var ComparisonValue = styled.span(templateObject_15$1 || (templateObject_15$1 = __makeTemplateObject(["\n font-weight: 600;\n color: #212529;\n"], ["\n font-weight: 600;\n color: #212529;\n"])));
|
|
18493
|
+
var ComparisonDivider = styled.hr(templateObject_16$1 || (templateObject_16$1 = __makeTemplateObject(["\n border: none;\n border-top: 1px solid #b3d9ff;\n margin: 0.375rem 0;\n"], ["\n border: none;\n border-top: 1px solid #b3d9ff;\n margin: 0.375rem 0;\n"])));
|
|
18494
|
+
var ComparisonScoreBadge = styled.span(templateObject_17$1 || (templateObject_17$1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n padding: 0.1875rem 0.5rem;\n border-radius: 4px;\n font-weight: 600;\n font-size: 0.75rem;\n background: white;\n color: #212529;\n border: 1px solid #dee2e6;\n"], ["\n display: inline-flex;\n align-items: center;\n padding: 0.1875rem 0.5rem;\n border-radius: 4px;\n font-weight: 600;\n font-size: 0.75rem;\n background: white;\n color: #212529;\n border: 1px solid #dee2e6;\n"])));
|
|
18495
|
+
var ImprovementBadge = styled.span(templateObject_18$1 || (templateObject_18$1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n padding: 0.1875rem 0.5rem;\n border-radius: 4px;\n font-weight: 600;\n font-size: 0.75rem;\n background: ", ";\n color: ", ";\n border: 1px solid ", ";\n"], ["\n display: inline-flex;\n align-items: center;\n padding: 0.1875rem 0.5rem;\n border-radius: 4px;\n font-weight: 600;\n font-size: 0.75rem;\n background: ", ";\n color: ", ";\n border: 1px solid ", ";\n"])), function (_a) {
|
|
18496
|
+
var $improved = _a.$improved;
|
|
18497
|
+
return $improved ? '#d4edda' : '#e2e3e5';
|
|
18498
|
+
}, function (_a) {
|
|
18499
|
+
var $improved = _a.$improved;
|
|
18500
|
+
return $improved ? '#155724' : '#383d41';
|
|
18501
|
+
}, function (_a) {
|
|
18502
|
+
var $improved = _a.$improved;
|
|
18503
|
+
return $improved ? '#c3e6cb' : '#d6d8db';
|
|
18504
|
+
});
|
|
18505
|
+
var BarcodeComparisonImagesContainer = styled.div(templateObject_19$1 || (templateObject_19$1 = __makeTemplateObject(["\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 1rem;\n margin-top: 0.75rem;\n padding: 0.5rem;\n background: rgba(255, 255, 255, 0.5);\n border-radius: 6px;\n"], ["\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 1rem;\n margin-top: 0.75rem;\n padding: 0.5rem;\n background: rgba(255, 255, 255, 0.5);\n border-radius: 6px;\n"])));
|
|
18506
|
+
var BarcodeComparisonImageWrapper = styled.div(templateObject_20$1 || (templateObject_20$1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 0.375rem;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 0.375rem;\n"])));
|
|
18507
|
+
var BarcodeComparisonImageLabel = styled.span(templateObject_21$1 || (templateObject_21$1 = __makeTemplateObject(["\n font-size: 0.75rem;\n font-weight: 700;\n color: #004085;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n padding: 0.25rem 0.5rem;\n background: white;\n border-radius: 4px;\n border: 1px solid #b3d9ff;\n"], ["\n font-size: 0.75rem;\n font-weight: 700;\n color: #004085;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n padding: 0.25rem 0.5rem;\n background: white;\n border-radius: 4px;\n border: 1px solid #b3d9ff;\n"])));
|
|
18508
|
+
var BarcodeComparisonImage = styled.img(templateObject_22$1 || (templateObject_22$1 = __makeTemplateObject(["\n width: 100%;\n height: auto;\n border-radius: 6px;\n border: 2px solid #dee2e6;\n background: white;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n cursor: pointer;\n transition:\n transform 0.15s ease,\n box-shadow 0.15s ease;\n\n &:hover {\n transform: scale(1.02);\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);\n }\n\n &:active {\n transform: scale(0.98);\n }\n"], ["\n width: 100%;\n height: auto;\n border-radius: 6px;\n border: 2px solid #dee2e6;\n background: white;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n cursor: pointer;\n transition:\n transform 0.15s ease,\n box-shadow 0.15s ease;\n\n &:hover {\n transform: scale(1.02);\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);\n }\n\n &:active {\n transform: scale(0.98);\n }\n"])));
|
|
18509
|
+
var BarcodeComparisonScoreLabel = styled.span(templateObject_23$1 || (templateObject_23$1 = __makeTemplateObject(["\n font-size: 0.8125rem;\n font-weight: 700;\n color: ", ";\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n padding: 0.25rem 0.5rem;\n background: ", ";\n border-radius: 4px;\n border: 1px solid ", ";\n"], ["\n font-size: 0.8125rem;\n font-weight: 700;\n color: ", ";\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n padding: 0.25rem 0.5rem;\n background: ", ";\n border-radius: 4px;\n border: 1px solid ", ";\n"])), function (_a) {
|
|
18510
|
+
var $isHigher = _a.$isHigher;
|
|
18511
|
+
return $isHigher ? '#155724' : '#495057';
|
|
18512
|
+
}, function (_a) {
|
|
18513
|
+
var $isHigher = _a.$isHigher;
|
|
18514
|
+
return $isHigher ? '#d4edda' : 'white';
|
|
18515
|
+
}, function (_a) {
|
|
18516
|
+
var $isHigher = _a.$isHigher;
|
|
18517
|
+
return $isHigher ? '#c3e6cb' : '#dee2e6';
|
|
18518
|
+
});
|
|
18519
|
+
var ClientBarcodeResultCard = styled.div(templateObject_24$1 || (templateObject_24$1 = __makeTemplateObject(["\n margin-top: 0.75rem;\n margin-bottom: 1rem;\n padding: 0.75rem;\n background: #d4edda;\n border-radius: 8px;\n border: 1px solid #c3e6cb;\n text-align: left;\n"], ["\n margin-top: 0.75rem;\n margin-bottom: 1rem;\n padding: 0.75rem;\n background: #d4edda;\n border-radius: 8px;\n border: 1px solid #c3e6cb;\n text-align: left;\n"])));
|
|
18520
|
+
var ClientBarcodeHeader = styled.div(templateObject_25 || (templateObject_25 = __makeTemplateObject(["\n font-size: 0.875rem;\n font-weight: 700;\n margin-bottom: 0.5rem;\n color: #155724;\n"], ["\n font-size: 0.875rem;\n font-weight: 700;\n margin-bottom: 0.5rem;\n color: #155724;\n"])));
|
|
18521
|
+
var ClientBarcodeRow = styled.div(templateObject_26 || (templateObject_26 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n margin-bottom: 0.375rem;\n\n &:last-child {\n margin-bottom: 0;\n }\n"], ["\n display: flex;\n flex-direction: column;\n margin-bottom: 0.375rem;\n\n &:last-child {\n margin-bottom: 0;\n }\n"])));
|
|
18522
|
+
var ClientBarcodeLabel = styled.span(templateObject_27 || (templateObject_27 = __makeTemplateObject(["\n font-size: 0.75rem;\n font-weight: 600;\n color: #155724;\n margin-bottom: 0.125rem;\n"], ["\n font-size: 0.75rem;\n font-weight: 600;\n color: #155724;\n margin-bottom: 0.125rem;\n"])));
|
|
18523
|
+
var ClientBarcodeData = styled.pre(templateObject_28 || (templateObject_28 = __makeTemplateObject(["\n font-size: 0.6875rem;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n color: #155724;\n background: rgba(255, 255, 255, 0.5);\n padding: 0.5rem;\n border-radius: 4px;\n margin: 0;\n white-space: pre-wrap;\n word-break: break-all;\n max-height: 150px;\n overflow-y: auto;\n"], ["\n font-size: 0.6875rem;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n color: #155724;\n background: rgba(255, 255, 255, 0.5);\n padding: 0.5rem;\n border-radius: 4px;\n margin: 0;\n white-space: pre-wrap;\n word-break: break-all;\n max-height: 150px;\n overflow-y: auto;\n"])));
|
|
18524
|
+
var ClientBarcodeFieldsTable = styled.table(templateObject_29 || (templateObject_29 = __makeTemplateObject(["\n width: 100%;\n max-height: 300px;\n overflow-y: auto;\n display: block;\n background: rgba(255, 255, 255, 0.5);\n padding: 0.5rem;\n border-radius: 4px;\n border-collapse: collapse;\n\n tbody {\n display: table;\n width: 100%;\n }\n"], ["\n width: 100%;\n max-height: 300px;\n overflow-y: auto;\n display: block;\n background: rgba(255, 255, 255, 0.5);\n padding: 0.5rem;\n border-radius: 4px;\n border-collapse: collapse;\n\n tbody {\n display: table;\n width: 100%;\n }\n"])));
|
|
18525
|
+
var ClientBarcodeFieldTableRow = styled.tr(templateObject_30 || (templateObject_30 = __makeTemplateObject(["\n border-bottom: 1px solid rgba(21, 87, 36, 0.1);\n\n &:last-child {\n border-bottom: none;\n }\n\n @media (max-width: 480px) {\n display: flex;\n flex-direction: column;\n padding: 0.375rem 0;\n }\n"], ["\n border-bottom: 1px solid rgba(21, 87, 36, 0.1);\n\n &:last-child {\n border-bottom: none;\n }\n\n @media (max-width: 480px) {\n display: flex;\n flex-direction: column;\n padding: 0.375rem 0;\n }\n"])));
|
|
18526
|
+
var ClientBarcodeFieldLabelCell = styled.td(templateObject_31 || (templateObject_31 = __makeTemplateObject(["\n font-size: 0.75rem;\n font-weight: 600;\n color: #155724;\n padding: 0.375rem 0.75rem 0.375rem 0;\n white-space: nowrap;\n vertical-align: top;\n\n @media (max-width: 480px) {\n padding: 0 0 0.125rem 0;\n white-space: normal;\n }\n"], ["\n font-size: 0.75rem;\n font-weight: 600;\n color: #155724;\n padding: 0.375rem 0.75rem 0.375rem 0;\n white-space: nowrap;\n vertical-align: top;\n\n @media (max-width: 480px) {\n padding: 0 0 0.125rem 0;\n white-space: normal;\n }\n"])));
|
|
18527
|
+
var ClientBarcodeFieldValueCell = styled.td(templateObject_32 || (templateObject_32 = __makeTemplateObject(["\n font-size: 0.75rem;\n color: #155724;\n padding: 0.375rem 0;\n word-break: break-word;\n\n @media (max-width: 480px) {\n padding: 0;\n }\n"], ["\n font-size: 0.75rem;\n color: #155724;\n padding: 0.375rem 0;\n word-break: break-word;\n\n @media (max-width: 480px) {\n padding: 0;\n }\n"
|
|
18528
|
+
// Native barcode result styles (blue theme for comparison)
|
|
18529
|
+
])));
|
|
18530
|
+
// Native barcode result styles (blue theme for comparison)
|
|
18531
|
+
var NativeBarcodeResultCard = styled.div(templateObject_33 || (templateObject_33 = __makeTemplateObject(["\n margin-top: 0.75rem;\n margin-bottom: 1rem;\n padding: 0.75rem;\n background: #cce5ff;\n border-radius: 8px;\n border: 1px solid #b8daff;\n text-align: left;\n"], ["\n margin-top: 0.75rem;\n margin-bottom: 1rem;\n padding: 0.75rem;\n background: #cce5ff;\n border-radius: 8px;\n border: 1px solid #b8daff;\n text-align: left;\n"])));
|
|
18532
|
+
var NativeBarcodeHeader = styled.div(templateObject_34 || (templateObject_34 = __makeTemplateObject(["\n font-size: 0.875rem;\n font-weight: 700;\n margin-bottom: 0.5rem;\n color: #004085;\n"], ["\n font-size: 0.875rem;\n font-weight: 700;\n margin-bottom: 0.5rem;\n color: #004085;\n"])));
|
|
18533
|
+
var NativeBarcodeRow = styled.div(templateObject_35 || (templateObject_35 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n margin-bottom: 0.375rem;\n\n &:last-child {\n margin-bottom: 0;\n }\n"], ["\n display: flex;\n flex-direction: column;\n margin-bottom: 0.375rem;\n\n &:last-child {\n margin-bottom: 0;\n }\n"])));
|
|
18534
|
+
var NativeBarcodeLabel = styled.span(templateObject_36 || (templateObject_36 = __makeTemplateObject(["\n font-size: 0.75rem;\n font-weight: 600;\n color: #004085;\n margin-bottom: 0.125rem;\n"], ["\n font-size: 0.75rem;\n font-weight: 600;\n color: #004085;\n margin-bottom: 0.125rem;\n"])));
|
|
18535
|
+
var NativeBarcodeData = styled.pre(templateObject_37 || (templateObject_37 = __makeTemplateObject(["\n font-size: 0.6875rem;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n color: #004085;\n background: rgba(255, 255, 255, 0.5);\n padding: 0.5rem;\n border-radius: 4px;\n margin: 0;\n white-space: pre-wrap;\n word-break: break-all;\n max-height: 150px;\n overflow-y: auto;\n"], ["\n font-size: 0.6875rem;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n color: #004085;\n background: rgba(255, 255, 255, 0.5);\n padding: 0.5rem;\n border-radius: 4px;\n margin: 0;\n white-space: pre-wrap;\n word-break: break-all;\n max-height: 150px;\n overflow-y: auto;\n"])));
|
|
18536
|
+
var NativeBarcodeFieldsTable = styled.table(templateObject_38 || (templateObject_38 = __makeTemplateObject(["\n width: 100%;\n max-height: 300px;\n overflow-y: auto;\n display: block;\n background: rgba(255, 255, 255, 0.5);\n padding: 0.5rem;\n border-radius: 4px;\n border-collapse: collapse;\n\n tbody {\n display: table;\n width: 100%;\n }\n"], ["\n width: 100%;\n max-height: 300px;\n overflow-y: auto;\n display: block;\n background: rgba(255, 255, 255, 0.5);\n padding: 0.5rem;\n border-radius: 4px;\n border-collapse: collapse;\n\n tbody {\n display: table;\n width: 100%;\n }\n"])));
|
|
18537
|
+
var NativeBarcodeFieldTableRow = styled.tr(templateObject_39 || (templateObject_39 = __makeTemplateObject(["\n border-bottom: 1px solid rgba(0, 64, 133, 0.1);\n\n &:last-child {\n border-bottom: none;\n }\n\n @media (max-width: 480px) {\n display: flex;\n flex-direction: column;\n padding: 0.375rem 0;\n }\n"], ["\n border-bottom: 1px solid rgba(0, 64, 133, 0.1);\n\n &:last-child {\n border-bottom: none;\n }\n\n @media (max-width: 480px) {\n display: flex;\n flex-direction: column;\n padding: 0.375rem 0;\n }\n"])));
|
|
18538
|
+
var NativeBarcodeFieldLabelCell = styled.td(templateObject_40 || (templateObject_40 = __makeTemplateObject(["\n font-size: 0.75rem;\n font-weight: 600;\n color: #004085;\n padding: 0.375rem 0.75rem 0.375rem 0;\n white-space: nowrap;\n vertical-align: top;\n\n @media (max-width: 480px) {\n padding: 0 0 0.125rem 0;\n white-space: normal;\n }\n"], ["\n font-size: 0.75rem;\n font-weight: 600;\n color: #004085;\n padding: 0.375rem 0.75rem 0.375rem 0;\n white-space: nowrap;\n vertical-align: top;\n\n @media (max-width: 480px) {\n padding: 0 0 0.125rem 0;\n white-space: normal;\n }\n"])));
|
|
18539
|
+
var NativeBarcodeFieldValueCell = styled.td(templateObject_41 || (templateObject_41 = __makeTemplateObject(["\n font-size: 0.75rem;\n color: #004085;\n padding: 0.375rem 0;\n word-break: break-word;\n\n @media (max-width: 480px) {\n padding: 0;\n }\n"], ["\n font-size: 0.75rem;\n color: #004085;\n padding: 0.375rem 0;\n word-break: break-word;\n\n @media (max-width: 480px) {\n padding: 0;\n }\n"
|
|
18540
|
+
// Comparison badge showing whether native and Dynamsoft results match
|
|
18541
|
+
])));
|
|
18542
|
+
// Comparison badge showing whether native and Dynamsoft results match
|
|
18543
|
+
var BarcodeComparisonBadge = styled.div(templateObject_42 || (templateObject_42 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n margin: 0.5rem 0;\n padding: 0.625rem 1rem;\n border-radius: 8px;\n font-size: 0.875rem;\n font-weight: 700;\n background: ", ";\n color: ", ";\n border: 2px solid ", ";\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n margin: 0.5rem 0;\n padding: 0.625rem 1rem;\n border-radius: 8px;\n font-size: 0.875rem;\n font-weight: 700;\n background: ", ";\n color: ", ";\n border: 2px solid ", ";\n"
|
|
18544
|
+
// Container for barcode decode results section
|
|
18545
|
+
])), function (_a) {
|
|
18546
|
+
var $match = _a.$match;
|
|
18547
|
+
return $match ? '#d4edda' : '#fff3cd';
|
|
18548
|
+
}, function (_a) {
|
|
18549
|
+
var $match = _a.$match;
|
|
18550
|
+
return $match ? '#155724' : '#856404';
|
|
18551
|
+
}, function (_a) {
|
|
18552
|
+
var $match = _a.$match;
|
|
18553
|
+
return $match ? '#28a745' : '#ffc107';
|
|
18554
|
+
});
|
|
18555
|
+
// Container for barcode decode results section
|
|
18556
|
+
var BarcodeResultsSection = styled.div(templateObject_43 || (templateObject_43 = __makeTemplateObject(["\n width: 450px;\n max-width: 100%;\n margin-top: 1rem;\n flex-shrink: 0;\n"], ["\n width: 450px;\n max-width: 100%;\n margin-top: 1rem;\n flex-shrink: 0;\n"
|
|
18557
|
+
// Warning shown when no PDF417 barcode was detected
|
|
18558
|
+
])));
|
|
18559
|
+
// Warning shown when no PDF417 barcode was detected
|
|
18560
|
+
var NoPDF417Warning = styled.div(templateObject_44 || (templateObject_44 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n margin-bottom: 0.75rem;\n padding: 0.75rem 1rem;\n border-radius: 8px;\n font-size: 0.875rem;\n font-weight: 600;\n background: #fff3cd;\n color: #856404;\n border: 1px solid #ffc107;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n margin-bottom: 0.75rem;\n padding: 0.75rem 1rem;\n border-radius: 8px;\n font-size: 0.875rem;\n font-weight: 600;\n background: #fff3cd;\n color: #856404;\n border: 1px solid #ffc107;\n"])));
|
|
18561
|
+
var templateObject_1$F, templateObject_2$B, templateObject_3$r, templateObject_4$l, templateObject_5$g, templateObject_6$a, templateObject_7$6, templateObject_8$5, templateObject_9$4, templateObject_10$3, templateObject_11$3, templateObject_12$3, templateObject_13$3, templateObject_14$1, templateObject_15$1, templateObject_16$1, templateObject_17$1, templateObject_18$1, templateObject_19$1, templateObject_20$1, templateObject_21$1, templateObject_22$1, templateObject_23$1, templateObject_24$1, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33, templateObject_34, templateObject_35, templateObject_36, templateObject_37, templateObject_38, templateObject_39, templateObject_40, templateObject_41, templateObject_42, templateObject_43, templateObject_44;
|
|
17827
18562
|
|
|
17828
18563
|
function useShowSuccessScreen(skipSuccessScreen, successScreenReady, onDoneCallback) {
|
|
17829
18564
|
var _this = this;
|
|
@@ -17858,44 +18593,420 @@
|
|
|
17858
18593
|
return !skipSuccessScreen || skipSuccessScreenResolvedFalse;
|
|
17859
18594
|
}
|
|
17860
18595
|
|
|
17861
|
-
|
|
17862
|
-
|
|
17863
|
-
|
|
17864
|
-
|
|
17865
|
-
|
|
17866
|
-
|
|
17867
|
-
|
|
17868
|
-
|
|
17869
|
-
|
|
18596
|
+
/**
|
|
18597
|
+
* Native barcode decoder that tries browser BarcodeDetector API first,
|
|
18598
|
+
* then falls back to zxing-js for broader compatibility.
|
|
18599
|
+
*
|
|
18600
|
+
* This provides a free alternative to Dynamsoft for PDF417 barcode scanning.
|
|
18601
|
+
*/
|
|
18602
|
+
// CDN URL for zxing-js library
|
|
18603
|
+
var ZXING_CDN_URL = 'https://unpkg.com/@zxing/library@latest';
|
|
18604
|
+
var zxingLoadPromise = null;
|
|
18605
|
+
var zxingInstance = null;
|
|
18606
|
+
var nativeSupportChecked = false;
|
|
18607
|
+
var nativeSupportsFormat = false;
|
|
18608
|
+
/**
|
|
18609
|
+
* Check if the native BarcodeDetector API is available
|
|
18610
|
+
*/
|
|
18611
|
+
function isNativeBarcodeDetectorAvailable() {
|
|
18612
|
+
return typeof window !== 'undefined' && 'BarcodeDetector' in window;
|
|
17870
18613
|
}
|
|
17871
|
-
|
|
17872
|
-
|
|
17873
|
-
|
|
17874
|
-
|
|
17875
|
-
|
|
18614
|
+
/**
|
|
18615
|
+
* Check if the native BarcodeDetector supports PDF417 format
|
|
18616
|
+
*/
|
|
18617
|
+
function checkNativePDF417Support() {
|
|
18618
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
18619
|
+
var formats, error_1;
|
|
18620
|
+
return __generator(this, function (_a) {
|
|
18621
|
+
switch (_a.label) {
|
|
18622
|
+
case 0:
|
|
18623
|
+
if (nativeSupportChecked) {
|
|
18624
|
+
return [2 /*return*/, nativeSupportsFormat];
|
|
18625
|
+
}
|
|
18626
|
+
if (!isNativeBarcodeDetectorAvailable()) {
|
|
18627
|
+
nativeSupportChecked = true;
|
|
18628
|
+
nativeSupportsFormat = false;
|
|
18629
|
+
return [2 /*return*/, false];
|
|
18630
|
+
}
|
|
18631
|
+
_a.label = 1;
|
|
18632
|
+
case 1:
|
|
18633
|
+
_a.trys.push([1, 3,, 4]);
|
|
18634
|
+
return [4 /*yield*/, window.BarcodeDetector.getSupportedFormats()];
|
|
18635
|
+
case 2:
|
|
18636
|
+
formats = _a.sent();
|
|
18637
|
+
nativeSupportsFormat = formats.includes('pdf417');
|
|
18638
|
+
nativeSupportChecked = true;
|
|
18639
|
+
log('[NativeBarcodeDecoder] Native BarcodeDetector formats:', formats);
|
|
18640
|
+
log('[NativeBarcodeDecoder] PDF417 supported:', nativeSupportsFormat);
|
|
18641
|
+
return [2 /*return*/, nativeSupportsFormat];
|
|
18642
|
+
case 3:
|
|
18643
|
+
error_1 = _a.sent();
|
|
18644
|
+
warn('[NativeBarcodeDecoder] Error checking native format support:', error_1);
|
|
18645
|
+
nativeSupportChecked = true;
|
|
18646
|
+
nativeSupportsFormat = false;
|
|
18647
|
+
return [2 /*return*/, false];
|
|
18648
|
+
case 4:
|
|
18649
|
+
return [2 /*return*/];
|
|
18650
|
+
}
|
|
18651
|
+
});
|
|
18652
|
+
});
|
|
17876
18653
|
}
|
|
17877
|
-
|
|
17878
|
-
|
|
17879
|
-
|
|
17880
|
-
|
|
17881
|
-
return
|
|
17882
|
-
|
|
17883
|
-
|
|
17884
|
-
|
|
17885
|
-
|
|
17886
|
-
|
|
17887
|
-
|
|
17888
|
-
|
|
17889
|
-
|
|
17890
|
-
|
|
17891
|
-
|
|
17892
|
-
|
|
17893
|
-
|
|
17894
|
-
|
|
17895
|
-
|
|
17896
|
-
|
|
17897
|
-
|
|
17898
|
-
|
|
18654
|
+
/**
|
|
18655
|
+
* Load a script from URL
|
|
18656
|
+
*/
|
|
18657
|
+
function loadScript$1(url) {
|
|
18658
|
+
return new Promise(function (resolve, reject) {
|
|
18659
|
+
if (document.querySelector("script[src=\"".concat(url, "\"]"))) {
|
|
18660
|
+
resolve();
|
|
18661
|
+
return;
|
|
18662
|
+
}
|
|
18663
|
+
var script = document.createElement('script');
|
|
18664
|
+
script.src = url;
|
|
18665
|
+
script.async = true;
|
|
18666
|
+
script.onload = function () {
|
|
18667
|
+
return resolve();
|
|
18668
|
+
};
|
|
18669
|
+
script.onerror = function () {
|
|
18670
|
+
return reject(new Error("Failed to load script from ".concat(url)));
|
|
18671
|
+
};
|
|
18672
|
+
document.head.appendChild(script);
|
|
18673
|
+
});
|
|
18674
|
+
}
|
|
18675
|
+
/**
|
|
18676
|
+
* Load zxing-js from CDN
|
|
18677
|
+
*/
|
|
18678
|
+
function loadZXing() {
|
|
18679
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
18680
|
+
var _this = this;
|
|
18681
|
+
return __generator(this, function (_a) {
|
|
18682
|
+
if (window.ZXing) {
|
|
18683
|
+
return [2 /*return*/, window.ZXing];
|
|
18684
|
+
}
|
|
18685
|
+
if (zxingLoadPromise) {
|
|
18686
|
+
return [2 /*return*/, zxingLoadPromise];
|
|
18687
|
+
}
|
|
18688
|
+
zxingLoadPromise = function () {
|
|
18689
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
18690
|
+
return __generator(this, function (_a) {
|
|
18691
|
+
switch (_a.label) {
|
|
18692
|
+
case 0:
|
|
18693
|
+
return [4 /*yield*/, loadScript$1(ZXING_CDN_URL)];
|
|
18694
|
+
case 1:
|
|
18695
|
+
_a.sent();
|
|
18696
|
+
if (!window.ZXing) {
|
|
18697
|
+
throw new Error('Failed to load ZXing library from CDN');
|
|
18698
|
+
}
|
|
18699
|
+
log('[NativeBarcodeDecoder] Loaded @zxing/library from CDN');
|
|
18700
|
+
return [2 /*return*/, window.ZXing];
|
|
18701
|
+
}
|
|
18702
|
+
});
|
|
18703
|
+
});
|
|
18704
|
+
}();
|
|
18705
|
+
return [2 /*return*/, zxingLoadPromise];
|
|
18706
|
+
});
|
|
18707
|
+
});
|
|
18708
|
+
}
|
|
18709
|
+
/**
|
|
18710
|
+
* Create a ZXing reader instance configured for PDF417
|
|
18711
|
+
*/
|
|
18712
|
+
function getZXingReader() {
|
|
18713
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
18714
|
+
var ZXing, reader;
|
|
18715
|
+
return __generator(this, function (_a) {
|
|
18716
|
+
switch (_a.label) {
|
|
18717
|
+
case 0:
|
|
18718
|
+
if (zxingInstance) {
|
|
18719
|
+
return [2 /*return*/, zxingInstance];
|
|
18720
|
+
}
|
|
18721
|
+
return [4 /*yield*/, loadZXing()
|
|
18722
|
+
// Use the dedicated PDF417 reader class
|
|
18723
|
+
];
|
|
18724
|
+
case 1:
|
|
18725
|
+
ZXing = _a.sent();
|
|
18726
|
+
reader = new ZXing.BrowserPDF417Reader();
|
|
18727
|
+
zxingInstance = reader;
|
|
18728
|
+
return [2 /*return*/, reader];
|
|
18729
|
+
}
|
|
18730
|
+
});
|
|
18731
|
+
});
|
|
18732
|
+
}
|
|
18733
|
+
/**
|
|
18734
|
+
* Decode a barcode using the native BarcodeDetector API
|
|
18735
|
+
*/
|
|
18736
|
+
function decodeWithNative(image) {
|
|
18737
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
18738
|
+
var detector, results, result, error_2;
|
|
18739
|
+
return __generator(this, function (_a) {
|
|
18740
|
+
switch (_a.label) {
|
|
18741
|
+
case 0:
|
|
18742
|
+
if (!isNativeBarcodeDetectorAvailable()) {
|
|
18743
|
+
return [2 /*return*/, null];
|
|
18744
|
+
}
|
|
18745
|
+
_a.label = 1;
|
|
18746
|
+
case 1:
|
|
18747
|
+
_a.trys.push([1, 3,, 4]);
|
|
18748
|
+
detector = new window.BarcodeDetector({
|
|
18749
|
+
formats: ['pdf417']
|
|
18750
|
+
});
|
|
18751
|
+
return [4 /*yield*/, detector.detect(image)];
|
|
18752
|
+
case 2:
|
|
18753
|
+
results = _a.sent();
|
|
18754
|
+
if (results.length > 0) {
|
|
18755
|
+
result = results[0];
|
|
18756
|
+
return [2 /*return*/, {
|
|
18757
|
+
text: result.rawValue,
|
|
18758
|
+
format: result.format,
|
|
18759
|
+
method: 'native'
|
|
18760
|
+
}];
|
|
18761
|
+
}
|
|
18762
|
+
return [2 /*return*/, null];
|
|
18763
|
+
case 3:
|
|
18764
|
+
error_2 = _a.sent();
|
|
18765
|
+
warn('[NativeBarcodeDecoder] Native decode error:', error_2);
|
|
18766
|
+
return [2 /*return*/, null];
|
|
18767
|
+
case 4:
|
|
18768
|
+
return [2 /*return*/];
|
|
18769
|
+
}
|
|
18770
|
+
});
|
|
18771
|
+
});
|
|
18772
|
+
}
|
|
18773
|
+
/**
|
|
18774
|
+
* Decode a barcode using zxing-js
|
|
18775
|
+
*/
|
|
18776
|
+
function decodeWithZXing(image) {
|
|
18777
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
18778
|
+
var reader, result, text, format, error_3;
|
|
18779
|
+
return __generator(this, function (_a) {
|
|
18780
|
+
switch (_a.label) {
|
|
18781
|
+
case 0:
|
|
18782
|
+
_a.trys.push([0, 7,, 8]);
|
|
18783
|
+
return [4 /*yield*/, getZXingReader()];
|
|
18784
|
+
case 1:
|
|
18785
|
+
reader = _a.sent();
|
|
18786
|
+
result = void 0;
|
|
18787
|
+
if (!(image instanceof HTMLImageElement)) return [3 /*break*/, 3];
|
|
18788
|
+
return [4 /*yield*/, reader.decodeFromImage(image)];
|
|
18789
|
+
case 2:
|
|
18790
|
+
// decodeFromImage takes an image element or undefined + URL
|
|
18791
|
+
result = _a.sent();
|
|
18792
|
+
return [3 /*break*/, 6];
|
|
18793
|
+
case 3:
|
|
18794
|
+
if (!(image instanceof HTMLCanvasElement)) return [3 /*break*/, 5];
|
|
18795
|
+
return [4 /*yield*/, reader.decodeFromCanvas(image)];
|
|
18796
|
+
case 4:
|
|
18797
|
+
result = _a.sent();
|
|
18798
|
+
return [3 /*break*/, 6];
|
|
18799
|
+
case 5:
|
|
18800
|
+
throw new Error('Unsupported image type for ZXing decoder');
|
|
18801
|
+
case 6:
|
|
18802
|
+
text = result.text || result.getText();
|
|
18803
|
+
format = result.getBarcodeFormat().toString();
|
|
18804
|
+
return [2 /*return*/, {
|
|
18805
|
+
text: text,
|
|
18806
|
+
format: format,
|
|
18807
|
+
method: 'zxing'
|
|
18808
|
+
}];
|
|
18809
|
+
case 7:
|
|
18810
|
+
error_3 = _a.sent();
|
|
18811
|
+
// NotFoundException is expected when no barcode is found
|
|
18812
|
+
if (error_3 instanceof Error && error_3.name !== 'NotFoundException' && !error_3.message.includes('No barcode') && !error_3.message.includes('not found')) {
|
|
18813
|
+
warn('[NativeBarcodeDecoder] ZXing decode error:', error_3);
|
|
18814
|
+
}
|
|
18815
|
+
return [2 /*return*/, null];
|
|
18816
|
+
case 8:
|
|
18817
|
+
return [2 /*return*/];
|
|
18818
|
+
}
|
|
18819
|
+
});
|
|
18820
|
+
});
|
|
18821
|
+
}
|
|
18822
|
+
/**
|
|
18823
|
+
* Convert various image sources to HTMLImageElement or HTMLCanvasElement
|
|
18824
|
+
*/
|
|
18825
|
+
function prepareImageForDecoding(source) {
|
|
18826
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
18827
|
+
var canvas, ctx, canvas, ctx, url_1, img_1, canvas, ctx;
|
|
18828
|
+
return __generator(this, function (_a) {
|
|
18829
|
+
switch (_a.label) {
|
|
18830
|
+
case 0:
|
|
18831
|
+
if (!(source instanceof HTMLImageElement)) return [3 /*break*/, 3];
|
|
18832
|
+
if (!!source.complete) return [3 /*break*/, 2];
|
|
18833
|
+
return [4 /*yield*/, new Promise(function (resolve, reject) {
|
|
18834
|
+
source.onload = function () {
|
|
18835
|
+
return resolve();
|
|
18836
|
+
};
|
|
18837
|
+
source.onerror = function () {
|
|
18838
|
+
return reject(new Error('Failed to load image'));
|
|
18839
|
+
};
|
|
18840
|
+
})];
|
|
18841
|
+
case 1:
|
|
18842
|
+
_a.sent();
|
|
18843
|
+
_a.label = 2;
|
|
18844
|
+
case 2:
|
|
18845
|
+
return [2 /*return*/, source];
|
|
18846
|
+
case 3:
|
|
18847
|
+
// If it's a canvas, return it directly
|
|
18848
|
+
if (source instanceof HTMLCanvasElement) {
|
|
18849
|
+
return [2 /*return*/, source];
|
|
18850
|
+
}
|
|
18851
|
+
// If it's a video element, capture a frame to canvas
|
|
18852
|
+
if (source instanceof HTMLVideoElement) {
|
|
18853
|
+
canvas = document.createElement('canvas');
|
|
18854
|
+
canvas.width = source.videoWidth;
|
|
18855
|
+
canvas.height = source.videoHeight;
|
|
18856
|
+
ctx = canvas.getContext('2d');
|
|
18857
|
+
if (!ctx) {
|
|
18858
|
+
throw new Error('Failed to get canvas context');
|
|
18859
|
+
}
|
|
18860
|
+
ctx.drawImage(source, 0, 0);
|
|
18861
|
+
return [2 /*return*/, canvas];
|
|
18862
|
+
}
|
|
18863
|
+
// If it's ImageData, draw to canvas
|
|
18864
|
+
if (source instanceof ImageData) {
|
|
18865
|
+
canvas = document.createElement('canvas');
|
|
18866
|
+
canvas.width = source.width;
|
|
18867
|
+
canvas.height = source.height;
|
|
18868
|
+
ctx = canvas.getContext('2d');
|
|
18869
|
+
if (!ctx) {
|
|
18870
|
+
throw new Error('Failed to get canvas context');
|
|
18871
|
+
}
|
|
18872
|
+
ctx.putImageData(source, 0, 0);
|
|
18873
|
+
return [2 /*return*/, canvas];
|
|
18874
|
+
}
|
|
18875
|
+
if (!(source instanceof Blob)) return [3 /*break*/, 7];
|
|
18876
|
+
url_1 = URL.createObjectURL(source);
|
|
18877
|
+
_a.label = 4;
|
|
18878
|
+
case 4:
|
|
18879
|
+
_a.trys.push([4,, 6, 7]);
|
|
18880
|
+
img_1 = new Image();
|
|
18881
|
+
img_1.crossOrigin = 'anonymous';
|
|
18882
|
+
return [4 /*yield*/, new Promise(function (resolve, reject) {
|
|
18883
|
+
img_1.onload = function () {
|
|
18884
|
+
return resolve();
|
|
18885
|
+
};
|
|
18886
|
+
img_1.onerror = function () {
|
|
18887
|
+
return reject(new Error('Failed to load image from blob'));
|
|
18888
|
+
};
|
|
18889
|
+
img_1.src = url_1;
|
|
18890
|
+
})];
|
|
18891
|
+
case 5:
|
|
18892
|
+
_a.sent();
|
|
18893
|
+
return [2 /*return*/, img_1];
|
|
18894
|
+
case 6:
|
|
18895
|
+
URL.revokeObjectURL(url_1);
|
|
18896
|
+
return [7 /*endfinally*/];
|
|
18897
|
+
case 7:
|
|
18898
|
+
// If it's an ImageBitmap, draw to canvas
|
|
18899
|
+
if (source instanceof ImageBitmap) {
|
|
18900
|
+
canvas = document.createElement('canvas');
|
|
18901
|
+
canvas.width = source.width;
|
|
18902
|
+
canvas.height = source.height;
|
|
18903
|
+
ctx = canvas.getContext('2d');
|
|
18904
|
+
if (!ctx) {
|
|
18905
|
+
throw new Error('Failed to get canvas context');
|
|
18906
|
+
}
|
|
18907
|
+
ctx.drawImage(source, 0, 0);
|
|
18908
|
+
return [2 /*return*/, canvas];
|
|
18909
|
+
}
|
|
18910
|
+
throw new Error('Unsupported image source type');
|
|
18911
|
+
}
|
|
18912
|
+
});
|
|
18913
|
+
});
|
|
18914
|
+
}
|
|
18915
|
+
/**
|
|
18916
|
+
* Decode a PDF417 barcode from an image source.
|
|
18917
|
+
*
|
|
18918
|
+
* Tries native BarcodeDetector API first (if available and supports PDF417),
|
|
18919
|
+
* then falls back to zxing-js.
|
|
18920
|
+
*
|
|
18921
|
+
* @param source - Image source (HTMLImageElement, HTMLCanvasElement, HTMLVideoElement, ImageData, Blob, ImageBitmap)
|
|
18922
|
+
* @param options - Decode options
|
|
18923
|
+
* @returns Decoded barcode result or null if no barcode found
|
|
18924
|
+
*/
|
|
18925
|
+
function decodePDF417(source_1) {
|
|
18926
|
+
return __awaiter(this, arguments, void 0, function (source, options) {
|
|
18927
|
+
var _a, tryNative, _b, fallbackToZXing, _c, preloadZXing, supportsNative, nativeResult, preparedImage, zxingResult;
|
|
18928
|
+
if (options === void 0) {
|
|
18929
|
+
options = {};
|
|
18930
|
+
}
|
|
18931
|
+
return __generator(this, function (_d) {
|
|
18932
|
+
switch (_d.label) {
|
|
18933
|
+
case 0:
|
|
18934
|
+
_a = options.tryNative, tryNative = _a === void 0 ? true : _a, _b = options.fallbackToZXing, fallbackToZXing = _b === void 0 ? true : _b, _c = options.preloadZXing, preloadZXing = _c === void 0 ? false : _c;
|
|
18935
|
+
// Optionally preload zxing in background
|
|
18936
|
+
if (preloadZXing && fallbackToZXing) {
|
|
18937
|
+
loadZXing()["catch"](function () {
|
|
18938
|
+
/* ignore preload errors */
|
|
18939
|
+
});
|
|
18940
|
+
}
|
|
18941
|
+
if (!tryNative) return [3 /*break*/, 3];
|
|
18942
|
+
return [4 /*yield*/, checkNativePDF417Support()];
|
|
18943
|
+
case 1:
|
|
18944
|
+
supportsNative = _d.sent();
|
|
18945
|
+
if (!supportsNative) return [3 /*break*/, 3];
|
|
18946
|
+
return [4 /*yield*/, decodeWithNative(source)];
|
|
18947
|
+
case 2:
|
|
18948
|
+
nativeResult = _d.sent();
|
|
18949
|
+
if (nativeResult) {
|
|
18950
|
+
return [2 /*return*/, nativeResult];
|
|
18951
|
+
}
|
|
18952
|
+
_d.label = 3;
|
|
18953
|
+
case 3:
|
|
18954
|
+
if (!fallbackToZXing) return [3 /*break*/, 6];
|
|
18955
|
+
return [4 /*yield*/, prepareImageForDecoding(source)];
|
|
18956
|
+
case 4:
|
|
18957
|
+
preparedImage = _d.sent();
|
|
18958
|
+
return [4 /*yield*/, decodeWithZXing(preparedImage)];
|
|
18959
|
+
case 5:
|
|
18960
|
+
zxingResult = _d.sent();
|
|
18961
|
+
if (zxingResult) {
|
|
18962
|
+
return [2 /*return*/, zxingResult];
|
|
18963
|
+
}
|
|
18964
|
+
_d.label = 6;
|
|
18965
|
+
case 6:
|
|
18966
|
+
return [2 /*return*/, null];
|
|
18967
|
+
}
|
|
18968
|
+
});
|
|
18969
|
+
});
|
|
18970
|
+
}
|
|
18971
|
+
|
|
18972
|
+
function setCanvasDimensions(canvas, width, height) {
|
|
18973
|
+
var _a;
|
|
18974
|
+
var devicePixelRatio = 1;
|
|
18975
|
+
if (typeof window !== 'undefined') devicePixelRatio = window.devicePixelRatio;
|
|
18976
|
+
canvas.width = width * devicePixelRatio;
|
|
18977
|
+
canvas.height = height * devicePixelRatio;
|
|
18978
|
+
canvas.style.width = width + 'px';
|
|
18979
|
+
canvas.style.height = height + 'px';
|
|
18980
|
+
(_a = canvas.getContext('2d')) === null || _a === void 0 ? void 0 : _a.scale(devicePixelRatio, devicePixelRatio);
|
|
18981
|
+
}
|
|
18982
|
+
function resetCanvasDimensions(canvas) {
|
|
18983
|
+
canvas.width = 0;
|
|
18984
|
+
canvas.height = 0;
|
|
18985
|
+
canvas.style.width = '0';
|
|
18986
|
+
canvas.style.height = '0';
|
|
18987
|
+
}
|
|
18988
|
+
|
|
18989
|
+
var IdCardGuideImageContainer = styled(IdCardBorder)(templateObject_1$E || (templateObject_1$E = __makeTemplateObject(["\n position: relative;\n ", "\n box-sizing: border-box;\n max-width: 100%;\n max-height: 100%;\n ", ";\n"], ["\n position: relative;\n ", "\n box-sizing: border-box;\n max-width: 100%;\n max-height: 100%;\n ", ";\n"])), function (props) {
|
|
18990
|
+
return props.$isVisible ? '' : 'opacity: 0;';
|
|
18991
|
+
}, function (props) {
|
|
18992
|
+
return props.$isMobile ? props.$isLandscape ? 'height: 100%;' : 'width: 80%;' : props.$isLandscape ? 'height: 70%;' : 'width: 82%;';
|
|
18993
|
+
});
|
|
18994
|
+
var IdCardGuideImage = styled.img(templateObject_2$A || (templateObject_2$A = __makeTemplateObject(["\n max-height: 100%;\n transform-style: preserve-3d;\n ", "\n ", "\n"], ["\n max-height: 100%;\n transform-style: preserve-3d;\n ", "\n ", "\n"])), function (props) {
|
|
18995
|
+
return props.$isMirrored ? 'transform: scaleX(-1);' : '';
|
|
18996
|
+
}, function (props) {
|
|
18997
|
+
return props.$isInvisible ? 'opacity: 0;' : '';
|
|
18998
|
+
});
|
|
18999
|
+
function IdCardBorder(_a) {
|
|
19000
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
19001
|
+
var children = _a.children,
|
|
19002
|
+
_s = _a.status,
|
|
19003
|
+
status = _s === void 0 ? 'ready' : _s,
|
|
19004
|
+
_t = _a.borderWidth,
|
|
19005
|
+
borderWidth = _t === void 0 ? 20 : _t,
|
|
19006
|
+
_u = _a.borderRadius,
|
|
19007
|
+
borderRadius = _u === void 0 ? 25 : _u,
|
|
19008
|
+
_v = _a.borderColor,
|
|
19009
|
+
borderColor = _v === void 0 ? 'white' : _v,
|
|
17899
19010
|
_w = _a.aspectRatio,
|
|
17900
19011
|
aspectRatio = _w === void 0 ? 1 : _w,
|
|
17901
19012
|
_x = _a.progress,
|
|
@@ -18030,17 +19141,17 @@
|
|
|
18030
19141
|
className: isProgressBar ? "idmSdkProgressBorder ".concat(progressPaused ? 'idmSdkProgressPaused' : '') : ''
|
|
18031
19142
|
}));
|
|
18032
19143
|
}
|
|
18033
|
-
var IdCardBorderContainer = styled.div(templateObject_3$
|
|
18034
|
-
var IdCardBorderInner = styled.div(templateObject_4$
|
|
18035
|
-
var SvgOverlay = styled.svg(templateObject_5$
|
|
18036
|
-
var IdCardBorderRect = styled.rect(templateObject_6$
|
|
19144
|
+
var IdCardBorderContainer = styled.div(templateObject_3$q || (templateObject_3$q = __makeTemplateObject(["\n align-items: center;\n justify-content: center;\n display: flex;\n position: relative;\n margin: auto;\n\n & .idmSdkWaves {\n position: absolute;\n animation: ", " 2s ease-out infinite;\n transform-style: preserve-3d;\n\n &:nth-child(3) {\n animation-delay: 0.66s;\n }\n\n &:nth-child(4) {\n animation-delay: 1.33s;\n }\n }\n"], ["\n align-items: center;\n justify-content: center;\n display: flex;\n position: relative;\n margin: auto;\n\n & .idmSdkWaves {\n position: absolute;\n animation: ", " 2s ease-out infinite;\n transform-style: preserve-3d;\n\n &:nth-child(3) {\n animation-delay: 0.66s;\n }\n\n &:nth-child(4) {\n animation-delay: 1.33s;\n }\n }\n"])), wavesAnimation);
|
|
19145
|
+
var IdCardBorderInner = styled.div(templateObject_4$k || (templateObject_4$k = __makeTemplateObject(["\n max-height: 100%;\n max-width: 100%;\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n"], ["\n max-height: 100%;\n max-width: 100%;\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n"])));
|
|
19146
|
+
var SvgOverlay = styled.svg(templateObject_5$f || (templateObject_5$f = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n"])));
|
|
19147
|
+
var IdCardBorderRect = styled.rect(templateObject_6$9 || (templateObject_6$9 = __makeTemplateObject(["\n &.idmSdkProgressBorder {\n animation: ", " ", "\n ", ";\n }\n\n &.idmSdkProgressPaused {\n animation-play-state: paused;\n }\n"], ["\n &.idmSdkProgressBorder {\n animation: ", " ", "\n ", ";\n }\n\n &.idmSdkProgressPaused {\n animation-play-state: paused;\n }\n"])), progressBorderAnimation, function (props) {
|
|
18037
19148
|
var _a;
|
|
18038
19149
|
return (_a = props.$speed) !== null && _a !== void 0 ? _a : '3s';
|
|
18039
19150
|
}, function (props) {
|
|
18040
19151
|
var _a;
|
|
18041
19152
|
return (_a = props.$fillMode) !== null && _a !== void 0 ? _a : 'forwards';
|
|
18042
19153
|
});
|
|
18043
|
-
var templateObject_1$
|
|
19154
|
+
var templateObject_1$E, templateObject_2$A, templateObject_3$q, templateObject_4$k, templateObject_5$f, templateObject_6$9;
|
|
18044
19155
|
|
|
18045
19156
|
var defaultIdCaptureGuideImages = {
|
|
18046
19157
|
portrait: {
|
|
@@ -18188,7 +19299,7 @@
|
|
|
18188
19299
|
clearTimeout(timeout);
|
|
18189
19300
|
};
|
|
18190
19301
|
}, []);
|
|
18191
|
-
return /*#__PURE__*/React.createElement(Wrapper$
|
|
19302
|
+
return /*#__PURE__*/React.createElement(Wrapper$2, {
|
|
18192
19303
|
"$isLandscape": orientation === 'landscape',
|
|
18193
19304
|
style: {
|
|
18194
19305
|
aspectRatio: aspectRatio
|
|
@@ -18229,15 +19340,15 @@
|
|
|
18229
19340
|
style: imageStyle
|
|
18230
19341
|
})));
|
|
18231
19342
|
};
|
|
18232
|
-
var Wrapper$
|
|
19343
|
+
var Wrapper$2 = styled.div(templateObject_1$D || (templateObject_1$D = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n ", "\n\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n ", "\n\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n"])), function (props) {
|
|
18233
19344
|
return props.$isLandscape ? 'height: 100%;' : 'height: 100%;';
|
|
18234
19345
|
});
|
|
18235
|
-
var FlipImageContainer = styled(IdCardGuideImageContainer)(templateObject_2$
|
|
19346
|
+
var FlipImageContainer = styled(IdCardGuideImageContainer)(templateObject_2$z || (templateObject_2$z = __makeTemplateObject(["\n backface-visibility: hidden;\n transition: transform ", "s;\n transform: ", ";\n transform-style: preserve-3d;\n position: absolute;\n display: block;\n top: 0;\n height: 100%; // todo: branch between desktop and mobile\n"], ["\n backface-visibility: hidden;\n transition: transform ", "s;\n transform: ", ";\n transform-style: preserve-3d;\n position: absolute;\n display: block;\n top: 0;\n height: 100%; // todo: branch between desktop and mobile\n"])), function (props) {
|
|
18236
19347
|
return props.$transitionTime;
|
|
18237
19348
|
}, function (props) {
|
|
18238
19349
|
return props.$transforms;
|
|
18239
19350
|
});
|
|
18240
|
-
var templateObject_1$
|
|
19351
|
+
var templateObject_1$D, templateObject_2$z;
|
|
18241
19352
|
|
|
18242
19353
|
var GuideOrientationContext = /*#__PURE__*/React.createContext({
|
|
18243
19354
|
orientation: 'landscape',
|
|
@@ -18332,7 +19443,7 @@
|
|
|
18332
19443
|
clearTimeout(timeout);
|
|
18333
19444
|
};
|
|
18334
19445
|
}, []);
|
|
18335
|
-
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
19446
|
+
return /*#__PURE__*/React.createElement(Wrapper$1, {
|
|
18336
19447
|
style: {
|
|
18337
19448
|
aspectRatio: imageAspectRatio
|
|
18338
19449
|
},
|
|
@@ -18376,10 +19487,10 @@
|
|
|
18376
19487
|
height: height
|
|
18377
19488
|
})));
|
|
18378
19489
|
};
|
|
18379
|
-
var Wrapper = styled.div(templateObject_1$
|
|
19490
|
+
var Wrapper$1 = styled.div(templateObject_1$C || (templateObject_1$C = __makeTemplateObject(["\n align-items: center;\n justify-content: center;\n display: flex;\n position: absolute;\n margin: auto;\n box-sizing: border-box;\n max-width: 100%;\n max-height: 100%;\n ", ";\n"], ["\n align-items: center;\n justify-content: center;\n display: flex;\n position: absolute;\n margin: auto;\n box-sizing: border-box;\n max-width: 100%;\n max-height: 100%;\n ", ";\n"])), function (props) {
|
|
18380
19491
|
return props.$isMobile ? props.$isLandscape ? 'height: 100%;' : 'width: 80%;' : props.$isLandscape ? 'height: 70%;' : 'width: 82%;';
|
|
18381
19492
|
});
|
|
18382
|
-
var templateObject_1$
|
|
19493
|
+
var templateObject_1$C;
|
|
18383
19494
|
|
|
18384
19495
|
var IdCaptureGuideOverlay = function IdCaptureGuideOverlay(_a) {
|
|
18385
19496
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
@@ -18525,10 +19636,10 @@
|
|
|
18525
19636
|
return v;
|
|
18526
19637
|
}).join(' ');
|
|
18527
19638
|
};
|
|
18528
|
-
var StyledPageContainer = styled.div(templateObject_1$
|
|
18529
|
-
var GuidesContainer = styled.div(templateObject_2$
|
|
18530
|
-
var GuideCenterRow = styled.div(templateObject_3$
|
|
18531
|
-
var GuideRegion = styled.div(templateObject_4$
|
|
19639
|
+
var StyledPageContainer = styled.div(templateObject_1$B || (templateObject_1$B = __makeTemplateObject(["\n position: relative;\n width: 100%;\n height: 100%;\n z-index: 1000;\n overflow: hidden;\n"], ["\n position: relative;\n width: 100%;\n height: 100%;\n z-index: 1000;\n overflow: hidden;\n"])));
|
|
19640
|
+
var GuidesContainer = styled.div(templateObject_2$y || (templateObject_2$y = __makeTemplateObject(["\n display: flex;\n flex-flow: column nowrap;\n width: 100%;\n height: 100%;\n"], ["\n display: flex;\n flex-flow: column nowrap;\n width: 100%;\n height: 100%;\n"])));
|
|
19641
|
+
var GuideCenterRow = styled.div(templateObject_3$p || (templateObject_3$p = __makeTemplateObject(["\n position: relative;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-items: center;\n box-sizing: border-box;\n max-width: 100%;\n max-height: 100%;\n min-height: 0;\n flex: 1;\n"], ["\n position: relative;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-items: center;\n box-sizing: border-box;\n max-width: 100%;\n max-height: 100%;\n min-height: 0;\n flex: 1;\n"])));
|
|
19642
|
+
var GuideRegion = styled.div(templateObject_4$j || (templateObject_4$j = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: end;\n width: 100%;\n position: relative;\n z-index: 1000;\n background: ", ";\n color: ", ";\n text-align: center;\n ", "\n ", "\n"], ["\n display: flex;\n flex-direction: column;\n justify-content: end;\n width: 100%;\n position: relative;\n z-index: 1000;\n background: ", ";\n color: ", ";\n text-align: center;\n ", "\n ", "\n"])), function (props) {
|
|
18532
19643
|
var _a, _b, _c, _d, _e;
|
|
18533
19644
|
return (_e = (_a = props.$maskColor) !== null && _a !== void 0 ? _a : (_d = (_c = (_b = props.theme) === null || _b === void 0 ? void 0 : _b.idCapture) === null || _c === void 0 ? void 0 : _c.guideOverlay) === null || _d === void 0 ? void 0 : _d.backgroundColor) !== null && _e !== void 0 ? _e : 'rgba(0, 0, 0, 0.5)';
|
|
18534
19645
|
}, function (props) {
|
|
@@ -18539,23 +19650,23 @@
|
|
|
18539
19650
|
}, function (props) {
|
|
18540
19651
|
return props.$minHeight ? "min-height: ".concat(props.$minHeight, "px;") : "";
|
|
18541
19652
|
});
|
|
18542
|
-
var Spacer = styled(GuideRegion)(templateObject_5$
|
|
18543
|
-
var GuideCenterRegion = styled.div(templateObject_6$
|
|
19653
|
+
var Spacer = styled(GuideRegion)(templateObject_5$e || (templateObject_5$e = __makeTemplateObject(["\n display: block;\n width: auto;\n"], ["\n display: block;\n width: auto;\n"])));
|
|
19654
|
+
var GuideCenterRegion = styled.div(templateObject_6$8 || (templateObject_6$8 = __makeTemplateObject(["\n ", "\n ", "\n transform-style: preserve-3d;\n box-sizing: border-box;\n display: flex;\n flex: 1;\n max-height: 100%;\n height: 100%;\n"], ["\n ", "\n ", "\n transform-style: preserve-3d;\n box-sizing: border-box;\n display: flex;\n flex: 1;\n max-height: 100%;\n height: 100%;\n"])), function (props) {
|
|
18544
19655
|
return props.$minWidth ? "min-width: ".concat(props.$minWidth, "px;") : "";
|
|
18545
19656
|
}, function (props) {
|
|
18546
19657
|
return props.$isMirrored ? 'transform: scaleX(-1);' : '';
|
|
18547
19658
|
});
|
|
18548
|
-
var GuideCenterBorder = styled.div(templateObject_7$
|
|
19659
|
+
var GuideCenterBorder = styled.div(templateObject_7$5 || (templateObject_7$5 = __makeTemplateObject(["\n box-sizing: border-box;\n border: ", ";\n display: flex;\n flex: 1;\n justify-content: center;\n max-height: 100%;\n min-height: 0;\n max-width: 100%;\n position: relative;\n ", "\n"], ["\n box-sizing: border-box;\n border: ", ";\n display: flex;\n flex: 1;\n justify-content: center;\n max-height: 100%;\n min-height: 0;\n max-width: 100%;\n position: relative;\n ", "\n"])), function (props) {
|
|
18549
19660
|
var _a, _b;
|
|
18550
19661
|
return "".concat((_a = props.$borderWidth) !== null && _a !== void 0 ? _a : 4, "px solid ").concat((_b = props.$borderColor) !== null && _b !== void 0 ? _b : 'white');
|
|
18551
19662
|
}, function (props) {
|
|
18552
19663
|
return props.$padding ? "padding: ".concat(props.$padding, "px;") : '';
|
|
18553
19664
|
});
|
|
18554
|
-
var GuideText = styled.span(templateObject_8$
|
|
18555
|
-
var GuideCenterInner = styled.div(templateObject_9$
|
|
19665
|
+
var GuideText = styled.span(templateObject_8$4 || (templateObject_8$4 = __makeTemplateObject(["\n align-content: center;\n margin-top: 12px;\n margin-bottom: 12px;\n"], ["\n align-content: center;\n margin-top: 12px;\n margin-bottom: 12px;\n"])));
|
|
19666
|
+
var GuideCenterInner = styled.div(templateObject_9$3 || (templateObject_9$3 = __makeTemplateObject(["\n position: relative;\n top: 0;\n margin: auto;\n ", "\n max-height: 100%;\n max-width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n"], ["\n position: relative;\n top: 0;\n margin: auto;\n ", "\n max-height: 100%;\n max-width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n"])), function (props) {
|
|
18556
19667
|
return props.$isLandscape ? 'height: 100%;' : 'width: 90%;';
|
|
18557
19668
|
});
|
|
18558
|
-
var templateObject_1$
|
|
19669
|
+
var templateObject_1$B, templateObject_2$y, templateObject_3$p, templateObject_4$j, templateObject_5$e, templateObject_6$8, templateObject_7$5, templateObject_8$4, templateObject_9$3;
|
|
18559
19670
|
|
|
18560
19671
|
var IdCaptureFitGuide = function IdCaptureFitGuide(_a) {
|
|
18561
19672
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
@@ -18678,7 +19789,7 @@
|
|
|
18678
19789
|
ref: wrapperRef,
|
|
18679
19790
|
"$maskColor": maskColor !== null && maskColor !== void 0 ? maskColor : '',
|
|
18680
19791
|
className: classNames.canvasWrapper
|
|
18681
|
-
}, /*#__PURE__*/React.createElement(Canvas$
|
|
19792
|
+
}, /*#__PURE__*/React.createElement(Canvas$2, {
|
|
18682
19793
|
ref: canvasRef,
|
|
18683
19794
|
className: classNames.canvas
|
|
18684
19795
|
})), /*#__PURE__*/React.createElement(IdCaptureGuideOverlay, {
|
|
@@ -18696,11 +19807,174 @@
|
|
|
18696
19807
|
progress: progress
|
|
18697
19808
|
}));
|
|
18698
19809
|
};
|
|
18699
|
-
var CanvasWrapper$1 = styled.div(templateObject_1$
|
|
19810
|
+
var CanvasWrapper$1 = styled.div(templateObject_1$A || (templateObject_1$A = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ", ";\n z-index: -1;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ", ";\n z-index: -1;\n"])), function (props) {
|
|
18700
19811
|
return props.$maskColor;
|
|
18701
19812
|
});
|
|
18702
|
-
var Canvas$
|
|
18703
|
-
var templateObject_1$
|
|
19813
|
+
var Canvas$2 = styled.canvas(templateObject_2$x || (templateObject_2$x = __makeTemplateObject(["\n display: block;\n"], ["\n display: block;\n"])));
|
|
19814
|
+
var templateObject_1$A, templateObject_2$x;
|
|
19815
|
+
|
|
19816
|
+
var PDF417_ASPECT_RATIO = 3 / 1;
|
|
19817
|
+
function BarcodeGuideOverlay(_a) {
|
|
19818
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
19819
|
+
var _l = _a.aspectRatio,
|
|
19820
|
+
aspectRatio = _l === void 0 ? PDF417_ASPECT_RATIO : _l,
|
|
19821
|
+
maskColor = _a.maskColor,
|
|
19822
|
+
_m = _a.cornerColor,
|
|
19823
|
+
cornerColor = _m === void 0 ? 'white' : _m,
|
|
19824
|
+
_o = _a.cornerLength,
|
|
19825
|
+
cornerLength = _o === void 0 ? 40 : _o,
|
|
19826
|
+
_p = _a.cornerWidth,
|
|
19827
|
+
cornerWidth = _p === void 0 ? 4 : _p,
|
|
19828
|
+
padding = _a.padding,
|
|
19829
|
+
_q = _a.borderRadius,
|
|
19830
|
+
borderRadius = _q === void 0 ? 8 : _q,
|
|
19831
|
+
_r = _a.headerText,
|
|
19832
|
+
headerText = _r === void 0 ? 'SCAN THE BARCODE' : _r,
|
|
19833
|
+
_s = _a.instructionText,
|
|
19834
|
+
instructionText = _s === void 0 ? 'Bring camera closer until the barcode fills the rectangular box.' : _s,
|
|
19835
|
+
_t = _a.isSuccess,
|
|
19836
|
+
isSuccess = _t === void 0 ? false : _t,
|
|
19837
|
+
_u = _a.successColor,
|
|
19838
|
+
successColor = _u === void 0 ? '#22c55e' : _u,
|
|
19839
|
+
_v = _a.classNames,
|
|
19840
|
+
classNames = _v === void 0 ? {} : _v;
|
|
19841
|
+
var canvasRef = React.useRef(null);
|
|
19842
|
+
var _w = useResizeObserver(),
|
|
19843
|
+
wrapperRef = _w.ref,
|
|
19844
|
+
_x = _w.width,
|
|
19845
|
+
wrapperWidth = _x === void 0 ? 1 : _x,
|
|
19846
|
+
_y = _w.height,
|
|
19847
|
+
wrapperHeight = _y === void 0 ? 1 : _y;
|
|
19848
|
+
var theme = styled.useTheme();
|
|
19849
|
+
if (padding === undefined) {
|
|
19850
|
+
padding = isMobile() ? (_d = (_c = (_b = theme.idCapture) === null || _b === void 0 ? void 0 : _b.guideBox) === null || _c === void 0 ? void 0 : _c.mobilePadding) !== null && _d !== void 0 ? _d : 24 : (_g = (_f = (_e = theme.idCapture) === null || _e === void 0 ? void 0 : _e.guideBox) === null || _f === void 0 ? void 0 : _f.desktopPadding) !== null && _g !== void 0 ? _g : 48;
|
|
19851
|
+
}
|
|
19852
|
+
if (maskColor === undefined) {
|
|
19853
|
+
maskColor = (_k = (_j = (_h = theme.idCapture) === null || _h === void 0 ? void 0 : _h.guideOverlay) === null || _j === void 0 ? void 0 : _j.backgroundColor) !== null && _k !== void 0 ? _k : '#708090';
|
|
19854
|
+
}
|
|
19855
|
+
React.useEffect(function () {
|
|
19856
|
+
var canvas = canvasRef.current;
|
|
19857
|
+
if (!canvas) return;
|
|
19858
|
+
// Wait for valid dimensions from resize observer
|
|
19859
|
+
if (wrapperWidth <= 1 || wrapperHeight <= 1) return;
|
|
19860
|
+
var boundingWidth = wrapperWidth - padding * 2;
|
|
19861
|
+
var boundingHeight = wrapperHeight - padding * 2;
|
|
19862
|
+
// Start with bounding box dimensions
|
|
19863
|
+
var rectWidth = boundingWidth;
|
|
19864
|
+
var rectHeight = boundingWidth / aspectRatio;
|
|
19865
|
+
// If calculated height exceeds available height, constrain by height instead
|
|
19866
|
+
if (rectHeight > boundingHeight) {
|
|
19867
|
+
rectHeight = boundingHeight;
|
|
19868
|
+
rectWidth = boundingHeight * aspectRatio;
|
|
19869
|
+
}
|
|
19870
|
+
// Center the rectangle
|
|
19871
|
+
var rectX = padding + (boundingWidth - rectWidth) / 2;
|
|
19872
|
+
var rectY = padding + (boundingHeight - rectHeight) / 2;
|
|
19873
|
+
setCanvasDimensions(canvas, wrapperWidth, wrapperHeight);
|
|
19874
|
+
var ctx = canvas.getContext('2d');
|
|
19875
|
+
if (!ctx) return;
|
|
19876
|
+
// Fill with mask color
|
|
19877
|
+
ctx.fillStyle = maskColor;
|
|
19878
|
+
ctx.clearRect(0, 0, wrapperWidth, wrapperHeight);
|
|
19879
|
+
ctx.fillRect(0, 0, wrapperWidth, wrapperHeight);
|
|
19880
|
+
// Create the cutout
|
|
19881
|
+
ctx.beginPath();
|
|
19882
|
+
ctx.roundRect(rectX, rectY, rectWidth, rectHeight, borderRadius);
|
|
19883
|
+
ctx.fillStyle = 'rgba(0,0,0,1)';
|
|
19884
|
+
ctx.globalCompositeOperation = 'destination-out';
|
|
19885
|
+
ctx.fill();
|
|
19886
|
+
ctx.globalCompositeOperation = 'source-over';
|
|
19887
|
+
// Draw corner brackets
|
|
19888
|
+
var color = isSuccess ? successColor : cornerColor;
|
|
19889
|
+
ctx.strokeStyle = color;
|
|
19890
|
+
ctx.lineWidth = cornerWidth;
|
|
19891
|
+
ctx.lineCap = 'round';
|
|
19892
|
+
var effectiveCornerLength = Math.min(cornerLength, rectWidth / 3, rectHeight / 3);
|
|
19893
|
+
// Top-left corner
|
|
19894
|
+
ctx.beginPath();
|
|
19895
|
+
ctx.moveTo(rectX + effectiveCornerLength, rectY);
|
|
19896
|
+
ctx.lineTo(rectX + borderRadius, rectY);
|
|
19897
|
+
ctx.arcTo(rectX, rectY, rectX, rectY + borderRadius, borderRadius);
|
|
19898
|
+
ctx.lineTo(rectX, rectY + effectiveCornerLength);
|
|
19899
|
+
ctx.stroke();
|
|
19900
|
+
// Top-right corner
|
|
19901
|
+
ctx.beginPath();
|
|
19902
|
+
ctx.moveTo(rectX + rectWidth - effectiveCornerLength, rectY);
|
|
19903
|
+
ctx.lineTo(rectX + rectWidth - borderRadius, rectY);
|
|
19904
|
+
ctx.arcTo(rectX + rectWidth, rectY, rectX + rectWidth, rectY + borderRadius, borderRadius);
|
|
19905
|
+
ctx.lineTo(rectX + rectWidth, rectY + effectiveCornerLength);
|
|
19906
|
+
ctx.stroke();
|
|
19907
|
+
// Bottom-left corner
|
|
19908
|
+
ctx.beginPath();
|
|
19909
|
+
ctx.moveTo(rectX, rectY + rectHeight - effectiveCornerLength);
|
|
19910
|
+
ctx.lineTo(rectX, rectY + rectHeight - borderRadius);
|
|
19911
|
+
ctx.arcTo(rectX, rectY + rectHeight, rectX + borderRadius, rectY + rectHeight, borderRadius);
|
|
19912
|
+
ctx.lineTo(rectX + effectiveCornerLength, rectY + rectHeight);
|
|
19913
|
+
ctx.stroke();
|
|
19914
|
+
// Bottom-right corner
|
|
19915
|
+
ctx.beginPath();
|
|
19916
|
+
ctx.moveTo(rectX + rectWidth, rectY + rectHeight - effectiveCornerLength);
|
|
19917
|
+
ctx.lineTo(rectX + rectWidth, rectY + rectHeight - borderRadius);
|
|
19918
|
+
ctx.arcTo(rectX + rectWidth, rectY + rectHeight, rectX + rectWidth - borderRadius, rectY + rectHeight, borderRadius);
|
|
19919
|
+
ctx.lineTo(rectX + rectWidth - effectiveCornerLength, rectY + rectHeight);
|
|
19920
|
+
ctx.stroke();
|
|
19921
|
+
return function () {
|
|
19922
|
+
resetCanvasDimensions(canvas);
|
|
19923
|
+
};
|
|
19924
|
+
}, [aspectRatio, borderRadius, cornerColor, cornerLength, cornerWidth, isSuccess, maskColor, padding, successColor, wrapperHeight, wrapperWidth]);
|
|
19925
|
+
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
19926
|
+
ref: wrapperRef,
|
|
19927
|
+
className: classNames.wrapper
|
|
19928
|
+
}, /*#__PURE__*/React.createElement(Canvas$1, {
|
|
19929
|
+
ref: canvasRef,
|
|
19930
|
+
className: classNames.canvas
|
|
19931
|
+
}), /*#__PURE__*/React.createElement(TextOverlay, null, /*#__PURE__*/React.createElement(HeaderText, {
|
|
19932
|
+
className: classNames.header
|
|
19933
|
+
}, headerText), /*#__PURE__*/React.createElement(InstructionText, {
|
|
19934
|
+
className: classNames.instruction
|
|
19935
|
+
}, instructionText)));
|
|
19936
|
+
}
|
|
19937
|
+
var Wrapper = styled.div(templateObject_1$z || (templateObject_1$z = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n z-index: 1;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n z-index: 1;\n"])));
|
|
19938
|
+
var Canvas$1 = styled.canvas(templateObject_2$w || (templateObject_2$w = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"])));
|
|
19939
|
+
var TextOverlay = styled.div(templateObject_3$o || (templateObject_3$o = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n padding-top: 48px;\n pointer-events: none;\n z-index: 2;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n padding-top: 48px;\n pointer-events: none;\n z-index: 2;\n"])));
|
|
19940
|
+
var HeaderText = styled.div(templateObject_4$i || (templateObject_4$i = __makeTemplateObject(["\n color: white;\n font-size: 24px;\n font-weight: 700;\n text-align: center;\n text-transform: uppercase;\n letter-spacing: 2px;\n margin-bottom: 16px;\n"], ["\n color: white;\n font-size: 24px;\n font-weight: 700;\n text-align: center;\n text-transform: uppercase;\n letter-spacing: 2px;\n margin-bottom: 16px;\n"])));
|
|
19941
|
+
var InstructionText = styled.div(templateObject_5$d || (templateObject_5$d = __makeTemplateObject(["\n color: white;\n font-size: 16px;\n font-weight: 400;\n text-align: center;\n max-width: 300px;\n line-height: 1.4;\n opacity: 0.9;\n"], ["\n color: white;\n font-size: 16px;\n font-weight: 400;\n text-align: center;\n max-width: 300px;\n line-height: 1.4;\n opacity: 0.9;\n"])));
|
|
19942
|
+
var templateObject_1$z, templateObject_2$w, templateObject_3$o, templateObject_4$i, templateObject_5$d;
|
|
19943
|
+
|
|
19944
|
+
function BarcodeSuccessOverlay(_a) {
|
|
19945
|
+
var _b = _a.headerText,
|
|
19946
|
+
headerText = _b === void 0 ? 'Scan Successful!' : _b,
|
|
19947
|
+
_c = _a.processingText,
|
|
19948
|
+
processingText = _c === void 0 ? 'Processing...' : _c,
|
|
19949
|
+
_d = _a.successColor,
|
|
19950
|
+
successColor = _d === void 0 ? '#22c55e' : _d;
|
|
19951
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BarcodeGuideOverlay, {
|
|
19952
|
+
headerText: headerText,
|
|
19953
|
+
instructionText: processingText,
|
|
19954
|
+
isSuccess: true,
|
|
19955
|
+
successColor: successColor
|
|
19956
|
+
}), /*#__PURE__*/React.createElement(CheckmarkWrapper, null, /*#__PURE__*/React.createElement(CheckmarkCircle, {
|
|
19957
|
+
"$color": successColor
|
|
19958
|
+
}, /*#__PURE__*/React.createElement(CheckmarkIcon, {
|
|
19959
|
+
viewBox: "0 0 24 24",
|
|
19960
|
+
fill: "none"
|
|
19961
|
+
}, /*#__PURE__*/React.createElement(CheckmarkPath, {
|
|
19962
|
+
d: "M5 13l4 4L19 7",
|
|
19963
|
+
stroke: "white",
|
|
19964
|
+
strokeWidth: "3",
|
|
19965
|
+
strokeLinecap: "round",
|
|
19966
|
+
strokeLinejoin: "round"
|
|
19967
|
+
})))));
|
|
19968
|
+
}
|
|
19969
|
+
var scaleIn = styled.keyframes(templateObject_1$y || (templateObject_1$y = __makeTemplateObject(["\n 0% {\n transform: scale(0);\n opacity: 0;\n }\n 50% {\n transform: scale(1.1);\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n"], ["\n 0% {\n transform: scale(0);\n opacity: 0;\n }\n 50% {\n transform: scale(1.1);\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n"])));
|
|
19970
|
+
var drawCheck = styled.keyframes(templateObject_2$v || (templateObject_2$v = __makeTemplateObject(["\n 0% {\n stroke-dashoffset: 24;\n }\n 100% {\n stroke-dashoffset: 0;\n }\n"], ["\n 0% {\n stroke-dashoffset: 24;\n }\n 100% {\n stroke-dashoffset: 0;\n }\n"])));
|
|
19971
|
+
var CheckmarkWrapper = styled.div(templateObject_3$n || (templateObject_3$n = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n pointer-events: none;\n z-index: 3;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n pointer-events: none;\n z-index: 3;\n"])));
|
|
19972
|
+
var CheckmarkCircle = styled.div(templateObject_4$h || (templateObject_4$h = __makeTemplateObject(["\n width: 80px;\n height: 80px;\n border-radius: 50%;\n background-color: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n animation: ", " 0.4s ease-out forwards;\n"], ["\n width: 80px;\n height: 80px;\n border-radius: 50%;\n background-color: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n animation: ", " 0.4s ease-out forwards;\n"])), function (props) {
|
|
19973
|
+
return props.$color;
|
|
19974
|
+
}, scaleIn);
|
|
19975
|
+
var CheckmarkIcon = styled.svg(templateObject_5$c || (templateObject_5$c = __makeTemplateObject(["\n width: 48px;\n height: 48px;\n"], ["\n width: 48px;\n height: 48px;\n"])));
|
|
19976
|
+
var CheckmarkPath = styled.path(templateObject_6$7 || (templateObject_6$7 = __makeTemplateObject(["\n stroke-dasharray: 24;\n stroke-dashoffset: 24;\n animation: ", " 0.4s ease-out 0.2s forwards;\n"], ["\n stroke-dasharray: 24;\n stroke-dashoffset: 24;\n animation: ", " 0.4s ease-out 0.2s forwards;\n"])), drawCheck);
|
|
19977
|
+
var templateObject_1$y, templateObject_2$v, templateObject_3$n, templateObject_4$h, templateObject_5$c, templateObject_6$7;
|
|
18704
19978
|
|
|
18705
19979
|
function IdCaptureGuides(_a) {
|
|
18706
19980
|
var _b = _a.guideType,
|
|
@@ -18722,7 +19996,15 @@
|
|
|
18722
19996
|
_k = _a.colors,
|
|
18723
19997
|
colors = _k === void 0 ? {} : _k,
|
|
18724
19998
|
_l = _a.verbiage,
|
|
18725
|
-
rawVerbiage = _l === void 0 ? {} : _l
|
|
19999
|
+
rawVerbiage = _l === void 0 ? {} : _l,
|
|
20000
|
+
_m = _a.isRequestingBetterBarcode,
|
|
20001
|
+
isRequestingBetterBarcode = _m === void 0 ? false : _m,
|
|
20002
|
+
_o = _a.isBarcodeSuccess,
|
|
20003
|
+
isBarcodeSuccess = _o === void 0 ? false : _o,
|
|
20004
|
+
_p = _a.barcodeHeaderText,
|
|
20005
|
+
barcodeHeaderText = _p === void 0 ? 'SCAN THE BARCODE' : _p,
|
|
20006
|
+
_q = _a.barcodeInstructionText,
|
|
20007
|
+
barcodeInstructionText = _q === void 0 ? 'Bring camera closer until the barcode fills the rectangular box.' : _q;
|
|
18726
20008
|
var state = useIdCaptureStore();
|
|
18727
20009
|
var isRearFacing = useCameraStore(function (state) {
|
|
18728
20010
|
return state.isRearFacing;
|
|
@@ -18732,6 +20014,18 @@
|
|
|
18732
20014
|
capturingText: 'Capturing...',
|
|
18733
20015
|
captureFailedText: 'Capture failed!'
|
|
18734
20016
|
});
|
|
20017
|
+
// Render barcode guide overlays when in barcode recapture state
|
|
20018
|
+
if (isRequestingBetterBarcode) {
|
|
20019
|
+
if (isBarcodeSuccess) {
|
|
20020
|
+
return /*#__PURE__*/React.createElement(BarcodeSuccessOverlay, null);
|
|
20021
|
+
}
|
|
20022
|
+
return /*#__PURE__*/React.createElement(BarcodeGuideOverlay, {
|
|
20023
|
+
headerText: barcodeHeaderText,
|
|
20024
|
+
instructionText: barcodeInstructionText
|
|
20025
|
+
});
|
|
20026
|
+
}
|
|
20027
|
+
// Client barcode scanning happens silently in the background
|
|
20028
|
+
// during normal ID back capture - no special UI needed here
|
|
18735
20029
|
return /*#__PURE__*/React.createElement(React.Fragment, null, guideType === 'overlay' && (/*#__PURE__*/React.createElement(IdCaptureGuideOverlay, {
|
|
18736
20030
|
images: images,
|
|
18737
20031
|
classNames: classNames,
|
|
@@ -18756,7 +20050,7 @@
|
|
|
18756
20050
|
})));
|
|
18757
20051
|
}
|
|
18758
20052
|
|
|
18759
|
-
var Spinner$1 = styled.div(templateObject_1$
|
|
20053
|
+
var Spinner$1 = styled.div(templateObject_1$x || (templateObject_1$x = __makeTemplateObject(["\n display: inline-block;\n width: ", "px;\n height: ", "px;\n margin: auto;\n\n &:after {\n content: ' ';\n display: block;\n width: ", "px;\n height: ", "px;\n margin: 8px;\n border-radius: 50%;\n border: ", "px solid\n ", ";\n border-color: ", " transparent\n ", " transparent;\n animation: ", " 1.2s linear infinite;\n box-sizing: content-box;\n }\n"], ["\n display: inline-block;\n width: ", "px;\n height: ", "px;\n margin: auto;\n\n &:after {\n content: ' ';\n display: block;\n width: ", "px;\n height: ", "px;\n margin: 8px;\n border-radius: 50%;\n border: ", "px solid\n ", ";\n border-color: ", " transparent\n ", " transparent;\n animation: ", " 1.2s linear infinite;\n box-sizing: content-box;\n }\n"])), function (_a) {
|
|
18760
20054
|
var $size = _a.$size;
|
|
18761
20055
|
return $size !== null && $size !== void 0 ? $size : 80;
|
|
18762
20056
|
}, function (_a) {
|
|
@@ -18781,11 +20075,11 @@
|
|
|
18781
20075
|
var $color = _a.$color;
|
|
18782
20076
|
return $color !== null && $color !== void 0 ? $color : '#888';
|
|
18783
20077
|
}, dualRingSpinnerAnimation);
|
|
18784
|
-
var SpinnerPageContainer = styled.div(templateObject_2$
|
|
20078
|
+
var SpinnerPageContainer = styled.div(templateObject_2$u || (templateObject_2$u = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n"])));
|
|
18785
20079
|
function SpinnerPage() {
|
|
18786
20080
|
return /*#__PURE__*/React.createElement(SpinnerPageContainer, null, /*#__PURE__*/React.createElement(Spinner$1, null));
|
|
18787
20081
|
}
|
|
18788
|
-
var templateObject_1$
|
|
20082
|
+
var templateObject_1$x, templateObject_2$u;
|
|
18789
20083
|
|
|
18790
20084
|
var IdCaptureImagePreview = function IdCaptureImagePreview(_a) {
|
|
18791
20085
|
var _b = _a.classNames,
|
|
@@ -18872,11 +20166,11 @@
|
|
|
18872
20166
|
onError: onError
|
|
18873
20167
|
})));
|
|
18874
20168
|
};
|
|
18875
|
-
var StyledSpinner = styled(Spinner$1)(templateObject_1$
|
|
18876
|
-
var ImagePreviewWrapper = styled.div(templateObject_2$
|
|
18877
|
-
var ImagePreviewText = styled.div(templateObject_3$
|
|
18878
|
-
var ImagePreviewImageWrapper = styled.div(templateObject_4$
|
|
18879
|
-
var templateObject_1$
|
|
20169
|
+
var StyledSpinner = styled(Spinner$1)(templateObject_1$w || (templateObject_1$w = __makeTemplateObject(["\n position: relative;\n top: 4px;\n left: -3px;\n margin: 0 3px 0 -12px;\n"], ["\n position: relative;\n top: 4px;\n left: -3px;\n margin: 0 3px 0 -12px;\n"])));
|
|
20170
|
+
var ImagePreviewWrapper = styled.div(templateObject_2$t || (templateObject_2$t = __makeTemplateObject(["\n position: absolute;\n display: flex;\n flex-direction: column;\n height: 33%;\n bottom: 12px;\n right: 12px;\n"], ["\n position: absolute;\n display: flex;\n flex-direction: column;\n height: 33%;\n bottom: 12px;\n right: 12px;\n"])));
|
|
20171
|
+
var ImagePreviewText = styled.div(templateObject_3$m || (templateObject_3$m = __makeTemplateObject(["\n display: block;\n position: absolute;\n top: -32px;\n font:\n 14px -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n Helvetica,\n Arial,\n sans-serif,\n 'Apple Color Emoji',\n 'Segoe UI Emoji',\n 'Segoe UI Symbol';\n color: white;\n text-align: center;\n margin: 0 auto;\n width: 100%;\n"], ["\n display: block;\n position: absolute;\n top: -32px;\n font:\n 14px -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n Helvetica,\n Arial,\n sans-serif,\n 'Apple Color Emoji',\n 'Segoe UI Emoji',\n 'Segoe UI Symbol';\n color: white;\n text-align: center;\n margin: 0 auto;\n width: 100%;\n"])));
|
|
20172
|
+
var ImagePreviewImageWrapper = styled.div(templateObject_4$g || (templateObject_4$g = __makeTemplateObject(["\n position: relative;\n height: calc(100% - 8px);\n padding: 4px;\n border-radius: 4px;\n background: white;\n\n & > img {\n border-radius: 4px;\n width: auto;\n max-height: 100%;\n }\n"], ["\n position: relative;\n height: calc(100% - 8px);\n padding: 4px;\n border-radius: 4px;\n background: white;\n\n & > img {\n border-radius: 4px;\n width: auto;\n max-height: 100%;\n }\n"])));
|
|
20173
|
+
var templateObject_1$w, templateObject_2$t, templateObject_3$m, templateObject_4$g;
|
|
18880
20174
|
|
|
18881
20175
|
var documentCaptureInitialState = {
|
|
18882
20176
|
documents: [],
|
|
@@ -19222,16 +20516,16 @@
|
|
|
19222
20516
|
ref: canvasRef
|
|
19223
20517
|
}));
|
|
19224
20518
|
};
|
|
19225
|
-
var CanvasWrapper = styled.div(templateObject_1$
|
|
20519
|
+
var CanvasWrapper = styled.div(templateObject_1$v || (templateObject_1$v = __makeTemplateObject(["\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ", ";\n"], ["\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ", ";\n"])), function (props) {
|
|
19226
20520
|
return props.$maskColor;
|
|
19227
20521
|
});
|
|
19228
|
-
var Canvas = styled.canvas(templateObject_2$
|
|
19229
|
-
var templateObject_1$
|
|
20522
|
+
var Canvas = styled.canvas(templateObject_2$s || (templateObject_2$s = __makeTemplateObject(["\n display: block;\n"], ["\n display: block;\n"])));
|
|
20523
|
+
var templateObject_1$v, templateObject_2$s;
|
|
19230
20524
|
|
|
19231
|
-
var CameraFeedWrapper = styled.div(templateObject_1$
|
|
20525
|
+
var CameraFeedWrapper = styled.div(templateObject_1$u || (templateObject_1$u = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
19232
20526
|
return props.$mode === 'snapToGuides' ? "display: flex;\n position: absolute;\n left: ".concat(props.$x, "px;\n top: ").concat(props.$y, "px;\n width: ").concat(props.$w, "px;\n height: ").concat(props.$h, "px;") : "";
|
|
19233
20527
|
});
|
|
19234
|
-
var templateObject_1$
|
|
20528
|
+
var templateObject_1$u;
|
|
19235
20529
|
|
|
19236
20530
|
var CameraVideoTag = function CameraVideoTag(props) {
|
|
19237
20531
|
var _a = useCameraStore(useShallow(function (store) {
|
|
@@ -19261,10 +20555,10 @@
|
|
|
19261
20555
|
"$isRearFacing": isRearFacing
|
|
19262
20556
|
}, props));
|
|
19263
20557
|
};
|
|
19264
|
-
var FullscreenVideoTag = styled.video(templateObject_1$
|
|
20558
|
+
var FullscreenVideoTag = styled.video(templateObject_1$t || (templateObject_1$t = __makeTemplateObject(["\n transform: ", ";\n transform-style: preserve-3d;\n min-width: 100%;\n min-height: 100%;\n width: auto;\n height: auto;\n max-width: 100%;\n max-height: 100%;\n object-fit: cover;\n background: black;\n z-index: -2;\n"], ["\n transform: ", ";\n transform-style: preserve-3d;\n min-width: 100%;\n min-height: 100%;\n width: auto;\n height: auto;\n max-width: 100%;\n max-height: 100%;\n object-fit: cover;\n background: black;\n z-index: -2;\n"])), function (props) {
|
|
19265
20559
|
return props.$isRearFacing ? '' : 'scaleX(-1)';
|
|
19266
20560
|
});
|
|
19267
|
-
var templateObject_1$
|
|
20561
|
+
var templateObject_1$t;
|
|
19268
20562
|
|
|
19269
20563
|
var DocumentCaptureScreen = function DocumentCaptureScreen(_a) {
|
|
19270
20564
|
var _b, _c, _d, _e;
|
|
@@ -19411,21 +20705,21 @@
|
|
|
19411
20705
|
disabled: !cameraReady || capturing
|
|
19412
20706
|
}, !cameraReady ? verbiage.loadingBtnText : capturing ? verbiage.capturingBtnText : verbiage.captureBtnText))))));
|
|
19413
20707
|
};
|
|
19414
|
-
var CaptureContainer = styled.div(templateObject_1$
|
|
19415
|
-
var HeadingRow = styled.div(templateObject_2$
|
|
20708
|
+
var CaptureContainer = styled.div(templateObject_1$s || (templateObject_1$s = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"], ["\n display: flex;\n flex-direction: column;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"])));
|
|
20709
|
+
var HeadingRow = styled.div(templateObject_2$r || (templateObject_2$r = __makeTemplateObject(["\n background: ", ";\n text-align: center;\n color: white;\n"], ["\n background: ", ";\n text-align: center;\n color: white;\n"])), function (props) {
|
|
19416
20710
|
return props.$maskColor;
|
|
19417
20711
|
});
|
|
19418
|
-
var Heading$9 = styled.h1(templateObject_3$
|
|
19419
|
-
var FooterRow = styled.div(templateObject_4$
|
|
20712
|
+
var Heading$9 = styled.h1(templateObject_3$l || (templateObject_3$l = __makeTemplateObject(["\n font-size: 22px;\n"], ["\n font-size: 22px;\n"])));
|
|
20713
|
+
var FooterRow = styled.div(templateObject_4$f || (templateObject_4$f = __makeTemplateObject(["\n background: ", ";\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: 0 20px 20px;\n height: auto;\n color: white;\n"], ["\n background: ", ";\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: 0 20px 20px;\n height: auto;\n color: white;\n"])), function (props) {
|
|
19420
20714
|
return props.$maskColor;
|
|
19421
20715
|
});
|
|
19422
|
-
var Instructions = styled.div(templateObject_5$
|
|
20716
|
+
var Instructions = styled.div(templateObject_5$b || (templateObject_5$b = __makeTemplateObject(["\n max-height: ", ";\n overflow-y: auto;\n"], ["\n max-height: ", ";\n overflow-y: auto;\n"])), function (props) {
|
|
19423
20717
|
var _a, _b, _c;
|
|
19424
20718
|
return (_c = (_b = (_a = props.theme.documentCapture) === null || _a === void 0 ? void 0 : _a.instructions) === null || _b === void 0 ? void 0 : _b.maxHeight) !== null && _c !== void 0 ? _c : '8rem';
|
|
19425
20719
|
});
|
|
19426
|
-
var StyledButtonsRow$8 = styled(ButtonsRow$2)(templateObject_6$
|
|
19427
|
-
var PreviewImage = styled.img(templateObject_7$
|
|
19428
|
-
var templateObject_1$
|
|
20720
|
+
var StyledButtonsRow$8 = styled(ButtonsRow$2)(templateObject_6$6 || (templateObject_6$6 = __makeTemplateObject(["\n padding-top: 20px;\n"], ["\n padding-top: 20px;\n"])));
|
|
20721
|
+
var PreviewImage = styled.img(templateObject_7$4 || (templateObject_7$4 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n object-fit: cover;\n"], ["\n width: 100%;\n height: 100%;\n object-fit: cover;\n"])));
|
|
20722
|
+
var templateObject_1$s, templateObject_2$r, templateObject_3$l, templateObject_4$f, templateObject_5$b, templateObject_6$6, templateObject_7$4;
|
|
19429
20723
|
|
|
19430
20724
|
var DocumentCaptureWizard = function DocumentCaptureWizard(_a) {
|
|
19431
20725
|
var onSuccess = _a.onSuccess,
|
|
@@ -19649,7 +20943,7 @@
|
|
|
19649
20943
|
className: classNames.inner
|
|
19650
20944
|
}, !silentFallback && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Heading$8, {
|
|
19651
20945
|
className: classNames.heading
|
|
19652
|
-
}, verbiage.headingText), /*#__PURE__*/React.createElement(Description$
|
|
20946
|
+
}, verbiage.headingText), /*#__PURE__*/React.createElement(Description$4, {
|
|
19653
20947
|
className: classNames.description
|
|
19654
20948
|
}, verbiage.descriptionText))), (images.length > 0 || isProcessing) && (/*#__PURE__*/React.createElement(OverlayImageRow, {
|
|
19655
20949
|
className: classNames.imageContainer
|
|
@@ -19696,13 +20990,13 @@
|
|
|
19696
20990
|
}
|
|
19697
20991
|
}, verbiage.doneBtnText))))));
|
|
19698
20992
|
};
|
|
19699
|
-
var StyledOverlayInner$2 = styled(OverlayInner$2)(templateObject_1$
|
|
19700
|
-
var Heading$8 = styled.h3(templateObject_2$
|
|
19701
|
-
var Description$
|
|
19702
|
-
var Instruction = styled.p(templateObject_4$
|
|
19703
|
-
var ImageCol = styled.div(templateObject_5$
|
|
19704
|
-
var StyledButtonsRow$7 = styled(ButtonsRow$2)(templateObject_6$
|
|
19705
|
-
var templateObject_1$
|
|
20993
|
+
var StyledOverlayInner$2 = styled(OverlayInner$2)(templateObject_1$r || (templateObject_1$r = __makeTemplateObject(["\n justify-content: center;\n"], ["\n justify-content: center;\n"])));
|
|
20994
|
+
var Heading$8 = styled.h3(templateObject_2$q || (templateObject_2$q = __makeTemplateObject(["\n margin-bottom: 8px;\n"], ["\n margin-bottom: 8px;\n"])));
|
|
20995
|
+
var Description$4 = styled.p(templateObject_3$k || (templateObject_3$k = __makeTemplateObject(["\n margin-bottom: 8px;\n"], ["\n margin-bottom: 8px;\n"])));
|
|
20996
|
+
var Instruction = styled.p(templateObject_4$e || (templateObject_4$e = __makeTemplateObject(["\n font-weight: bold;\n"], ["\n font-weight: bold;\n"])));
|
|
20997
|
+
var ImageCol = styled.div(templateObject_5$a || (templateObject_5$a = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n flex-grow: 1;\n flex-basis: 0;\n"], ["\n display: flex;\n justify-content: center;\n flex-grow: 1;\n flex-basis: 0;\n"])));
|
|
20998
|
+
var StyledButtonsRow$7 = styled(ButtonsRow$2)(templateObject_6$5 || (templateObject_6$5 = __makeTemplateObject(["\n margin-top: 32px;\n"], ["\n margin-top: 32px;\n"])));
|
|
20999
|
+
var templateObject_1$r, templateObject_2$q, templateObject_3$k, templateObject_4$e, templateObject_5$a, templateObject_6$5;
|
|
19706
21000
|
|
|
19707
21001
|
function ScalingCameraFeed() {
|
|
19708
21002
|
var _a = useIdCaptureStore(),
|
|
@@ -19762,7 +21056,7 @@
|
|
|
19762
21056
|
className: classNames.captureWithCameraPanel
|
|
19763
21057
|
}, /*#__PURE__*/React.createElement(CameraIcon, {
|
|
19764
21058
|
className: classNames.captureWithCameraIcon
|
|
19765
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
21059
|
+
}), /*#__PURE__*/React.createElement(Button$1, {
|
|
19766
21060
|
className: classNames.captureWithCameraButton,
|
|
19767
21061
|
colors: buttonColors,
|
|
19768
21062
|
onClick: function onClick() {
|
|
@@ -19781,7 +21075,7 @@
|
|
|
19781
21075
|
className: classNames.uploadFromStoragePanel
|
|
19782
21076
|
}, /*#__PURE__*/React.createElement(UploadIcon, {
|
|
19783
21077
|
className: classNames.uploadFromStorageIcon
|
|
19784
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
21078
|
+
}), /*#__PURE__*/React.createElement(Button$1, {
|
|
19785
21079
|
className: classNames.uploadFromStorageButton,
|
|
19786
21080
|
colors: buttonColors,
|
|
19787
21081
|
onClick: function onClick() {
|
|
@@ -19805,7 +21099,7 @@
|
|
|
19805
21099
|
}
|
|
19806
21100
|
}, verbiage.uploadFromStorageText, /*#__PURE__*/React.createElement(ArrowIcon, null)))), selectIdTypeModalOpen && (/*#__PURE__*/React.createElement(Modal, {
|
|
19807
21101
|
className: classNames.selectIdTypeModal
|
|
19808
|
-
}, /*#__PURE__*/React.createElement(Dialog, {
|
|
21102
|
+
}, /*#__PURE__*/React.createElement(Dialog$1, {
|
|
19809
21103
|
className: classNames.selectIdTypeDialog
|
|
19810
21104
|
}, /*#__PURE__*/React.createElement(ScreenPanel, {
|
|
19811
21105
|
className: classNames.selectPassportTypePanel
|
|
@@ -19813,7 +21107,7 @@
|
|
|
19813
21107
|
className: classNames.selectIdTypeHeading
|
|
19814
21108
|
}, verbiage.selectIdTypeText), /*#__PURE__*/React.createElement(PassportIcon, {
|
|
19815
21109
|
className: classNames.selectPassportTypeIcon
|
|
19816
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
21110
|
+
}), /*#__PURE__*/React.createElement(Button$1, {
|
|
19817
21111
|
className: classNames.selectPassportTypeButton,
|
|
19818
21112
|
colors: buttonColors,
|
|
19819
21113
|
onClick: function onClick() {
|
|
@@ -19826,7 +21120,7 @@
|
|
|
19826
21120
|
className: classNames.selectIdCardTypePanel
|
|
19827
21121
|
}, /*#__PURE__*/React.createElement(IdDocumentIcon, {
|
|
19828
21122
|
className: classNames.selectIdCardTypeIcon
|
|
19829
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
21123
|
+
}), /*#__PURE__*/React.createElement(Button$1, {
|
|
19830
21124
|
className: classNames.selectIdCardTypeButton,
|
|
19831
21125
|
colors: buttonColors,
|
|
19832
21126
|
onClick: function onClick() {
|
|
@@ -19871,7 +21165,7 @@
|
|
|
19871
21165
|
className: classNames.actionsBar
|
|
19872
21166
|
}, /*#__PURE__*/React.createElement(CancelUploadTypeButton, {
|
|
19873
21167
|
className: classNames.cancelButton
|
|
19874
|
-
}, verbiage.cancelText), /*#__PURE__*/React.createElement(Button, {
|
|
21168
|
+
}, verbiage.cancelText), /*#__PURE__*/React.createElement(Button$1, {
|
|
19875
21169
|
className: classNames.continueButton,
|
|
19876
21170
|
disabled: !file,
|
|
19877
21171
|
colors: buttonColors,
|
|
@@ -19943,7 +21237,7 @@
|
|
|
19943
21237
|
className: classNames.actionsBar
|
|
19944
21238
|
}, /*#__PURE__*/React.createElement(CancelUploadTypeButton, {
|
|
19945
21239
|
className: classNames.cancelButton
|
|
19946
|
-
}, verbiage.cancelText), /*#__PURE__*/React.createElement(Button, {
|
|
21240
|
+
}, verbiage.cancelText), /*#__PURE__*/React.createElement(Button$1, {
|
|
19947
21241
|
className: classNames.continueButton,
|
|
19948
21242
|
disabled: !idFrontFile || !state.allowSinglePageIdCapture && !idBackFile,
|
|
19949
21243
|
colors: buttonColors,
|
|
@@ -19985,7 +21279,7 @@
|
|
|
19985
21279
|
function CancelUploadTypeButton(_a) {
|
|
19986
21280
|
var children = _a.children,
|
|
19987
21281
|
className = _a.className;
|
|
19988
|
-
return /*#__PURE__*/React.createElement(Button, {
|
|
21282
|
+
return /*#__PURE__*/React.createElement(Button$1, {
|
|
19989
21283
|
className: className,
|
|
19990
21284
|
colors: buttonColors,
|
|
19991
21285
|
onClick: function onClick() {
|
|
@@ -20044,7 +21338,7 @@
|
|
|
20044
21338
|
setFile(file);
|
|
20045
21339
|
onFileSelected === null || onFileSelected === void 0 ? void 0 : onFileSelected(file);
|
|
20046
21340
|
}
|
|
20047
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
21341
|
+
}), /*#__PURE__*/React.createElement(Button$1, {
|
|
20048
21342
|
className: className,
|
|
20049
21343
|
colors: buttonColors,
|
|
20050
21344
|
onClick: function onClick() {
|
|
@@ -20054,24 +21348,24 @@
|
|
|
20054
21348
|
}
|
|
20055
21349
|
}, file ? "".concat(file.name, " (").concat(humanFileSize(file.size), ")") : filePickerLoading ? loadingText : children));
|
|
20056
21350
|
}
|
|
20057
|
-
var ScreenContainer = styled.div(templateObject_1$
|
|
21351
|
+
var ScreenContainer = styled.div(templateObject_1$q || (templateObject_1$q = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n position: relative;\n font-family: ", ";\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n position: relative;\n font-family: ", ";\n"])), function (props) {
|
|
20058
21352
|
var _a;
|
|
20059
21353
|
return (_a = props.theme) === null || _a === void 0 ? void 0 : _a.fontFamily;
|
|
20060
21354
|
});
|
|
20061
|
-
var ScreenPanel = styled.div(templateObject_2$
|
|
20062
|
-
var SelectIdCardScreenPanel = styled(ScreenPanel)(templateObject_3$
|
|
20063
|
-
var ScreenPanelHeading = styled.h3(templateObject_4$
|
|
20064
|
-
var ScreenActionsBar = styled.div(templateObject_5$
|
|
20065
|
-
var DashedSeparator = styled.div(templateObject_6$
|
|
20066
|
-
var OrWrapper = styled.div(templateObject_7$
|
|
20067
|
-
var UploadIdBackHelpText = styled.p(templateObject_8$
|
|
20068
|
-
var Button = styled(WideBorderButton)(templateObject_9$
|
|
20069
|
-
var Modal = styled.div(templateObject_10$
|
|
20070
|
-
var Dialog = styled.div(templateObject_11$
|
|
21355
|
+
var ScreenPanel = styled.div(templateObject_2$p || (templateObject_2$p = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 100%;\n flex-grow: 1;\n background: #f7f6fb;\n box-sizing: border-box;\n padding: 40px;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 100%;\n flex-grow: 1;\n background: #f7f6fb;\n box-sizing: border-box;\n padding: 40px;\n"])));
|
|
21356
|
+
var SelectIdCardScreenPanel = styled(ScreenPanel)(templateObject_3$j || (templateObject_3$j = __makeTemplateObject(["\n background: white;\n padding: 80px 0;\n\n @media (max-height: 1000px) {\n padding: 40px 0;\n }\n"], ["\n background: white;\n padding: 80px 0;\n\n @media (max-height: 1000px) {\n padding: 40px 0;\n }\n"])));
|
|
21357
|
+
var ScreenPanelHeading = styled.h3(templateObject_4$d || (templateObject_4$d = __makeTemplateObject(["\n margin: 0 0 30px;\n"], ["\n margin: 0 0 30px;\n"])));
|
|
21358
|
+
var ScreenActionsBar = styled.div(templateObject_5$9 || (templateObject_5$9 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: end;\n gap: 20px;\n padding: 20px;\n width: 100%;\n box-sizing: border-box;\n border-top: 1px solid #ccc;\n\n @media (max-width: 600px) {\n justify-content: center;\n }\n"], ["\n display: flex;\n align-items: center;\n justify-content: end;\n gap: 20px;\n padding: 20px;\n width: 100%;\n box-sizing: border-box;\n border-top: 1px solid #ccc;\n\n @media (max-width: 600px) {\n justify-content: center;\n }\n"])));
|
|
21359
|
+
var DashedSeparator = styled.div(templateObject_6$4 || (templateObject_6$4 = __makeTemplateObject(["\n width: 100%;\n height: 0;\n border-top: 2px solid #606060;\n border-top-style: dashed;\n display: flex;\n align-items: center;\n justify-content: center;\n"], ["\n width: 100%;\n height: 0;\n border-top: 2px solid #606060;\n border-top-style: dashed;\n display: flex;\n align-items: center;\n justify-content: center;\n"])));
|
|
21360
|
+
var OrWrapper = styled.div(templateObject_7$3 || (templateObject_7$3 = __makeTemplateObject(["\n color: #323232;\n font-weight: bold;\n background: white;\n border-radius: 50%;\n top: -2px;\n position: relative;\n width: 60px;\n height: 60px;\n display: flex;\n align-items: center;\n justify-content: center;\n"], ["\n color: #323232;\n font-weight: bold;\n background: white;\n border-radius: 50%;\n top: -2px;\n position: relative;\n width: 60px;\n height: 60px;\n display: flex;\n align-items: center;\n justify-content: center;\n"])));
|
|
21361
|
+
var UploadIdBackHelpText = styled.p(templateObject_8$3 || (templateObject_8$3 = __makeTemplateObject(["\n color: #323232;\n font-style: italic;\n margin: 30px 0 0;\n"], ["\n color: #323232;\n font-style: italic;\n margin: 30px 0 0;\n"])));
|
|
21362
|
+
var Button$1 = styled(WideBorderButton)(templateObject_9$2 || (templateObject_9$2 = __makeTemplateObject(["\n width: auto;\n font-weight: 500;\n padding-left: 40px;\n padding-right: 40px;\n transition: background-color 0.3s ease;\n background-color: #ffffff;\n white-space: nowrap;\n\n &:disabled,\n &.disabled {\n background-color: #f1f1f1 !important;\n border-color: #dbdbdb !important;\n color: #323232 !important;\n }\n\n &:hover {\n filter: none;\n background-color: #fafafa !important;\n }\n"], ["\n width: auto;\n font-weight: 500;\n padding-left: 40px;\n padding-right: 40px;\n transition: background-color 0.3s ease;\n background-color: #ffffff;\n white-space: nowrap;\n\n &:disabled,\n &.disabled {\n background-color: #f1f1f1 !important;\n border-color: #dbdbdb !important;\n color: #323232 !important;\n }\n\n &:hover {\n filter: none;\n background-color: #fafafa !important;\n }\n"])));
|
|
21363
|
+
var Modal = styled.div(templateObject_10$2 || (templateObject_10$2 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.5);\n z-index: 10000;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.5);\n z-index: 10000;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"])));
|
|
21364
|
+
var Dialog$1 = styled.div(templateObject_11$2 || (templateObject_11$2 = __makeTemplateObject(["\n width: 100%;\n max-width: 500px;\n height: 100%;\n max-height: 600px;\n background: white;\n border-radius: 25px;\n overflow: auto;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);\n font-family: ", ";\n //margin: 25px;\n"], ["\n width: 100%;\n max-width: 500px;\n height: 100%;\n max-height: 600px;\n background: white;\n border-radius: 25px;\n overflow: auto;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);\n font-family: ", ";\n //margin: 25px;\n"])), function (props) {
|
|
20071
21365
|
var _a;
|
|
20072
21366
|
return (_a = props.theme) === null || _a === void 0 ? void 0 : _a.fontFamily;
|
|
20073
21367
|
});
|
|
20074
|
-
var ModalCloseButton = styled.button(templateObject_12$
|
|
21368
|
+
var ModalCloseButton = styled.button(templateObject_12$2 || (templateObject_12$2 = __makeTemplateObject(["\n width: 60px;\n height: 60px;\n background: black;\n color: whitesmoke;\n border-radius: 50%;\n font-size: 32px;\n border: none;\n cursor: pointer;\n margin: 20px 0;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);\n transition: background 0.3s ease;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n padding: 0;\n\n &:hover {\n background: #222;\n color: white;\n }\n"], ["\n width: 60px;\n height: 60px;\n background: black;\n color: whitesmoke;\n border-radius: 50%;\n font-size: 32px;\n border: none;\n cursor: pointer;\n margin: 20px 0;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);\n transition: background 0.3s ease;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n padding: 0;\n\n &:hover {\n background: #222;\n color: white;\n }\n"])));
|
|
20075
21369
|
function XIcon(props) {
|
|
20076
21370
|
return /*#__PURE__*/React.createElement("svg", _assign({
|
|
20077
21371
|
width: "25",
|
|
@@ -20262,88 +21556,537 @@
|
|
|
20262
21556
|
style: {
|
|
20263
21557
|
marginBottom: 30
|
|
20264
21558
|
}
|
|
20265
|
-
}, props), /*#__PURE__*/React.createElement("path", {
|
|
20266
|
-
d: "M18 41C18 41 18.5 33 24.5 33C30.5 33 31 41 31 41",
|
|
20267
|
-
stroke: "black",
|
|
20268
|
-
strokeWidth: "3",
|
|
20269
|
-
strokeLinecap: "round",
|
|
20270
|
-
strokeLinejoin: "round"
|
|
20271
|
-
}), /*#__PURE__*/React.createElement("rect", {
|
|
20272
|
-
x: "2",
|
|
20273
|
-
y: "2",
|
|
20274
|
-
width: "88",
|
|
20275
|
-
height: "58",
|
|
20276
|
-
rx: "6",
|
|
20277
|
-
stroke: "black",
|
|
20278
|
-
strokeWidth: "3"
|
|
20279
|
-
}), /*#__PURE__*/React.createElement("rect", {
|
|
20280
|
-
x: "10",
|
|
20281
|
-
y: "15",
|
|
20282
|
-
width: "29",
|
|
20283
|
-
height: "30",
|
|
20284
|
-
rx: "3",
|
|
20285
|
-
stroke: "black",
|
|
20286
|
-
strokeWidth: "3"
|
|
20287
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
20288
|
-
d: "M48 17H80",
|
|
20289
|
-
stroke: "black",
|
|
20290
|
-
strokeWidth: "3",
|
|
20291
|
-
strokeLinecap: "round",
|
|
20292
|
-
strokeLinejoin: "round"
|
|
20293
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
20294
|
-
d: "M48 35H80",
|
|
20295
|
-
stroke: "black",
|
|
20296
|
-
strokeWidth: "3",
|
|
20297
|
-
strokeLinecap: "round",
|
|
20298
|
-
strokeLinejoin: "round"
|
|
20299
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
20300
|
-
d: "M48 44H62",
|
|
20301
|
-
stroke: "black",
|
|
20302
|
-
strokeWidth: "3",
|
|
20303
|
-
strokeLinecap: "round",
|
|
20304
|
-
strokeLinejoin: "round"
|
|
20305
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
20306
|
-
d: "M48 26H69",
|
|
20307
|
-
stroke: "black",
|
|
20308
|
-
strokeWidth: "3",
|
|
20309
|
-
strokeLinecap: "round",
|
|
20310
|
-
strokeLinejoin: "round"
|
|
20311
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
20312
|
-
d: "M74 26L80 26",
|
|
20313
|
-
stroke: "black",
|
|
20314
|
-
strokeWidth: "3",
|
|
20315
|
-
strokeLinecap: "round",
|
|
20316
|
-
strokeLinejoin: "round"
|
|
20317
|
-
}), /*#__PURE__*/React.createElement("circle", {
|
|
20318
|
-
cx: "24.5",
|
|
20319
|
-
cy: "26.5",
|
|
20320
|
-
r: "6.5",
|
|
20321
|
-
stroke: "black",
|
|
20322
|
-
strokeWidth: "3"
|
|
20323
|
-
}));
|
|
21559
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
21560
|
+
d: "M18 41C18 41 18.5 33 24.5 33C30.5 33 31 41 31 41",
|
|
21561
|
+
stroke: "black",
|
|
21562
|
+
strokeWidth: "3",
|
|
21563
|
+
strokeLinecap: "round",
|
|
21564
|
+
strokeLinejoin: "round"
|
|
21565
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
21566
|
+
x: "2",
|
|
21567
|
+
y: "2",
|
|
21568
|
+
width: "88",
|
|
21569
|
+
height: "58",
|
|
21570
|
+
rx: "6",
|
|
21571
|
+
stroke: "black",
|
|
21572
|
+
strokeWidth: "3"
|
|
21573
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
21574
|
+
x: "10",
|
|
21575
|
+
y: "15",
|
|
21576
|
+
width: "29",
|
|
21577
|
+
height: "30",
|
|
21578
|
+
rx: "3",
|
|
21579
|
+
stroke: "black",
|
|
21580
|
+
strokeWidth: "3"
|
|
21581
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
21582
|
+
d: "M48 17H80",
|
|
21583
|
+
stroke: "black",
|
|
21584
|
+
strokeWidth: "3",
|
|
21585
|
+
strokeLinecap: "round",
|
|
21586
|
+
strokeLinejoin: "round"
|
|
21587
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
21588
|
+
d: "M48 35H80",
|
|
21589
|
+
stroke: "black",
|
|
21590
|
+
strokeWidth: "3",
|
|
21591
|
+
strokeLinecap: "round",
|
|
21592
|
+
strokeLinejoin: "round"
|
|
21593
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
21594
|
+
d: "M48 44H62",
|
|
21595
|
+
stroke: "black",
|
|
21596
|
+
strokeWidth: "3",
|
|
21597
|
+
strokeLinecap: "round",
|
|
21598
|
+
strokeLinejoin: "round"
|
|
21599
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
21600
|
+
d: "M48 26H69",
|
|
21601
|
+
stroke: "black",
|
|
21602
|
+
strokeWidth: "3",
|
|
21603
|
+
strokeLinecap: "round",
|
|
21604
|
+
strokeLinejoin: "round"
|
|
21605
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
21606
|
+
d: "M74 26L80 26",
|
|
21607
|
+
stroke: "black",
|
|
21608
|
+
strokeWidth: "3",
|
|
21609
|
+
strokeLinecap: "round",
|
|
21610
|
+
strokeLinejoin: "round"
|
|
21611
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
21612
|
+
cx: "24.5",
|
|
21613
|
+
cy: "26.5",
|
|
21614
|
+
r: "6.5",
|
|
21615
|
+
stroke: "black",
|
|
21616
|
+
strokeWidth: "3"
|
|
21617
|
+
}));
|
|
21618
|
+
}
|
|
21619
|
+
var InlineSvg = styled.svg(templateObject_13$2 || (templateObject_13$2 = __makeTemplateObject(["\n display: inline;\n"], ["\n display: inline;\n"])));
|
|
21620
|
+
function humanFileSize(bytes, si, dp) {
|
|
21621
|
+
if (si === void 0) {
|
|
21622
|
+
si = false;
|
|
21623
|
+
}
|
|
21624
|
+
if (dp === void 0) {
|
|
21625
|
+
dp = 1;
|
|
21626
|
+
}
|
|
21627
|
+
var thresh = si ? 1000 : 1024;
|
|
21628
|
+
if (Math.abs(bytes) < thresh) {
|
|
21629
|
+
return bytes + ' B';
|
|
21630
|
+
}
|
|
21631
|
+
var units = si ? ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'] : ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];
|
|
21632
|
+
var u = -1;
|
|
21633
|
+
var r = Math.pow(10, dp);
|
|
21634
|
+
do {
|
|
21635
|
+
bytes /= thresh;
|
|
21636
|
+
++u;
|
|
21637
|
+
} while (Math.round(Math.abs(bytes) * r) / r >= thresh && u < units.length - 1);
|
|
21638
|
+
return bytes.toFixed(dp) + ' ' + units[u];
|
|
21639
|
+
}
|
|
21640
|
+
var templateObject_1$q, templateObject_2$p, templateObject_3$j, templateObject_4$d, templateObject_5$9, templateObject_6$4, templateObject_7$3, templateObject_8$3, templateObject_9$2, templateObject_10$2, templateObject_11$2, templateObject_12$2, templateObject_13$2;
|
|
21641
|
+
|
|
21642
|
+
/**
|
|
21643
|
+
* Lazy loader for Dynamsoft Barcode Reader Bundle from CDN
|
|
21644
|
+
* Only loads when client-side barcode scanning is enabled.
|
|
21645
|
+
*/
|
|
21646
|
+
var DYNAMSOFT_CDN_URL = 'https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@11.0.3000/dist/dbr.bundle.min.js';
|
|
21647
|
+
var loadPromise = null;
|
|
21648
|
+
var isInitialized = false;
|
|
21649
|
+
function isDynamsoftLoaded() {
|
|
21650
|
+
return typeof window !== 'undefined' && !!window.Dynamsoft;
|
|
21651
|
+
}
|
|
21652
|
+
function loadScript(url) {
|
|
21653
|
+
return new Promise(function (resolve, reject) {
|
|
21654
|
+
if (document.querySelector("script[src=\"".concat(url, "\"]"))) {
|
|
21655
|
+
resolve();
|
|
21656
|
+
return;
|
|
21657
|
+
}
|
|
21658
|
+
var script = document.createElement('script');
|
|
21659
|
+
script.src = url;
|
|
21660
|
+
script.async = true;
|
|
21661
|
+
script.onload = function () {
|
|
21662
|
+
document.dispatchEvent(new CustomEvent('idmission.dynamsoftLoaded', {
|
|
21663
|
+
detail: {
|
|
21664
|
+
url: url
|
|
21665
|
+
}
|
|
21666
|
+
}));
|
|
21667
|
+
resolve();
|
|
21668
|
+
};
|
|
21669
|
+
script.onerror = function () {
|
|
21670
|
+
reject(new Error("Failed to load Dynamsoft SDK from ".concat(url)));
|
|
21671
|
+
};
|
|
21672
|
+
document.head.appendChild(script);
|
|
21673
|
+
});
|
|
21674
|
+
}
|
|
21675
|
+
function loadDynamsoftSDK() {
|
|
21676
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
21677
|
+
return __generator(this, function (_a) {
|
|
21678
|
+
if (isDynamsoftLoaded()) {
|
|
21679
|
+
return [2 /*return*/, window.Dynamsoft];
|
|
21680
|
+
}
|
|
21681
|
+
if (loadPromise) {
|
|
21682
|
+
return [2 /*return*/, loadPromise];
|
|
21683
|
+
}
|
|
21684
|
+
loadPromise = loadScript(DYNAMSOFT_CDN_URL).then(function () {
|
|
21685
|
+
if (!window.Dynamsoft) {
|
|
21686
|
+
throw new Error('Dynamsoft SDK failed to initialize after loading');
|
|
21687
|
+
}
|
|
21688
|
+
return window.Dynamsoft;
|
|
21689
|
+
});
|
|
21690
|
+
return [2 /*return*/, loadPromise];
|
|
21691
|
+
});
|
|
21692
|
+
});
|
|
21693
|
+
}
|
|
21694
|
+
function initializeDynamsoft(config) {
|
|
21695
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
21696
|
+
var Dynamsoft, licenseValue, orgIdJson, base64;
|
|
21697
|
+
return __generator(this, function (_a) {
|
|
21698
|
+
switch (_a.label) {
|
|
21699
|
+
case 0:
|
|
21700
|
+
return [4 /*yield*/, loadDynamsoftSDK()];
|
|
21701
|
+
case 1:
|
|
21702
|
+
Dynamsoft = _a.sent();
|
|
21703
|
+
if (isInitialized) {
|
|
21704
|
+
return [2 /*return*/, Dynamsoft];
|
|
21705
|
+
}
|
|
21706
|
+
if (config.organizationId) {
|
|
21707
|
+
orgIdJson = JSON.stringify({
|
|
21708
|
+
organizationID: config.organizationId
|
|
21709
|
+
});
|
|
21710
|
+
base64 = btoa(orgIdJson);
|
|
21711
|
+
licenseValue = "DLS2".concat(base64);
|
|
21712
|
+
} else {
|
|
21713
|
+
licenseValue = config.licenseKey;
|
|
21714
|
+
}
|
|
21715
|
+
return [4 /*yield*/, Dynamsoft.License.LicenseManager.initLicense(licenseValue)];
|
|
21716
|
+
case 2:
|
|
21717
|
+
_a.sent();
|
|
21718
|
+
isInitialized = true;
|
|
21719
|
+
document.dispatchEvent(new CustomEvent('idmission.dynamsoftInitialized', {
|
|
21720
|
+
detail: {
|
|
21721
|
+
success: true
|
|
21722
|
+
}
|
|
21723
|
+
}));
|
|
21724
|
+
return [2 /*return*/, Dynamsoft];
|
|
21725
|
+
}
|
|
21726
|
+
});
|
|
21727
|
+
});
|
|
21728
|
+
}
|
|
21729
|
+
|
|
21730
|
+
var STORAGE_KEY = 'idmission_dynamsoft_license';
|
|
21731
|
+
function DynamsoftLicensePrompt(_a) {
|
|
21732
|
+
var onLicenseSubmit = _a.onLicenseSubmit,
|
|
21733
|
+
onCancel = _a.onCancel;
|
|
21734
|
+
var _b = React.useState(''),
|
|
21735
|
+
licenseKey = _b[0],
|
|
21736
|
+
setLicenseKey = _b[1];
|
|
21737
|
+
// Check for stored license on mount
|
|
21738
|
+
React.useEffect(function () {
|
|
21739
|
+
var stored = localStorage.getItem(STORAGE_KEY);
|
|
21740
|
+
if (stored) {
|
|
21741
|
+
setLicenseKey(stored);
|
|
21742
|
+
}
|
|
21743
|
+
}, []);
|
|
21744
|
+
var handleSubmit = React.useCallback(function (e) {
|
|
21745
|
+
e.preventDefault();
|
|
21746
|
+
var trimmedKey = licenseKey.trim();
|
|
21747
|
+
if (trimmedKey) {
|
|
21748
|
+
// Store for future sessions
|
|
21749
|
+
localStorage.setItem(STORAGE_KEY, trimmedKey);
|
|
21750
|
+
onLicenseSubmit(trimmedKey);
|
|
21751
|
+
}
|
|
21752
|
+
}, [licenseKey, onLicenseSubmit]);
|
|
21753
|
+
var handleUseSaved = React.useCallback(function () {
|
|
21754
|
+
var stored = localStorage.getItem(STORAGE_KEY);
|
|
21755
|
+
if (stored) {
|
|
21756
|
+
onLicenseSubmit(stored);
|
|
21757
|
+
}
|
|
21758
|
+
}, [onLicenseSubmit]);
|
|
21759
|
+
var hasSavedLicense = !!localStorage.getItem(STORAGE_KEY);
|
|
21760
|
+
return /*#__PURE__*/React.createElement(Overlay, null, /*#__PURE__*/React.createElement(Dialog, null, /*#__PURE__*/React.createElement(Title$1, null, "Dynamsoft License Required"), /*#__PURE__*/React.createElement(Description$3, null, "Enter your Dynamsoft Barcode Reader license key to enable client-side barcode scanning. The key will be stored in your browser for future sessions."), /*#__PURE__*/React.createElement(Form, {
|
|
21761
|
+
onSubmit: handleSubmit
|
|
21762
|
+
}, /*#__PURE__*/React.createElement(TextArea, {
|
|
21763
|
+
value: licenseKey,
|
|
21764
|
+
onChange: function onChange(e) {
|
|
21765
|
+
return setLicenseKey(e.target.value);
|
|
21766
|
+
},
|
|
21767
|
+
placeholder: "Paste your Dynamsoft license key here...",
|
|
21768
|
+
rows: 4,
|
|
21769
|
+
autoFocus: true
|
|
21770
|
+
}), /*#__PURE__*/React.createElement(ButtonRow, null, onCancel && (/*#__PURE__*/React.createElement(CancelButton, {
|
|
21771
|
+
type: "button",
|
|
21772
|
+
onClick: onCancel
|
|
21773
|
+
}, "Skip")), hasSavedLicense && (/*#__PURE__*/React.createElement(SavedButton, {
|
|
21774
|
+
type: "button",
|
|
21775
|
+
onClick: handleUseSaved
|
|
21776
|
+
}, "Use Saved Key")), /*#__PURE__*/React.createElement(SubmitButton, {
|
|
21777
|
+
type: "submit",
|
|
21778
|
+
disabled: !licenseKey.trim()
|
|
21779
|
+
}, "Activate"))), /*#__PURE__*/React.createElement(HelpText, null, "Don't have a license?", ' ', /*#__PURE__*/React.createElement(HelpLink, {
|
|
21780
|
+
href: "https://www.dynamsoft.com/customer/license/trialLicense",
|
|
21781
|
+
target: "_blank",
|
|
21782
|
+
rel: "noopener noreferrer"
|
|
21783
|
+
}, "Get a free trial"))));
|
|
21784
|
+
}
|
|
21785
|
+
function getSavedDynamsoftLicense() {
|
|
21786
|
+
if (typeof window === 'undefined') return null;
|
|
21787
|
+
return localStorage.getItem(STORAGE_KEY);
|
|
21788
|
+
}
|
|
21789
|
+
var Overlay = styled.div(templateObject_1$p || (templateObject_1$p = __makeTemplateObject(["\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.7);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n padding: 1rem;\n"], ["\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.7);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n padding: 1rem;\n"])));
|
|
21790
|
+
var Dialog = styled.div(templateObject_2$o || (templateObject_2$o = __makeTemplateObject(["\n background: white;\n border-radius: 12px;\n padding: 1.5rem;\n max-width: 480px;\n width: 100%;\n box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);\n"], ["\n background: white;\n border-radius: 12px;\n padding: 1.5rem;\n max-width: 480px;\n width: 100%;\n box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);\n"])));
|
|
21791
|
+
var Title$1 = styled.h2(templateObject_3$i || (templateObject_3$i = __makeTemplateObject(["\n margin: 0 0 0.75rem 0;\n font-size: 1.25rem;\n color: #1a1a1a;\n"], ["\n margin: 0 0 0.75rem 0;\n font-size: 1.25rem;\n color: #1a1a1a;\n"])));
|
|
21792
|
+
var Description$3 = styled.p(templateObject_4$c || (templateObject_4$c = __makeTemplateObject(["\n margin: 0 0 1rem 0;\n font-size: 0.875rem;\n color: #666;\n line-height: 1.5;\n"], ["\n margin: 0 0 1rem 0;\n font-size: 0.875rem;\n color: #666;\n line-height: 1.5;\n"])));
|
|
21793
|
+
var Form = styled.form(templateObject_5$8 || (templateObject_5$8 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 1rem;\n"], ["\n display: flex;\n flex-direction: column;\n gap: 1rem;\n"])));
|
|
21794
|
+
var TextArea = styled.textarea(templateObject_6$3 || (templateObject_6$3 = __makeTemplateObject(["\n width: 100%;\n box-sizing: border-box;\n padding: 0.75rem;\n border: 1px solid #ddd;\n border-radius: 8px;\n font-size: 0.8125rem;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n resize: vertical;\n min-height: 80px;\n\n &:focus {\n outline: none;\n border-color: #0066cc;\n box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);\n }\n\n &::placeholder {\n color: #999;\n }\n"], ["\n width: 100%;\n box-sizing: border-box;\n padding: 0.75rem;\n border: 1px solid #ddd;\n border-radius: 8px;\n font-size: 0.8125rem;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n resize: vertical;\n min-height: 80px;\n\n &:focus {\n outline: none;\n border-color: #0066cc;\n box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);\n }\n\n &::placeholder {\n color: #999;\n }\n"])));
|
|
21795
|
+
var ButtonRow = styled.div(templateObject_7$2 || (templateObject_7$2 = __makeTemplateObject(["\n display: flex;\n gap: 0.75rem;\n justify-content: flex-end;\n"], ["\n display: flex;\n gap: 0.75rem;\n justify-content: flex-end;\n"])));
|
|
21796
|
+
var Button = styled.button(templateObject_8$2 || (templateObject_8$2 = __makeTemplateObject(["\n padding: 0.625rem 1.25rem;\n border-radius: 6px;\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.15s ease;\n\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n"], ["\n padding: 0.625rem 1.25rem;\n border-radius: 6px;\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.15s ease;\n\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n"])));
|
|
21797
|
+
var SubmitButton = styled(Button)(templateObject_9$1 || (templateObject_9$1 = __makeTemplateObject(["\n background: #0066cc;\n color: white;\n border: none;\n\n &:hover:not(:disabled) {\n background: #0052a3;\n }\n"], ["\n background: #0066cc;\n color: white;\n border: none;\n\n &:hover:not(:disabled) {\n background: #0052a3;\n }\n"])));
|
|
21798
|
+
var CancelButton = styled(Button)(templateObject_10$1 || (templateObject_10$1 = __makeTemplateObject(["\n background: transparent;\n color: #666;\n border: 1px solid #ddd;\n\n &:hover {\n background: #f5f5f5;\n }\n"], ["\n background: transparent;\n color: #666;\n border: 1px solid #ddd;\n\n &:hover {\n background: #f5f5f5;\n }\n"])));
|
|
21799
|
+
var SavedButton = styled(Button)(templateObject_11$1 || (templateObject_11$1 = __makeTemplateObject(["\n background: #e8f4e8;\n color: #2e7d32;\n border: 1px solid #c8e6c9;\n\n &:hover {\n background: #c8e6c9;\n }\n"], ["\n background: #e8f4e8;\n color: #2e7d32;\n border: 1px solid #c8e6c9;\n\n &:hover {\n background: #c8e6c9;\n }\n"])));
|
|
21800
|
+
var HelpText = styled.p(templateObject_12$1 || (templateObject_12$1 = __makeTemplateObject(["\n margin: 1rem 0 0 0;\n font-size: 0.8125rem;\n color: #888;\n text-align: center;\n"], ["\n margin: 1rem 0 0 0;\n font-size: 0.8125rem;\n color: #888;\n text-align: center;\n"])));
|
|
21801
|
+
var HelpLink = styled.a(templateObject_13$1 || (templateObject_13$1 = __makeTemplateObject(["\n color: #0066cc;\n text-decoration: none;\n\n &:hover {\n text-decoration: underline;\n }\n"], ["\n color: #0066cc;\n text-decoration: none;\n\n &:hover {\n text-decoration: underline;\n }\n"])));
|
|
21802
|
+
var templateObject_1$p, templateObject_2$o, templateObject_3$i, templateObject_4$c, templateObject_5$8, templateObject_6$3, templateObject_7$2, templateObject_8$2, templateObject_9$1, templateObject_10$1, templateObject_11$1, templateObject_12$1, templateObject_13$1;
|
|
21803
|
+
|
|
21804
|
+
var DynamsoftBarcodeContext = /*#__PURE__*/React.createContext({
|
|
21805
|
+
loadState: 'not-started',
|
|
21806
|
+
error: null,
|
|
21807
|
+
lastDecodeResult: null,
|
|
21808
|
+
isScanning: false,
|
|
21809
|
+
startScanning: function startScanning() {},
|
|
21810
|
+
stopScanning: function stopScanning() {},
|
|
21811
|
+
resetDecodeResult: function resetDecodeResult() {}
|
|
21812
|
+
});
|
|
21813
|
+
function DynamsoftBarcodeProvider(_a) {
|
|
21814
|
+
var _this = this;
|
|
21815
|
+
var children = _a.children,
|
|
21816
|
+
organizationId = _a.organizationId,
|
|
21817
|
+
licenseKey = _a.licenseKey,
|
|
21818
|
+
_b = _a.promptForLicense,
|
|
21819
|
+
promptForLicense = _b === void 0 ? false : _b,
|
|
21820
|
+
_c = _a.enabled,
|
|
21821
|
+
enabled = _c === void 0 ? true : _c,
|
|
21822
|
+
onBarcodeDecoded = _a.onBarcodeDecoded,
|
|
21823
|
+
onError = _a.onError;
|
|
21824
|
+
var _d = React.useState('not-started'),
|
|
21825
|
+
loadState = _d[0],
|
|
21826
|
+
setLoadState = _d[1];
|
|
21827
|
+
var _e = React.useState(null),
|
|
21828
|
+
error = _e[0],
|
|
21829
|
+
setError = _e[1];
|
|
21830
|
+
var _f = React.useState(null),
|
|
21831
|
+
lastDecodeResult = _f[0],
|
|
21832
|
+
setLastDecodeResult = _f[1];
|
|
21833
|
+
var _g = React.useState(false),
|
|
21834
|
+
isScanning = _g[0],
|
|
21835
|
+
setIsScanning = _g[1];
|
|
21836
|
+
var _h = React.useState(null),
|
|
21837
|
+
promptedLicenseKey = _h[0],
|
|
21838
|
+
setPromptedLicenseKey = _h[1];
|
|
21839
|
+
var _j = React.useState(false),
|
|
21840
|
+
showLicensePrompt = _j[0],
|
|
21841
|
+
setShowLicensePrompt = _j[1];
|
|
21842
|
+
var readerRef = React.useRef(null);
|
|
21843
|
+
var scanningRef = React.useRef(false);
|
|
21844
|
+
var animationFrameRef = React.useRef(null);
|
|
21845
|
+
var videoRef = useCameraStore().videoRef;
|
|
21846
|
+
// Check for saved license on mount if promptForLicense is enabled
|
|
21847
|
+
React.useEffect(function () {
|
|
21848
|
+
if (promptForLicense && !organizationId && !licenseKey) {
|
|
21849
|
+
var savedLicense = getSavedDynamsoftLicense();
|
|
21850
|
+
if (savedLicense) {
|
|
21851
|
+
log('[DynamsoftBarcodeProvider] Using saved license from localStorage');
|
|
21852
|
+
setPromptedLicenseKey(savedLicense);
|
|
21853
|
+
} else {
|
|
21854
|
+
log('[DynamsoftBarcodeProvider] No saved license, showing prompt');
|
|
21855
|
+
setShowLicensePrompt(true);
|
|
21856
|
+
}
|
|
21857
|
+
}
|
|
21858
|
+
}, [promptForLicense, organizationId, licenseKey]);
|
|
21859
|
+
// Handle license submission from prompt
|
|
21860
|
+
var handleLicenseSubmit = React.useCallback(function (key) {
|
|
21861
|
+
log('[DynamsoftBarcodeProvider] License key submitted');
|
|
21862
|
+
setPromptedLicenseKey(key);
|
|
21863
|
+
setShowLicensePrompt(false);
|
|
21864
|
+
}, []);
|
|
21865
|
+
// Handle prompt skip/cancel
|
|
21866
|
+
var handleLicenseCancel = React.useCallback(function () {
|
|
21867
|
+
log('[DynamsoftBarcodeProvider] License prompt cancelled');
|
|
21868
|
+
setShowLicensePrompt(false);
|
|
21869
|
+
}, []);
|
|
21870
|
+
// Build license config from props or prompted key
|
|
21871
|
+
var licenseConfig = React.useMemo(function () {
|
|
21872
|
+
if (organizationId) return {
|
|
21873
|
+
organizationId: organizationId
|
|
21874
|
+
};
|
|
21875
|
+
if (licenseKey) return {
|
|
21876
|
+
licenseKey: licenseKey
|
|
21877
|
+
};
|
|
21878
|
+
if (promptedLicenseKey) return {
|
|
21879
|
+
licenseKey: promptedLicenseKey
|
|
21880
|
+
};
|
|
21881
|
+
return null;
|
|
21882
|
+
}, [organizationId, licenseKey, promptedLicenseKey]);
|
|
21883
|
+
// Load and initialize Dynamsoft SDK
|
|
21884
|
+
React.useEffect(function () {
|
|
21885
|
+
if (!enabled || !licenseConfig) return;
|
|
21886
|
+
if (loadState !== 'not-started') return;
|
|
21887
|
+
var initSDK = function initSDK() {
|
|
21888
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
21889
|
+
var router, err_1, error_1;
|
|
21890
|
+
var _a, _b;
|
|
21891
|
+
return __generator(this, function (_c) {
|
|
21892
|
+
switch (_c.label) {
|
|
21893
|
+
case 0:
|
|
21894
|
+
_c.trys.push([0, 6,, 7]);
|
|
21895
|
+
setLoadState('loading');
|
|
21896
|
+
log('[DynamsoftBarcodeProvider] Loading Dynamsoft SDK from CDN...');
|
|
21897
|
+
return [4 /*yield*/, loadDynamsoftSDK()];
|
|
21898
|
+
case 1:
|
|
21899
|
+
_c.sent();
|
|
21900
|
+
setLoadState('initializing');
|
|
21901
|
+
log('[DynamsoftBarcodeProvider] Initializing Dynamsoft license...');
|
|
21902
|
+
return [4 /*yield*/, initializeDynamsoft(licenseConfig)
|
|
21903
|
+
// Log available Dynamsoft APIs for debugging
|
|
21904
|
+
];
|
|
21905
|
+
case 2:
|
|
21906
|
+
_c.sent();
|
|
21907
|
+
// Log available Dynamsoft APIs for debugging
|
|
21908
|
+
if (window.Dynamsoft) {
|
|
21909
|
+
log('[DynamsoftBarcodeProvider] Available Dynamsoft APIs:', Object.keys(window.Dynamsoft));
|
|
21910
|
+
if (window.Dynamsoft.DBR) {
|
|
21911
|
+
log('[DynamsoftBarcodeProvider] DBR APIs:', Object.keys(window.Dynamsoft.DBR));
|
|
21912
|
+
}
|
|
21913
|
+
if (window.Dynamsoft.CVR) {
|
|
21914
|
+
log('[DynamsoftBarcodeProvider] CVR APIs:', Object.keys(window.Dynamsoft.CVR));
|
|
21915
|
+
}
|
|
21916
|
+
}
|
|
21917
|
+
if (!((_b = (_a = window.Dynamsoft) === null || _a === void 0 ? void 0 : _a.CVR) === null || _b === void 0 ? void 0 : _b.CaptureVisionRouter)) return [3 /*break*/, 4];
|
|
21918
|
+
return [4 /*yield*/, window.Dynamsoft.CVR.CaptureVisionRouter.createInstance()
|
|
21919
|
+
// Store router as our "reader" - we'll use capture() method
|
|
21920
|
+
// PDF417 filtering is done at the result level in decodeFrame()
|
|
21921
|
+
];
|
|
21922
|
+
case 3:
|
|
21923
|
+
router = _c.sent();
|
|
21924
|
+
// Store router as our "reader" - we'll use capture() method
|
|
21925
|
+
// PDF417 filtering is done at the result level in decodeFrame()
|
|
21926
|
+
readerRef.current = router;
|
|
21927
|
+
log('[DynamsoftBarcodeProvider] CaptureVisionRouter instance created');
|
|
21928
|
+
return [3 /*break*/, 5];
|
|
21929
|
+
case 4:
|
|
21930
|
+
throw new Error('Dynamsoft CaptureVisionRouter not available');
|
|
21931
|
+
case 5:
|
|
21932
|
+
setLoadState('ready');
|
|
21933
|
+
log('[DynamsoftBarcodeProvider] Dynamsoft SDK ready');
|
|
21934
|
+
return [3 /*break*/, 7];
|
|
21935
|
+
case 6:
|
|
21936
|
+
err_1 = _c.sent();
|
|
21937
|
+
error_1 = err_1 instanceof Error ? err_1 : new Error('Failed to load Dynamsoft SDK');
|
|
21938
|
+
setError(error_1);
|
|
21939
|
+
setLoadState('error');
|
|
21940
|
+
log('[DynamsoftBarcodeProvider] Error loading Dynamsoft SDK:', error_1);
|
|
21941
|
+
onError === null || onError === void 0 ? void 0 : onError(error_1);
|
|
21942
|
+
return [3 /*break*/, 7];
|
|
21943
|
+
case 7:
|
|
21944
|
+
return [2 /*return*/];
|
|
21945
|
+
}
|
|
21946
|
+
});
|
|
21947
|
+
});
|
|
21948
|
+
};
|
|
21949
|
+
void initSDK();
|
|
21950
|
+
}, [enabled, licenseConfig, loadState, onError]);
|
|
21951
|
+
// Cleanup router on unmount
|
|
21952
|
+
React.useEffect(function () {
|
|
21953
|
+
return function () {
|
|
21954
|
+
if (readerRef.current) {
|
|
21955
|
+
var router = readerRef.current;
|
|
21956
|
+
router.dispose();
|
|
21957
|
+
readerRef.current = null;
|
|
21958
|
+
}
|
|
21959
|
+
if (animationFrameRef.current) {
|
|
21960
|
+
cancelAnimationFrame(animationFrameRef.current);
|
|
21961
|
+
}
|
|
21962
|
+
};
|
|
21963
|
+
}, []);
|
|
21964
|
+
var decodeFrame = React.useCallback(function () {
|
|
21965
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
21966
|
+
var video, router, result, items, pdf417Item, decodeResult, otherBarcodes, err_2;
|
|
21967
|
+
return __generator(this, function (_a) {
|
|
21968
|
+
switch (_a.label) {
|
|
21969
|
+
case 0:
|
|
21970
|
+
if (!scanningRef.current) return [2 /*return*/];
|
|
21971
|
+
if (!readerRef.current) return [2 /*return*/];
|
|
21972
|
+
if (!videoRef.current) return [2 /*return*/];
|
|
21973
|
+
video = videoRef.current;
|
|
21974
|
+
if (video.readyState < 2) {
|
|
21975
|
+
// Video not ready, try again
|
|
21976
|
+
animationFrameRef.current = requestAnimationFrame(decodeFrame);
|
|
21977
|
+
return [2 /*return*/];
|
|
21978
|
+
}
|
|
21979
|
+
_a.label = 1;
|
|
21980
|
+
case 1:
|
|
21981
|
+
_a.trys.push([1, 3,, 4]);
|
|
21982
|
+
router = readerRef.current;
|
|
21983
|
+
return [4 /*yield*/, router.capture(video)
|
|
21984
|
+
// Extract barcode results from captured result
|
|
21985
|
+
// The result contains items array with different result types
|
|
21986
|
+
];
|
|
21987
|
+
case 2:
|
|
21988
|
+
result = _a.sent();
|
|
21989
|
+
items = result.items;
|
|
21990
|
+
if (items && items.length > 0) {
|
|
21991
|
+
pdf417Item = items.find(function (item) {
|
|
21992
|
+
var _a;
|
|
21993
|
+
return item.type === 2 && item.text && ((_a = item.formatString) === null || _a === void 0 ? void 0 : _a.toUpperCase().includes('PDF417'));
|
|
21994
|
+
});
|
|
21995
|
+
if (pdf417Item && pdf417Item.text) {
|
|
21996
|
+
decodeResult = {
|
|
21997
|
+
text: pdf417Item.text,
|
|
21998
|
+
format: pdf417Item.formatString || 'PDF417'
|
|
21999
|
+
};
|
|
22000
|
+
log("[DynamsoftBarcodeProvider] PDF417 barcode decoded: ".concat(decodeResult.text.substring(0, 50), "..."));
|
|
22001
|
+
setLastDecodeResult(decodeResult);
|
|
22002
|
+
onBarcodeDecoded === null || onBarcodeDecoded === void 0 ? void 0 : onBarcodeDecoded(decodeResult);
|
|
22003
|
+
// Stop scanning after successful decode
|
|
22004
|
+
scanningRef.current = false;
|
|
22005
|
+
setIsScanning(false);
|
|
22006
|
+
return [2 /*return*/];
|
|
22007
|
+
}
|
|
22008
|
+
otherBarcodes = items.filter(function (item) {
|
|
22009
|
+
var _a;
|
|
22010
|
+
return item.type === 2 && item.text && !((_a = item.formatString) === null || _a === void 0 ? void 0 : _a.toUpperCase().includes('PDF417'));
|
|
22011
|
+
});
|
|
22012
|
+
if (otherBarcodes.length > 0) {
|
|
22013
|
+
log("[DynamsoftBarcodeProvider] Ignoring non-PDF417 barcodes: ".concat(otherBarcodes.map(function (b) {
|
|
22014
|
+
return b.formatString;
|
|
22015
|
+
}).join(', ')));
|
|
22016
|
+
}
|
|
22017
|
+
}
|
|
22018
|
+
return [3 /*break*/, 4];
|
|
22019
|
+
case 3:
|
|
22020
|
+
err_2 = _a.sent();
|
|
22021
|
+
// Decode errors are expected when no barcode is visible
|
|
22022
|
+
// Only log unexpected errors
|
|
22023
|
+
if (err_2 instanceof Error && !err_2.message.includes('No barcode') && !err_2.message.includes('timeout')) {
|
|
22024
|
+
log('[DynamsoftBarcodeProvider] Decode error:', err_2.message);
|
|
22025
|
+
}
|
|
22026
|
+
return [3 /*break*/, 4];
|
|
22027
|
+
case 4:
|
|
22028
|
+
// Continue scanning
|
|
22029
|
+
if (scanningRef.current) {
|
|
22030
|
+
animationFrameRef.current = requestAnimationFrame(decodeFrame);
|
|
22031
|
+
}
|
|
22032
|
+
return [2 /*return*/];
|
|
22033
|
+
}
|
|
22034
|
+
});
|
|
22035
|
+
});
|
|
22036
|
+
}, [onBarcodeDecoded, videoRef]);
|
|
22037
|
+
var startScanning = React.useCallback(function () {
|
|
22038
|
+
if (loadState !== 'ready') {
|
|
22039
|
+
log('[DynamsoftBarcodeProvider] Cannot start scanning - SDK not ready:', loadState);
|
|
22040
|
+
return;
|
|
22041
|
+
}
|
|
22042
|
+
if (scanningRef.current) {
|
|
22043
|
+
log('[DynamsoftBarcodeProvider] Already scanning');
|
|
22044
|
+
return;
|
|
22045
|
+
}
|
|
22046
|
+
log('[DynamsoftBarcodeProvider] Starting continuous barcode scanning');
|
|
22047
|
+
scanningRef.current = true;
|
|
22048
|
+
setIsScanning(true);
|
|
22049
|
+
setLastDecodeResult(null);
|
|
22050
|
+
// Start decode loop
|
|
22051
|
+
animationFrameRef.current = requestAnimationFrame(decodeFrame);
|
|
22052
|
+
}, [decodeFrame, loadState]);
|
|
22053
|
+
var stopScanning = React.useCallback(function () {
|
|
22054
|
+
log('[DynamsoftBarcodeProvider] Stopping barcode scanning');
|
|
22055
|
+
scanningRef.current = false;
|
|
22056
|
+
setIsScanning(false);
|
|
22057
|
+
if (animationFrameRef.current) {
|
|
22058
|
+
cancelAnimationFrame(animationFrameRef.current);
|
|
22059
|
+
animationFrameRef.current = null;
|
|
22060
|
+
}
|
|
22061
|
+
}, []);
|
|
22062
|
+
var resetDecodeResult = React.useCallback(function () {
|
|
22063
|
+
setLastDecodeResult(null);
|
|
22064
|
+
}, []);
|
|
22065
|
+
var value = React.useMemo(function () {
|
|
22066
|
+
return {
|
|
22067
|
+
loadState: loadState,
|
|
22068
|
+
error: error,
|
|
22069
|
+
lastDecodeResult: lastDecodeResult,
|
|
22070
|
+
isScanning: isScanning,
|
|
22071
|
+
startScanning: startScanning,
|
|
22072
|
+
stopScanning: stopScanning,
|
|
22073
|
+
resetDecodeResult: resetDecodeResult
|
|
22074
|
+
};
|
|
22075
|
+
}, [loadState, error, lastDecodeResult, isScanning, startScanning, stopScanning, resetDecodeResult]);
|
|
22076
|
+
return /*#__PURE__*/React.createElement(DynamsoftBarcodeContext.Provider, {
|
|
22077
|
+
value: value
|
|
22078
|
+
}, children, showLicensePrompt && (/*#__PURE__*/React.createElement(DynamsoftLicensePrompt, {
|
|
22079
|
+
onLicenseSubmit: handleLicenseSubmit,
|
|
22080
|
+
onCancel: handleLicenseCancel
|
|
22081
|
+
})));
|
|
20324
22082
|
}
|
|
20325
|
-
|
|
20326
|
-
|
|
20327
|
-
if (
|
|
20328
|
-
|
|
20329
|
-
}
|
|
20330
|
-
if (dp === void 0) {
|
|
20331
|
-
dp = 1;
|
|
20332
|
-
}
|
|
20333
|
-
var thresh = si ? 1000 : 1024;
|
|
20334
|
-
if (Math.abs(bytes) < thresh) {
|
|
20335
|
-
return bytes + ' B';
|
|
22083
|
+
function useDynamsoftBarcodeContext() {
|
|
22084
|
+
var context = React.useContext(DynamsoftBarcodeContext);
|
|
22085
|
+
if (!context) {
|
|
22086
|
+
throw new Error('useDynamsoftBarcodeContext must be used within a DynamsoftBarcodeProvider');
|
|
20336
22087
|
}
|
|
20337
|
-
|
|
20338
|
-
var u = -1;
|
|
20339
|
-
var r = Math.pow(10, dp);
|
|
20340
|
-
do {
|
|
20341
|
-
bytes /= thresh;
|
|
20342
|
-
++u;
|
|
20343
|
-
} while (Math.round(Math.abs(bytes) * r) / r >= thresh && u < units.length - 1);
|
|
20344
|
-
return bytes.toFixed(dp) + ' ' + units[u];
|
|
22088
|
+
return context;
|
|
20345
22089
|
}
|
|
20346
|
-
var templateObject_1$p, templateObject_2$o, templateObject_3$i, templateObject_4$c, templateObject_5$8, templateObject_6$3, templateObject_7$2, templateObject_8$2, templateObject_9$1, templateObject_10$1, templateObject_11$1, templateObject_12$1, templateObject_13$1;
|
|
20347
22090
|
|
|
20348
22091
|
var lastDocumentDetectedAtDefaults = {
|
|
20349
22092
|
idCardFront: null,
|
|
@@ -20353,7 +22096,7 @@
|
|
|
20353
22096
|
none: null
|
|
20354
22097
|
};
|
|
20355
22098
|
var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
20356
|
-
var _b, _c, _d, _e, _f;
|
|
22099
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
20357
22100
|
var onLoadingStarted = _a.onLoadingStarted,
|
|
20358
22101
|
onLoadingProgress = _a.onLoadingProgress,
|
|
20359
22102
|
onLoadingCompleted = _a.onLoadingCompleted,
|
|
@@ -20364,86 +22107,119 @@
|
|
|
20364
22107
|
onLoadingOverlayDismissed = _a.onLoadingOverlayDismissed,
|
|
20365
22108
|
onDocumentCaptured = _a.onDocumentCaptured,
|
|
20366
22109
|
onDocumentDetected = _a.onDocumentDetected,
|
|
20367
|
-
|
|
20368
|
-
documentDetectionThrottleMs =
|
|
20369
|
-
|
|
20370
|
-
loadingOverlayMode =
|
|
22110
|
+
_o = _a.documentDetectionThrottleMs,
|
|
22111
|
+
documentDetectionThrottleMs = _o === void 0 ? 0 : _o,
|
|
22112
|
+
_p = _a.loadingOverlayMode,
|
|
22113
|
+
loadingOverlayMode = _p === void 0 ? 'default' : _p,
|
|
20371
22114
|
customOverlayContent = _a.customOverlayContent,
|
|
20372
22115
|
precapturedDocuments = _a.precapturedDocuments,
|
|
20373
|
-
|
|
20374
|
-
captureRequirement =
|
|
20375
|
-
|
|
20376
|
-
allowSinglePageIdCapture =
|
|
20377
|
-
|
|
20378
|
-
separateIdCardCaptureSequence =
|
|
20379
|
-
|
|
20380
|
-
thresholds =
|
|
20381
|
-
|
|
20382
|
-
skipSuccessScreen =
|
|
22116
|
+
_q = _a.captureRequirement,
|
|
22117
|
+
captureRequirement = _q === void 0 ? 'idCardOrPassport' : _q,
|
|
22118
|
+
_r = _a.allowSinglePageIdCapture,
|
|
22119
|
+
allowSinglePageIdCapture = _r === void 0 ? false : _r,
|
|
22120
|
+
_s = _a.separateIdCardCaptureSequence,
|
|
22121
|
+
separateIdCardCaptureSequence = _s === void 0 ? false : _s,
|
|
22122
|
+
_t = _a.thresholds,
|
|
22123
|
+
thresholds = _t === void 0 ? defaultIdCaptureThresholds : _t,
|
|
22124
|
+
_u = _a.skipSuccessScreen,
|
|
22125
|
+
skipSuccessScreen = _u === void 0 ? false : _u,
|
|
20383
22126
|
instructions = _a.instructions,
|
|
20384
|
-
|
|
20385
|
-
releaseCameraAccessOnExit =
|
|
20386
|
-
|
|
20387
|
-
guideType =
|
|
20388
|
-
|
|
20389
|
-
portraitGuidesOnMobile =
|
|
20390
|
-
|
|
20391
|
-
rotateLoadingOverlayImageWhenPortrait =
|
|
20392
|
-
|
|
20393
|
-
silentFallback =
|
|
20394
|
-
|
|
20395
|
-
forceFallbackMode =
|
|
20396
|
-
|
|
20397
|
-
allowIdCardBackToFrontCapture =
|
|
20398
|
-
|
|
20399
|
-
enableOverrideWrongDocumentTypeDialog =
|
|
20400
|
-
|
|
20401
|
-
allowOverrideWrongDocumentTypeAfterMs =
|
|
20402
|
-
|
|
20403
|
-
allowUploadingDocumentsFromStorage =
|
|
20404
|
-
|
|
20405
|
-
guideImages =
|
|
20406
|
-
|
|
20407
|
-
|
|
20408
|
-
|
|
20409
|
-
|
|
20410
|
-
|
|
20411
|
-
|
|
20412
|
-
|
|
20413
|
-
|
|
20414
|
-
|
|
20415
|
-
|
|
20416
|
-
|
|
20417
|
-
|
|
22127
|
+
_v = _a.releaseCameraAccessOnExit,
|
|
22128
|
+
releaseCameraAccessOnExit = _v === void 0 ? true : _v,
|
|
22129
|
+
_w = _a.guideType,
|
|
22130
|
+
guideType = _w === void 0 ? 'fit' : _w,
|
|
22131
|
+
_x = _a.portraitGuidesOnMobile,
|
|
22132
|
+
portraitGuidesOnMobile = _x === void 0 ? true : _x,
|
|
22133
|
+
_y = _a.rotateLoadingOverlayImageWhenPortrait,
|
|
22134
|
+
rotateLoadingOverlayImageWhenPortrait = _y === void 0 ? true : _y,
|
|
22135
|
+
_z = _a.silentFallback,
|
|
22136
|
+
silentFallback = _z === void 0 ? false : _z,
|
|
22137
|
+
_0 = _a.forceFallbackMode,
|
|
22138
|
+
forceFallbackMode = _0 === void 0 ? false : _0,
|
|
22139
|
+
_1 = _a.allowIdCardBackToFrontCapture,
|
|
22140
|
+
allowIdCardBackToFrontCapture = _1 === void 0 ? false : _1,
|
|
22141
|
+
_2 = _a.enableOverrideWrongDocumentTypeDialog,
|
|
22142
|
+
enableOverrideWrongDocumentTypeDialog = _2 === void 0 ? false : _2,
|
|
22143
|
+
_3 = _a.allowOverrideWrongDocumentTypeAfterMs,
|
|
22144
|
+
allowOverrideWrongDocumentTypeAfterMs = _3 === void 0 ? 8000 : _3,
|
|
22145
|
+
_4 = _a.allowUploadingDocumentsFromStorage,
|
|
22146
|
+
allowUploadingDocumentsFromStorage = _4 === void 0 ? false : _4,
|
|
22147
|
+
_5 = _a.guideImages,
|
|
22148
|
+
guideImages = _5 === void 0 ? defaultIdCaptureGuideImages : _5,
|
|
22149
|
+
_6 = _a.barcodeRecaptureThreshold,
|
|
22150
|
+
barcodeRecaptureThreshold = _6 === void 0 ? 1 : _6,
|
|
22151
|
+
_7 = _a.barcodeRecaptureTimeoutMs,
|
|
22152
|
+
barcodeRecaptureTimeoutMs = _7 === void 0 ? 5000 : _7,
|
|
22153
|
+
_8 = _a.barcodeRecaptureMoveCloserTimeoutMs,
|
|
22154
|
+
barcodeRecaptureMoveCloserTimeoutMs = _8 === void 0 ? 10000 : _8,
|
|
22155
|
+
_9 = _a.barcodeRecaptureBboxGrowthPct,
|
|
22156
|
+
barcodeRecaptureBboxGrowthPct = _9 === void 0 ? 20 : _9,
|
|
22157
|
+
_10 = _a.documentEdgeDistancePct,
|
|
22158
|
+
documentEdgeDistancePct = _10 === void 0 ? 0 : _10,
|
|
22159
|
+
_11 = _a.enableClientBarcodeScan,
|
|
22160
|
+
enableClientBarcodeScan = _11 === void 0 ? false : _11,
|
|
22161
|
+
onClientBarcodeDecoded = _a.onClientBarcodeDecoded,
|
|
22162
|
+
_12 = _a.assets,
|
|
22163
|
+
assets = _12 === void 0 ? {} : _12,
|
|
22164
|
+
_13 = _a.classNames,
|
|
22165
|
+
classNames = _13 === void 0 ? {} : _13,
|
|
22166
|
+
_14 = _a.colors,
|
|
22167
|
+
colors = _14 === void 0 ? {} : _14,
|
|
22168
|
+
_15 = _a.verbiage,
|
|
22169
|
+
verbiage = _15 === void 0 ? {} : _15,
|
|
22170
|
+
_16 = _a.debugMode,
|
|
22171
|
+
debugMode = _16 === void 0 ? false : _16;
|
|
20418
22172
|
var state = useIdCaptureStore();
|
|
20419
|
-
var
|
|
20420
|
-
|
|
20421
|
-
|
|
20422
|
-
|
|
20423
|
-
|
|
20424
|
-
|
|
20425
|
-
|
|
20426
|
-
|
|
20427
|
-
|
|
20428
|
-
|
|
20429
|
-
|
|
20430
|
-
|
|
20431
|
-
|
|
20432
|
-
|
|
20433
|
-
|
|
20434
|
-
|
|
20435
|
-
|
|
20436
|
-
|
|
20437
|
-
|
|
20438
|
-
|
|
20439
|
-
|
|
20440
|
-
|
|
20441
|
-
|
|
20442
|
-
|
|
20443
|
-
|
|
20444
|
-
|
|
20445
|
-
|
|
20446
|
-
|
|
22173
|
+
var isCapturing = state.captureState === 'capturing' || state.captureState === 'requestingBetterBarcode';
|
|
22174
|
+
var _17 = useCameraStore(),
|
|
22175
|
+
cameraAccessDenied = _17.cameraAccessDenied,
|
|
22176
|
+
requestCameraAccess = _17.requestCameraAccess,
|
|
22177
|
+
releaseCameraAccess = _17.releaseCameraAccess;
|
|
22178
|
+
var _18 = React.useState(false),
|
|
22179
|
+
overlayDismissed = _18[0],
|
|
22180
|
+
setOverlayDismissed = _18[1];
|
|
22181
|
+
var _19 = useSubmissionContext(),
|
|
22182
|
+
submissionStatus = _19.submissionStatus,
|
|
22183
|
+
setIdFrontImage = _19.setIdFrontImage,
|
|
22184
|
+
setIdBackImage = _19.setIdBackImage,
|
|
22185
|
+
setPassportImage = _19.setPassportImage,
|
|
22186
|
+
setIdFrontIrImage = _19.setIdFrontIrImage,
|
|
22187
|
+
setIdBackIrImage = _19.setIdBackIrImage,
|
|
22188
|
+
setIdFrontUvImage = _19.setIdFrontUvImage,
|
|
22189
|
+
setIdBackUvImage = _19.setIdBackUvImage,
|
|
22190
|
+
setIdBarcodeImage = _19.setIdBarcodeImage,
|
|
22191
|
+
logIdFrontCaptureAttempt = _19.logIdFrontCaptureAttempt,
|
|
22192
|
+
logIdBackCaptureAttempt = _19.logIdBackCaptureAttempt;
|
|
22193
|
+
var _20 = useIdCaptureModelsContext(),
|
|
22194
|
+
start = _20.start,
|
|
22195
|
+
stop = _20.stop,
|
|
22196
|
+
onPredictionMade = _20.onPredictionMade,
|
|
22197
|
+
setRequiredDocumentType = _20.setRequiredDocumentType,
|
|
22198
|
+
modelError = _20.modelError,
|
|
22199
|
+
resetBestFrame = _20.resetBestFrame,
|
|
22200
|
+
resetBestBarcode = _20.resetBestBarcode,
|
|
22201
|
+
documentDetectionBoundaries = _20.documentDetectionBoundaries,
|
|
22202
|
+
setDocumentDetectionBoundaries = _20.setDocumentDetectionBoundaries,
|
|
22203
|
+
getBestBarcode = _20.getBestBarcode,
|
|
22204
|
+
startBarcodeRecapturePhase = _20.startBarcodeRecapturePhase,
|
|
22205
|
+
getRecaptureBestBarcode = _20.getRecaptureBestBarcode;
|
|
22206
|
+
var initialBarcodeBboxRef = React.useRef(null);
|
|
22207
|
+
var recapturePhaseStartedRef = React.useRef(false);
|
|
22208
|
+
var _21 = React.useState(false),
|
|
22209
|
+
barcodeRecaptureGrowthSatisfied = _21[0],
|
|
22210
|
+
setBarcodeRecaptureGrowthSatisfied = _21[1];
|
|
22211
|
+
React.useEffect(function () {
|
|
22212
|
+
// Reset recapture gating whenever we enter/exit the recapture flow
|
|
22213
|
+
if (state.captureState === 'requestingBetterBarcode') {
|
|
22214
|
+
initialBarcodeBboxRef.current = null;
|
|
22215
|
+
recapturePhaseStartedRef.current = false;
|
|
22216
|
+
setBarcodeRecaptureGrowthSatisfied(false);
|
|
22217
|
+
return;
|
|
22218
|
+
}
|
|
22219
|
+
initialBarcodeBboxRef.current = null;
|
|
22220
|
+
recapturePhaseStartedRef.current = false;
|
|
22221
|
+
setBarcodeRecaptureGrowthSatisfied(false);
|
|
22222
|
+
}, [state.captureState]);
|
|
20447
22223
|
React.useEffect(function () {
|
|
20448
22224
|
dispatchIdCaptureAction({
|
|
20449
22225
|
type: 'configureWizard',
|
|
@@ -20454,10 +22230,12 @@
|
|
|
20454
22230
|
allowIdCardBackToFrontCapture: allowIdCardBackToFrontCapture,
|
|
20455
22231
|
enableOverrideWrongDocumentTypeDialog: enableOverrideWrongDocumentTypeDialog,
|
|
20456
22232
|
allowOverrideWrongDocumentTypeAfterMs: allowOverrideWrongDocumentTypeAfterMs,
|
|
20457
|
-
allowUploadingDocumentsFromStorage: allowUploadingDocumentsFromStorage
|
|
22233
|
+
allowUploadingDocumentsFromStorage: allowUploadingDocumentsFromStorage,
|
|
22234
|
+
barcodeRecaptureThreshold: barcodeRecaptureThreshold,
|
|
22235
|
+
barcodeRecaptureTimeoutMs: barcodeRecaptureTimeoutMs
|
|
20458
22236
|
}
|
|
20459
22237
|
});
|
|
20460
|
-
}, [allowIdCardBackToFrontCapture, allowOverrideWrongDocumentTypeAfterMs, allowSinglePageIdCapture, allowUploadingDocumentsFromStorage, captureRequirement, enableOverrideWrongDocumentTypeDialog, precapturedDocuments]);
|
|
22238
|
+
}, [allowIdCardBackToFrontCapture, allowOverrideWrongDocumentTypeAfterMs, allowSinglePageIdCapture, allowUploadingDocumentsFromStorage, barcodeRecaptureThreshold, barcodeRecaptureTimeoutMs, captureRequirement, enableOverrideWrongDocumentTypeDialog, precapturedDocuments]);
|
|
20461
22239
|
React.useEffect(function () {
|
|
20462
22240
|
var _a;
|
|
20463
22241
|
var desiredEdgeDistance = documentEdgeDistancePct !== null && documentEdgeDistancePct !== void 0 ? documentEdgeDistancePct : 0;
|
|
@@ -20467,10 +22245,36 @@
|
|
|
20467
22245
|
edgeMarginPct: desiredEdgeDistance
|
|
20468
22246
|
}));
|
|
20469
22247
|
}, [documentDetectionBoundaries, documentEdgeDistancePct, setDocumentDetectionBoundaries]);
|
|
22248
|
+
// Relax detection boundaries during barcode recapture to allow edge detections
|
|
22249
|
+
// (when user zooms in, the barcode may be closer to frame edges)
|
|
22250
|
+
var savedBoundariesRef = React.useRef(documentDetectionBoundaries);
|
|
22251
|
+
React.useEffect(function () {
|
|
22252
|
+
if (state.captureState === 'requestingBetterBarcode') {
|
|
22253
|
+
// Save current boundaries and relax to 0 for recapture
|
|
22254
|
+
savedBoundariesRef.current = documentDetectionBoundaries;
|
|
22255
|
+
log('[IdCaptureWizard] Relaxing detection boundaries for barcode recapture');
|
|
22256
|
+
setDocumentDetectionBoundaries({
|
|
22257
|
+
top: 0,
|
|
22258
|
+
bottom: 0,
|
|
22259
|
+
left: 0,
|
|
22260
|
+
right: 0,
|
|
22261
|
+
edgeMarginPct: documentDetectionBoundaries.edgeMarginPct
|
|
22262
|
+
});
|
|
22263
|
+
} else if (savedBoundariesRef.current !== documentDetectionBoundaries) {
|
|
22264
|
+
// Restore boundaries when exiting recapture (only if they were changed)
|
|
22265
|
+
var saved = savedBoundariesRef.current;
|
|
22266
|
+
if (saved.top === 0 && saved.bottom === 0 && saved.left === 0 && saved.right === 0) {
|
|
22267
|
+
// Don't restore if saved values are the relaxed ones
|
|
22268
|
+
return;
|
|
22269
|
+
}
|
|
22270
|
+
}
|
|
22271
|
+
}, [state.captureState, documentDetectionBoundaries, setDocumentDetectionBoundaries]);
|
|
20470
22272
|
var documentCount = Object.keys(state.capturedDocuments).length;
|
|
20471
22273
|
React.useEffect(function () {
|
|
22274
|
+
// Skip reset during barcode recapture - the recapture flow manages its own canvas state
|
|
22275
|
+
if (state.captureState === 'requestingBetterBarcode') return;
|
|
20472
22276
|
if (documentCount) resetBestFrame();
|
|
20473
|
-
}, [documentCount, resetBestFrame]);
|
|
22277
|
+
}, [documentCount, resetBestFrame, state.captureState]);
|
|
20474
22278
|
var isFallbackMode = forceFallbackMode || modelError;
|
|
20475
22279
|
var lastDocumentDetectedAt = React.useRef(_assign({}, lastDocumentDetectedAtDefaults));
|
|
20476
22280
|
var logCaptureMetadata = React.useCallback(function (metadata) {
|
|
@@ -20489,24 +22293,62 @@
|
|
|
20489
22293
|
}
|
|
20490
22294
|
}, [isFallbackMode, logIdBackCaptureAttempt, logIdFrontCaptureAttempt]);
|
|
20491
22295
|
React.useEffect(function startModelsWhenCapturing() {
|
|
20492
|
-
if (!overlayDismissed ||
|
|
22296
|
+
if (!overlayDismissed || !isCapturing) return;
|
|
20493
22297
|
dispatchIdCaptureAction({
|
|
20494
22298
|
type: 'captureStarted'
|
|
20495
22299
|
});
|
|
20496
22300
|
start();
|
|
20497
|
-
}, [overlayDismissed, start
|
|
22301
|
+
}, [isCapturing, overlayDismissed, start]);
|
|
20498
22302
|
React.useEffect(function () {
|
|
20499
22303
|
onPredictionMade(function (prediction) {
|
|
20500
|
-
var _a;
|
|
20501
|
-
var
|
|
20502
|
-
captureState =
|
|
20503
|
-
requestedDocumentType =
|
|
22304
|
+
var _a, _b, _c, _d;
|
|
22305
|
+
var _e = useIdCaptureStore.getState(),
|
|
22306
|
+
captureState = _e.captureState,
|
|
22307
|
+
requestedDocumentType = _e.requestedDocumentType;
|
|
20504
22308
|
var k = "".concat(requestedDocumentType, "DetectionThresholdMet");
|
|
20505
22309
|
var thresholdMet = prediction[k];
|
|
20506
|
-
if (captureState === 'capturing') {
|
|
22310
|
+
if (captureState === 'capturing' || captureState === 'requestingBetterBarcode') {
|
|
22311
|
+
// During barcode recapture, wait until the barcode bbox grows by a configurable %
|
|
22312
|
+
// (to confirm the user moved the camera closer) before we start recapture processing.
|
|
22313
|
+
if (captureState === 'requestingBetterBarcode') {
|
|
22314
|
+
var growthPct = Math.max(0, Math.min(barcodeRecaptureBboxGrowthPct, 200));
|
|
22315
|
+
var requiredMultiplier = 1 + growthPct / 100;
|
|
22316
|
+
if (!recapturePhaseStartedRef.current) {
|
|
22317
|
+
// If growth requirement is disabled, begin recapture immediately.
|
|
22318
|
+
if (requiredMultiplier === 1) {
|
|
22319
|
+
recapturePhaseStartedRef.current = true;
|
|
22320
|
+
setBarcodeRecaptureGrowthSatisfied(true);
|
|
22321
|
+
startBarcodeRecapturePhase();
|
|
22322
|
+
} else {
|
|
22323
|
+
var pdf417Box = (_a = prediction.bestPDF417) === null || _a === void 0 ? void 0 : _a.box;
|
|
22324
|
+
var frameWidth = (_b = prediction.frameWidth) !== null && _b !== void 0 ? _b : 0;
|
|
22325
|
+
var frameHeight = (_c = prediction.frameHeight) !== null && _c !== void 0 ? _c : 0;
|
|
22326
|
+
if (pdf417Box && frameWidth > 0 && frameHeight > 0) {
|
|
22327
|
+
var widthRatio = pdf417Box.width / frameWidth;
|
|
22328
|
+
var heightRatio = pdf417Box.height / frameHeight;
|
|
22329
|
+
if (!initialBarcodeBboxRef.current) {
|
|
22330
|
+
// First observed bbox when we enter recapture.
|
|
22331
|
+
initialBarcodeBboxRef.current = {
|
|
22332
|
+
widthRatio: widthRatio,
|
|
22333
|
+
heightRatio: heightRatio
|
|
22334
|
+
};
|
|
22335
|
+
} else {
|
|
22336
|
+
var baseline = initialBarcodeBboxRef.current;
|
|
22337
|
+
var widthSatisfied = widthRatio >= baseline.widthRatio * requiredMultiplier;
|
|
22338
|
+
var heightSatisfied = heightRatio >= baseline.heightRatio * requiredMultiplier;
|
|
22339
|
+
if (widthSatisfied && heightSatisfied) {
|
|
22340
|
+
recapturePhaseStartedRef.current = true;
|
|
22341
|
+
setBarcodeRecaptureGrowthSatisfied(true);
|
|
22342
|
+
startBarcodeRecapturePhase();
|
|
22343
|
+
}
|
|
22344
|
+
}
|
|
22345
|
+
}
|
|
22346
|
+
}
|
|
22347
|
+
}
|
|
22348
|
+
}
|
|
20507
22349
|
if (prediction.detectedDocumentType !== 'none') {
|
|
20508
22350
|
var now = Date.now();
|
|
20509
|
-
if (!lastDocumentDetectedAt.current[prediction.detectedDocumentType] || documentDetectionThrottleMs && now - ((
|
|
22351
|
+
if (!lastDocumentDetectedAt.current[prediction.detectedDocumentType] || documentDetectionThrottleMs && now - ((_d = lastDocumentDetectedAt.current[prediction.detectedDocumentType]) !== null && _d !== void 0 ? _d : 0) > documentDetectionThrottleMs) {
|
|
20510
22352
|
lastDocumentDetectedAt.current[prediction.detectedDocumentType] = now;
|
|
20511
22353
|
onDocumentDetected === null || onDocumentDetected === void 0 ? void 0 : onDocumentDetected(prediction.detectedDocumentType);
|
|
20512
22354
|
}
|
|
@@ -20524,10 +22366,67 @@
|
|
|
20524
22366
|
});
|
|
20525
22367
|
}
|
|
20526
22368
|
});
|
|
20527
|
-
}, [documentDetectionThrottleMs, onDocumentDetected, onPredictionMade, resetBestFrame]);
|
|
22369
|
+
}, [barcodeRecaptureBboxGrowthPct, documentDetectionThrottleMs, onDocumentDetected, onPredictionMade, resetBestFrame, startBarcodeRecapturePhase]);
|
|
20528
22370
|
React.useEffect(function () {
|
|
20529
22371
|
if (state.captureState === 'complete') stop();
|
|
20530
22372
|
}, [state.captureState, stop]);
|
|
22373
|
+
// Run native barcode decoder when capture completes and there's a barcode image
|
|
22374
|
+
React.useEffect(function () {
|
|
22375
|
+
var _a;
|
|
22376
|
+
if (state.captureState !== 'complete') return;
|
|
22377
|
+
if (state.nativeBarcodeDecodeResult) return; // Already decoded
|
|
22378
|
+
if (state.nativeBarcodeDecoding) return; // Already decoding
|
|
22379
|
+
var barcodeImage = (_a = state.capturedDocuments.idBarcodeImage) === null || _a === void 0 ? void 0 : _a.imageData;
|
|
22380
|
+
if (!barcodeImage) return;
|
|
22381
|
+
log('[IdCaptureWizard] Running native barcode decoder on final barcode image');
|
|
22382
|
+
dispatchIdCaptureAction({
|
|
22383
|
+
type: 'nativeBarcodeDecodeStarted'
|
|
22384
|
+
});
|
|
22385
|
+
// Convert base64/data URL to blob and decode
|
|
22386
|
+
fetch(barcodeImage.startsWith('data:') ? barcodeImage : "data:image/jpeg;base64,".concat(barcodeImage)).then(function (res) {
|
|
22387
|
+
return res.blob();
|
|
22388
|
+
}).then(function (blob) {
|
|
22389
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
22390
|
+
var result, error_1;
|
|
22391
|
+
return __generator(this, function (_a) {
|
|
22392
|
+
switch (_a.label) {
|
|
22393
|
+
case 0:
|
|
22394
|
+
_a.trys.push([0, 2,, 3]);
|
|
22395
|
+
return [4 /*yield*/, decodePDF417(blob)];
|
|
22396
|
+
case 1:
|
|
22397
|
+
result = _a.sent();
|
|
22398
|
+
if (result) {
|
|
22399
|
+
log("[IdCaptureWizard] Native barcode decoded via ".concat(result.method, ": ").concat(result.text.substring(0, 50), "..."));
|
|
22400
|
+
dispatchIdCaptureAction({
|
|
22401
|
+
type: 'nativeBarcodeDecoded',
|
|
22402
|
+
payload: result
|
|
22403
|
+
});
|
|
22404
|
+
} else {
|
|
22405
|
+
log('[IdCaptureWizard] Native barcode decode returned no result');
|
|
22406
|
+
dispatchIdCaptureAction({
|
|
22407
|
+
type: 'nativeBarcodeDecodeFailed'
|
|
22408
|
+
});
|
|
22409
|
+
}
|
|
22410
|
+
return [3 /*break*/, 3];
|
|
22411
|
+
case 2:
|
|
22412
|
+
error_1 = _a.sent();
|
|
22413
|
+
log('[IdCaptureWizard] Native barcode decode error:', error_1);
|
|
22414
|
+
dispatchIdCaptureAction({
|
|
22415
|
+
type: 'nativeBarcodeDecodeFailed'
|
|
22416
|
+
});
|
|
22417
|
+
return [3 /*break*/, 3];
|
|
22418
|
+
case 3:
|
|
22419
|
+
return [2 /*return*/];
|
|
22420
|
+
}
|
|
22421
|
+
});
|
|
22422
|
+
});
|
|
22423
|
+
})["catch"](function (error) {
|
|
22424
|
+
log('[IdCaptureWizard] Failed to fetch barcode image for native decode:', error);
|
|
22425
|
+
dispatchIdCaptureAction({
|
|
22426
|
+
type: 'nativeBarcodeDecodeFailed'
|
|
22427
|
+
});
|
|
22428
|
+
});
|
|
22429
|
+
}, [state.captureState, (_b = state.capturedDocuments.idBarcodeImage) === null || _b === void 0 ? void 0 : _b.imageData, state.nativeBarcodeDecodeResult, state.nativeBarcodeDecoding]);
|
|
20531
22430
|
var onCapture = React.useCallback(function (imageData, width, height, documentType, metadata) {
|
|
20532
22431
|
logCaptureMetadata(metadata);
|
|
20533
22432
|
onDocumentCaptured === null || onDocumentCaptured === void 0 ? void 0 : onDocumentCaptured(metadata);
|
|
@@ -20579,9 +22478,9 @@
|
|
|
20579
22478
|
type: 'resetWizard'
|
|
20580
22479
|
});
|
|
20581
22480
|
}, []);
|
|
20582
|
-
var
|
|
20583
|
-
attempt =
|
|
20584
|
-
setAttempt =
|
|
22481
|
+
var _22 = React.useState(0),
|
|
22482
|
+
attempt = _22[0],
|
|
22483
|
+
setAttempt = _22[1];
|
|
20585
22484
|
var onExit = React.useCallback(function () {
|
|
20586
22485
|
releaseCameraAccess();
|
|
20587
22486
|
setOverlayDismissed(false);
|
|
@@ -20607,20 +22506,25 @@
|
|
|
20607
22506
|
});
|
|
20608
22507
|
}
|
|
20609
22508
|
}, [cameraAccessDenied]);
|
|
22509
|
+
var guidanceBarcodeRecaptureText = (_c = verbiage.guidanceBarcodeRecaptureText) !== null && _c !== void 0 ? _c : 'Please move the barcode closer to the camera';
|
|
22510
|
+
var guidanceBarcodeRecaptureInProgressText = (_d = verbiage.guidanceBarcodeRecaptureInProgressText) !== null && _d !== void 0 ? _d : 'Barcode capture in progress, please hold still';
|
|
22511
|
+
var barcodeRecaptureGuidanceMessage = barcodeRecaptureGrowthSatisfied ? guidanceBarcodeRecaptureInProgressText : guidanceBarcodeRecaptureText;
|
|
20610
22512
|
var idCaptureVerbiages = {
|
|
20611
22513
|
idCardFront: useTranslations(verbiage.idCardFront, {
|
|
20612
22514
|
instructionText: 'Scan the front of ID',
|
|
20613
22515
|
processingIdCardText: "ID card ".concat('idCardFront' in state.capturedDocuments ? 'front' : 'back', " captured.")
|
|
20614
22516
|
}),
|
|
20615
22517
|
idCardBack: useTranslations(verbiage.idCardBack, {
|
|
20616
|
-
instructionText: 'Scan the back of ID'
|
|
22518
|
+
instructionText: state.captureState === 'requestingBetterBarcode' ? barcodeRecaptureGuidanceMessage : 'Scan the back of ID'
|
|
20617
22519
|
}),
|
|
20618
22520
|
passport: useTranslations(verbiage.passport, {
|
|
20619
22521
|
instructionText: 'Scan the ID page of passport'
|
|
20620
22522
|
})
|
|
20621
22523
|
};
|
|
20622
22524
|
var theme = styled.useTheme();
|
|
20623
|
-
|
|
22525
|
+
// During barcode recapture, use idCardBack verbiage to show barcode recapture message
|
|
22526
|
+
var verbiageKey = state.captureState === 'requestingBetterBarcode' ? 'idCardBack' : state.requestedDocumentType;
|
|
22527
|
+
var idCaptureVerbiage = idCaptureVerbiages[verbiageKey];
|
|
20624
22528
|
React.useEffect(function () {
|
|
20625
22529
|
if (separateIdCardCaptureSequence) return;
|
|
20626
22530
|
if (state.captureState !== 'requestingFlip') return;
|
|
@@ -20634,6 +22538,152 @@
|
|
|
20634
22538
|
clearTimeout(t);
|
|
20635
22539
|
};
|
|
20636
22540
|
}, [resetBestFrame, separateIdCardCaptureSequence, state.captureState]);
|
|
22541
|
+
// Handle barcode recapture start - snapshot initial barcode and initialize recapture state
|
|
22542
|
+
React.useEffect(function () {
|
|
22543
|
+
var _a, _b;
|
|
22544
|
+
if (state.captureState !== 'requestingBetterBarcode') return;
|
|
22545
|
+
if (state.initialCaptureBarcodeImage !== null) return; // Already initialized
|
|
22546
|
+
// Get the initial barcode image from capturedDocuments (since resetBestFrame clears the canvas)
|
|
22547
|
+
var initialBarcodeImage = (_b = (_a = state.capturedDocuments.idBarcodeImage) === null || _a === void 0 ? void 0 : _a.imageData) !== null && _b !== void 0 ? _b : null;
|
|
22548
|
+
dispatchIdCaptureAction({
|
|
22549
|
+
type: 'barcodeRecaptureStarted',
|
|
22550
|
+
payload: {
|
|
22551
|
+
initialBarcodeScore: state.initialBarcodeScore,
|
|
22552
|
+
initialCaptureBarcodeImage: initialBarcodeImage
|
|
22553
|
+
}
|
|
22554
|
+
});
|
|
22555
|
+
// Start recapture phase immediately so barcode analysis runs with relaxed conditions
|
|
22556
|
+
// (don't require document in bounds since user is zooming in)
|
|
22557
|
+
startBarcodeRecapturePhase();
|
|
22558
|
+
}, [startBarcodeRecapturePhase, state.captureState, (_e = state.capturedDocuments.idBarcodeImage) === null || _e === void 0 ? void 0 : _e.imageData, state.initialBarcodeScore, state.initialCaptureBarcodeImage]);
|
|
22559
|
+
// Reset best barcode after 1 second delay to ignore early frames before user has time to move closer
|
|
22560
|
+
React.useEffect(function () {
|
|
22561
|
+
if (state.captureState !== 'requestingBetterBarcode') return;
|
|
22562
|
+
var t = setTimeout(function () {
|
|
22563
|
+
log('[IdCaptureWizard] Resetting best barcode after 1s delay in move-closer window');
|
|
22564
|
+
resetBestBarcode();
|
|
22565
|
+
}, 1000);
|
|
22566
|
+
return function () {
|
|
22567
|
+
return clearTimeout(t);
|
|
22568
|
+
};
|
|
22569
|
+
}, [resetBestBarcode, state.captureState]);
|
|
22570
|
+
// Handle barcode recapture timeout
|
|
22571
|
+
React.useEffect(function () {
|
|
22572
|
+
if (state.captureState !== 'requestingBetterBarcode') return;
|
|
22573
|
+
// Continue detection to try to get a better barcode
|
|
22574
|
+
setTimeout(start, 100);
|
|
22575
|
+
var t = setTimeout(function () {
|
|
22576
|
+
var _a, _b;
|
|
22577
|
+
// Move-closer window expired before growth requirement was met
|
|
22578
|
+
if (recapturePhaseStartedRef.current) return;
|
|
22579
|
+
// Use recapture tracking since we start tracking with relaxed conditions immediately
|
|
22580
|
+
var recaptureBarcode = getRecaptureBestBarcode();
|
|
22581
|
+
var recaptureScore = (_a = recaptureBarcode === null || recaptureBarcode === void 0 ? void 0 : recaptureBarcode.score) !== null && _a !== void 0 ? _a : null;
|
|
22582
|
+
var improved = !!recaptureBarcode && recaptureBarcode.score > state.initialBarcodeScore;
|
|
22583
|
+
if (improved) {
|
|
22584
|
+
log("[IdCaptureWizard] Barcode recapture move-closer window timed out. Found better barcode anyway: ".concat(recaptureBarcode.score.toFixed(3), " (was ").concat(state.initialBarcodeScore.toFixed(3), ")"));
|
|
22585
|
+
dispatchIdCaptureAction({
|
|
22586
|
+
type: 'barcodeCaptured',
|
|
22587
|
+
payload: {
|
|
22588
|
+
imageUrl: recaptureBarcode.canvas.toDataURL('image/jpeg', 0.95),
|
|
22589
|
+
barcodeReadabilityScore: recaptureBarcode.score
|
|
22590
|
+
}
|
|
22591
|
+
});
|
|
22592
|
+
} else {
|
|
22593
|
+
log("[IdCaptureWizard] Barcode recapture move-closer window timed out. No better barcode found. Best score during window: ".concat((_b = recaptureScore === null || recaptureScore === void 0 ? void 0 : recaptureScore.toFixed(3)) !== null && _b !== void 0 ? _b : 'none', ", initial score: ").concat(state.initialBarcodeScore.toFixed(3)));
|
|
22594
|
+
}
|
|
22595
|
+
// Record recapture attempt data for diagnostics - always store the best score
|
|
22596
|
+
// from the move-closer window so debug info shows what was actually captured
|
|
22597
|
+
dispatchIdCaptureAction({
|
|
22598
|
+
type: 'barcodeRecaptureScoreUpdated',
|
|
22599
|
+
payload: {
|
|
22600
|
+
recaptureBarcodeScore: recaptureScore
|
|
22601
|
+
}
|
|
22602
|
+
});
|
|
22603
|
+
// Persist the barcode image from move-closer window for debug visual comparison
|
|
22604
|
+
if (recaptureBarcode) {
|
|
22605
|
+
dispatchIdCaptureAction({
|
|
22606
|
+
type: 'recaptureBarcodeImageCaptured',
|
|
22607
|
+
payload: {
|
|
22608
|
+
recaptureBarcodeImage: recaptureBarcode.canvas.toDataURL('image/jpeg', 0.95)
|
|
22609
|
+
}
|
|
22610
|
+
});
|
|
22611
|
+
}
|
|
22612
|
+
dispatchIdCaptureAction({
|
|
22613
|
+
type: 'barcodeRecaptureCompleted'
|
|
22614
|
+
});
|
|
22615
|
+
}, barcodeRecaptureMoveCloserTimeoutMs);
|
|
22616
|
+
return function () {
|
|
22617
|
+
return clearTimeout(t);
|
|
22618
|
+
};
|
|
22619
|
+
}, [barcodeRecaptureMoveCloserTimeoutMs, getRecaptureBestBarcode, start, state.captureState, state.initialBarcodeScore]);
|
|
22620
|
+
React.useEffect(function () {
|
|
22621
|
+
if (state.captureState !== 'requestingBetterBarcode') return;
|
|
22622
|
+
if (!barcodeRecaptureGrowthSatisfied) return;
|
|
22623
|
+
var t = setTimeout(function () {
|
|
22624
|
+
var _a, _b;
|
|
22625
|
+
// Capture window expired - complete with whatever barcode we have
|
|
22626
|
+
var recaptureBarcode = getRecaptureBestBarcode();
|
|
22627
|
+
var bestBarcode = getBestBarcode();
|
|
22628
|
+
var recaptureScore = (_a = recaptureBarcode === null || recaptureBarcode === void 0 ? void 0 : recaptureBarcode.score) !== null && _a !== void 0 ? _a : null;
|
|
22629
|
+
var improved = !!bestBarcode && bestBarcode.score > state.initialBarcodeScore;
|
|
22630
|
+
log("[IdCaptureWizard] Recapture timeout debug: recaptureBarcode=".concat(!!recaptureBarcode, ", recaptureScore=").concat(recaptureScore, ", bestBarcode=").concat(!!bestBarcode, ", bestBarcodeScore=").concat(bestBarcode === null || bestBarcode === void 0 ? void 0 : bestBarcode.score, ", initialScore=").concat(state.initialBarcodeScore, ", improved=").concat(improved));
|
|
22631
|
+
// Store the recapture score for diagnostic purposes
|
|
22632
|
+
// Always use actual recapture score (even if worse than initial) so debug info
|
|
22633
|
+
// shows what was actually captured during each sequence
|
|
22634
|
+
dispatchIdCaptureAction({
|
|
22635
|
+
type: 'barcodeRecaptureScoreUpdated',
|
|
22636
|
+
payload: {
|
|
22637
|
+
recaptureBarcodeScore: recaptureScore
|
|
22638
|
+
}
|
|
22639
|
+
});
|
|
22640
|
+
// Store the recapture barcode image if we found one
|
|
22641
|
+
if (recaptureBarcode) {
|
|
22642
|
+
dispatchIdCaptureAction({
|
|
22643
|
+
type: 'recaptureBarcodeImageCaptured',
|
|
22644
|
+
payload: {
|
|
22645
|
+
recaptureBarcodeImage: recaptureBarcode.canvas.toDataURL('image/jpeg', 0.95)
|
|
22646
|
+
}
|
|
22647
|
+
});
|
|
22648
|
+
} else if (improved) {
|
|
22649
|
+
// If we improved but don't have a recapture-specific best tracked,
|
|
22650
|
+
// still persist the "after" image so debug visual comparison works.
|
|
22651
|
+
dispatchIdCaptureAction({
|
|
22652
|
+
type: 'recaptureBarcodeImageCaptured',
|
|
22653
|
+
payload: {
|
|
22654
|
+
recaptureBarcodeImage: bestBarcode.canvas.toDataURL('image/jpeg', 0.95)
|
|
22655
|
+
}
|
|
22656
|
+
});
|
|
22657
|
+
}
|
|
22658
|
+
if (improved) {
|
|
22659
|
+
log("[IdCaptureWizard] Barcode recapture completed. Found better barcode: ".concat(bestBarcode.score.toFixed(3), " (was ").concat(state.initialBarcodeScore.toFixed(3), ")"));
|
|
22660
|
+
dispatchIdCaptureAction({
|
|
22661
|
+
type: 'barcodeCaptured',
|
|
22662
|
+
payload: {
|
|
22663
|
+
imageUrl: bestBarcode.canvas.toDataURL('image/jpeg', 0.95),
|
|
22664
|
+
barcodeReadabilityScore: bestBarcode.score
|
|
22665
|
+
}
|
|
22666
|
+
});
|
|
22667
|
+
} else {
|
|
22668
|
+
log("[IdCaptureWizard] Barcode recapture completed. No better barcode found. Best recapture score: ".concat((_b = recaptureScore === null || recaptureScore === void 0 ? void 0 : recaptureScore.toFixed(3)) !== null && _b !== void 0 ? _b : 'none', ", initial score: ").concat(state.initialBarcodeScore.toFixed(3)));
|
|
22669
|
+
}
|
|
22670
|
+
dispatchIdCaptureAction({
|
|
22671
|
+
type: 'barcodeRecaptureCompleted'
|
|
22672
|
+
});
|
|
22673
|
+
}, barcodeRecaptureTimeoutMs);
|
|
22674
|
+
return function () {
|
|
22675
|
+
return clearTimeout(t);
|
|
22676
|
+
};
|
|
22677
|
+
}, [barcodeRecaptureGrowthSatisfied, barcodeRecaptureTimeoutMs, getBestBarcode, getRecaptureBestBarcode, state.captureState, state.initialBarcodeScore]);
|
|
22678
|
+
// Continue detection during barcode recapture and update barcode if better one found
|
|
22679
|
+
React.useEffect(function () {
|
|
22680
|
+
if (state.captureState !== 'requestingBetterBarcode') return;
|
|
22681
|
+
// Set required document type to idCardBack for barcode detection
|
|
22682
|
+
setRequiredDocumentType('idCardBack');
|
|
22683
|
+
return function () {
|
|
22684
|
+
setRequiredDocumentType('none');
|
|
22685
|
+
};
|
|
22686
|
+
}, [setRequiredDocumentType, state.captureState]);
|
|
20637
22687
|
React.useEffect(function () {
|
|
20638
22688
|
if (state.requestedDocumentType === 'idCardFront') {
|
|
20639
22689
|
if (captureRequirement === 'idCardOrPassport') {
|
|
@@ -20672,9 +22722,9 @@
|
|
|
20672
22722
|
});
|
|
20673
22723
|
});
|
|
20674
22724
|
}, []);
|
|
20675
|
-
var
|
|
20676
|
-
progressStarted =
|
|
20677
|
-
setProgressStarted =
|
|
22725
|
+
var _23 = React.useState(false),
|
|
22726
|
+
progressStarted = _23[0],
|
|
22727
|
+
setProgressStarted = _23[1];
|
|
20678
22728
|
React.useEffect(function () {
|
|
20679
22729
|
if (state.captureState === 'capturing') {
|
|
20680
22730
|
setProgressStarted(false);
|
|
@@ -20685,6 +22735,65 @@
|
|
|
20685
22735
|
setProgressStarted(true);
|
|
20686
22736
|
}
|
|
20687
22737
|
}, [state.goodFramesCount]);
|
|
22738
|
+
// Configure client barcode scan state
|
|
22739
|
+
React.useEffect(function () {
|
|
22740
|
+
dispatchIdCaptureAction({
|
|
22741
|
+
type: 'configureClientBarcodeScan',
|
|
22742
|
+
payload: {
|
|
22743
|
+
enabled: enableClientBarcodeScan
|
|
22744
|
+
}
|
|
22745
|
+
});
|
|
22746
|
+
}, [enableClientBarcodeScan]);
|
|
22747
|
+
// Client barcode scanning integration
|
|
22748
|
+
var dynamsoftContext = useDynamsoftBarcodeContext();
|
|
22749
|
+
var _24 = dynamsoftContext !== null && dynamsoftContext !== void 0 ? dynamsoftContext : {
|
|
22750
|
+
loadState: 'not-started',
|
|
22751
|
+
lastDecodeResult: null,
|
|
22752
|
+
isScanning: false,
|
|
22753
|
+
startScanning: function startScanning() {},
|
|
22754
|
+
stopScanning: function stopScanning() {}
|
|
22755
|
+
},
|
|
22756
|
+
dynamsoftLoadState = _24.loadState,
|
|
22757
|
+
lastDecodeResult = _24.lastDecodeResult,
|
|
22758
|
+
isDynamsoftScanning = _24.isScanning,
|
|
22759
|
+
startScanning = _24.startScanning,
|
|
22760
|
+
stopScanning = _24.stopScanning;
|
|
22761
|
+
// Start/stop client barcode scanning when capturing ID back or during barcode recapture
|
|
22762
|
+
React.useEffect(function () {
|
|
22763
|
+
if (!enableClientBarcodeScan) return;
|
|
22764
|
+
if (dynamsoftLoadState !== 'ready') return;
|
|
22765
|
+
// Scan during initial ID back capture
|
|
22766
|
+
var isCapturingIdBack = overlayDismissed && state.captureState === 'capturing' && state.requestedDocumentType === 'idCardBack';
|
|
22767
|
+
// Also scan during barcode recapture flow (when asking user to move closer)
|
|
22768
|
+
var isInBarcodeRecapture = state.captureState === 'requestingBetterBarcode';
|
|
22769
|
+
var shouldScan = (isCapturingIdBack || isInBarcodeRecapture) && !lastDecodeResult;
|
|
22770
|
+
if (shouldScan && !isDynamsoftScanning) {
|
|
22771
|
+
log('[IdCaptureWizard] Starting client barcode scanning');
|
|
22772
|
+
dispatchIdCaptureAction({
|
|
22773
|
+
type: 'clientBarcodeScanStarted'
|
|
22774
|
+
});
|
|
22775
|
+
startScanning();
|
|
22776
|
+
} else if (!shouldScan && isDynamsoftScanning) {
|
|
22777
|
+
log('[IdCaptureWizard] Stopping client barcode scanning');
|
|
22778
|
+
stopScanning();
|
|
22779
|
+
dispatchIdCaptureAction({
|
|
22780
|
+
type: 'clientBarcodeScanStopped'
|
|
22781
|
+
});
|
|
22782
|
+
}
|
|
22783
|
+
}, [enableClientBarcodeScan, dynamsoftLoadState, overlayDismissed, state.captureState, state.requestedDocumentType, lastDecodeResult, isDynamsoftScanning, startScanning, stopScanning]);
|
|
22784
|
+
// Handle client barcode decode result
|
|
22785
|
+
React.useEffect(function () {
|
|
22786
|
+
if (!lastDecodeResult) return;
|
|
22787
|
+
log("[IdCaptureWizard] Client barcode decoded: ".concat(lastDecodeResult.format, " - ").concat(lastDecodeResult.text.substring(0, 50), "..."));
|
|
22788
|
+
dispatchIdCaptureAction({
|
|
22789
|
+
type: 'clientBarcodeDecoded',
|
|
22790
|
+
payload: lastDecodeResult
|
|
22791
|
+
});
|
|
22792
|
+
// Note: We no longer exit recapture immediately when Dynamsoft decodes.
|
|
22793
|
+
// This allows the barcode recapture flow to continue and capture a good
|
|
22794
|
+
// barcode image for comparison with native decoder results.
|
|
22795
|
+
onClientBarcodeDecoded === null || onClientBarcodeDecoded === void 0 ? void 0 : onClientBarcodeDecoded(lastDecodeResult);
|
|
22796
|
+
}, [lastDecodeResult, onClientBarcodeDecoded]);
|
|
20688
22797
|
if (isFallbackMode) {
|
|
20689
22798
|
return /*#__PURE__*/React.createElement(IdCaptureFallback, {
|
|
20690
22799
|
idCaptureRequirement: captureRequirement,
|
|
@@ -20702,9 +22811,9 @@
|
|
|
20702
22811
|
verbiage: verbiage.uploadOrCaptureScreen
|
|
20703
22812
|
});
|
|
20704
22813
|
}
|
|
20705
|
-
var requestedAction = state.captureState === 'requestingFlip' ? 'FLIP_ID' : state.requestedDocumentType === 'idCardBack' ? 'SHOW_ID_BACK' : state.requestedDocumentType === 'passport' ? 'SHOW_PASSPORT' : 'SHOW_ID_FRONT';
|
|
22814
|
+
var requestedAction = state.captureState === 'requestingFlip' ? 'FLIP_ID' : state.captureState === 'requestingBetterBarcode' ? 'SHOW_ID_BACK' : state.requestedDocumentType === 'idCardBack' ? 'SHOW_ID_BACK' : state.requestedDocumentType === 'passport' ? 'SHOW_PASSPORT' : 'SHOW_ID_FRONT';
|
|
20706
22815
|
var guidesStatus = !overlayDismissed ? 'disabled' : state.isGoodFrame ? 'capturing' : 'ready';
|
|
20707
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ScalingCameraFeed, null), overlayDismissed && state.captureState === 'capturing' && (/*#__PURE__*/React.createElement(IdCapture, {
|
|
22816
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ScalingCameraFeed, null), overlayDismissed && (state.captureState === 'capturing' || state.captureState === 'requestingBetterBarcode') && (/*#__PURE__*/React.createElement(IdCapture, {
|
|
20708
22817
|
requiredDocumentType: state.requestedDocumentType,
|
|
20709
22818
|
thresholds: thresholds,
|
|
20710
22819
|
onCapture: onCapture,
|
|
@@ -20712,27 +22821,35 @@
|
|
|
20712
22821
|
colors: colors,
|
|
20713
22822
|
verbiage: idCaptureVerbiage,
|
|
20714
22823
|
debugMode: debugMode
|
|
20715
|
-
})), /*#__PURE__*/React.createElement(
|
|
22824
|
+
})), overlayDismissed && state.captureState === 'requestingBetterBarcode' && (/*#__PURE__*/React.createElement(GuidanceMessageContainer, {
|
|
22825
|
+
"$top": "",
|
|
22826
|
+
"$bottom": "12.5%",
|
|
22827
|
+
className: (_f = classNames.capture) === null || _f === void 0 ? void 0 : _f.guidanceMessageContainer
|
|
22828
|
+
}, /*#__PURE__*/React.createElement(GuidanceMessage, {
|
|
22829
|
+
"$variant": "default",
|
|
22830
|
+
className: (_g = classNames.capture) === null || _g === void 0 ? void 0 : _g.guidanceMessage
|
|
22831
|
+
}, barcodeRecaptureGuidanceMessage))), /*#__PURE__*/React.createElement(IdCaptureGuides, {
|
|
20716
22832
|
key: "guides".concat(attempt),
|
|
20717
22833
|
guideType: guideType,
|
|
20718
22834
|
status: guidesStatus,
|
|
20719
|
-
progress: progressStarted &&
|
|
22835
|
+
progress: progressStarted && isCapturing ? 1 : 0,
|
|
20720
22836
|
portraitGuidesOnMobile: portraitGuidesOnMobile,
|
|
20721
22837
|
requestedAction: requestedAction,
|
|
20722
22838
|
images: guideImages,
|
|
20723
22839
|
classNames: classNames.guides,
|
|
20724
22840
|
colors: colors,
|
|
20725
22841
|
verbiage: idCaptureVerbiage,
|
|
20726
|
-
isBackToFront: state.allowIdCardBackToFrontCapture && 'idCardBack' in state.capturedDocuments
|
|
20727
|
-
|
|
20728
|
-
|
|
20729
|
-
|
|
22842
|
+
isBackToFront: state.allowIdCardBackToFrontCapture && 'idCardBack' in state.capturedDocuments,
|
|
22843
|
+
isRequestingBetterBarcode: state.captureState === 'requestingBetterBarcode'
|
|
22844
|
+
}), debugMode && !((_j = (_h = theme.idCapture) === null || _h === void 0 ? void 0 : _h.capturePreview) === null || _j === void 0 ? void 0 : _j.disabled) && state.captureState === 'requestingFlip' && !separateIdCardCaptureSequence && state.imageUrl && (/*#__PURE__*/React.createElement(IdCaptureImagePreview, {
|
|
22845
|
+
classNames: (_k = classNames.capture) === null || _k === void 0 ? void 0 : _k.imagePreview,
|
|
22846
|
+
text: (_l = idCaptureVerbiages === null || idCaptureVerbiages === void 0 ? void 0 : idCaptureVerbiages.idCardFront) === null || _l === void 0 ? void 0 : _l.processingIdCardText,
|
|
20730
22847
|
imageUrl: state.imageUrl
|
|
20731
22848
|
})), state.captureState !== 'complete' && (/*#__PURE__*/React.createElement("div", {
|
|
20732
22849
|
id: "idmission-above-guides-content"
|
|
20733
22850
|
})), (!customOverlayContent || !!customOverlayContent && overlayDismissed) && (/*#__PURE__*/React.createElement(ExitCaptureButton, {
|
|
20734
22851
|
onClick: onExit,
|
|
20735
|
-
className: (
|
|
22852
|
+
className: (_m = classNames.capture) === null || _m === void 0 ? void 0 : _m.exitCaptureBtn
|
|
20736
22853
|
})), !overlayDismissed && (/*#__PURE__*/React.createElement(IdCaptureLoadingOverlay, {
|
|
20737
22854
|
key: "loading".concat(attempt),
|
|
20738
22855
|
mode: loadingOverlayMode,
|
|
@@ -20770,9 +22887,21 @@
|
|
|
20770
22887
|
onRetryClick: onRetryClick,
|
|
20771
22888
|
colors: colors.success,
|
|
20772
22889
|
verbiage: verbiage.success,
|
|
20773
|
-
debugMode: debugMode
|
|
22890
|
+
debugMode: debugMode,
|
|
22891
|
+
initialBarcodeScore:
|
|
22892
|
+
// Show diagnostic info if recapture occurred (indicated by recaptureBarcodeScore being set)
|
|
22893
|
+
// If recapture occurred, initialBarcodeScore was set (even if it's 0, which is valid)
|
|
22894
|
+
state.recaptureBarcodeScore !== null ? state.initialBarcodeScore : undefined,
|
|
22895
|
+
recaptureBarcodeScore: state.recaptureBarcodeScore,
|
|
22896
|
+
initialCaptureBarcodeImage: state.initialCaptureBarcodeImage,
|
|
22897
|
+
recaptureBarcodeImage: state.recaptureBarcodeImage,
|
|
22898
|
+
clientBarcodeDecodeResult: state.clientBarcodeDecodeResult,
|
|
22899
|
+
nativeBarcodeDecodeResult: state.nativeBarcodeDecodeResult
|
|
20774
22900
|
})));
|
|
20775
22901
|
};
|
|
22902
|
+
function IdCaptureWizardInner(props) {
|
|
22903
|
+
return /*#__PURE__*/React.createElement(IdCaptureStateProvider, null, /*#__PURE__*/React.createElement(GuideOrientationContextProvider, null, /*#__PURE__*/React.createElement(IdCaptureWizard, _assign({}, props))));
|
|
22904
|
+
}
|
|
20776
22905
|
function IdCaptureWizardWithProviders(_a) {
|
|
20777
22906
|
var _b, _c, _d, _e, _f, _g;
|
|
20778
22907
|
var onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
@@ -20780,6 +22909,20 @@
|
|
|
20780
22909
|
onMicrophoneAccessDenied = _a.onMicrophoneAccessDenied,
|
|
20781
22910
|
shouldLoadIdCaptureModels = _a.shouldLoadIdCaptureModels,
|
|
20782
22911
|
idCaptureProps = __rest(_a, ["onCameraAccessDenied", "onCameraTamperingDetected", "onMicrophoneAccessDenied", "shouldLoadIdCaptureModels"]);
|
|
22912
|
+
var enableClientBarcodeScan = idCaptureProps.enableClientBarcodeScan,
|
|
22913
|
+
dynamsoftOrganizationId = idCaptureProps.dynamsoftOrganizationId,
|
|
22914
|
+
dynamsoftLicenseKey = idCaptureProps.dynamsoftLicenseKey,
|
|
22915
|
+
promptForDynamsoftLicense = idCaptureProps.promptForDynamsoftLicense,
|
|
22916
|
+
onClientBarcodeDecoded = idCaptureProps.onClientBarcodeDecoded;
|
|
22917
|
+
// Enable Dynamsoft provider if we have credentials OR if prompt mode is enabled
|
|
22918
|
+
var shouldUseDynamsoftProvider = enableClientBarcodeScan && (dynamsoftOrganizationId || dynamsoftLicenseKey || promptForDynamsoftLicense);
|
|
22919
|
+
var innerContent = shouldUseDynamsoftProvider ? (/*#__PURE__*/React.createElement(DynamsoftBarcodeProvider, {
|
|
22920
|
+
organizationId: dynamsoftOrganizationId,
|
|
22921
|
+
licenseKey: dynamsoftLicenseKey,
|
|
22922
|
+
promptForLicense: promptForDynamsoftLicense,
|
|
22923
|
+
enabled: enableClientBarcodeScan,
|
|
22924
|
+
onBarcodeDecoded: onClientBarcodeDecoded
|
|
22925
|
+
}, /*#__PURE__*/React.createElement(IdCaptureWizardInner, _assign({}, idCaptureProps)))) : (/*#__PURE__*/React.createElement(IdCaptureWizardInner, _assign({}, idCaptureProps)));
|
|
20783
22926
|
return /*#__PURE__*/React.createElement(CameraStoreProvider, {
|
|
20784
22927
|
onCameraAccessDenied: onCameraAccessDenied,
|
|
20785
22928
|
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
@@ -20795,7 +22938,7 @@
|
|
|
20795
22938
|
onModelError: idCaptureProps.onModelError,
|
|
20796
22939
|
modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs,
|
|
20797
22940
|
allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
|
|
20798
|
-
},
|
|
22941
|
+
}, innerContent));
|
|
20799
22942
|
}
|
|
20800
22943
|
|
|
20801
22944
|
function SelfieCaptureLoadingGraphic(_a) {
|
|
@@ -28101,7 +30244,14 @@
|
|
|
28101
30244
|
geolocationRequired = _6 === void 0 ? false : _6,
|
|
28102
30245
|
_7 = _a.debugMode,
|
|
28103
30246
|
debugMode = _7 === void 0 ? false : _7,
|
|
28104
|
-
documentEdgeDistancePct = _a.documentEdgeDistancePct
|
|
30247
|
+
documentEdgeDistancePct = _a.documentEdgeDistancePct,
|
|
30248
|
+
_8 = _a.enableClientBarcodeScan,
|
|
30249
|
+
enableClientBarcodeScan = _8 === void 0 ? false : _8,
|
|
30250
|
+
dynamsoftOrganizationId = _a.dynamsoftOrganizationId,
|
|
30251
|
+
dynamsoftLicenseKey = _a.dynamsoftLicenseKey,
|
|
30252
|
+
_9 = _a.promptForDynamsoftLicense,
|
|
30253
|
+
promptForDynamsoftLicense = _9 === void 0 ? false : _9,
|
|
30254
|
+
onClientBarcodeDecoded = _a.onClientBarcodeDecoded;
|
|
28105
30255
|
useLanguage(lang);
|
|
28106
30256
|
useDebugLogging(debugMode);
|
|
28107
30257
|
var idCaptureProps = React.useMemo(function () {
|
|
@@ -28142,9 +30292,14 @@
|
|
|
28142
30292
|
classNames: classNames,
|
|
28143
30293
|
colors: colors,
|
|
28144
30294
|
verbiage: verbiage,
|
|
28145
|
-
debugMode: debugMode
|
|
30295
|
+
debugMode: debugMode,
|
|
30296
|
+
enableClientBarcodeScan: enableClientBarcodeScan,
|
|
30297
|
+
dynamsoftOrganizationId: dynamsoftOrganizationId,
|
|
30298
|
+
dynamsoftLicenseKey: dynamsoftLicenseKey,
|
|
30299
|
+
promptForDynamsoftLicense: promptForDynamsoftLicense,
|
|
30300
|
+
onClientBarcodeDecoded: onClientBarcodeDecoded
|
|
28146
30301
|
};
|
|
28147
|
-
}, [onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onExitCapture, onUserCancel, onModelError, onDocumentCaptured, onDocumentDetected, documentDetectionThrottleMs, precapturedDocuments, idCaptureRequirement, allowSinglePageIdCapture, separateIdCardCaptureSequence, idCaptureThresholds, skipSuccessScreen, loadingOverlayMode, customOverlayContent, onLoadingOverlayDismissed, forceFallbackMode, silentFallback, allowIdCardBackToFrontCapture, allowUploadingDocumentsFromStorage, instructions, guideType, guideImages, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, modelLoadTimeoutMs, enableOverrideWrongDocumentTypeDialog, allowOverrideWrongDocumentTypeAfterMs, assets, classNames, colors, verbiage, debugMode, documentEdgeDistancePct]);
|
|
30302
|
+
}, [onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onExitCapture, onUserCancel, onModelError, onDocumentCaptured, onDocumentDetected, documentDetectionThrottleMs, precapturedDocuments, idCaptureRequirement, allowSinglePageIdCapture, separateIdCardCaptureSequence, idCaptureThresholds, skipSuccessScreen, loadingOverlayMode, customOverlayContent, onLoadingOverlayDismissed, forceFallbackMode, silentFallback, allowIdCardBackToFrontCapture, allowUploadingDocumentsFromStorage, instructions, guideType, guideImages, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, modelLoadTimeoutMs, enableOverrideWrongDocumentTypeDialog, allowOverrideWrongDocumentTypeAfterMs, assets, classNames, colors, verbiage, debugMode, documentEdgeDistancePct, enableClientBarcodeScan, dynamsoftOrganizationId, dynamsoftLicenseKey, promptForDynamsoftLicense, onClientBarcodeDecoded]);
|
|
28148
30303
|
var additionalDocumentCaptureProps = React.useMemo(function () {
|
|
28149
30304
|
return {
|
|
28150
30305
|
documents: captureAdditionalDocuments,
|