datakeen-session-react 1.1.180 → 1.1.182

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.
Files changed (72) hide show
  1. package/.gitlab-ci.yml +115 -46
  2. package/dist/cjs/components/document-collection/DocumentCollection.js +12 -7
  3. package/dist/cjs/components/document-collection/DocumentCollection.js.map +1 -1
  4. package/dist/cjs/components/document-collection/DocumentError.js +16 -12
  5. package/dist/cjs/components/document-collection/DocumentError.js.map +1 -1
  6. package/dist/cjs/components/document-collection/DocumentProcessing.js +17 -5
  7. package/dist/cjs/components/document-collection/DocumentProcessing.js.map +1 -1
  8. package/dist/cjs/components/jdi/JDIError.js +14 -10
  9. package/dist/cjs/components/jdi/JDIError.js.map +1 -1
  10. package/dist/cjs/components/jdi/JDIProcessing.js +13 -5
  11. package/dist/cjs/components/jdi/JDIProcessing.js.map +1 -1
  12. package/dist/cjs/components/session/DocumentCheck.js +15 -10
  13. package/dist/cjs/components/session/DocumentCheck.js.map +1 -1
  14. package/dist/cjs/components/session/Selfie.js +3 -1
  15. package/dist/cjs/components/session/Selfie.js.map +1 -1
  16. package/dist/cjs/components/session/UserInputForm/AddressFields.js +1 -1
  17. package/dist/cjs/components/session/UserInputForm/AddressFields.js.map +1 -1
  18. package/dist/cjs/components/session/UserInputForm/LegalRepFields.js +5 -1
  19. package/dist/cjs/components/session/UserInputForm/LegalRepFields.js.map +1 -1
  20. package/dist/cjs/components/signature-electronic/SignatureElectronic.js +17 -4
  21. package/dist/cjs/components/signature-electronic/SignatureElectronic.js.map +1 -1
  22. package/dist/cjs/components/signature-electronic/SignedDocumentPreview.js +130 -0
  23. package/dist/cjs/components/signature-electronic/SignedDocumentPreview.js.map +1 -0
  24. package/dist/cjs/components/template/ExternalVerificationNodeHandler.js +93 -45
  25. package/dist/cjs/components/template/ExternalVerificationNodeHandler.js.map +1 -1
  26. package/dist/cjs/constants/userInputForm.js.map +1 -1
  27. package/dist/cjs/hooks/useUserInputForm.js +11 -1
  28. package/dist/cjs/hooks/useUserInputForm.js.map +1 -1
  29. package/dist/cjs/i18n/en.json.js +9 -3
  30. package/dist/cjs/i18n/en.json.js.map +1 -1
  31. package/dist/cjs/i18n/fr.json.js +9 -3
  32. package/dist/cjs/i18n/fr.json.js.map +1 -1
  33. package/dist/cjs/index.css.js +1 -1
  34. package/dist/cjs/types/session.js.map +1 -1
  35. package/dist/cjs/utils/analysisErrors.js +22 -0
  36. package/dist/cjs/utils/analysisErrors.js.map +1 -0
  37. package/dist/esm/components/document-collection/DocumentCollection.js +12 -7
  38. package/dist/esm/components/document-collection/DocumentCollection.js.map +1 -1
  39. package/dist/esm/components/document-collection/DocumentError.js +17 -13
  40. package/dist/esm/components/document-collection/DocumentError.js.map +1 -1
  41. package/dist/esm/components/document-collection/DocumentProcessing.js +17 -5
  42. package/dist/esm/components/document-collection/DocumentProcessing.js.map +1 -1
  43. package/dist/esm/components/jdi/JDIError.js +15 -11
  44. package/dist/esm/components/jdi/JDIError.js.map +1 -1
  45. package/dist/esm/components/jdi/JDIProcessing.js +13 -5
  46. package/dist/esm/components/jdi/JDIProcessing.js.map +1 -1
  47. package/dist/esm/components/session/DocumentCheck.js +15 -10
  48. package/dist/esm/components/session/DocumentCheck.js.map +1 -1
  49. package/dist/esm/components/session/Selfie.js +3 -1
  50. package/dist/esm/components/session/Selfie.js.map +1 -1
  51. package/dist/esm/components/session/UserInputForm/AddressFields.js +1 -1
  52. package/dist/esm/components/session/UserInputForm/AddressFields.js.map +1 -1
  53. package/dist/esm/components/session/UserInputForm/LegalRepFields.js +5 -1
  54. package/dist/esm/components/session/UserInputForm/LegalRepFields.js.map +1 -1
  55. package/dist/esm/components/signature-electronic/SignatureElectronic.js +17 -4
  56. package/dist/esm/components/signature-electronic/SignatureElectronic.js.map +1 -1
  57. package/dist/esm/components/signature-electronic/SignedDocumentPreview.js +126 -0
  58. package/dist/esm/components/signature-electronic/SignedDocumentPreview.js.map +1 -0
  59. package/dist/esm/components/template/ExternalVerificationNodeHandler.js +94 -46
  60. package/dist/esm/components/template/ExternalVerificationNodeHandler.js.map +1 -1
  61. package/dist/esm/constants/userInputForm.js.map +1 -1
  62. package/dist/esm/hooks/useUserInputForm.js +11 -1
  63. package/dist/esm/hooks/useUserInputForm.js.map +1 -1
  64. package/dist/esm/i18n/en.json.js +9 -3
  65. package/dist/esm/i18n/en.json.js.map +1 -1
  66. package/dist/esm/i18n/fr.json.js +9 -3
  67. package/dist/esm/i18n/fr.json.js.map +1 -1
  68. package/dist/esm/index.css.js +1 -1
  69. package/dist/esm/types/session.js.map +1 -1
  70. package/dist/esm/utils/analysisErrors.js +19 -0
  71. package/dist/esm/utils/analysisErrors.js.map +1 -0
  72. package/package.json +1 -1
