datakeen-session-react 1.1.140-dev.97 → 1.1.140-oid4vp-demo.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +37 -0
- package/dist/cjs/components/document-collection/DocumentCollection.js +132 -22
- package/dist/cjs/components/document-collection/DocumentCollection.js.map +1 -1
- package/dist/cjs/components/session/DocumentCheck.js +112 -15
- package/dist/cjs/components/session/DocumentCheck.js.map +1 -1
- package/dist/cjs/components/template/TemplateNodeRenderer.js +5 -1
- package/dist/cjs/components/template/TemplateNodeRenderer.js.map +1 -1
- package/dist/cjs/components/wallet/AgeControl.js +75 -0
- package/dist/cjs/components/wallet/AgeControl.js.map +1 -0
- package/dist/cjs/components/wallet/WalletProposal.js +27 -0
- package/dist/cjs/components/wallet/WalletProposal.js.map +1 -0
- package/dist/cjs/components/wallet/WalletSuccessAnimation.js +37 -0
- package/dist/cjs/components/wallet/WalletSuccessAnimation.js.map +1 -0
- package/dist/cjs/components/wallet/WalletVerificationStep.js +132 -0
- package/dist/cjs/components/wallet/WalletVerificationStep.js.map +1 -0
- package/dist/cjs/hooks/useWalletSseStatus.js +67 -0
- package/dist/cjs/hooks/useWalletSseStatus.js.map +1 -0
- package/dist/cjs/i18n/en.json.js +34 -1
- package/dist/cjs/i18n/en.json.js.map +1 -1
- package/dist/cjs/i18n/fr.json.js +34 -1
- package/dist/cjs/i18n/fr.json.js.map +1 -1
- package/dist/cjs/services/sessionService.js +57 -0
- package/dist/cjs/services/sessionService.js.map +1 -1
- package/dist/cjs/types/session.js.map +1 -1
- package/dist/esm/components/document-collection/DocumentCollection.js +132 -22
- package/dist/esm/components/document-collection/DocumentCollection.js.map +1 -1
- package/dist/esm/components/session/DocumentCheck.js +113 -16
- package/dist/esm/components/session/DocumentCheck.js.map +1 -1
- package/dist/esm/components/template/TemplateNodeRenderer.js +5 -1
- package/dist/esm/components/template/TemplateNodeRenderer.js.map +1 -1
- package/dist/esm/components/wallet/AgeControl.js +71 -0
- package/dist/esm/components/wallet/AgeControl.js.map +1 -0
- package/dist/esm/components/wallet/WalletProposal.js +23 -0
- package/dist/esm/components/wallet/WalletProposal.js.map +1 -0
- package/dist/esm/components/wallet/WalletSuccessAnimation.js +33 -0
- package/dist/esm/components/wallet/WalletSuccessAnimation.js.map +1 -0
- package/dist/esm/components/wallet/WalletVerificationStep.js +128 -0
- package/dist/esm/components/wallet/WalletVerificationStep.js.map +1 -0
- package/dist/esm/hooks/useWalletSseStatus.js +65 -0
- package/dist/esm/hooks/useWalletSseStatus.js.map +1 -0
- package/dist/esm/i18n/en.json.js +33 -2
- package/dist/esm/i18n/en.json.js.map +1 -1
- package/dist/esm/i18n/fr.json.js +33 -2
- package/dist/esm/i18n/fr.json.js.map +1 -1
- package/dist/esm/services/sessionService.js +55 -1
- package/dist/esm/services/sessionService.js.map +1 -1
- package/dist/esm/types/session.js.map +1 -1
- package/package.json +1 -1
|
@@ -34,6 +34,8 @@ var sessionService = require('../../services/sessionService.js');
|
|
|
34
34
|
var NfcScanNode = require('../nfc-scan/NfcScanNode.js');
|
|
35
35
|
var NfcChipGate = require('../nfc-scan/NfcChipGate.js');
|
|
36
36
|
var NfcFallbackSurvey = require('../nfc-scan/NfcFallbackSurvey.js');
|
|
37
|
+
var WalletProposal = require('../wallet/WalletProposal.js');
|
|
38
|
+
var WalletVerificationStep = require('../wallet/WalletVerificationStep.js');
|
|
37
39
|
var europeanCountries = require('../../utils/europeanCountries.js');
|
|
38
40
|
|
|
39
41
|
var NFC_ELIGIBLE_DOCUMENT_TYPES = new Set([
|
|
@@ -49,6 +51,9 @@ var NFC_ELIGIBLE_DOCUMENT_TYPES = new Set([
|
|
|
49
51
|
var normalizeNfcMode = function (mode) {
|
|
50
52
|
return mode === "nfcAndApi" || mode === "nfcOrPhoto" ? "nfcOrPhoto" : "nfcOnly";
|
|
51
53
|
};
|
|
54
|
+
var normalizeWalletMode = function (mode) {
|
|
55
|
+
return mode === "walletOnly" ? "walletOnly" : "walletOrPhoto";
|
|
56
|
+
};
|
|
52
57
|
/**
|
|
53
58
|
* DocumentCheck component manages the multi-step document verification flow for a session.
|
|
54
59
|
* It handles country and document type selection, document upload or photo capture, processing, and error/success handling.
|
|
@@ -131,10 +136,13 @@ var DocumentCheck = function (_a) {
|
|
|
131
136
|
// Quand l'utilisateur déclare ne pas avoir de puce (questionnaire de fallback),
|
|
132
137
|
// on ne doit plus le réorienter vers le scan NFC (ni avant, ni après l'analyse API).
|
|
133
138
|
var _z = React.useState(false), nfcSkipped = _z[0], setNfcSkipped = _z[1];
|
|
139
|
+
// Idem pour le wallet : une fois décliné/échoué, on ne re-propose plus le wallet
|
|
140
|
+
// sur ce nœud (mais le NFC, s'il est également activé, reste tenté ensuite).
|
|
141
|
+
var _0 = React.useState(false), walletDeclined = _0[0], setWalletDeclined = _0[1];
|
|
134
142
|
// Initialize retry count from session data
|
|
135
|
-
var
|
|
143
|
+
var _1 = React.useState(function () {
|
|
136
144
|
return retryService.getNodeRetryCount(session, node.id);
|
|
137
|
-
}), retryCount =
|
|
145
|
+
}), retryCount = _1[0], setRetryCount = _1[1];
|
|
138
146
|
// Update retry count when session loads/changes
|
|
139
147
|
React.useEffect(function () {
|
|
140
148
|
if (session) {
|
|
@@ -189,10 +197,10 @@ var DocumentCheck = function (_a) {
|
|
|
189
197
|
setDocStep(6);
|
|
190
198
|
}
|
|
191
199
|
}, [retryCount, node.allowResubmission, node.maxResubmissionAttempts]);
|
|
192
|
-
var
|
|
193
|
-
var
|
|
194
|
-
var
|
|
195
|
-
var
|
|
200
|
+
var _2 = React.useState({}), capturedImages = _2[0], setCapturedImages = _2[1];
|
|
201
|
+
var _3 = React.useState("before-recto"), currentPhotoStep = _3[0], setCurrentPhotoStep = _3[1];
|
|
202
|
+
var _4 = React.useState("photo"), videoFlowPhase = _4[0], setVideoFlowPhase = _4[1];
|
|
203
|
+
var _5 = DocumentContext.useDocumentContext(), selectedDocumentType = _5.selectedDocumentType, setSelectedDocumentType = _5.setSelectedDocumentType;
|
|
196
204
|
var finalAcceptedCountries = React.useMemo(function () {
|
|
197
205
|
if (loadingTemplates)
|
|
198
206
|
return acceptedCountries;
|
|
@@ -380,10 +388,9 @@ var DocumentCheck = function (_a) {
|
|
|
380
388
|
handleProcessingComplete(success, undefined, analysisData);
|
|
381
389
|
};
|
|
382
390
|
var handleDocumentTypeSelect = function (documentId) { return tslib_es6.__awaiter(void 0, void 0, void 0, function () {
|
|
383
|
-
var documentLabel, documentTemplateID, selectedDoc, selectedCountryCode, selectedDocumentInput,
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
switch (_b.label) {
|
|
391
|
+
var documentLabel, documentTemplateID, selectedDoc, selectedCountryCode, selectedDocumentInput, wallets, error_2;
|
|
392
|
+
return tslib_es6.__generator(this, function (_a) {
|
|
393
|
+
switch (_a.label) {
|
|
387
394
|
case 0:
|
|
388
395
|
documentLabel = t("documentTypes.".concat(documentId), documentId);
|
|
389
396
|
auditTrailService.logDocumentTypeSelected(sessionId, documentId, documentLabel);
|
|
@@ -416,6 +423,37 @@ var DocumentCheck = function (_a) {
|
|
|
416
423
|
setCapturedImages({});
|
|
417
424
|
setCurrentPhotoStep("before-recto");
|
|
418
425
|
setVideoFlowPhase("photo");
|
|
426
|
+
if (!(node.walletEnabled === true && !walletDeclined)) return [3 /*break*/, 4];
|
|
427
|
+
_a.label = 1;
|
|
428
|
+
case 1:
|
|
429
|
+
_a.trys.push([1, 3, , 4]);
|
|
430
|
+
return [4 /*yield*/, sessionService.fetchWallets(selectedCountryCode, "pid")];
|
|
431
|
+
case 2:
|
|
432
|
+
wallets = _a.sent();
|
|
433
|
+
if (wallets.length > 0) {
|
|
434
|
+
setDocStep(-10);
|
|
435
|
+
return [2 /*return*/];
|
|
436
|
+
}
|
|
437
|
+
return [3 /*break*/, 4];
|
|
438
|
+
case 3:
|
|
439
|
+
error_2 = _a.sent();
|
|
440
|
+
console.error("Failed to check wallet availability:", error_2);
|
|
441
|
+
return [3 /*break*/, 4];
|
|
442
|
+
case 4: return [4 /*yield*/, proceedWithNfcOrPhoto(documentId, selectedDocumentInput)];
|
|
443
|
+
case 5:
|
|
444
|
+
_a.sent();
|
|
445
|
+
return [2 /*return*/];
|
|
446
|
+
}
|
|
447
|
+
});
|
|
448
|
+
}); };
|
|
449
|
+
// Logique NFC-ou-photo existante, factorisée pour être rejouable après un
|
|
450
|
+
// refus/échec du wallet (le wallet est tenté avant, cf. handleDocumentTypeSelect).
|
|
451
|
+
var proceedWithNfcOrPhoto = function (documentId, selectedDocumentInput) { return tslib_es6.__awaiter(void 0, void 0, void 0, function () {
|
|
452
|
+
var nfcMode, error_3;
|
|
453
|
+
var _a;
|
|
454
|
+
return tslib_es6.__generator(this, function (_b) {
|
|
455
|
+
switch (_b.label) {
|
|
456
|
+
case 0:
|
|
419
457
|
if (!(node.nfcEnabled === true &&
|
|
420
458
|
!nfcSkipped &&
|
|
421
459
|
NFC_ELIGIBLE_DOCUMENT_TYPES.has(documentId))) return [3 /*break*/, 5];
|
|
@@ -428,8 +466,8 @@ var DocumentCheck = function (_a) {
|
|
|
428
466
|
_b.sent();
|
|
429
467
|
return [3 /*break*/, 4];
|
|
430
468
|
case 3:
|
|
431
|
-
|
|
432
|
-
console.error("Failed to persist NFC document selection:",
|
|
469
|
+
error_3 = _b.sent();
|
|
470
|
+
console.error("Failed to persist NFC document selection:", error_3);
|
|
433
471
|
setNfcPreparationError(t("nfc_scan.preparation_failed", "Impossible de préparer le scan NFC. Veuillez réessayer."));
|
|
434
472
|
return [3 /*break*/, 4];
|
|
435
473
|
case 4:
|
|
@@ -441,6 +479,61 @@ var DocumentCheck = function (_a) {
|
|
|
441
479
|
}
|
|
442
480
|
});
|
|
443
481
|
}); };
|
|
482
|
+
// Le wallet a été décliné (WalletProposal) ou a échoué (WalletVerificationStep).
|
|
483
|
+
// walletOnly : pas d'alternative photo/NFC → on saute le nœud, comme le NFC en mode nfcOnly.
|
|
484
|
+
// walletOrPhoto : on rejoue la logique NFC-ou-photo normale.
|
|
485
|
+
var handleWalletDeclineOrFail = function () { return tslib_es6.__awaiter(void 0, void 0, void 0, function () {
|
|
486
|
+
var error_4, selectedDocumentInput;
|
|
487
|
+
return tslib_es6.__generator(this, function (_a) {
|
|
488
|
+
switch (_a.label) {
|
|
489
|
+
case 0:
|
|
490
|
+
setWalletDeclined(true);
|
|
491
|
+
_a.label = 1;
|
|
492
|
+
case 1:
|
|
493
|
+
_a.trys.push([1, 3, , 4]);
|
|
494
|
+
return [4 /*yield*/, sessionService.skipWalletWithReason(sessionId, {
|
|
495
|
+
nodeId: node.id,
|
|
496
|
+
reason: "wallet_declined_or_failed",
|
|
497
|
+
label: "Wallet non utilisé",
|
|
498
|
+
})];
|
|
499
|
+
case 2:
|
|
500
|
+
_a.sent();
|
|
501
|
+
return [3 /*break*/, 4];
|
|
502
|
+
case 3:
|
|
503
|
+
error_4 = _a.sent();
|
|
504
|
+
console.error("Failed to persist wallet skip reason:", error_4);
|
|
505
|
+
return [3 /*break*/, 4];
|
|
506
|
+
case 4:
|
|
507
|
+
if (normalizeWalletMode(node.walletMode) === "walletOnly") {
|
|
508
|
+
if (template) {
|
|
509
|
+
stepObject.goToNextStep(node.id, template);
|
|
510
|
+
}
|
|
511
|
+
else {
|
|
512
|
+
stepObject.setStep(stepObject.step + 1);
|
|
513
|
+
}
|
|
514
|
+
return [2 /*return*/];
|
|
515
|
+
}
|
|
516
|
+
selectedDocumentInput = {
|
|
517
|
+
countryCode: selectedCountry.toUpperCase(),
|
|
518
|
+
identityDocumentType: selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.id,
|
|
519
|
+
identityDocumentTemplateId: selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.documentTemplateId,
|
|
520
|
+
};
|
|
521
|
+
return [4 /*yield*/, proceedWithNfcOrPhoto((selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.id) || "", selectedDocumentInput)];
|
|
522
|
+
case 5:
|
|
523
|
+
_a.sent();
|
|
524
|
+
return [2 /*return*/];
|
|
525
|
+
}
|
|
526
|
+
});
|
|
527
|
+
}); };
|
|
528
|
+
// Vérification par wallet aboutie : l'identité est confirmée, on saute la capture photo.
|
|
529
|
+
var handleWalletVerificationCompleted = function () {
|
|
530
|
+
if (template) {
|
|
531
|
+
stepObject.goToNextStep(node.id, template);
|
|
532
|
+
}
|
|
533
|
+
else {
|
|
534
|
+
stepObject.setStep(stepObject.step + 1);
|
|
535
|
+
}
|
|
536
|
+
};
|
|
444
537
|
var handleDocumentUpload = function (files) {
|
|
445
538
|
auditTrailService.logDocumentLoaded(sessionId, "recto");
|
|
446
539
|
if (files.back) {
|
|
@@ -564,7 +657,7 @@ var DocumentCheck = function (_a) {
|
|
|
564
657
|
// - nfcOrPhoto → flux photo/API du même nœud (intro/pays → upload → analyse), sans scan NFC
|
|
565
658
|
// - nfcOnly → on saute le nœud (nœud suivant)
|
|
566
659
|
var handleNfcFallback = function (reason, label, comment) { return tslib_es6.__awaiter(void 0, void 0, void 0, function () {
|
|
567
|
-
var
|
|
660
|
+
var error_5, nfcMode, hasIntroduction;
|
|
568
661
|
var _a, _b;
|
|
569
662
|
return tslib_es6.__generator(this, function (_c) {
|
|
570
663
|
switch (_c.label) {
|
|
@@ -578,8 +671,8 @@ var DocumentCheck = function (_a) {
|
|
|
578
671
|
_c.sent();
|
|
579
672
|
return [3 /*break*/, 4];
|
|
580
673
|
case 3:
|
|
581
|
-
|
|
582
|
-
console.error("Failed to persist NFC fallback reason:",
|
|
674
|
+
error_5 = _c.sent();
|
|
675
|
+
console.error("Failed to persist NFC fallback reason:", error_5);
|
|
583
676
|
return [3 /*break*/, 4];
|
|
584
677
|
case 4:
|
|
585
678
|
nfcMode = normalizeNfcMode(node.nfcMode);
|
|
@@ -622,6 +715,10 @@ var DocumentCheck = function (_a) {
|
|
|
622
715
|
}
|
|
623
716
|
};
|
|
624
717
|
switch (docStep) {
|
|
718
|
+
case -10:
|
|
719
|
+
return (jsxRuntime.jsx(WalletProposal.default, { walletMode: normalizeWalletMode(node.walletMode), onUseWallet: function () { return setDocStep(-11); }, onDecline: handleWalletDeclineOrFail }));
|
|
720
|
+
case -11:
|
|
721
|
+
return (jsxRuntime.jsx(WalletVerificationStep.default, { sessionId: sessionId, nodeId: node.id, credentialType: "pid", walletMode: normalizeWalletMode(node.walletMode), onCompleted: handleWalletVerificationCompleted, onFailedOrDeclined: handleWalletDeclineOrFail }));
|
|
625
722
|
case -1: {
|
|
626
723
|
var hasIntroduction_1 = ((_f = node.introductionPage) === null || _f === void 0 ? void 0 : _f.title) !== undefined ||
|
|
627
724
|
((_g = node.introductionPage) === null || _g === void 0 ? void 0 : _g.description) !== undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentCheck.js","sources":["../../../../../src/components/session/DocumentCheck.tsx"],"sourcesContent":["import { useState, useEffect, useMemo, useRef } from \"react\";\nimport type {\n AcceptedCountry,\n stepObject,\n SessionTemplate,\n} from \"../../types/session\";\nimport JDIPreIntroduction from \"../jdi/JDIPreIntroduction\";\nimport JDICountrySelection from \"../jdi/JDICountrySelection\";\nimport JDIDocumentSelection from \"../jdi/JDIDocumentSelection\";\nimport JDIDocumentUpload from \"../jdi/JDIDocumentUpload\";\nimport JDIProcessing from \"../jdi/JDIProcessing\";\nimport JDISuccess from \"../jdi/JDISuccess\";\nimport JDIError from \"../jdi/JDIError\";\nimport BeforePhoto from \"../id-check/BeforePhoto\";\nimport BeforeVersoPhoto from \"../id-check/BeforeVersoPhoto\";\nimport Photo from \"../id-check/Photo\";\nimport PhotoConfirmation from \"../id-check/PhotoConfirmation\";\nimport DocumentVideoCapture from \"../document-video/DocumentVideoCapture\";\nimport { Camera, Upload } from \"lucide-react\";\nimport { useDocumentContext } from \"../../context/DocumentContext\";\nimport type { onUploadFiles } from \"../../types/uploadFiles\";\nimport type { Prediction } from \"../../utils/apiAnalysis\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport {\n logDocumentTypeSelected,\n logCaptureModeSelected,\n logPhotoCaptured,\n logPhotosValidated,\n logDocumentLoaded,\n logDocumentsValidated,\n} from \"../../services/auditTrailService\";\nimport ButtonDesktop from \"../ui/ButtonDesktop\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\nimport { ISO_COUNTRY_CODES } from \"../../utils/isoCountryCodes\";\nimport {\n DocumentTemplate,\n FetchedDocumentTemplates,\n getAllDocumentTemplates,\n getDocTypeKey,\n getDocumentTemplateId,\n} from \"../../services/documentTemplate\";\nimport { UserInput } from \"../../types/userInput\";\nimport {\n resizeAfterCapture,\n dataUrlToBlob,\n blobToDataUrl,\n} from \"../../utils/imageProcessing\";\nimport {\n getNodeRetryCount,\n incrementNodeRetryCount,\n} from \"../../services/retryService\";\nimport { getSession } from \"../../context/SessionContext\";\nimport {\n updateSessionUserInput,\n skipNfcWithReason,\n} from \"../../services/sessionService\";\nimport NfcScanStep from \"../nfc-scan/NfcScanNode\";\nimport NfcChipGate from \"../nfc-scan/NfcChipGate\";\nimport NfcFallbackSurvey from \"../nfc-scan/NfcFallbackSurvey\";\n\nexport interface CountryDocuments {\n code: string;\n documents: {\n passport: string[];\n idCard: string[];\n residencePermit: string[];\n driverLicense: string[];\n pinkDriverLicense: string[];\n };\n}\n\nexport interface NodeIdentityControl {\n id: string;\n acceptedCountries: CountryDocuments[];\n automaticPhotoCapture?: boolean;\n withVideo?: boolean;\n nfcEnabled?: boolean;\n // \"nfcAndApi\" reste accepté pour rétrocompat (parcours legacy), normalisé via normalizeNfcMode.\n nfcMode?: \"nfcOnly\" | \"nfcOrPhoto\" | \"nfcAndApi\";\n allowedAddingMethods?: string[];\n introductionPage?: {\n title: string;\n description: string;\n };\n countrySelection?: {\n title: string;\n description: string;\n };\n documentSelection?: {\n title: string;\n description: string;\n };\n allowResubmission: boolean;\n maxResubmissionAttempts?: number;\n}\n\ninterface DocumentCheckProps {\n stepObject: stepObject;\n sessionId: string;\n node: NodeIdentityControl;\n onContinueOnPC?: () => void;\n documentTypeId: string;\n acceptedCountries?: AcceptedCountry[];\n isMobileCapture?: boolean;\n allowedAddingMethods?: string[];\n template?: SessionTemplate;\n templateIndex?: number;\n setUserInput: React.Dispatch<React.SetStateAction<UserInput>>;\n}\n\nimport { EUROPEAN_COUNTRY_CODES } from \"../../utils/europeanCountries\";\n\nconst NFC_ELIGIBLE_DOCUMENT_TYPES = new Set([\n \"passport\",\n \"idCard\",\n \"residencePermit\",\n]);\n\n/**\n * Normalise le mode NFC vers les valeurs courantes.\n * Rétrocompat : les parcours enregistrés avant le renommage portent encore\n * `nfcAndApi`, qui doit être traité comme `nfcOrPhoto` (scan NFC avec alternative photo).\n */\nconst normalizeNfcMode = (mode?: string): \"nfcOnly\" | \"nfcOrPhoto\" =>\n mode === \"nfcAndApi\" || mode === \"nfcOrPhoto\" ? \"nfcOrPhoto\" : \"nfcOnly\";\n\n/**\n * DocumentCheck component manages the multi-step document verification flow for a session.\n * It handles country and document type selection, document upload or photo capture, processing, and error/success handling.\n * The component adapts its flow for mobile capture and supports custom session templates.\n *\n * @component\n * @param {Object} props - Component props.\n * @param {stepObject} props.stepObject - Object managing the current step in the parent flow, with setStep and step properties.\n * @param {string} props.sessionId - Unique identifier for the current session.\n * @param {() => void} [props.onContinueOnPC] - Optional callback to continue the process on a PC (used for mobile capture fallback).\n * @param {string} props.documentTypeId - The ID of the required document type for verification (e.g., \"jdi-2\" for ID card).\n * @param {AcceptedCountry[]} [props.acceptedCountries] - Optional list of countries accepted for the document type. If not provided, resolved from the session template.\n * @param {boolean} [props.isMobileCapture=false] - If true, enables mobile photo capture flow instead of file upload.\n * @param {SessionTemplate} [props.template] - Optional session template object, used to resolve accepted countries and flow configuration.\n * @param {number} [props.templateIndex] - Optional index of the current template node, used for navigation and retry logic.\n *\n * @returns {JSX.Element} Multi-step document verification UI, rendering different subcomponents based on the current step.\n *\n * @remarks\n * - Handles both desktop and mobile flows, including photo capture and file upload.\n * - Integrates with context for selected document type and manages internal state for step navigation, country selection, file uploads, and error handling.\n * - Displays error messages and fallback UI for misconfiguration or invalid navigation.\n * - Uses hooks for translation, retry navigation, and context management.\n */\nconst DocumentCheck = ({\n stepObject,\n sessionId,\n node,\n onContinueOnPC: _onContinueOnPC,\n documentTypeId,\n acceptedCountries,\n isMobileCapture = false,\n allowedAddingMethods,\n template,\n setUserInput,\n}: DocumentCheckProps): JSX.Element => {\n const { t } = useI18n();\n const { session } = getSession();\n\n const [documentTemplates, setDocumentTemplates] =\n useState<FetchedDocumentTemplates>();\n const [loadingTemplates, setLoadingTemplates] = useState(true);\n\n useEffect(() => {\n (async () => {\n setLoadingTemplates(true);\n const templates = await getAllDocumentTemplates();\n setDocumentTemplates(templates);\n setLoadingTemplates(false);\n })();\n }, []);\n\n const initialRetryCount = getNodeRetryCount(session, node.id);\n const [selectedMethod, setSelectedMethod] = useState<\n \"download\" | \"picture\" | null\n >(null);\n\n const isPictureAllowed = allowedAddingMethods?.includes(\"picture\") ?? true;\n const isDownloadAllowed = allowedAddingMethods?.includes(\"download\") ?? true;\n\n // Check if retry is allowed based on initial retry count\n const isInitialRetryAllowed = () => {\n // Special case: if allowResubmission is false and retryCount > 0, no retries allowed\n if (node.allowResubmission === false && initialRetryCount > 0) {\n return false;\n }\n\n if (node.allowResubmission === undefined) return true;\n if (!node.allowResubmission) return false;\n if (node.maxResubmissionAttempts !== undefined) {\n return initialRetryCount <= node.maxResubmissionAttempts;\n }\n return true;\n };\n\n // Initialize docStep - if retries exhausted, start at error page (step 6)\n const [docStep, setDocStep] = useState(() => {\n if (initialRetryCount > 0 && !isInitialRetryAllowed()) {\n return 6; // Error page\n }\n return 0; // Normal flow - start with introduction\n });\n const [selectedCountry, setSelectedCountry] = useState(\n acceptedCountries?.[0]?.code?.toUpperCase() || \"FR\",\n );\n const [fileUploaded, setFileUploaded] = useState<onUploadFiles | null>(null);\n const [analysisData, setAnalysisData] = useState<Prediction[] | null>(null);\n const [errorCode, setErrorCode] = useState<string | null>(null);\n const [nfcPreparationError, setNfcPreparationError] = useState<string | null>(null);\n // Quand l'utilisateur déclare ne pas avoir de puce (questionnaire de fallback),\n // on ne doit plus le réorienter vers le scan NFC (ni avant, ni après l'analyse API).\n const [nfcSkipped, setNfcSkipped] = useState(false);\n\n // Initialize retry count from session data\n const [retryCount, setRetryCount] = useState(() => {\n return getNodeRetryCount(session, node.id);\n });\n\n // Update retry count when session loads/changes\n useEffect(() => {\n if (session) {\n const sessionRetryCount = getNodeRetryCount(session, node.id);\n setRetryCount(sessionRetryCount);\n }\n }, [session, node.id]);\n\n // Restauration après refresh : si le NFC est en cours côté backend (l'utilisateur attendait sur\n // l'écran QR), revenir directement à cet écran (docStep 7) au lieu de repartir au début du nœud.\n // `docStep` est en mémoire et serait sinon perdu au rechargement.\n const hasRestoredNfcStep = useRef(false);\n useEffect(() => {\n if (hasRestoredNfcStep.current) return;\n if (node.nfcEnabled !== true) return;\n const status = session?.nfcStatus;\n if (status === \"pending\" || status === \"opened\") {\n hasRestoredNfcStep.current = true;\n setDocStep(7);\n }\n }, [session, node.nfcEnabled]);\n\n // Check retry limits on mount/reload - if retries exhausted, show error page immediately\n useEffect(() => {\n // Special case: if allowResubmission is false and retryCount > 0, show error immediately\n if (node.allowResubmission === false && retryCount > 0) {\n setDocStep(6);\n return;\n }\n\n // Normal case: check against maxResubmissionAttempts\n // Inline retry check to avoid dependency issues\n const checkRetryLimit = () => {\n // If allowResubmission is undefined (old journeys), allow unlimited retries\n if (node.allowResubmission === undefined) {\n return true;\n }\n // If allowResubmission is false, no retries allowed\n if (!node.allowResubmission) {\n return false;\n }\n // If allowResubmission is true, check against maxResubmissionAttempts\n if (node.maxResubmissionAttempts !== undefined) {\n return retryCount <= node.maxResubmissionAttempts;\n }\n // If maxResubmissionAttempts is not set, allow unlimited retries\n return true;\n };\n\n // Check immediately on mount if retries are exhausted\n // This redirects to error page before showing any JDI steps\n if (retryCount > 0 && !checkRetryLimit()) {\n // User has exhausted retries, redirect to error page immediately\n setDocStep(6);\n }\n }, [retryCount, node.allowResubmission, node.maxResubmissionAttempts]);\n\n const [capturedImages, setCapturedImages] = useState<Record<string, string>>(\n {},\n );\n const [currentPhotoStep, setCurrentPhotoStep] = useState(\n \"before-recto\" as\n | \"before-recto\"\n | \"recto\"\n | \"before-verso\"\n | \"verso\"\n | \"confirmation\",\n );\n const [videoFlowPhase, setVideoFlowPhase] = useState<\"photo\" | \"video\">(\n \"photo\",\n );\n\n const { selectedDocumentType, setSelectedDocumentType } =\n useDocumentContext();\n\n const finalAcceptedCountries = useMemo(() => {\n if (loadingTemplates) return acceptedCountries;\n const result: AcceptedCountry[] = [];\n const hasInternational = acceptedCountries?.some(c => c.code === \"INT\");\n const hasEurope = acceptedCountries?.some(c => c.code === \"EU\");\n\n if (!hasInternational && !hasEurope) return acceptedCountries;\n\n const internationalDoc = acceptedCountries?.find(c => c.code === \"INT\");\n const europeDoc = acceptedCountries?.find(c => c.code === \"EU\");\n\n for (const ISOCode of ISO_COUNTRY_CODES) {\n if (ISOCode === \"INT\" || ISOCode === \"EU\") continue;\n\n const countryDocInput = acceptedCountries?.find(c => c.code?.toUpperCase() === ISOCode);\n const isEuropean = EUROPEAN_COUNTRY_CODES.includes(ISOCode);\n\n // Determine which configuration to use for this country\n // 1. Specific country config\n // 2. EU group config (if European)\n // 3. INT group config\n let configToUse: AcceptedCountry | undefined = countryDocInput;\n\n if (!configToUse) {\n if (isEuropean && europeDoc) {\n configToUse = europeDoc;\n } else if (internationalDoc) {\n configToUse = internationalDoc;\n }\n }\n\n if (configToUse) {\n const documents: AcceptedCountry['documents'] = {\n passport: [],\n idCard: [],\n driverLicense: [],\n residencePermit: [],\n pinkDriverLicense: [],\n };\n for (const key of Object.keys(configToUse.documents)) {\n const docKey = key as keyof AcceptedCountry['documents'];\n if (!isDocumentTypeAvailable(ISOCode, docKey)) continue;\n documents[docKey] = configToUse.documents[docKey];\n }\n if (\n documents.passport.length ||\n documents.idCard.length ||\n documents.driverLicense.length ||\n documents.residencePermit.length ||\n documents.pinkDriverLicense.length\n ) {\n result.push({ code: ISOCode, documents: { ...documents } });\n }\n }\n }\n return result;\n }, [acceptedCountries, documentTemplates, loadingTemplates]);\n\n // Helper to check if a document type is available for a country\n function isDocumentTypeAvailable(\n countryCode: string,\n documentType: keyof AcceptedCountry[\"documents\"],\n ) {\n if (countryCode === 'INT' || countryCode === 'EU') return true;\n const docTypeKey = (getDocTypeKey(documentType) ?? \"\").toLowerCase();\n return documentTemplates?.data?.some(\n (tpl: DocumentTemplate) =>\n tpl.countryCode === countryCode &&\n (tpl.name?.toLowerCase() || \"\").includes(docTypeKey),\n );\n }\n\n useEffect(() => {\n if (!documentTypeId) console.error(\"DocumentCheck: Missing documentTypeId\");\n console.debug(\"[DocumentCheck] node content:\", node);\n\n // Don't reset docStep if we're already on error page (step 6) due to exhausted retries\n if (docStep === 6) {\n return;\n }\n\n // En NFC, on affiche d'abord l'écran de confirmation de la puce (gate -1)\n if (node.nfcEnabled === true) {\n setDocStep(-1);\n return;\n }\n\n if (\n node.introductionPage?.title === undefined &&\n node.introductionPage?.description === undefined\n ) {\n setDocStep(1);\n } else {\n setDocStep(0);\n }\n }, [documentTypeId, sessionId, isMobileCapture]);\n\n const handleCountrySelect = (countryId: string) => {\n console.debug(\n \"[DocumentCheck] handleCountrySelect - countryId:\",\n countryId,\n );\n setUserInput((prev) => ({ ...prev, countryCode: countryId.toUpperCase() }));\n setSelectedCountry(countryId.toUpperCase());\n setSelectedDocumentType(null);\n setFileUploaded(null);\n setAnalysisData(null);\n setErrorCode(null);\n setNfcPreparationError(null);\n // Reset retry count to 0 (will be synced to session)\n setRetryCount(0);\n setCapturedImages({});\n setCurrentPhotoStep(\"before-recto\");\n setVideoFlowPhase(\"photo\");\n setDocStep(2);\n };\n\n const handlePhotoCapture = async (\n imageData: string,\n side: \"recto\" | \"verso\",\n ) => {\n try {\n // Convert data URL to Blob for processing\n const imageBlob = dataUrlToBlob(imageData);\n\n // Resize and optimize the image (only on mobile)\n const processedBlob = await resizeAfterCapture(imageBlob);\n\n // Convert back to data URL for storage and display\n const processedDataUrl = await blobToDataUrl(processedBlob);\n\n console.debug(`[DocumentCheck] Photo processed for ${side}`, {\n originalSize: imageBlob.size,\n processedSize: processedBlob.size,\n originalType: imageBlob.type,\n processedType: processedBlob.type,\n });\n\n setCapturedImages((prev) => ({ ...prev, [side]: processedDataUrl }));\n logPhotoCaptured(sessionId, side);\n\n if (side === \"recto\") {\n const isSingleSided =\n selectedDocumentType?.id === \"passport\" ||\n selectedDocumentType?.id === \"pinkDriverLicense\";\n setCurrentPhotoStep(isSingleSided ? \"confirmation\" : \"before-verso\");\n } else {\n setCurrentPhotoStep(\"confirmation\");\n }\n } catch (error) {\n console.error(\n `[DocumentCheck] Failed to process photo for ${side}:`,\n error,\n );\n // Fallback: use original image if processing fails\n setCapturedImages((prev) => ({ ...prev, [side]: imageData }));\n logPhotoCaptured(sessionId, side);\n\n if (side === \"recto\") {\n const isSingleSided =\n selectedDocumentType?.id === \"passport\" ||\n selectedDocumentType?.id === \"pinkDriverLicense\";\n setCurrentPhotoStep(isSingleSided ? \"confirmation\" : \"before-verso\");\n } else {\n setCurrentPhotoStep(\"confirmation\");\n }\n }\n };\n\n const handlePhotoConfirmation = () => {\n if (capturedImages.recto) {\n logPhotosValidated(sessionId);\n setFileUploaded({\n front: capturedImages.recto,\n back: capturedImages.verso || null,\n });\n setDocStep(4);\n }\n };\n\n const handlePhotoConfirmedForVideo = () => {\n setVideoFlowPhase(\"video\");\n };\n\n const handleDocumentVideoComplete = (\n success: boolean,\n predictions?: Prediction[],\n errorCode?: string,\n ) => {\n const analysisData =\n predictions && predictions.length > 0 ? predictions : null;\n if (analysisData) {\n setAnalysisData(analysisData);\n }\n if (errorCode) {\n setErrorCode(errorCode);\n }\n handleProcessingComplete(success, undefined, analysisData);\n };\n\n const handleDocumentTypeSelect = async (documentId: string) => {\n const documentLabel = t(`documentTypes.${documentId}`, documentId);\n logDocumentTypeSelected(sessionId, documentId, documentLabel);\n const documentTemplateID = loadingTemplates\n ? undefined\n : getDocumentTemplateId({\n acceptedCountries: finalAcceptedCountries,\n countryCode: selectedCountry,\n documentId,\n documentTemplates,\n });\n\n const selectedDoc = {\n id: documentId,\n label: t(`documentTypes.${documentId}`),\n hasTwoSides:\n documentId !== \"passport\" && documentId !== \"pinkDriverLicense\",\n documentTemplateId: documentTemplateID,\n };\n\n const selectedCountryCode = selectedCountry.toUpperCase();\n const selectedDocumentInput = {\n countryCode: selectedCountryCode,\n identityDocumentType: documentId,\n identityDocumentTemplateId: documentTemplateID,\n };\n\n setSelectedDocumentType(selectedDoc);\n setUserInput((prev) => ({ ...prev, ...selectedDocumentInput }));\n setFileUploaded(null);\n setAnalysisData(null);\n setErrorCode(null);\n setNfcPreparationError(null);\n setCapturedImages({});\n setCurrentPhotoStep(\"before-recto\");\n setVideoFlowPhase(\"photo\");\n\n if (\n node.nfcEnabled === true &&\n !nfcSkipped &&\n NFC_ELIGIBLE_DOCUMENT_TYPES.has(documentId)\n ) {\n const nfcMode = normalizeNfcMode(node.nfcMode);\n try {\n await updateSessionUserInput(sessionId, {\n ...((session?.userInput as Record<string, unknown> | undefined) ?? {}),\n ...selectedDocumentInput,\n });\n } catch (error) {\n console.error(\"Failed to persist NFC document selection:\", error);\n setNfcPreparationError(\n t(\n \"nfc_scan.preparation_failed\",\n \"Impossible de préparer le scan NFC. Veuillez réessayer.\",\n ),\n );\n }\n setDocStep(nfcMode === \"nfcOrPhoto\" ? 3 : 7);\n return;\n }\n\n setDocStep(3);\n };\n\n const handleDocumentUpload = (files: onUploadFiles) => {\n logDocumentLoaded(sessionId, \"recto\");\n if (files.back) {\n logDocumentLoaded(sessionId, \"verso\");\n }\n logDocumentsValidated(sessionId);\n\n setFileUploaded(files);\n\n // Check if retry limit is reached before processing\n if (!isRetryAllowed() && retryCount > 0) {\n // Skip processing and go directly to error page\n setDocStep(6);\n } else {\n // Proceed to processing\n setDocStep(4);\n }\n };\n\n const handleProcessingComplete = (\n success: boolean,\n _retryCount?: number,\n apiAnalysisData?: Prediction[] | null,\n ) => {\n if (apiAnalysisData) {\n setAnalysisData(apiAnalysisData);\n\n // Extract and store the error code\n if (apiAnalysisData.length > 0) {\n const code = apiAnalysisData[0].code;\n setErrorCode(code);\n }\n }\n\n if (success) {\n const shouldRunNfcAfterApi =\n node.nfcEnabled === true &&\n !nfcSkipped &&\n normalizeNfcMode(node.nfcMode) === \"nfcOrPhoto\" &&\n !!selectedDocumentType?.id &&\n NFC_ELIGIBLE_DOCUMENT_TYPES.has(selectedDocumentType.id);\n\n if (shouldRunNfcAfterApi) {\n setDocStep(7);\n return;\n }\n\n // Increment currentStep in database immediately after successful analysis\n // This prevents double analysis if the user refreshes the page\n if (template) {\n stepObject.goToNextStep(node.id, template);\n } else {\n stepObject.setStep(stepObject.step + 1);\n }\n setDocStep(5);\n } else {\n // Increment retry count both in state and session\n setRetryCount((prev) => {\n const newCount = prev + 1;\n // Update session asynchronously\n incrementNodeRetryCount(sessionId, node.id, prev).catch((error) => {\n console.error(\"Failed to update retry count in session:\", error);\n });\n return newCount;\n });\n setDocStep(6);\n }\n };\n\n const handleRetryFromError = () => {\n // Note: retry count is already incremented in handleProcessingComplete\n // This function just handles navigation\n // Pour l'erreur 2.5 (face manquante), on conserve fileUploaded pour pré-remplir\n // l'upload avec la face déjà déposée. Pour les autres erreurs, on repart de zéro.\n if (errorCode !== \"2.5\") {\n setFileUploaded(null);\n }\n // Always stay on the current node and go back to upload step.\n // Never navigate to a different global step: if this node was reached via a\n // condition branch (e.g. \"true\"), navigating away would land on the other\n // branch (\"false\"). The retry means \"re-submit on THIS node\", not \"go back\n // in the journey\".\n setDocStep(3);\n };\n\n // Check if retry is allowed based on configuration\n const isRetryAllowed = () => {\n console.log(\"isRetryAllowed - Props:\", {\n allowResubmission: node.allowResubmission,\n maxResubmissionAttempts: node.maxResubmissionAttempts,\n retryCount,\n });\n // Specimen documents (code 8.x) block retry — user can only continue anyway\n if (errorCode?.startsWith(\"8\")) {\n return false;\n }\n // If allowResubmission is undefined (old journeys), allow unlimited retries\n if (node.allowResubmission === undefined) {\n return true;\n }\n // If allowResubmission is false, no retries allowed\n if (!node.allowResubmission) {\n return false;\n }\n // If allowResubmission is true, check against maxResubmissionAttempts\n if (node.maxResubmissionAttempts !== undefined) {\n return retryCount <= node.maxResubmissionAttempts;\n }\n // If maxResubmissionAttempts is not set, allow unlimited retries\n return true;\n };\n\n const handleContinueAnyway = () => {\n if (template) {\n stepObject.goToNextStep(node.id, template);\n } else {\n stepObject.setStep(stepObject.step + 1);\n }\n setDocStep(0);\n };\n\n const handleSuccessContinue = () => {\n if (template) {\n stepObject.goToNextStep(node.id, template);\n } else {\n stepObject.setStep(stepObject.step + 1);\n }\n setDocStep(0);\n };\n\n // Questionnaire de fallback NFC : l'utilisateur a déclaré ne pas avoir de puce.\n // On enregistre la raison (non bloquant) puis on poursuit selon le mode du nœud :\n // - nfcOrPhoto → flux photo/API du même nœud (intro/pays → upload → analyse), sans scan NFC\n // - nfcOnly → on saute le nœud (nœud suivant)\n const handleNfcFallback = async (\n reason: string,\n label: string,\n comment?: string,\n ) => {\n setNfcSkipped(true);\n try {\n await skipNfcWithReason(sessionId, { reason, label, comment });\n } catch (error) {\n console.error(\"Failed to persist NFC fallback reason:\", error);\n }\n\n const nfcMode = normalizeNfcMode(node.nfcMode);\n if (nfcMode === \"nfcOrPhoto\") {\n const hasIntroduction =\n node.introductionPage?.title !== undefined ||\n node.introductionPage?.description !== undefined;\n setDocStep(hasIntroduction ? 0 : 1);\n return;\n }\n\n if (template) {\n stepObject.goToNextStep(node.id, template);\n } else {\n stepObject.setStep(stepObject.step + 1);\n }\n };\n\n const handleBack = () => {\n const hasIntroduction =\n node.introductionPage?.title !== undefined ||\n node.introductionPage?.description !== undefined;\n\n // Le questionnaire de fallback (-2) revient au gate (-1)\n if (docStep === -2) {\n setDocStep(-1);\n return;\n }\n\n // En NFC, le premier écran réel (intro=0 sinon pays=1) revient au gate (-1)\n if (\n node.nfcEnabled === true &&\n docStep === (hasIntroduction ? 0 : 1)\n ) {\n setDocStep(-1);\n return;\n }\n\n if (docStep === 0) {\n stepObject.goBack();\n } else {\n setDocStep((prev) => prev - 1);\n }\n };\n\n switch (docStep) {\n case -1: {\n const hasIntroduction =\n node.introductionPage?.title !== undefined ||\n node.introductionPage?.description !== undefined;\n return (\n <NfcChipGate\n onConfirm={() => setDocStep(hasIntroduction ? 0 : 1)}\n // Pas de puce → questionnaire de fallback pour recueillir la raison\n onNoChip={() => setDocStep(-2)}\n />\n );\n }\n case -2:\n return <NfcFallbackSurvey onSubmit={handleNfcFallback} />;\n case 0:\n if (!documentTypeId) {\n console.error(\"DocumentCheck: Missing documentTypeId in step 0\");\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-red-500 text-4xl mb-4\">⚠️</div>\n <h2 className=\"text-xl font-bold text-red-600 mb-2\">\n {t(\n \"document_check.config_error.title\",\n \"Erreur de configuration\",\n )}\n </h2>\n <p className=\"text-gray-600 mb-4\">\n {t(\n \"document_check.config_error.description\",\n \"Type de document non spécifié.\",\n )}\n </p>\n <ButtonDesktop\n type=\"back\"\n className=\"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors\"\n onClick={() =>\n stepObject.setStep(Math.max(0, stepObject.step - 1))\n }\n >\n {t(\"document_check.config_error.back\", \"Retour\")}\n </ButtonDesktop>\n </div>\n );\n }\n return (\n <JDIPreIntroduction\n documentTypeId={documentTypeId}\n onContinue={() => setDocStep(1)}\n onBack={handleBack}\n introTitleText={\n node.introductionPage?.title || t(\"jdi.pre_introduction.title\")\n }\n introDescText={\n node.introductionPage?.description ||\n t(\"jdi.pre_introduction.description\")\n }\n />\n );\n case 1:\n return (\n <JDICountrySelection\n onCountrySelect={handleCountrySelect}\n onBack={handleBack}\n documentTypeId={documentTypeId}\n acceptedCountries={finalAcceptedCountries}\n countryIntroText={\n node.countrySelection?.title || t(\"jdi.country_selection.title\")\n }\n countryDescText={\n node.countrySelection?.description ||\n t(\"jdi.country_selection.description\")\n }\n />\n );\n case 2:\n return (\n <JDIDocumentSelection\n onDocumentSelect={handleDocumentTypeSelect}\n onBack={handleBack}\n documentTypeId={documentTypeId}\n sessionId={sessionId}\n chosenCountry={\n finalAcceptedCountries?.find((c) => c.code === selectedCountry) ||\n undefined\n }\n documentSelectionTitle={\n node.documentSelection?.title || t(\"jdi.document_selection.title\")\n }\n documentSelectionDescription={\n // En NFC, on laisse JDIDocumentSelection choisir le wording adapté\n // (subtitle_identity_nfc) plutôt que l'override \"téléverser\" du nœud.\n node.nfcEnabled === true\n ? undefined\n : node.documentSelection?.description ||\n t(\"jdi.document_selection.description\")\n }\n nfcEnabled={node.nfcEnabled === true}\n />\n );\n case 3:\n if (!selectedDocumentType) {\n console.error(\n \"DocumentCheck: selectedDocumentType is null for step 3!\",\n );\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-red-500 text-4xl mb-4\">⚠️</div>\n <h2 className=\"text-xl font-bold text-red-600 mb-2\">\n {t(\"document_check.selection_error.title\", \"Erreur de sélection\")}\n </h2>\n <p className=\"text-gray-600 mb-4\">\n {t(\n \"document_check.selection_error.description\",\n \"Aucun type de document sélectionné. Veuillez revenir à l'étape précédente.\",\n )}\n </p>\n <ButtonDesktop\n className=\"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors\"\n type=\"back\"\n onClick={() => setDocStep(2)}\n >\n {t(\n \"document_check.selection_error.back\",\n \"Retour à la sélection\",\n )}\n </ButtonDesktop>\n </div>\n );\n }\n\n if (isPictureAllowed && isDownloadAllowed && !selectedMethod) {\n return (\n <MobilePageLayout\n footer={\n <div className=\"w-full max-w-md mx-auto\">\n <ButtonDesktop\n type=\"back\"\n onClick={handleBack}\n className=\"w-full text-[#3C3C40] text-center font-poppins text-sm font-medium hover:underline py-2\"\n >\n {t(\"buttons.back\", \"Retour\")}\n </ButtonDesktop>\n </div>\n }\n >\n <div className=\"px-4 py-6 pt-11 md:px-8 md:py-8\">\n <div className=\"w-full max-w-md mx-auto space-y-6\">\n <div className=\"text-center space-y-4\">\n <Title className=\"text-xl md:text-2xl lg:text-3xl\">\n {t(\n \"document_check.method_selection.title\",\n \"Choisissez une méthode\",\n )}\n </Title>\n <Subtitle className=\"text-sm text-gray-600 leading-relaxed\">\n {t(\n \"document_check.method_selection.subtitle\",\n \"Comment souhaitez-vous ajouter votre document ?\",\n )}\n </Subtitle>\n </div>\n\n <div className=\"grid gap-4\">\n <button\n onClick={() => { setSelectedMethod(\"picture\"); logCaptureModeSelected(sessionId, \"picture\"); }}\n className=\"flex items-center p-4 bg-white border-2 border-gray-100 rounded-xl hover:border-teal-500 transition-colors text-left group\"\n >\n <div className=\"w-12 h-12 bg-teal-50 rounded-lg flex items-center justify-center text-teal-600 group-hover:bg-teal-100 transition-colors mr-4\">\n <Camera size={24} />\n </div>\n <div>\n <p className=\"font-semibold text-gray-900\">\n {t(\n \"document_check.method_selection.picture_title\",\n \"Prendre une photo\",\n )}\n </p>\n <p className=\"text-sm text-gray-500\">\n {t(\n \"document_check.method_selection.picture_desc\",\n \"Utilisez l'appareil photo de votre appareil\",\n )}\n </p>\n </div>\n </button>\n\n <button\n onClick={() => { setSelectedMethod(\"download\"); logCaptureModeSelected(sessionId, \"upload\"); }}\n className=\"flex items-center p-4 bg-white border-2 border-gray-100 rounded-xl hover:border-teal-500 transition-colors text-left group\"\n >\n <div className=\"w-12 h-12 bg-teal-50 rounded-lg flex items-center justify-center text-teal-600 group-hover:bg-teal-100 transition-colors mr-4\">\n <Upload size={24} />\n </div>\n <div>\n <p className=\"font-semibold text-gray-900\">\n {t(\n \"document_check.method_selection.download_title\",\n \"Téléverser un fichier\",\n )}\n </p>\n <p className=\"text-sm text-gray-500\">\n {t(\n \"document_check.method_selection.download_desc\",\n \"Sélectionnez un fichier sur votre appareil\",\n )}\n </p>\n </div>\n </button>\n </div>\n </div>\n </div>\n </MobilePageLayout>\n );\n }\n\n const activeMethod =\n selectedMethod ||\n (isPictureAllowed && isMobileCapture ? \"picture\" : \"download\");\n\n if (activeMethod === \"picture\" && isPictureAllowed) {\n const isSingleSided =\n selectedDocumentType?.id === \"passport\" ||\n selectedDocumentType?.id === \"pinkDriverLicense\";\n const onConfirm = node.withVideo\n ? handlePhotoConfirmedForVideo\n : handlePhotoConfirmation;\n\n if (node.withVideo && videoFlowPhase === \"video\") {\n return (\n <DocumentVideoCapture\n selectedDocumentType={selectedDocumentType}\n onComplete={handleDocumentVideoComplete}\n onBack={() => {\n setVideoFlowPhase(\"photo\");\n setCurrentPhotoStep(\"confirmation\");\n }}\n nodeId={node.id}\n sessionId={sessionId}\n previewOverrides={{\n recto: capturedImages.recto,\n verso: capturedImages.verso,\n }}\n />\n );\n }\n\n if (currentPhotoStep === \"before-recto\") {\n return (\n <BeforePhoto\n setStep={() => setCurrentPhotoStep(\"recto\")}\n isSingleSided={isSingleSided}\n onBack={() => setDocStep(2)}\n />\n );\n }\n if (currentPhotoStep === \"recto\") {\n return (\n <Photo\n onCapture={(imageData) => handlePhotoCapture(imageData, \"recto\")}\n />\n );\n }\n if (currentPhotoStep === \"before-verso\") {\n return (\n <BeforeVersoPhoto setStep={() => setCurrentPhotoStep(\"verso\")} />\n );\n }\n if (currentPhotoStep === \"verso\") {\n return (\n <Photo\n onCapture={(imageData) => handlePhotoCapture(imageData, \"verso\")}\n />\n );\n }\n if (currentPhotoStep === \"confirmation\") {\n return (\n <PhotoConfirmation\n imageUrl={capturedImages.recto || \"\"}\n versoImageUrl={capturedImages.verso}\n requiresTwoSides={!!capturedImages.verso}\n onConfirm={onConfirm}\n onRetry={() => setCurrentPhotoStep(\"before-recto\")}\n onRetryAfterProcessing={() => setCurrentPhotoStep(\"before-recto\")}\n fileUploaded={fileUploaded}\n isSingleSided={isSingleSided}\n />\n );\n }\n return (\n <BeforePhoto\n setStep={() => setCurrentPhotoStep(\"recto\")}\n isSingleSided={isSingleSided}\n onBack={() => setDocStep(2)}\n />\n );\n } else {\n return (\n <JDIDocumentUpload\n documentType={selectedDocumentType?.id || documentTypeId}\n documentTypeId={documentTypeId}\n documentLabel={selectedDocumentType?.label}\n onUpload={handleDocumentUpload}\n onBack={() => {\n if (isPictureAllowed && isDownloadAllowed) {\n setSelectedMethod(null);\n } else {\n setDocStep(2);\n }\n }}\n initialFront={errorCode === \"2.5\" ? fileUploaded?.front : null}\n initialBack={errorCode === \"2.5\" ? fileUploaded?.back : null}\n sessionId={sessionId}\n />\n );\n }\n case 4:\n return (\n <JDIProcessing\n documentType={selectedDocumentType?.id || documentTypeId}\n onProcessingComplete={handleProcessingComplete}\n fileUploaded={fileUploaded}\n documentTypeId={documentTypeId}\n retryCount={retryCount}\n documentTemplateId={selectedDocumentType?.documentTemplateId}\n nodeId={node.id}\n />\n );\n case 5:\n return (\n <JDISuccess\n documentType={selectedDocumentType?.id || documentTypeId}\n onContinue={handleSuccessContinue}\n errorCode={errorCode || undefined}\n />\n );\n case 6:\n return (\n <JDIError\n documentType={selectedDocumentType?.id || documentTypeId}\n onRetry={handleRetryFromError}\n onContinueAnyway={handleContinueAnyway}\n retryCount={retryCount}\n predictions={analysisData || undefined}\n errorCode={errorCode || undefined}\n allowResubmission={node.allowResubmission}\n maxResubmissionAttempts={node.maxResubmissionAttempts}\n isRetryAllowed={isRetryAllowed()}\n />\n );\n case 7:\n if (nfcPreparationError) {\n return (\n <MobilePageLayout\n footer={\n <div className=\"w-full max-w-md mx-auto\">\n <ButtonDesktop\n type=\"back\"\n onClick={() => setDocStep(2)}\n className=\"w-full text-[#3C3C40] text-center font-poppins text-sm font-medium hover:underline py-2\"\n >\n {t(\"buttons.back\", \"Retour\")}\n </ButtonDesktop>\n </div>\n }\n >\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-red-500 text-4xl mb-4\">⚠️</div>\n <h2 className=\"text-xl font-bold text-red-600 mb-2\">\n {t(\"nfc_scan.preparation_error_title\", \"Erreur de préparation NFC\")}\n </h2>\n <p className=\"text-gray-600 mb-4\">{nfcPreparationError}</p>\n </div>\n </MobilePageLayout>\n );\n }\n return (\n <NfcScanStep\n sessionId={sessionId}\n nodeId={node.id}\n stepObject={stepObject}\n template={template}\n onBack={() => {\n // Retour vers la sélection du document (corriger un mauvais choix). Le démontage de\n // NfcScanStep ferme le SSE via le cleanup du hook (pas d'appel backend nécessaire).\n const hasIntroduction =\n node.introductionPage?.title !== undefined ||\n node.introductionPage?.description !== undefined;\n hasRestoredNfcStep.current = true; // ne pas re-restaurer l'étape QR après ce retour\n setDocStep(hasIntroduction ? 0 : 1);\n }}\n />\n );\n default:\n console.error(`Invalid docStep: ${docStep}`);\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-red-500 text-4xl mb-4\">⚠️</div>\n <h2 className=\"text-xl font-bold text-red-600 mb-2\">\n {t(\"document_check.navigation_error.title\", \"Erreur de navigation\")}\n </h2>\n <p className=\"text-gray-600 mb-4\">\n {t(\n \"document_check.navigation_error.description\",\n \"Étape non valide. Veuillez recommencer.\",\n )}\n </p>\n <ButtonDesktop\n className=\"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors\"\n type=\"back\"\n onClick={() => setDocStep(0)}\n >\n {t(\"document_check.navigation_error.back\", \"Retour au début\")}\n </ButtonDesktop>\n </div>\n );\n }\n};\n\nexport default DocumentCheck;\n"],"names":["useI18n","getSession","useState","useEffect","__awaiter","getAllDocumentTemplates","getNodeRetryCount","useRef","useDocumentContext","useMemo","EUROPEAN_COUNTRY_CODES","__assign","ISO_COUNTRY_CODES","getDocTypeKey","dataUrlToBlob","resizeAfterCapture","blobToDataUrl","logPhotoCaptured","logPhotosValidated","logDocumentTypeSelected","getDocumentTemplateId","updateSessionUserInput","logDocumentLoaded","logDocumentsValidated","incrementNodeRetryCount","skipNfcWithReason","_jsx","NfcChipGate","NfcFallbackSurvey","_jsxs","ButtonDesktop","JDIPreIntroduction","JDICountrySelection","JDIDocumentSelection","MobilePageLayout","Title","Subtitle","logCaptureModeSelected","Camera","Upload","DocumentVideoCapture","BeforePhoto","Photo","BeforeVersoPhoto","PhotoConfirmation","JDIDocumentUpload","JDIProcessing","JDISuccess","JDIError","NfcScanStep"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkHA,IAAM,2BAA2B,GAAG,IAAI,GAAG,CAAC;IAC1C,UAAU;IACV,QAAQ;IACR,iBAAiB;AAClB,CAAA,CAAC;AAEF;;;;AAIG;AACH,IAAM,gBAAgB,GAAG,UAAC,IAAa,EAAA;AACrC,IAAA,OAAA,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,YAAY,GAAG,YAAY,GAAG,SAAS;AAAxE,CAAwE;AAE1E;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AACH,IAAM,aAAa,GAAG,UAAC,EAWF,EAAA;;AAVnB,IAAA,IAAA,UAAU,GAAA,EAAA,CAAA,UAAA,CAAA,CACV,SAAS,GAAA,EAAA,CAAA,SAAA,CAAA,CACT,IAAI,GAAA,EAAA,CAAA,IAAA,CAAA,CAC2B,EAAA,CAAA,cAAA,CAAA,KAC/B,cAAc,oBAAA,CAAA,CACd,iBAAiB,GAAA,EAAA,CAAA,iBAAA,CAAA,CACjB,EAAA,GAAA,EAAA,CAAA,eAAuB,CAAA,CAAvB,eAAe,GAAA,EAAA,KAAA,MAAA,GAAG,KAAK,GAAA,EAAA,CAAA,CACvB,oBAAoB,GAAA,EAAA,CAAA,oBAAA,CAAA,CACpB,QAAQ,GAAA,EAAA,CAAA,QAAA,CAAA,CACR,YAAY,GAAA,EAAA,CAAA;AAEJ,IAAA,IAAA,CAAC,GAAKA,eAAO,EAAE,EAAd;AACD,IAAA,IAAA,OAAO,GAAKC,yBAAU,EAAE,QAAjB;IAET,IAAA,EAAA,GACJC,cAAQ,EAA4B,EAD/B,iBAAiB,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gBAAgB,0CAAE,WAAW,MAAK,SAAS;AAClD,oBAAA,kBAAkB,CAAC,OAAO,GAAG,IAAI,CAAC;oBAClC,UAAU,CAAC,eAAe,GAAG,CAAC,GAAG,CAAC,CAAC;gBACrC,CAAC,EAAA,CACD;AAEN,QAAA;AACE,YAAA,OAAO,CAAC,KAAK,CAAC,2BAAoB,OAAO,CAAE,CAAC;AAC5C,YAAA,QACEpB,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,kEAAkE,EAAA,QAAA,EAAA,CAC/EH,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,4BAA4B,EAAA,QAAA,EAAA,cAAA,EAAA,CAAS,EACpDA,cAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,qCAAqC,EAAA,QAAA,EAChD,CAAC,CAAC,uCAAuC,EAAE,sBAAsB,CAAC,EAAA,CAChE,EACLA,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,oBAAoB,EAAA,QAAA,EAC9B,CAAC,CACA,6CAA6C,EAC7C,yCAAyC,CAC1C,EAAA,CACC,EACJA,cAAA,CAACI,qBAAa,IACZ,SAAS,EAAC,iFAAiF,EAC3F,IAAI,EAAC,MAAM,EACX,OAAO,EAAE,YAAA,EAAM,OAAA,UAAU,CAAC,CAAC,CAAC,CAAA,CAAb,CAAa,EAAA,QAAA,EAE3B,CAAC,CAAC,sCAAsC,EAAE,iBAAiB,CAAC,EAAA,CAC/C,CAAA,EAAA,CACZ;;AAGd;;;;"}
|
|
1
|
+
{"version":3,"file":"DocumentCheck.js","sources":["../../../../../src/components/session/DocumentCheck.tsx"],"sourcesContent":["import { useState, useEffect, useMemo, useRef } from \"react\";\nimport type {\n AcceptedCountry,\n stepObject,\n SessionTemplate,\n} from \"../../types/session\";\nimport JDIPreIntroduction from \"../jdi/JDIPreIntroduction\";\nimport JDICountrySelection from \"../jdi/JDICountrySelection\";\nimport JDIDocumentSelection from \"../jdi/JDIDocumentSelection\";\nimport JDIDocumentUpload from \"../jdi/JDIDocumentUpload\";\nimport JDIProcessing from \"../jdi/JDIProcessing\";\nimport JDISuccess from \"../jdi/JDISuccess\";\nimport JDIError from \"../jdi/JDIError\";\nimport BeforePhoto from \"../id-check/BeforePhoto\";\nimport BeforeVersoPhoto from \"../id-check/BeforeVersoPhoto\";\nimport Photo from \"../id-check/Photo\";\nimport PhotoConfirmation from \"../id-check/PhotoConfirmation\";\nimport DocumentVideoCapture from \"../document-video/DocumentVideoCapture\";\nimport { Camera, Upload } from \"lucide-react\";\nimport { useDocumentContext } from \"../../context/DocumentContext\";\nimport type { onUploadFiles } from \"../../types/uploadFiles\";\nimport type { Prediction } from \"../../utils/apiAnalysis\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport {\n logDocumentTypeSelected,\n logCaptureModeSelected,\n logPhotoCaptured,\n logPhotosValidated,\n logDocumentLoaded,\n logDocumentsValidated,\n} from \"../../services/auditTrailService\";\nimport ButtonDesktop from \"../ui/ButtonDesktop\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\nimport { ISO_COUNTRY_CODES } from \"../../utils/isoCountryCodes\";\nimport {\n DocumentTemplate,\n FetchedDocumentTemplates,\n getAllDocumentTemplates,\n getDocTypeKey,\n getDocumentTemplateId,\n} from \"../../services/documentTemplate\";\nimport { UserInput } from \"../../types/userInput\";\nimport {\n resizeAfterCapture,\n dataUrlToBlob,\n blobToDataUrl,\n} from \"../../utils/imageProcessing\";\nimport {\n getNodeRetryCount,\n incrementNodeRetryCount,\n} from \"../../services/retryService\";\nimport { getSession } from \"../../context/SessionContext\";\nimport {\n updateSessionUserInput,\n skipNfcWithReason,\n fetchWallets,\n skipWalletWithReason,\n} from \"../../services/sessionService\";\nimport NfcScanStep from \"../nfc-scan/NfcScanNode\";\nimport NfcChipGate from \"../nfc-scan/NfcChipGate\";\nimport NfcFallbackSurvey from \"../nfc-scan/NfcFallbackSurvey\";\nimport WalletProposal from \"../wallet/WalletProposal\";\nimport WalletVerificationStep from \"../wallet/WalletVerificationStep\";\n\nexport interface CountryDocuments {\n code: string;\n documents: {\n passport: string[];\n idCard: string[];\n residencePermit: string[];\n driverLicense: string[];\n pinkDriverLicense: string[];\n };\n}\n\nexport interface NodeIdentityControl {\n id: string;\n acceptedCountries: CountryDocuments[];\n automaticPhotoCapture?: boolean;\n withVideo?: boolean;\n nfcEnabled?: boolean;\n // \"nfcAndApi\" reste accepté pour rétrocompat (parcours legacy), normalisé via normalizeNfcMode.\n nfcMode?: \"nfcOnly\" | \"nfcOrPhoto\" | \"nfcAndApi\";\n walletEnabled?: boolean;\n walletMode?: \"walletOnly\" | \"walletOrPhoto\";\n allowedAddingMethods?: string[];\n introductionPage?: {\n title: string;\n description: string;\n };\n countrySelection?: {\n title: string;\n description: string;\n };\n documentSelection?: {\n title: string;\n description: string;\n };\n allowResubmission: boolean;\n maxResubmissionAttempts?: number;\n}\n\ninterface DocumentCheckProps {\n stepObject: stepObject;\n sessionId: string;\n node: NodeIdentityControl;\n onContinueOnPC?: () => void;\n documentTypeId: string;\n acceptedCountries?: AcceptedCountry[];\n isMobileCapture?: boolean;\n allowedAddingMethods?: string[];\n template?: SessionTemplate;\n templateIndex?: number;\n setUserInput: React.Dispatch<React.SetStateAction<UserInput>>;\n}\n\nimport { EUROPEAN_COUNTRY_CODES } from \"../../utils/europeanCountries\";\n\nconst NFC_ELIGIBLE_DOCUMENT_TYPES = new Set([\n \"passport\",\n \"idCard\",\n \"residencePermit\",\n]);\n\n/**\n * Normalise le mode NFC vers les valeurs courantes.\n * Rétrocompat : les parcours enregistrés avant le renommage portent encore\n * `nfcAndApi`, qui doit être traité comme `nfcOrPhoto` (scan NFC avec alternative photo).\n */\nconst normalizeNfcMode = (mode?: string): \"nfcOnly\" | \"nfcOrPhoto\" =>\n mode === \"nfcAndApi\" || mode === \"nfcOrPhoto\" ? \"nfcOrPhoto\" : \"nfcOnly\";\n\nconst normalizeWalletMode = (mode?: string): \"walletOnly\" | \"walletOrPhoto\" =>\n mode === \"walletOnly\" ? \"walletOnly\" : \"walletOrPhoto\";\n\n/**\n * DocumentCheck component manages the multi-step document verification flow for a session.\n * It handles country and document type selection, document upload or photo capture, processing, and error/success handling.\n * The component adapts its flow for mobile capture and supports custom session templates.\n *\n * @component\n * @param {Object} props - Component props.\n * @param {stepObject} props.stepObject - Object managing the current step in the parent flow, with setStep and step properties.\n * @param {string} props.sessionId - Unique identifier for the current session.\n * @param {() => void} [props.onContinueOnPC] - Optional callback to continue the process on a PC (used for mobile capture fallback).\n * @param {string} props.documentTypeId - The ID of the required document type for verification (e.g., \"jdi-2\" for ID card).\n * @param {AcceptedCountry[]} [props.acceptedCountries] - Optional list of countries accepted for the document type. If not provided, resolved from the session template.\n * @param {boolean} [props.isMobileCapture=false] - If true, enables mobile photo capture flow instead of file upload.\n * @param {SessionTemplate} [props.template] - Optional session template object, used to resolve accepted countries and flow configuration.\n * @param {number} [props.templateIndex] - Optional index of the current template node, used for navigation and retry logic.\n *\n * @returns {JSX.Element} Multi-step document verification UI, rendering different subcomponents based on the current step.\n *\n * @remarks\n * - Handles both desktop and mobile flows, including photo capture and file upload.\n * - Integrates with context for selected document type and manages internal state for step navigation, country selection, file uploads, and error handling.\n * - Displays error messages and fallback UI for misconfiguration or invalid navigation.\n * - Uses hooks for translation, retry navigation, and context management.\n */\nconst DocumentCheck = ({\n stepObject,\n sessionId,\n node,\n onContinueOnPC: _onContinueOnPC,\n documentTypeId,\n acceptedCountries,\n isMobileCapture = false,\n allowedAddingMethods,\n template,\n setUserInput,\n}: DocumentCheckProps): JSX.Element => {\n const { t } = useI18n();\n const { session } = getSession();\n\n const [documentTemplates, setDocumentTemplates] =\n useState<FetchedDocumentTemplates>();\n const [loadingTemplates, setLoadingTemplates] = useState(true);\n\n useEffect(() => {\n (async () => {\n setLoadingTemplates(true);\n const templates = await getAllDocumentTemplates();\n setDocumentTemplates(templates);\n setLoadingTemplates(false);\n })();\n }, []);\n\n const initialRetryCount = getNodeRetryCount(session, node.id);\n const [selectedMethod, setSelectedMethod] = useState<\n \"download\" | \"picture\" | null\n >(null);\n\n const isPictureAllowed = allowedAddingMethods?.includes(\"picture\") ?? true;\n const isDownloadAllowed = allowedAddingMethods?.includes(\"download\") ?? true;\n\n // Check if retry is allowed based on initial retry count\n const isInitialRetryAllowed = () => {\n // Special case: if allowResubmission is false and retryCount > 0, no retries allowed\n if (node.allowResubmission === false && initialRetryCount > 0) {\n return false;\n }\n\n if (node.allowResubmission === undefined) return true;\n if (!node.allowResubmission) return false;\n if (node.maxResubmissionAttempts !== undefined) {\n return initialRetryCount <= node.maxResubmissionAttempts;\n }\n return true;\n };\n\n // Initialize docStep - if retries exhausted, start at error page (step 6)\n const [docStep, setDocStep] = useState(() => {\n if (initialRetryCount > 0 && !isInitialRetryAllowed()) {\n return 6; // Error page\n }\n return 0; // Normal flow - start with introduction\n });\n const [selectedCountry, setSelectedCountry] = useState(\n acceptedCountries?.[0]?.code?.toUpperCase() || \"FR\",\n );\n const [fileUploaded, setFileUploaded] = useState<onUploadFiles | null>(null);\n const [analysisData, setAnalysisData] = useState<Prediction[] | null>(null);\n const [errorCode, setErrorCode] = useState<string | null>(null);\n const [nfcPreparationError, setNfcPreparationError] = useState<string | null>(null);\n // Quand l'utilisateur déclare ne pas avoir de puce (questionnaire de fallback),\n // on ne doit plus le réorienter vers le scan NFC (ni avant, ni après l'analyse API).\n const [nfcSkipped, setNfcSkipped] = useState(false);\n // Idem pour le wallet : une fois décliné/échoué, on ne re-propose plus le wallet\n // sur ce nœud (mais le NFC, s'il est également activé, reste tenté ensuite).\n const [walletDeclined, setWalletDeclined] = useState(false);\n\n // Initialize retry count from session data\n const [retryCount, setRetryCount] = useState(() => {\n return getNodeRetryCount(session, node.id);\n });\n\n // Update retry count when session loads/changes\n useEffect(() => {\n if (session) {\n const sessionRetryCount = getNodeRetryCount(session, node.id);\n setRetryCount(sessionRetryCount);\n }\n }, [session, node.id]);\n\n // Restauration après refresh : si le NFC est en cours côté backend (l'utilisateur attendait sur\n // l'écran QR), revenir directement à cet écran (docStep 7) au lieu de repartir au début du nœud.\n // `docStep` est en mémoire et serait sinon perdu au rechargement.\n const hasRestoredNfcStep = useRef(false);\n useEffect(() => {\n if (hasRestoredNfcStep.current) return;\n if (node.nfcEnabled !== true) return;\n const status = session?.nfcStatus;\n if (status === \"pending\" || status === \"opened\") {\n hasRestoredNfcStep.current = true;\n setDocStep(7);\n }\n }, [session, node.nfcEnabled]);\n\n // Check retry limits on mount/reload - if retries exhausted, show error page immediately\n useEffect(() => {\n // Special case: if allowResubmission is false and retryCount > 0, show error immediately\n if (node.allowResubmission === false && retryCount > 0) {\n setDocStep(6);\n return;\n }\n\n // Normal case: check against maxResubmissionAttempts\n // Inline retry check to avoid dependency issues\n const checkRetryLimit = () => {\n // If allowResubmission is undefined (old journeys), allow unlimited retries\n if (node.allowResubmission === undefined) {\n return true;\n }\n // If allowResubmission is false, no retries allowed\n if (!node.allowResubmission) {\n return false;\n }\n // If allowResubmission is true, check against maxResubmissionAttempts\n if (node.maxResubmissionAttempts !== undefined) {\n return retryCount <= node.maxResubmissionAttempts;\n }\n // If maxResubmissionAttempts is not set, allow unlimited retries\n return true;\n };\n\n // Check immediately on mount if retries are exhausted\n // This redirects to error page before showing any JDI steps\n if (retryCount > 0 && !checkRetryLimit()) {\n // User has exhausted retries, redirect to error page immediately\n setDocStep(6);\n }\n }, [retryCount, node.allowResubmission, node.maxResubmissionAttempts]);\n\n const [capturedImages, setCapturedImages] = useState<Record<string, string>>(\n {},\n );\n const [currentPhotoStep, setCurrentPhotoStep] = useState(\n \"before-recto\" as\n | \"before-recto\"\n | \"recto\"\n | \"before-verso\"\n | \"verso\"\n | \"confirmation\",\n );\n const [videoFlowPhase, setVideoFlowPhase] = useState<\"photo\" | \"video\">(\n \"photo\",\n );\n\n const { selectedDocumentType, setSelectedDocumentType } =\n useDocumentContext();\n\n const finalAcceptedCountries = useMemo(() => {\n if (loadingTemplates) return acceptedCountries;\n const result: AcceptedCountry[] = [];\n const hasInternational = acceptedCountries?.some(c => c.code === \"INT\");\n const hasEurope = acceptedCountries?.some(c => c.code === \"EU\");\n\n if (!hasInternational && !hasEurope) return acceptedCountries;\n\n const internationalDoc = acceptedCountries?.find(c => c.code === \"INT\");\n const europeDoc = acceptedCountries?.find(c => c.code === \"EU\");\n\n for (const ISOCode of ISO_COUNTRY_CODES) {\n if (ISOCode === \"INT\" || ISOCode === \"EU\") continue;\n\n const countryDocInput = acceptedCountries?.find(c => c.code?.toUpperCase() === ISOCode);\n const isEuropean = EUROPEAN_COUNTRY_CODES.includes(ISOCode);\n\n // Determine which configuration to use for this country\n // 1. Specific country config\n // 2. EU group config (if European)\n // 3. INT group config\n let configToUse: AcceptedCountry | undefined = countryDocInput;\n\n if (!configToUse) {\n if (isEuropean && europeDoc) {\n configToUse = europeDoc;\n } else if (internationalDoc) {\n configToUse = internationalDoc;\n }\n }\n\n if (configToUse) {\n const documents: AcceptedCountry['documents'] = {\n passport: [],\n idCard: [],\n driverLicense: [],\n residencePermit: [],\n pinkDriverLicense: [],\n };\n for (const key of Object.keys(configToUse.documents)) {\n const docKey = key as keyof AcceptedCountry['documents'];\n if (!isDocumentTypeAvailable(ISOCode, docKey)) continue;\n documents[docKey] = configToUse.documents[docKey];\n }\n if (\n documents.passport.length ||\n documents.idCard.length ||\n documents.driverLicense.length ||\n documents.residencePermit.length ||\n documents.pinkDriverLicense.length\n ) {\n result.push({ code: ISOCode, documents: { ...documents } });\n }\n }\n }\n return result;\n }, [acceptedCountries, documentTemplates, loadingTemplates]);\n\n // Helper to check if a document type is available for a country\n function isDocumentTypeAvailable(\n countryCode: string,\n documentType: keyof AcceptedCountry[\"documents\"],\n ) {\n if (countryCode === 'INT' || countryCode === 'EU') return true;\n const docTypeKey = (getDocTypeKey(documentType) ?? \"\").toLowerCase();\n return documentTemplates?.data?.some(\n (tpl: DocumentTemplate) =>\n tpl.countryCode === countryCode &&\n (tpl.name?.toLowerCase() || \"\").includes(docTypeKey),\n );\n }\n\n useEffect(() => {\n if (!documentTypeId) console.error(\"DocumentCheck: Missing documentTypeId\");\n console.debug(\"[DocumentCheck] node content:\", node);\n\n // Don't reset docStep if we're already on error page (step 6) due to exhausted retries\n if (docStep === 6) {\n return;\n }\n\n // En NFC, on affiche d'abord l'écran de confirmation de la puce (gate -1)\n if (node.nfcEnabled === true) {\n setDocStep(-1);\n return;\n }\n\n if (\n node.introductionPage?.title === undefined &&\n node.introductionPage?.description === undefined\n ) {\n setDocStep(1);\n } else {\n setDocStep(0);\n }\n }, [documentTypeId, sessionId, isMobileCapture]);\n\n const handleCountrySelect = (countryId: string) => {\n console.debug(\n \"[DocumentCheck] handleCountrySelect - countryId:\",\n countryId,\n );\n setUserInput((prev) => ({ ...prev, countryCode: countryId.toUpperCase() }));\n setSelectedCountry(countryId.toUpperCase());\n setSelectedDocumentType(null);\n setFileUploaded(null);\n setAnalysisData(null);\n setErrorCode(null);\n setNfcPreparationError(null);\n // Reset retry count to 0 (will be synced to session)\n setRetryCount(0);\n setCapturedImages({});\n setCurrentPhotoStep(\"before-recto\");\n setVideoFlowPhase(\"photo\");\n setDocStep(2);\n };\n\n const handlePhotoCapture = async (\n imageData: string,\n side: \"recto\" | \"verso\",\n ) => {\n try {\n // Convert data URL to Blob for processing\n const imageBlob = dataUrlToBlob(imageData);\n\n // Resize and optimize the image (only on mobile)\n const processedBlob = await resizeAfterCapture(imageBlob);\n\n // Convert back to data URL for storage and display\n const processedDataUrl = await blobToDataUrl(processedBlob);\n\n console.debug(`[DocumentCheck] Photo processed for ${side}`, {\n originalSize: imageBlob.size,\n processedSize: processedBlob.size,\n originalType: imageBlob.type,\n processedType: processedBlob.type,\n });\n\n setCapturedImages((prev) => ({ ...prev, [side]: processedDataUrl }));\n logPhotoCaptured(sessionId, side);\n\n if (side === \"recto\") {\n const isSingleSided =\n selectedDocumentType?.id === \"passport\" ||\n selectedDocumentType?.id === \"pinkDriverLicense\";\n setCurrentPhotoStep(isSingleSided ? \"confirmation\" : \"before-verso\");\n } else {\n setCurrentPhotoStep(\"confirmation\");\n }\n } catch (error) {\n console.error(\n `[DocumentCheck] Failed to process photo for ${side}:`,\n error,\n );\n // Fallback: use original image if processing fails\n setCapturedImages((prev) => ({ ...prev, [side]: imageData }));\n logPhotoCaptured(sessionId, side);\n\n if (side === \"recto\") {\n const isSingleSided =\n selectedDocumentType?.id === \"passport\" ||\n selectedDocumentType?.id === \"pinkDriverLicense\";\n setCurrentPhotoStep(isSingleSided ? \"confirmation\" : \"before-verso\");\n } else {\n setCurrentPhotoStep(\"confirmation\");\n }\n }\n };\n\n const handlePhotoConfirmation = () => {\n if (capturedImages.recto) {\n logPhotosValidated(sessionId);\n setFileUploaded({\n front: capturedImages.recto,\n back: capturedImages.verso || null,\n });\n setDocStep(4);\n }\n };\n\n const handlePhotoConfirmedForVideo = () => {\n setVideoFlowPhase(\"video\");\n };\n\n const handleDocumentVideoComplete = (\n success: boolean,\n predictions?: Prediction[],\n errorCode?: string,\n ) => {\n const analysisData =\n predictions && predictions.length > 0 ? predictions : null;\n if (analysisData) {\n setAnalysisData(analysisData);\n }\n if (errorCode) {\n setErrorCode(errorCode);\n }\n handleProcessingComplete(success, undefined, analysisData);\n };\n\n const handleDocumentTypeSelect = async (documentId: string) => {\n const documentLabel = t(`documentTypes.${documentId}`, documentId);\n logDocumentTypeSelected(sessionId, documentId, documentLabel);\n const documentTemplateID = loadingTemplates\n ? undefined\n : getDocumentTemplateId({\n acceptedCountries: finalAcceptedCountries,\n countryCode: selectedCountry,\n documentId,\n documentTemplates,\n });\n\n const selectedDoc = {\n id: documentId,\n label: t(`documentTypes.${documentId}`),\n hasTwoSides:\n documentId !== \"passport\" && documentId !== \"pinkDriverLicense\",\n documentTemplateId: documentTemplateID,\n };\n\n const selectedCountryCode = selectedCountry.toUpperCase();\n const selectedDocumentInput = {\n countryCode: selectedCountryCode,\n identityDocumentType: documentId,\n identityDocumentTemplateId: documentTemplateID,\n };\n\n setSelectedDocumentType(selectedDoc);\n setUserInput((prev) => ({ ...prev, ...selectedDocumentInput }));\n setFileUploaded(null);\n setAnalysisData(null);\n setErrorCode(null);\n setNfcPreparationError(null);\n setCapturedImages({});\n setCurrentPhotoStep(\"before-recto\");\n setVideoFlowPhase(\"photo\");\n\n // Wallet gate first, NFC as fallback (cf. WALLET_OID4VP_IMPLEMENTATION_PLAN.md §7) :\n // si un wallet est disponible pour ce pays, on le propose avant toute alternative\n // NFC/photo. Le NFC (et la photo) restent le repli si le wallet est indisponible,\n // décliné, ou échoue.\n if (node.walletEnabled === true && !walletDeclined) {\n try {\n const wallets = await fetchWallets(selectedCountryCode, \"pid\");\n if (wallets.length > 0) {\n setDocStep(-10);\n return;\n }\n } catch (error) {\n console.error(\"Failed to check wallet availability:\", error);\n // Indisponibilité du référentiel wallet : on poursuit sur le flux NFC/photo existant.\n }\n }\n\n await proceedWithNfcOrPhoto(documentId, selectedDocumentInput);\n };\n\n // Logique NFC-ou-photo existante, factorisée pour être rejouable après un\n // refus/échec du wallet (le wallet est tenté avant, cf. handleDocumentTypeSelect).\n const proceedWithNfcOrPhoto = async (\n documentId: string,\n selectedDocumentInput: Record<string, unknown>,\n ) => {\n if (\n node.nfcEnabled === true &&\n !nfcSkipped &&\n NFC_ELIGIBLE_DOCUMENT_TYPES.has(documentId)\n ) {\n const nfcMode = normalizeNfcMode(node.nfcMode);\n try {\n await updateSessionUserInput(sessionId, {\n ...((session?.userInput as Record<string, unknown> | undefined) ?? {}),\n ...selectedDocumentInput,\n });\n } catch (error) {\n console.error(\"Failed to persist NFC document selection:\", error);\n setNfcPreparationError(\n t(\n \"nfc_scan.preparation_failed\",\n \"Impossible de préparer le scan NFC. Veuillez réessayer.\",\n ),\n );\n }\n setDocStep(nfcMode === \"nfcOrPhoto\" ? 3 : 7);\n return;\n }\n\n setDocStep(3);\n };\n\n // Le wallet a été décliné (WalletProposal) ou a échoué (WalletVerificationStep).\n // walletOnly : pas d'alternative photo/NFC → on saute le nœud, comme le NFC en mode nfcOnly.\n // walletOrPhoto : on rejoue la logique NFC-ou-photo normale.\n const handleWalletDeclineOrFail = async () => {\n setWalletDeclined(true);\n try {\n await skipWalletWithReason(sessionId, {\n nodeId: node.id,\n reason: \"wallet_declined_or_failed\",\n label: \"Wallet non utilisé\",\n });\n } catch (error) {\n console.error(\"Failed to persist wallet skip reason:\", error);\n }\n\n if (normalizeWalletMode(node.walletMode) === \"walletOnly\") {\n if (template) {\n stepObject.goToNextStep(node.id, template);\n } else {\n stepObject.setStep(stepObject.step + 1);\n }\n return;\n }\n\n const selectedDocumentInput = {\n countryCode: selectedCountry.toUpperCase(),\n identityDocumentType: selectedDocumentType?.id,\n identityDocumentTemplateId: selectedDocumentType?.documentTemplateId,\n };\n await proceedWithNfcOrPhoto(selectedDocumentType?.id || \"\", selectedDocumentInput);\n };\n\n // Vérification par wallet aboutie : l'identité est confirmée, on saute la capture photo.\n const handleWalletVerificationCompleted = () => {\n if (template) {\n stepObject.goToNextStep(node.id, template);\n } else {\n stepObject.setStep(stepObject.step + 1);\n }\n };\n\n const handleDocumentUpload = (files: onUploadFiles) => {\n logDocumentLoaded(sessionId, \"recto\");\n if (files.back) {\n logDocumentLoaded(sessionId, \"verso\");\n }\n logDocumentsValidated(sessionId);\n\n setFileUploaded(files);\n\n // Check if retry limit is reached before processing\n if (!isRetryAllowed() && retryCount > 0) {\n // Skip processing and go directly to error page\n setDocStep(6);\n } else {\n // Proceed to processing\n setDocStep(4);\n }\n };\n\n const handleProcessingComplete = (\n success: boolean,\n _retryCount?: number,\n apiAnalysisData?: Prediction[] | null,\n ) => {\n if (apiAnalysisData) {\n setAnalysisData(apiAnalysisData);\n\n // Extract and store the error code\n if (apiAnalysisData.length > 0) {\n const code = apiAnalysisData[0].code;\n setErrorCode(code);\n }\n }\n\n if (success) {\n const shouldRunNfcAfterApi =\n node.nfcEnabled === true &&\n !nfcSkipped &&\n normalizeNfcMode(node.nfcMode) === \"nfcOrPhoto\" &&\n !!selectedDocumentType?.id &&\n NFC_ELIGIBLE_DOCUMENT_TYPES.has(selectedDocumentType.id);\n\n if (shouldRunNfcAfterApi) {\n setDocStep(7);\n return;\n }\n\n // Increment currentStep in database immediately after successful analysis\n // This prevents double analysis if the user refreshes the page\n if (template) {\n stepObject.goToNextStep(node.id, template);\n } else {\n stepObject.setStep(stepObject.step + 1);\n }\n setDocStep(5);\n } else {\n // Increment retry count both in state and session\n setRetryCount((prev) => {\n const newCount = prev + 1;\n // Update session asynchronously\n incrementNodeRetryCount(sessionId, node.id, prev).catch((error) => {\n console.error(\"Failed to update retry count in session:\", error);\n });\n return newCount;\n });\n setDocStep(6);\n }\n };\n\n const handleRetryFromError = () => {\n // Note: retry count is already incremented in handleProcessingComplete\n // This function just handles navigation\n // Pour l'erreur 2.5 (face manquante), on conserve fileUploaded pour pré-remplir\n // l'upload avec la face déjà déposée. Pour les autres erreurs, on repart de zéro.\n if (errorCode !== \"2.5\") {\n setFileUploaded(null);\n }\n // Always stay on the current node and go back to upload step.\n // Never navigate to a different global step: if this node was reached via a\n // condition branch (e.g. \"true\"), navigating away would land on the other\n // branch (\"false\"). The retry means \"re-submit on THIS node\", not \"go back\n // in the journey\".\n setDocStep(3);\n };\n\n // Check if retry is allowed based on configuration\n const isRetryAllowed = () => {\n console.log(\"isRetryAllowed - Props:\", {\n allowResubmission: node.allowResubmission,\n maxResubmissionAttempts: node.maxResubmissionAttempts,\n retryCount,\n });\n // Specimen documents (code 8.x) block retry — user can only continue anyway\n if (errorCode?.startsWith(\"8\")) {\n return false;\n }\n // If allowResubmission is undefined (old journeys), allow unlimited retries\n if (node.allowResubmission === undefined) {\n return true;\n }\n // If allowResubmission is false, no retries allowed\n if (!node.allowResubmission) {\n return false;\n }\n // If allowResubmission is true, check against maxResubmissionAttempts\n if (node.maxResubmissionAttempts !== undefined) {\n return retryCount <= node.maxResubmissionAttempts;\n }\n // If maxResubmissionAttempts is not set, allow unlimited retries\n return true;\n };\n\n const handleContinueAnyway = () => {\n if (template) {\n stepObject.goToNextStep(node.id, template);\n } else {\n stepObject.setStep(stepObject.step + 1);\n }\n setDocStep(0);\n };\n\n const handleSuccessContinue = () => {\n if (template) {\n stepObject.goToNextStep(node.id, template);\n } else {\n stepObject.setStep(stepObject.step + 1);\n }\n setDocStep(0);\n };\n\n // Questionnaire de fallback NFC : l'utilisateur a déclaré ne pas avoir de puce.\n // On enregistre la raison (non bloquant) puis on poursuit selon le mode du nœud :\n // - nfcOrPhoto → flux photo/API du même nœud (intro/pays → upload → analyse), sans scan NFC\n // - nfcOnly → on saute le nœud (nœud suivant)\n const handleNfcFallback = async (\n reason: string,\n label: string,\n comment?: string,\n ) => {\n setNfcSkipped(true);\n try {\n await skipNfcWithReason(sessionId, { reason, label, comment });\n } catch (error) {\n console.error(\"Failed to persist NFC fallback reason:\", error);\n }\n\n const nfcMode = normalizeNfcMode(node.nfcMode);\n if (nfcMode === \"nfcOrPhoto\") {\n const hasIntroduction =\n node.introductionPage?.title !== undefined ||\n node.introductionPage?.description !== undefined;\n setDocStep(hasIntroduction ? 0 : 1);\n return;\n }\n\n if (template) {\n stepObject.goToNextStep(node.id, template);\n } else {\n stepObject.setStep(stepObject.step + 1);\n }\n };\n\n const handleBack = () => {\n const hasIntroduction =\n node.introductionPage?.title !== undefined ||\n node.introductionPage?.description !== undefined;\n\n // Le questionnaire de fallback (-2) revient au gate (-1)\n if (docStep === -2) {\n setDocStep(-1);\n return;\n }\n\n // En NFC, le premier écran réel (intro=0 sinon pays=1) revient au gate (-1)\n if (\n node.nfcEnabled === true &&\n docStep === (hasIntroduction ? 0 : 1)\n ) {\n setDocStep(-1);\n return;\n }\n\n if (docStep === 0) {\n stepObject.goBack();\n } else {\n setDocStep((prev) => prev - 1);\n }\n };\n\n switch (docStep) {\n case -10:\n return (\n <WalletProposal\n walletMode={normalizeWalletMode(node.walletMode)}\n onUseWallet={() => setDocStep(-11)}\n onDecline={handleWalletDeclineOrFail}\n />\n );\n case -11:\n return (\n <WalletVerificationStep\n sessionId={sessionId}\n nodeId={node.id}\n credentialType=\"pid\"\n walletMode={normalizeWalletMode(node.walletMode)}\n onCompleted={handleWalletVerificationCompleted}\n onFailedOrDeclined={handleWalletDeclineOrFail}\n />\n );\n case -1: {\n const hasIntroduction =\n node.introductionPage?.title !== undefined ||\n node.introductionPage?.description !== undefined;\n return (\n <NfcChipGate\n onConfirm={() => setDocStep(hasIntroduction ? 0 : 1)}\n // Pas de puce → questionnaire de fallback pour recueillir la raison\n onNoChip={() => setDocStep(-2)}\n />\n );\n }\n case -2:\n return <NfcFallbackSurvey onSubmit={handleNfcFallback} />;\n case 0:\n if (!documentTypeId) {\n console.error(\"DocumentCheck: Missing documentTypeId in step 0\");\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-red-500 text-4xl mb-4\">⚠️</div>\n <h2 className=\"text-xl font-bold text-red-600 mb-2\">\n {t(\n \"document_check.config_error.title\",\n \"Erreur de configuration\",\n )}\n </h2>\n <p className=\"text-gray-600 mb-4\">\n {t(\n \"document_check.config_error.description\",\n \"Type de document non spécifié.\",\n )}\n </p>\n <ButtonDesktop\n type=\"back\"\n className=\"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors\"\n onClick={() =>\n stepObject.setStep(Math.max(0, stepObject.step - 1))\n }\n >\n {t(\"document_check.config_error.back\", \"Retour\")}\n </ButtonDesktop>\n </div>\n );\n }\n return (\n <JDIPreIntroduction\n documentTypeId={documentTypeId}\n onContinue={() => setDocStep(1)}\n onBack={handleBack}\n introTitleText={\n node.introductionPage?.title || t(\"jdi.pre_introduction.title\")\n }\n introDescText={\n node.introductionPage?.description ||\n t(\"jdi.pre_introduction.description\")\n }\n />\n );\n case 1:\n return (\n <JDICountrySelection\n onCountrySelect={handleCountrySelect}\n onBack={handleBack}\n documentTypeId={documentTypeId}\n acceptedCountries={finalAcceptedCountries}\n countryIntroText={\n node.countrySelection?.title || t(\"jdi.country_selection.title\")\n }\n countryDescText={\n node.countrySelection?.description ||\n t(\"jdi.country_selection.description\")\n }\n />\n );\n case 2:\n return (\n <JDIDocumentSelection\n onDocumentSelect={handleDocumentTypeSelect}\n onBack={handleBack}\n documentTypeId={documentTypeId}\n sessionId={sessionId}\n chosenCountry={\n finalAcceptedCountries?.find((c) => c.code === selectedCountry) ||\n undefined\n }\n documentSelectionTitle={\n node.documentSelection?.title || t(\"jdi.document_selection.title\")\n }\n documentSelectionDescription={\n // En NFC, on laisse JDIDocumentSelection choisir le wording adapté\n // (subtitle_identity_nfc) plutôt que l'override \"téléverser\" du nœud.\n node.nfcEnabled === true\n ? undefined\n : node.documentSelection?.description ||\n t(\"jdi.document_selection.description\")\n }\n nfcEnabled={node.nfcEnabled === true}\n />\n );\n case 3:\n if (!selectedDocumentType) {\n console.error(\n \"DocumentCheck: selectedDocumentType is null for step 3!\",\n );\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-red-500 text-4xl mb-4\">⚠️</div>\n <h2 className=\"text-xl font-bold text-red-600 mb-2\">\n {t(\"document_check.selection_error.title\", \"Erreur de sélection\")}\n </h2>\n <p className=\"text-gray-600 mb-4\">\n {t(\n \"document_check.selection_error.description\",\n \"Aucun type de document sélectionné. Veuillez revenir à l'étape précédente.\",\n )}\n </p>\n <ButtonDesktop\n className=\"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors\"\n type=\"back\"\n onClick={() => setDocStep(2)}\n >\n {t(\n \"document_check.selection_error.back\",\n \"Retour à la sélection\",\n )}\n </ButtonDesktop>\n </div>\n );\n }\n\n if (isPictureAllowed && isDownloadAllowed && !selectedMethod) {\n return (\n <MobilePageLayout\n footer={\n <div className=\"w-full max-w-md mx-auto\">\n <ButtonDesktop\n type=\"back\"\n onClick={handleBack}\n className=\"w-full text-[#3C3C40] text-center font-poppins text-sm font-medium hover:underline py-2\"\n >\n {t(\"buttons.back\", \"Retour\")}\n </ButtonDesktop>\n </div>\n }\n >\n <div className=\"px-4 py-6 pt-11 md:px-8 md:py-8\">\n <div className=\"w-full max-w-md mx-auto space-y-6\">\n <div className=\"text-center space-y-4\">\n <Title className=\"text-xl md:text-2xl lg:text-3xl\">\n {t(\n \"document_check.method_selection.title\",\n \"Choisissez une méthode\",\n )}\n </Title>\n <Subtitle className=\"text-sm text-gray-600 leading-relaxed\">\n {t(\n \"document_check.method_selection.subtitle\",\n \"Comment souhaitez-vous ajouter votre document ?\",\n )}\n </Subtitle>\n </div>\n\n <div className=\"grid gap-4\">\n <button\n onClick={() => { setSelectedMethod(\"picture\"); logCaptureModeSelected(sessionId, \"picture\"); }}\n className=\"flex items-center p-4 bg-white border-2 border-gray-100 rounded-xl hover:border-teal-500 transition-colors text-left group\"\n >\n <div className=\"w-12 h-12 bg-teal-50 rounded-lg flex items-center justify-center text-teal-600 group-hover:bg-teal-100 transition-colors mr-4\">\n <Camera size={24} />\n </div>\n <div>\n <p className=\"font-semibold text-gray-900\">\n {t(\n \"document_check.method_selection.picture_title\",\n \"Prendre une photo\",\n )}\n </p>\n <p className=\"text-sm text-gray-500\">\n {t(\n \"document_check.method_selection.picture_desc\",\n \"Utilisez l'appareil photo de votre appareil\",\n )}\n </p>\n </div>\n </button>\n\n <button\n onClick={() => { setSelectedMethod(\"download\"); logCaptureModeSelected(sessionId, \"upload\"); }}\n className=\"flex items-center p-4 bg-white border-2 border-gray-100 rounded-xl hover:border-teal-500 transition-colors text-left group\"\n >\n <div className=\"w-12 h-12 bg-teal-50 rounded-lg flex items-center justify-center text-teal-600 group-hover:bg-teal-100 transition-colors mr-4\">\n <Upload size={24} />\n </div>\n <div>\n <p className=\"font-semibold text-gray-900\">\n {t(\n \"document_check.method_selection.download_title\",\n \"Téléverser un fichier\",\n )}\n </p>\n <p className=\"text-sm text-gray-500\">\n {t(\n \"document_check.method_selection.download_desc\",\n \"Sélectionnez un fichier sur votre appareil\",\n )}\n </p>\n </div>\n </button>\n </div>\n </div>\n </div>\n </MobilePageLayout>\n );\n }\n\n const activeMethod =\n selectedMethod ||\n (isPictureAllowed && isMobileCapture ? \"picture\" : \"download\");\n\n if (activeMethod === \"picture\" && isPictureAllowed) {\n const isSingleSided =\n selectedDocumentType?.id === \"passport\" ||\n selectedDocumentType?.id === \"pinkDriverLicense\";\n const onConfirm = node.withVideo\n ? handlePhotoConfirmedForVideo\n : handlePhotoConfirmation;\n\n if (node.withVideo && videoFlowPhase === \"video\") {\n return (\n <DocumentVideoCapture\n selectedDocumentType={selectedDocumentType}\n onComplete={handleDocumentVideoComplete}\n onBack={() => {\n setVideoFlowPhase(\"photo\");\n setCurrentPhotoStep(\"confirmation\");\n }}\n nodeId={node.id}\n sessionId={sessionId}\n previewOverrides={{\n recto: capturedImages.recto,\n verso: capturedImages.verso,\n }}\n />\n );\n }\n\n if (currentPhotoStep === \"before-recto\") {\n return (\n <BeforePhoto\n setStep={() => setCurrentPhotoStep(\"recto\")}\n isSingleSided={isSingleSided}\n onBack={() => setDocStep(2)}\n />\n );\n }\n if (currentPhotoStep === \"recto\") {\n return (\n <Photo\n onCapture={(imageData) => handlePhotoCapture(imageData, \"recto\")}\n />\n );\n }\n if (currentPhotoStep === \"before-verso\") {\n return (\n <BeforeVersoPhoto setStep={() => setCurrentPhotoStep(\"verso\")} />\n );\n }\n if (currentPhotoStep === \"verso\") {\n return (\n <Photo\n onCapture={(imageData) => handlePhotoCapture(imageData, \"verso\")}\n />\n );\n }\n if (currentPhotoStep === \"confirmation\") {\n return (\n <PhotoConfirmation\n imageUrl={capturedImages.recto || \"\"}\n versoImageUrl={capturedImages.verso}\n requiresTwoSides={!!capturedImages.verso}\n onConfirm={onConfirm}\n onRetry={() => setCurrentPhotoStep(\"before-recto\")}\n onRetryAfterProcessing={() => setCurrentPhotoStep(\"before-recto\")}\n fileUploaded={fileUploaded}\n isSingleSided={isSingleSided}\n />\n );\n }\n return (\n <BeforePhoto\n setStep={() => setCurrentPhotoStep(\"recto\")}\n isSingleSided={isSingleSided}\n onBack={() => setDocStep(2)}\n />\n );\n } else {\n return (\n <JDIDocumentUpload\n documentType={selectedDocumentType?.id || documentTypeId}\n documentTypeId={documentTypeId}\n documentLabel={selectedDocumentType?.label}\n onUpload={handleDocumentUpload}\n onBack={() => {\n if (isPictureAllowed && isDownloadAllowed) {\n setSelectedMethod(null);\n } else {\n setDocStep(2);\n }\n }}\n initialFront={errorCode === \"2.5\" ? fileUploaded?.front : null}\n initialBack={errorCode === \"2.5\" ? fileUploaded?.back : null}\n sessionId={sessionId}\n />\n );\n }\n case 4:\n return (\n <JDIProcessing\n documentType={selectedDocumentType?.id || documentTypeId}\n onProcessingComplete={handleProcessingComplete}\n fileUploaded={fileUploaded}\n documentTypeId={documentTypeId}\n retryCount={retryCount}\n documentTemplateId={selectedDocumentType?.documentTemplateId}\n nodeId={node.id}\n />\n );\n case 5:\n return (\n <JDISuccess\n documentType={selectedDocumentType?.id || documentTypeId}\n onContinue={handleSuccessContinue}\n errorCode={errorCode || undefined}\n />\n );\n case 6:\n return (\n <JDIError\n documentType={selectedDocumentType?.id || documentTypeId}\n onRetry={handleRetryFromError}\n onContinueAnyway={handleContinueAnyway}\n retryCount={retryCount}\n predictions={analysisData || undefined}\n errorCode={errorCode || undefined}\n allowResubmission={node.allowResubmission}\n maxResubmissionAttempts={node.maxResubmissionAttempts}\n isRetryAllowed={isRetryAllowed()}\n />\n );\n case 7:\n if (nfcPreparationError) {\n return (\n <MobilePageLayout\n footer={\n <div className=\"w-full max-w-md mx-auto\">\n <ButtonDesktop\n type=\"back\"\n onClick={() => setDocStep(2)}\n className=\"w-full text-[#3C3C40] text-center font-poppins text-sm font-medium hover:underline py-2\"\n >\n {t(\"buttons.back\", \"Retour\")}\n </ButtonDesktop>\n </div>\n }\n >\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-red-500 text-4xl mb-4\">⚠️</div>\n <h2 className=\"text-xl font-bold text-red-600 mb-2\">\n {t(\"nfc_scan.preparation_error_title\", \"Erreur de préparation NFC\")}\n </h2>\n <p className=\"text-gray-600 mb-4\">{nfcPreparationError}</p>\n </div>\n </MobilePageLayout>\n );\n }\n return (\n <NfcScanStep\n sessionId={sessionId}\n nodeId={node.id}\n stepObject={stepObject}\n template={template}\n onBack={() => {\n // Retour vers la sélection du document (corriger un mauvais choix). Le démontage de\n // NfcScanStep ferme le SSE via le cleanup du hook (pas d'appel backend nécessaire).\n const hasIntroduction =\n node.introductionPage?.title !== undefined ||\n node.introductionPage?.description !== undefined;\n hasRestoredNfcStep.current = true; // ne pas re-restaurer l'étape QR après ce retour\n setDocStep(hasIntroduction ? 0 : 1);\n }}\n />\n );\n default:\n console.error(`Invalid docStep: ${docStep}`);\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-red-500 text-4xl mb-4\">⚠️</div>\n <h2 className=\"text-xl font-bold text-red-600 mb-2\">\n {t(\"document_check.navigation_error.title\", \"Erreur de navigation\")}\n </h2>\n <p className=\"text-gray-600 mb-4\">\n {t(\n \"document_check.navigation_error.description\",\n \"Étape non valide. Veuillez recommencer.\",\n )}\n </p>\n <ButtonDesktop\n className=\"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors\"\n type=\"back\"\n onClick={() => setDocStep(0)}\n >\n {t(\"document_check.navigation_error.back\", \"Retour au début\")}\n </ButtonDesktop>\n </div>\n );\n }\n};\n\nexport default DocumentCheck;\n"],"names":["useI18n","getSession","useState","useEffect","__awaiter","getAllDocumentTemplates","getNodeRetryCount","useRef","useDocumentContext","useMemo","EUROPEAN_COUNTRY_CODES","__assign","ISO_COUNTRY_CODES","getDocTypeKey","dataUrlToBlob","resizeAfterCapture","blobToDataUrl","logPhotoCaptured","logPhotosValidated","logDocumentTypeSelected","getDocumentTemplateId","fetchWallets","updateSessionUserInput","skipWalletWithReason","logDocumentLoaded","logDocumentsValidated","incrementNodeRetryCount","skipNfcWithReason","_jsx","WalletProposal","WalletVerificationStep","NfcChipGate","NfcFallbackSurvey","_jsxs","ButtonDesktop","JDIPreIntroduction","JDICountrySelection","JDIDocumentSelection","MobilePageLayout","Title","Subtitle","logCaptureModeSelected","Camera","Upload","DocumentVideoCapture","BeforePhoto","Photo","BeforeVersoPhoto","PhotoConfirmation","JDIDocumentUpload","JDIProcessing","JDISuccess","JDIError","NfcScanStep"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwHA,IAAM,2BAA2B,GAAG,IAAI,GAAG,CAAC;IAC1C,UAAU;IACV,QAAQ;IACR,iBAAiB;AAClB,CAAA,CAAC;AAEF;;;;AAIG;AACH,IAAM,gBAAgB,GAAG,UAAC,IAAa,EAAA;AACrC,IAAA,OAAA,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,YAAY,GAAG,YAAY,GAAG,SAAS;AAAxE,CAAwE;AAE1E,IAAM,mBAAmB,GAAG,UAAC,IAAa,EAAA;IACxC,OAAA,IAAI,KAAK,YAAY,GAAG,YAAY,GAAG,eAAe;AAAtD,CAAsD;AAExD;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AACH,IAAM,aAAa,GAAG,UAAC,EAWF,EAAA;;AAVnB,IAAA,IAAA,UAAU,GAAA,EAAA,CAAA,UAAA,CAAA,CACV,SAAS,GAAA,EAAA,CAAA,SAAA,CAAA,CACT,IAAI,GAAA,EAAA,CAAA,IAAA,CAAA,CAC2B,EAAA,CAAA,cAAA,CAAA,KAC/B,cAAc,oBAAA,CAAA,CACd,iBAAiB,GAAA,EAAA,CAAA,iBAAA,CAAA,CACjB,EAAA,GAAA,EAAA,CAAA,eAAuB,CAAA,CAAvB,eAAe,GAAA,EAAA,KAAA,MAAA,GAAG,KAAK,GAAA,EAAA,CAAA,CACvB,oBAAoB,GAAA,EAAA,CAAA,oBAAA,CAAA,CACpB,QAAQ,GAAA,EAAA,CAAA,QAAA,CAAA,CACR,YAAY,GAAA,EAAA,CAAA;AAEJ,IAAA,IAAA,CAAC,GAAKA,eAAO,EAAE,EAAd;AACD,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JA,cAAA,CAACM,qBAAa,IACZ,SAAS,EAAC,iFAAiF,EAC3F,IAAI,EAAC,MAAM,EACX,OAAO,EAAE,YAAA,EAAM,OAAA,UAAU,CAAC,CAAC,CAAC,CAAA,CAAb,CAAa,EAAA,QAAA,EAE3B,CAAC,CAAC,sCAAsC,EAAE,iBAAiB,CAAC,EAAA,CAC/C,CAAA,EAAA,CACZ;;AAGd;;;;"}
|
|
@@ -20,6 +20,7 @@ var SignatureElectronic = require('../signature-electronic/SignatureElectronic.j
|
|
|
20
20
|
var ExternalVerificationNodeHandler = require('./ExternalVerificationNodeHandler.js');
|
|
21
21
|
var PdfGeneration = require('../session/PdfGeneration.js');
|
|
22
22
|
var LegalConsentNode = require('../legal-consent/LegalConsentNode.js');
|
|
23
|
+
var AgeControl = require('../wallet/AgeControl.js');
|
|
23
24
|
|
|
24
25
|
var TemplateNodeRenderer = function (_a) {
|
|
25
26
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
@@ -97,7 +98,7 @@ var TemplateNodeRenderer = function (_a) {
|
|
|
97
98
|
return (jsxRuntime.jsx(DocumentCollection.default, { node: node, stepObject: stepObject, sessionId: sessionId, template: session.template, onContinueOnPC: onContinueOnPC, allowedDocumentTypes: (node.allowedDocumentTypes || []).map(function (docType) { return (tslib_es6.__assign(tslib_es6.__assign({}, docType), { side: typeof docType.side === "string" ||
|
|
98
99
|
typeof docType.side === "number"
|
|
99
100
|
? docType.side
|
|
100
|
-
: undefined })); }), allowedAddingMethods: node.allowedAddingMethods || ["download"], introductionPage: node.introductionPage, documentSelection: node.documentSelection, allowResubmission: node.allowResubmission, maxResubmissionAttempts: node.maxResubmissionAttempts }, "doc-collection-".concat(templateIndex)));
|
|
101
|
+
: undefined })); }), allowedAddingMethods: node.allowedAddingMethods || ["download"], introductionPage: node.introductionPage, documentSelection: node.documentSelection, allowResubmission: node.allowResubmission, maxResubmissionAttempts: node.maxResubmissionAttempts, countryCode: userInput === null || userInput === void 0 ? void 0 : userInput.countryCode }, "doc-collection-".concat(templateIndex)));
|
|
101
102
|
}
|
|
102
103
|
case "document-selection":
|
|
103
104
|
case "controle-jdi": {
|
|
@@ -124,6 +125,8 @@ var TemplateNodeRenderer = function (_a) {
|
|
|
124
125
|
case "jdd":
|
|
125
126
|
console.log("🚧 Rendering JDD Work in Progress component");
|
|
126
127
|
return jsxRuntime.jsx(JDDWorkInProgress.default, { onContinue: onContinueOnPC });
|
|
128
|
+
case "age-control":
|
|
129
|
+
return (jsxRuntime.jsx(AgeControl.default, { sessionId: sessionId, node: node, stepObject: stepObject, template: session.template, countryCode: userInput === null || userInput === void 0 ? void 0 : userInput.countryCode }, "age-control-".concat(templateIndex)));
|
|
127
130
|
case "condition":
|
|
128
131
|
console.debug("🔀 Rendering Condition Node Handler component and well");
|
|
129
132
|
return (jsxRuntime.jsx(ConditionNodeHandler.default, { node: node, session: session, templateNodes: templateNodes, stepObject: stepObject, userInput: userInput, contactInfo: contactInfo }));
|
|
@@ -169,6 +172,7 @@ var TemplateNodeRenderer = function (_a) {
|
|
|
169
172
|
"video-capture",
|
|
170
173
|
"country-selection",
|
|
171
174
|
"identity-control",
|
|
175
|
+
"age-control",
|
|
172
176
|
"jdd",
|
|
173
177
|
"condition",
|
|
174
178
|
"custom",
|