@@ -23,6 +23,13 @@ var STANDARD_FIELD_ALIASES = {
23
23
  prenom: ['firstName', 'first_name', 'prenom'],
24
24
  nom: ['lastName', 'last_name', 'surname', 'familyName', 'nom'],
25
25
  date_naissance: ['birthDate', 'birth_date', 'dateOfBirth', 'date_naissance'],
26
+ // Champs d'un nœud identity-legal-rep (RL) : la clé de config (builder) diffère
27
+ // de la clé réellement soumise par LegalRepFields — sans cet alias, la
28
+ // résolution échouait silencieusement dès qu'un nœud identity-legal-rep était
29
+ // choisi comme "Nœud source Nom/Prénom" (compareTargets ne trouvait jamais la
30
+ // valeur, causant un person_mismatch systématique).
31
+ legalRepresentativePrenom: ['legalRepresentativeFirstName', 'legalRepresentativePrenom'],
32
+ legalRepresentativeNom: ['legalRepresentativeLastName', 'legalRepresentativeNom'],
26
33
  };
27
34
  var normalizeReferenceField = function (field) {
28
35
  if (!field)
@@ -62,19 +69,25 @@ var ExternalVerificationNodeHandler = function (_a) {
62
69
  var nodeData = node;
63
70
  var apiType = String(nodeData.targetApi || 'INSEE');
64
71
  var isInpiRbe = apiType === 'INPI_RBE';
72
+ // Paramétrable depuis le journey builder (panneau "Configuration de la base
73
+ // externe"), par nœud. Absent/true = comportement actuel inchangé.
74
+ var allowContinueOnFailure = nodeData.allowContinueOnFailure !== false;
65
75
  var _o = React.useState('loading'), phase = _o[0], setPhase = _o[1];
66
76
  var _p = React.useState(null), errorScreenData = _p[0], setErrorScreenData = _p[1];
67
77
  var _q = React.useState(function () {
68
78
  if (isInpiRbe) {
69
79
  return [
70
80
  {
71
- title: t('inpi_verification.step1', 'Appel au RNE'),
72
- subtitle: t('inpi_verification.step1_sub', 'Connexion au registre national des entreprises'),
81
+ // Générique : le backend interroge le RNE puis, si besoin, le RNA en
82
+ // fallback (associations) via un seul appel la source réelle n'est
83
+ // connue qu'à la réponse finale (cf. inpiData.source).
84
+ title: t('inpi_verification.step1', 'Vérification du SIREN auprès des registres officiels'),
85
+ subtitle: t('inpi_verification.step1_sub', 'Connexion aux registres RNE et RNA'),
73
86
  status: 'active',
74
87
  },
75
88
  {
76
- title: t('inpi_verification.step2', "Récupération des données d'entreprise"),
77
- subtitle: t('inpi_verification.step2_sub', 'Lecture des informations légales et des dirigeants'),
89
+ title: t('inpi_verification.step2', "Récupération des données d'identité"),
90
+ subtitle: t('inpi_verification.step2_sub', 'Lecture des informations légales et des responsables'),
78
91
  status: 'pending',
79
92
  },
80
93
  {
@@ -105,10 +118,10 @@ var ExternalVerificationNodeHandler = function (_a) {
105
118
  React.useEffect(function () {
106
119
  var abortController = new AbortController();
107
120
  var run = function () { return tslib_es6.__awaiter(void 0, void 0, void 0, function () {
108
- var result, referenceField, referenceValueMasked, resolvedReferenceValue, referenceNodeId, referenceVariable, submittedFirstName, submittedLastName, nodeInput, userInputFlat, lookupKeys, referenceValue, allCustomFields, _i, _a, _b, value, str, comparisonConfig, cfg, personNodeInput, flat, firstNameKeys, lastNameKeys, birthDateKeys, dateOfBirth, response, res, apiErr_1, apiResult, inpi, cfg;
109
- var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
110
- return tslib_es6.__generator(this, function (_s) {
111
- switch (_s.label) {
121
+ var result, referenceField, referenceValueMasked, resolvedReferenceValue, referenceNodeId, referenceVariable, submittedFirstName, submittedLastName, submittedSiren, nodeInput, userInputFlat, lookupKeys, referenceValue, allCustomFields, _i, _a, _b, value, str, comparisonConfig, cfg, personNodeInput, flat, isPersonneMorale, sirenKeys, firstNameKeys, lastNameKeys, birthDateKeys, dateOfBirth, response, res, apiErr_1, apiResult, inpi, cfg, isPersonneMorale_1;
122
+ var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
123
+ return tslib_es6.__generator(this, function (_v) {
124
+ switch (_v.label) {
112
125
  case 0:
113
126
  result = {
114
127
  isVerified: false,
@@ -121,9 +134,10 @@ var ExternalVerificationNodeHandler = function (_a) {
121
134
  referenceVariable = String(nodeData.referenceVariable || '');
122
135
  submittedFirstName = '';
123
136
  submittedLastName = '';
124
- _s.label = 1;
137
+ submittedSiren = '';
138
+ _v.label = 1;
125
139
  case 1:
126
- _s.trys.push([1, 9, , 10]);
140
+ _v.trys.push([1, 9, , 10]);
127
141
  if (!(session === null || session === void 0 ? void 0 : session.id))
128
142
  throw new Error('Session ID is missing');
129
143
  referenceField = normalizeReferenceField(String(nodeData.referenceField || referenceVariable || ''));
@@ -173,45 +187,62 @@ var ExternalVerificationNodeHandler = function (_a) {
173
187
  cfg = nodeData.comparisonConfig;
174
188
  personNodeInput = (_d = userInput[cfg.personReferenceNodeId]) !== null && _d !== void 0 ? _d : {};
175
189
  flat = userInput;
176
- firstNameKeys = expandFieldKey((_e = cfg.personFirstNameField) !== null && _e !== void 0 ? _e : '').filter(Boolean);
177
- lastNameKeys = expandFieldKey((_f = cfg.personLastNameField) !== null && _f !== void 0 ? _f : '').filter(Boolean);
178
- birthDateKeys = cfg.personBirthDateField
179
- ? expandFieldKey(cfg.personBirthDateField).filter(Boolean)
180
- : [];
181
- submittedFirstName = (_g = resolveFieldValue(personNodeInput, flat, firstNameKeys)) !== null && _g !== void 0 ? _g : '';
182
- submittedLastName = (_h = resolveFieldValue(personNodeInput, flat, lastNameKeys)) !== null && _h !== void 0 ? _h : '';
183
- dateOfBirth = cfg.compareBirthDate && birthDateKeys.length
184
- ? resolveFieldValue(personNodeInput, flat, birthDateKeys)
185
- : undefined;
186
- if (submittedFirstName && submittedLastName) {
187
- comparisonConfig = tslib_es6.__assign({ firstName: submittedFirstName, lastName: submittedLastName, compareTargets: (_j = cfg.compareTargets) !== null && _j !== void 0 ? _j : ['mandataires'] }, (dateOfBirth ? { dateOfBirth: dateOfBirth } : {}));
190
+ isPersonneMorale = cfg.personType === 'MORALE';
191
+ if (isPersonneMorale) {
192
+ sirenKeys = expandFieldKey((_e = cfg.personSirenField) !== null && _e !== void 0 ? _e : '').filter(Boolean);
193
+ submittedSiren = (_f = resolveFieldValue(personNodeInput, flat, sirenKeys)) !== null && _f !== void 0 ? _f : '';
194
+ if (submittedSiren) {
195
+ comparisonConfig = {
196
+ personType: 'MORALE',
197
+ siren: submittedSiren,
198
+ // Un RBE est toujours une personne physique en droit
199
+ // français : forcé à 'mandataires' quel que soit le
200
+ // contenu de cfg.compareTargets (défense en profondeur).
201
+ compareTargets: ['mandataires'],
202
+ };
203
+ }
204
+ }
205
+ else {
206
+ firstNameKeys = expandFieldKey((_g = cfg.personFirstNameField) !== null && _g !== void 0 ? _g : '').filter(Boolean);
207
+ lastNameKeys = expandFieldKey((_h = cfg.personLastNameField) !== null && _h !== void 0 ? _h : '').filter(Boolean);
208
+ birthDateKeys = cfg.personBirthDateField
209
+ ? expandFieldKey(cfg.personBirthDateField).filter(Boolean)
210
+ : [];
211
+ submittedFirstName = (_j = resolveFieldValue(personNodeInput, flat, firstNameKeys)) !== null && _j !== void 0 ? _j : '';
212
+ submittedLastName = (_k = resolveFieldValue(personNodeInput, flat, lastNameKeys)) !== null && _k !== void 0 ? _k : '';
213
+ dateOfBirth = cfg.compareBirthDate && birthDateKeys.length
214
+ ? resolveFieldValue(personNodeInput, flat, birthDateKeys)
215
+ : undefined;
216
+ if (submittedFirstName && submittedLastName) {
217
+ comparisonConfig = tslib_es6.__assign({ firstName: submittedFirstName, lastName: submittedLastName, compareTargets: (_l = cfg.compareTargets) !== null && _l !== void 0 ? _l : ['mandataires'] }, (dateOfBirth ? { dateOfBirth: dateOfBirth } : {}));
218
+ }
188
219
  }
189
220
  }
190
221
  if (isInpiRbe)
191
222
  advanceStep(1);
192
- _s.label = 4;
223
+ _v.label = 4;
193
224
  case 4:
194
- _s.trys.push([4, 7, , 8]);
195
- return [4 /*yield*/, api.apiService.post("/session/sdk/".concat(session.id, "/verify-external/").concat(node.id), tslib_es6.__assign({ apiType: apiType, referenceValue: referenceValue, referenceField: referenceField }, (comparisonConfig ? { comparisonConfig: comparisonConfig } : {})), { signal: abortController.signal })];
225
+ _v.trys.push([4, 7, , 8]);
226
+ return [4 /*yield*/, api.apiService.post("/session/sdk/".concat(session.id, "/verify-external/").concat(node.id), tslib_es6.__assign({ apiType: apiType, referenceValue: referenceValue, referenceField: referenceField, enableRnaFallback: isInpiRbe && nodeData.rnaFallbackEnabled === true }, (comparisonConfig ? { comparisonConfig: comparisonConfig } : {})), { signal: abortController.signal })];
196
227
  case 5:
197
- response = _s.sent();
228
+ response = _v.sent();
198
229
  if (isInpiRbe)
199
230
  advanceStep(2);
200
231
  return [4 /*yield*/, new Promise(function (r) { return setTimeout(r, 600); })];
201
232
  case 6:
202
- _s.sent();
203
- res = (_k = response.data) === null || _k === void 0 ? void 0 : _k.data;
233
+ _v.sent();
234
+ res = (_m = response.data) === null || _m === void 0 ? void 0 : _m.data;
204
235
  if (res && typeof res.isVerified === 'boolean') {
205
236
  result = res;
206
237
  }
207
238
  return [3 /*break*/, 8];
208
239
  case 7:
209
- apiErr_1 = _s.sent();
240
+ apiErr_1 = _v.sent();
210
241
  if (abortController.signal.aborted)
211
242
  return [2 /*return*/];
212
243
  if (isInpiRbe)
213
244
  advanceStep(2);
214
- apiResult = (_m = (_l = apiErr_1 === null || apiErr_1 === void 0 ? void 0 : apiErr_1.response) === null || _l === void 0 ? void 0 : _l.data) === null || _m === void 0 ? void 0 : _m.data;
245
+ apiResult = (_p = (_o = apiErr_1 === null || apiErr_1 === void 0 ? void 0 : apiErr_1.response) === null || _o === void 0 ? void 0 : _o.data) === null || _p === void 0 ? void 0 : _p.data;
215
246
  if (apiResult && typeof apiResult.isVerified === 'boolean') {
216
247
  result = apiResult;
217
248
  }
@@ -226,7 +257,7 @@ var ExternalVerificationNodeHandler = function (_a) {
226
257
  return [3 /*break*/, 8];
227
258
  case 8: return [3 /*break*/, 10];
228
259
  case 9:
229
- _s.sent();
260
+ _v.sent();
230
261
  result = {
231
262
  isVerified: false,
232
263
  status: 'external_error',
@@ -256,15 +287,24 @@ var ExternalVerificationNodeHandler = function (_a) {
256
287
  if (result.status === 'person_mismatch') {
257
288
  inpi = result.inpiData;
258
289
  cfg = nodeData.comparisonConfig;
290
+ isPersonneMorale_1 = (cfg === null || cfg === void 0 ? void 0 : cfg.personType) === 'MORALE';
259
291
  setErrorScreenData({
260
292
  submittedLastName: submittedLastName,
261
293
  submittedFirstName: submittedFirstName,
262
- mandataires: ((_o = inpi === null || inpi === void 0 ? void 0 : inpi.mandataires) !== null && _o !== void 0 ? _o : []).filter(function (m) { return m.type === 'individu'; }),
263
- beneficiairesEffectifs: (_p = inpi === null || inpi === void 0 ? void 0 : inpi.beneficiairesEffectifs) !== null && _p !== void 0 ? _p : [],
264
- compareTargets: (_q = cfg === null || cfg === void 0 ? void 0 : cfg.compareTargets) !== null && _q !== void 0 ? _q : ['mandataires'],
265
- personNodeId: (_r = cfg === null || cfg === void 0 ? void 0 : cfg.personReferenceNodeId) !== null && _r !== void 0 ? _r : '',
294
+ submittedSiren: isPersonneMorale_1 ? submittedSiren : undefined,
295
+ // En mode personne morale, seuls les mandataires personne morale ont
296
+ // un sens (un RBE est toujours une personne physique) ; en mode
297
+ // physique, comportement inchangé (mandataires individus uniquement).
298
+ mandataires: ((_q = inpi === null || inpi === void 0 ? void 0 : inpi.mandataires) !== null && _q !== void 0 ? _q : []).filter(function (m) {
299
+ return isPersonneMorale_1 ? m.type === 'personne_morale' : m.type === 'individu';
300
+ }),
301
+ beneficiairesEffectifs: (_r = inpi === null || inpi === void 0 ? void 0 : inpi.beneficiairesEffectifs) !== null && _r !== void 0 ? _r : [],
302
+ compareTargets: isPersonneMorale_1 ? ['mandataires'] : ((_s = cfg === null || cfg === void 0 ? void 0 : cfg.compareTargets) !== null && _s !== void 0 ? _s : ['mandataires']),
303
+ personNodeId: (_t = cfg === null || cfg === void 0 ? void 0 : cfg.personReferenceNodeId) !== null && _t !== void 0 ? _t : '',
304
+ targetDenomination: (_u = inpi === null || inpi === void 0 ? void 0 : inpi.identite) === null || _u === void 0 ? void 0 : _u.denomination,
266
305
  siren: resolvedReferenceValue,
267
306
  sirenNodeId: referenceNodeId,
307
+ source: inpi === null || inpi === void 0 ? void 0 : inpi.source,
268
308
  });
269
309
  setPhase('mismatch');
270
310
  }
@@ -278,6 +318,7 @@ var ExternalVerificationNodeHandler = function (_a) {
278
318
  personNodeId: '',
279
319
  siren: resolvedReferenceValue,
280
320
  sirenNodeId: referenceNodeId,
321
+ isDoubleNotFound: result.errorCode === 'NOT_FOUND_RNE_RNA',
281
322
  });
282
323
  setPhase('not_found');
283
324
  }
@@ -327,23 +368,30 @@ var ExternalVerificationNodeHandler = function (_a) {
327
368
  var showBeneficiaires = ((_b = d === null || d === void 0 ? void 0 : d.compareTargets) === null || _b === void 0 ? void 0 : _b.includes('beneficiairesEffectifs')) && ((_d = (_c = d === null || d === void 0 ? void 0 : d.beneficiairesEffectifs) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0;
328
369
  var showMandataires = (!((_e = d === null || d === void 0 ? void 0 : d.compareTargets) === null || _e === void 0 ? void 0 : _e.length) || ((_f = d === null || d === void 0 ? void 0 : d.compareTargets) === null || _f === void 0 ? void 0 : _f.includes('mandataires'))) &&
329
370
  ((_h = (_g = d === null || d === void 0 ? void 0 : d.mandataires) === null || _g === void 0 ? void 0 : _g.length) !== null && _h !== void 0 ? _h : 0) > 0;
330
- var personListLabel = ((_j = d === null || d === void 0 ? void 0 : d.compareTargets) === null || _j === void 0 ? void 0 : _j.includes('beneficiairesEffectifs')) && !((_k = d === null || d === void 0 ? void 0 : d.compareTargets) === null || _k === void 0 ? void 0 : _k.includes('mandataires'))
331
- ? t('inpi_verification.beneficiaires_label', 'Bénéficiaires effectifs renseignés au RNE')
332
- : ((_l = d === null || d === void 0 ? void 0 : d.compareTargets) === null || _l === void 0 ? void 0 : _l.includes('mandataires')) && !((_m = d === null || d === void 0 ? void 0 : d.compareTargets) === null || _m === void 0 ? void 0 : _m.includes('beneficiairesEffectifs'))
333
- ? t('inpi_verification.mandataires_label', 'Mandataires renseignés au RNE')
334
- : t('inpi_verification.persons_label', 'Personnes renseignées au RNE');
335
- return (jsxRuntime.jsxs("div", { className: "flex flex-col justify-between h-full w-full", children: [jsxRuntime.jsx("div", { className: "flex-1 px-4 py-6 pt-11 md:px-8 md:py-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto space-y-6", children: [jsxRuntime.jsx("div", { className: "text-center", children: jsxRuntime.jsx("div", { className: "mx-auto w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mb-4", children: jsxRuntime.jsx("div", { className: "w-8 h-8 bg-red-500 rounded-full flex items-center justify-center", children: jsxRuntime.jsx("span", { className: "text-white text-lg", children: "\u2715" }) }) }) }), jsxRuntime.jsxs("div", { className: "text-center space-y-4", children: [jsxRuntime.jsx(Title.default, { className: "text-xl md:text-2xl lg:text-3xl text-red-600", children: t('inpi_verification.mismatch_title', 'Identité non confirmée') }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm text-gray-600 leading-relaxed", children: t('inpi_verification.mismatch_desc', "Les informations saisies ne correspondent à aucune personne déclarée à l'INPI pour cette société.") })] }), d && (d.submittedLastName || d.submittedFirstName) && (jsxRuntime.jsxs("div", { className: "bg-red-50 border border-red-200 rounded-lg p-4", children: [jsxRuntime.jsx("h3", { className: "font-medium text-red-900 mb-2", children: t('errors.problems_detected', 'Problèmes détectés') }), jsxRuntime.jsxs("div", { className: "text-sm text-red-800 space-y-1", children: [d.submittedLastName && (jsxRuntime.jsxs("p", { children: [t('inpi_verification.submitted_last_name', 'Nom saisi'), ' : ', jsxRuntime.jsx("strong", { children: d.submittedLastName })] })), d.submittedFirstName && (jsxRuntime.jsxs("p", { children: [t('inpi_verification.submitted_first_name', 'Prénom saisi'), ' : ', jsxRuntime.jsx("strong", { children: d.submittedFirstName })] }))] })] })), (showMandataires || showBeneficiaires) && (jsxRuntime.jsxs("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4", children: [jsxRuntime.jsx("h3", { className: "font-medium text-blue-900 mb-2", children: personListLabel }), jsxRuntime.jsxs("div", { className: "text-sm text-blue-800 space-y-1", children: [showMandataires && d.mandataires.map(function (m, i) {
336
- var _a, _b;
337
- return (jsxRuntime.jsxs("p", { children: [jsxRuntime.jsx("strong", { children: (_a = m.nom) !== null && _a !== void 0 ? _a : '—' }), ((_b = m.prenoms) !== null && _b !== void 0 ? _b : []).length > 0 && " ".concat(m.prenoms.join(' '))] }, "m-".concat(i)));
371
+ var isRna = (d === null || d === void 0 ? void 0 : d.source) === 'RNA';
372
+ var personListLabel = isRna
373
+ ? t('inpi_verification.dirigeants_label', 'Dirigeants renseignés au RNA')
374
+ : ((_j = d === null || d === void 0 ? void 0 : d.compareTargets) === null || _j === void 0 ? void 0 : _j.includes('beneficiairesEffectifs')) && !((_k = d === null || d === void 0 ? void 0 : d.compareTargets) === null || _k === void 0 ? void 0 : _k.includes('mandataires'))
375
+ ? t('inpi_verification.beneficiaires_label', 'Bénéficiaires effectifs renseignés au RNE')
376
+ : ((_l = d === null || d === void 0 ? void 0 : d.compareTargets) === null || _l === void 0 ? void 0 : _l.includes('mandataires')) && !((_m = d === null || d === void 0 ? void 0 : d.compareTargets) === null || _m === void 0 ? void 0 : _m.includes('beneficiairesEffectifs'))
377
+ ? t('inpi_verification.mandataires_label', 'Mandataires renseignés au RNE')
378
+ : t('inpi_verification.persons_label', 'Personnes renseignées au RNE');
379
+ return (jsxRuntime.jsxs("div", { className: "flex flex-col justify-between h-full w-full", children: [jsxRuntime.jsx("div", { className: "flex-1 px-4 py-6 pt-11 md:px-8 md:py-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto space-y-6", children: [jsxRuntime.jsx("div", { className: "text-center", children: jsxRuntime.jsx("div", { className: "mx-auto w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mb-4", children: jsxRuntime.jsx("div", { className: "w-8 h-8 bg-red-500 rounded-full flex items-center justify-center", children: jsxRuntime.jsx("span", { className: "text-white text-lg", children: "\u2715" }) }) }) }), jsxRuntime.jsxs("div", { className: "text-center space-y-4", children: [jsxRuntime.jsx(Title.default, { className: "text-xl md:text-2xl lg:text-3xl text-red-600", children: t('inpi_verification.mismatch_title', 'Identité non confirmée') }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm text-gray-600 leading-relaxed", children: (d === null || d === void 0 ? void 0 : d.targetDenomination)
380
+ ? t('inpi_verification.mismatch_desc_denomination', "Le responsable l\u00E9gal saisi ne fait pas partie des responsables l\u00E9gaux ou b\u00E9n\u00E9ficiaires effectifs de la soci\u00E9t\u00E9 ".concat(d.targetDenomination))
381
+ : t('inpi_verification.mismatch_desc', "Les informations saisies ne correspondent à aucune personne déclarée à l'INPI pour cette société.") })] }), d && (d.submittedLastName || d.submittedFirstName || d.submittedSiren) && (jsxRuntime.jsxs("div", { className: "bg-red-50 border border-red-200 rounded-lg p-4", children: [jsxRuntime.jsx("h3", { className: "font-medium text-red-900 mb-2", children: t('errors.problems_detected', 'Problèmes détectés') }), jsxRuntime.jsxs("div", { className: "text-sm text-red-800 space-y-1", children: [d.submittedSiren && (jsxRuntime.jsxs("p", { children: [t('inpi_verification.submitted_siren', 'SIREN saisi'), ' : ', jsxRuntime.jsx("strong", { children: d.submittedSiren })] })), d.submittedLastName && (jsxRuntime.jsxs("p", { children: [t('inpi_verification.submitted_last_name', 'Nom saisi'), ' : ', jsxRuntime.jsx("strong", { children: d.submittedLastName })] })), d.submittedFirstName && (jsxRuntime.jsxs("p", { children: [t('inpi_verification.submitted_first_name', 'Prénom saisi'), ' : ', jsxRuntime.jsx("strong", { children: d.submittedFirstName })] }))] })] })), (showMandataires || showBeneficiaires) && (jsxRuntime.jsxs("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4", children: [jsxRuntime.jsx("h3", { className: "font-medium text-blue-900 mb-2", children: personListLabel }), jsxRuntime.jsxs("div", { className: "text-sm text-blue-800 space-y-1", children: [showMandataires && d.mandataires.map(function (m, i) {
382
+ var _a, _b, _c;
383
+ return (jsxRuntime.jsx("p", { children: m.type === 'personne_morale' ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("strong", { children: (_a = m.denominationSociale) !== null && _a !== void 0 ? _a : '—' }), m.siren && " (SIREN ".concat(m.siren, ")")] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("strong", { children: (_b = m.nom) !== null && _b !== void 0 ? _b : '—' }), ((_c = m.prenoms) !== null && _c !== void 0 ? _c : []).length > 0 && " ".concat(m.prenoms.join(' '))] })) }, "m-".concat(i)));
338
384
  }), showBeneficiaires && d.beneficiairesEffectifs.map(function (b, i) {
339
385
  var _a, _b;
340
386
  return (jsxRuntime.jsxs("p", { children: [jsxRuntime.jsx("strong", { children: (_a = b.nom) !== null && _a !== void 0 ? _a : '—' }), ((_b = b.prenoms) !== null && _b !== void 0 ? _b : []).length > 0 && " ".concat(b.prenoms.join(' '))] }, "b-".concat(i)));
341
- })] })] }))] }) }), jsxRuntime.jsx("div", { className: "sticky bottom-0 md:static bg-white border-t md:border-t-0 p-4 md:p-0 md:pb-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto", children: [jsxRuntime.jsxs("div", { className: "flex flex-col space-y-3 md:hidden", children: [jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-mismatch-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), jsxRuntime.jsx(Button.default, { onClick: onNext, "data-cy": "inpi-mismatch-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') })] }), jsxRuntime.jsxs("div", { className: "hidden md:flex justify-center space-x-3", children: [jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-mismatch-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), jsxRuntime.jsx(Button.default, { onClick: onNext, "data-cy": "inpi-mismatch-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') })] })] }) })] }));
387
+ })] })] }))] }) }), jsxRuntime.jsx("div", { className: "sticky bottom-0 md:static bg-white border-t md:border-t-0 p-4 md:p-0 md:pb-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto", children: [jsxRuntime.jsxs("div", { className: "flex flex-col space-y-3 md:hidden", children: [jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-mismatch-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), allowContinueOnFailure && (jsxRuntime.jsx(Button.default, { onClick: onNext, "data-cy": "inpi-mismatch-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') }))] }), jsxRuntime.jsxs("div", { className: "hidden md:flex justify-center space-x-3", children: [jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-mismatch-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), allowContinueOnFailure && (jsxRuntime.jsx(Button.default, { onClick: onNext, "data-cy": "inpi-mismatch-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') }))] })] }) })] }));
342
388
  }
343
389
  // ─── Not found phase ───────────────────────────────────────────────────────
344
390
  if (phase === 'not_found') {
345
391
  var d = errorScreenData;
346
- return (jsxRuntime.jsxs("div", { className: "flex flex-col justify-between h-full w-full", children: [jsxRuntime.jsx("div", { className: "flex-1 px-4 py-6 pt-11 md:px-8 md:py-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto space-y-6", children: [jsxRuntime.jsx("div", { className: "text-center", children: jsxRuntime.jsx("div", { className: "mx-auto w-16 h-16 bg-orange-100 rounded-full flex items-center justify-center mb-4", children: jsxRuntime.jsx("div", { className: "w-8 h-8 bg-orange-500 rounded-full flex items-center justify-center", children: jsxRuntime.jsx("span", { className: "text-white text-lg font-bold", children: "!" }) }) }) }), jsxRuntime.jsxs("div", { className: "text-center space-y-4", children: [jsxRuntime.jsx(Title.default, { className: "text-xl md:text-2xl lg:text-3xl text-orange-600", children: t('inpi_verification.not_found_title', 'Société introuvable') }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm text-gray-600 leading-relaxed", children: t('inpi_verification.not_found_desc', "Le numéro saisi ne correspond à aucune société enregistrée dans le Registre National des Entreprises.") })] }), jsxRuntime.jsxs("div", { className: "bg-orange-50 border border-orange-200 rounded-lg p-4", children: [jsxRuntime.jsx("h3", { className: "font-medium text-orange-900 mb-2", children: t('errors.problems_detected', 'Problèmes détectés') }), jsxRuntime.jsxs("div", { className: "text-sm text-orange-800 space-y-1", children: [(d === null || d === void 0 ? void 0 : d.siren) && (jsxRuntime.jsxs("p", { children: [t('inpi_verification.siren_label', 'SIREN'), ' : ', jsxRuntime.jsx("strong", { children: d.siren })] })), jsxRuntime.jsx("p", { children: t('inpi_verification.not_found_detail', 'Aucune société trouvée dans le Registre National des Entreprises.') })] })] })] }) }), jsxRuntime.jsx("div", { className: "sticky bottom-0 md:static bg-white border-t md:border-t-0 p-4 md:p-0 md:pb-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto", children: [jsxRuntime.jsxs("div", { className: "flex flex-col space-y-3 md:hidden", children: [jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-not-found-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), jsxRuntime.jsx(Button.default, { onClick: onNext, "data-cy": "inpi-not-found-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') })] }), jsxRuntime.jsxs("div", { className: "hidden md:flex justify-center space-x-3", children: [jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-not-found-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), jsxRuntime.jsx(Button.default, { onClick: onNext, "data-cy": "inpi-not-found-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') })] })] }) })] }));
392
+ return (jsxRuntime.jsxs("div", { className: "flex flex-col justify-between h-full w-full", children: [jsxRuntime.jsx("div", { className: "flex-1 px-4 py-6 pt-11 md:px-8 md:py-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto space-y-6", children: [jsxRuntime.jsx("div", { className: "text-center", children: jsxRuntime.jsx("div", { className: "mx-auto w-16 h-16 bg-orange-100 rounded-full flex items-center justify-center mb-4", children: jsxRuntime.jsx("div", { className: "w-8 h-8 bg-orange-500 rounded-full flex items-center justify-center", children: jsxRuntime.jsx("span", { className: "text-white text-lg font-bold", children: "!" }) }) }) }), jsxRuntime.jsxs("div", { className: "text-center space-y-4", children: [jsxRuntime.jsx(Title.default, { className: "text-xl md:text-2xl lg:text-3xl text-orange-600", children: t('inpi_verification.not_found_title', 'Société introuvable') }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm text-gray-600 leading-relaxed", children: t('inpi_verification.not_found_desc', "Le numéro saisi ne correspond à aucune société enregistrée dans le Registre National des Entreprises.") }), jsxRuntime.jsx("span", { className: "inline-block rounded-full bg-red-100 px-3 py-1 text-xs font-semibold text-red-700", children: t('inpi_verification.not_found_rejected_label', 'Dossier rejeté') })] }), jsxRuntime.jsxs("div", { className: "bg-orange-50 border border-orange-200 rounded-lg p-4", children: [jsxRuntime.jsx("h3", { className: "font-medium text-orange-900 mb-2", children: t('errors.problems_detected', 'Problèmes détectés') }), jsxRuntime.jsxs("div", { className: "text-sm text-orange-800 space-y-1", children: [(d === null || d === void 0 ? void 0 : d.siren) && (jsxRuntime.jsxs("p", { children: [t('inpi_verification.siren_label', 'SIREN'), ' : ', jsxRuntime.jsx("strong", { children: d.siren })] })), jsxRuntime.jsx("p", { children: (d === null || d === void 0 ? void 0 : d.isDoubleNotFound)
393
+ ? t('inpi_verification.not_found_detail_rne_rna', "Aucune société ni association trouvée, ni dans le Registre National des Entreprises (RNE), ni dans le Répertoire National des Associations (RNA).")
394
+ : t('inpi_verification.not_found_detail', 'Aucune société trouvée dans le Registre National des Entreprises.') })] })] })] }) }), jsxRuntime.jsx("div", { className: "sticky bottom-0 md:static bg-white border-t md:border-t-0 p-4 md:p-0 md:pb-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto", children: [jsxRuntime.jsxs("div", { className: "flex flex-col space-y-3 md:hidden", children: [jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-not-found-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), allowContinueOnFailure && (jsxRuntime.jsx(Button.default, { onClick: onNext, "data-cy": "inpi-not-found-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') }))] }), jsxRuntime.jsxs("div", { className: "hidden md:flex justify-center space-x-3", children: [jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-not-found-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), allowContinueOnFailure && (jsxRuntime.jsx(Button.default, { onClick: onNext, "data-cy": "inpi-not-found-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') }))] })] }) })] }));
347
395
  }
348
396
  // ─── Error / fallback ─────────────────────────────────────────────────────
349
397
  return (jsxRuntime.jsx(LoadingState.default, { message: t('verification_node.verifying_title', 'Vérification en cours…'), subtitle: t('verification_node.verifying_desc', 'Vérification en cours…') }));