datakeen-session-react 1.1.175 → 1.1.177

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 (64) hide show
  1. package/CLAUDE.md +233 -0
  2. package/dist/cjs/components/legal-consent/LegalConsentNode.js +6 -11
  3. package/dist/cjs/components/legal-consent/LegalConsentNode.js.map +1 -1
  4. package/dist/cjs/components/session/UserInputForm/CustomFormFields.js +41 -1
  5. package/dist/cjs/components/session/UserInputForm/CustomFormFields.js.map +1 -1
  6. package/dist/cjs/components/session/UserInputForm/LegalRepFields.js +45 -0
  7. package/dist/cjs/components/session/UserInputForm/LegalRepFields.js.map +1 -0
  8. package/dist/cjs/components/session/UserInputForm.js +2 -1
  9. package/dist/cjs/components/session/UserInputForm.js.map +1 -1
  10. package/dist/cjs/components/signature-electronic/SignatureElectronic.js +4 -5
  11. package/dist/cjs/components/signature-electronic/SignatureElectronic.js.map +1 -1
  12. package/dist/cjs/components/template/TemplateNodeRenderer.js +1 -1
  13. package/dist/cjs/components/template/TemplateNodeRenderer.js.map +1 -1
  14. package/dist/cjs/constants/userInputForm.js +2 -2
  15. package/dist/cjs/constants/userInputForm.js.map +1 -1
  16. package/dist/cjs/hooks/useUserInputForm.js +17 -1
  17. package/dist/cjs/hooks/useUserInputForm.js.map +1 -1
  18. package/dist/cjs/i18n/documents/documents.en.json.js +3 -0
  19. package/dist/cjs/i18n/documents/documents.en.json.js.map +1 -1
  20. package/dist/cjs/i18n/documents/documents.fr.json.js +3 -0
  21. package/dist/cjs/i18n/documents/documents.fr.json.js.map +1 -1
  22. package/dist/cjs/i18n/en.json.js +4 -1
  23. package/dist/cjs/i18n/en.json.js.map +1 -1
  24. package/dist/cjs/i18n/fr.json.js +4 -1
  25. package/dist/cjs/i18n/fr.json.js.map +1 -1
  26. package/dist/cjs/types/session.js.map +1 -1
  27. package/dist/cjs/utils/conditionEvaluator.js +27 -2
  28. package/dist/cjs/utils/conditionEvaluator.js.map +1 -1
  29. package/dist/cjs/utils/renderInlineMarkdown.js +75 -0
  30. package/dist/cjs/utils/renderInlineMarkdown.js.map +1 -0
  31. package/dist/cjs/utils/userInputForm.js +1 -0
  32. package/dist/cjs/utils/userInputForm.js.map +1 -1
  33. package/dist/esm/components/legal-consent/LegalConsentNode.js +6 -11
  34. package/dist/esm/components/legal-consent/LegalConsentNode.js.map +1 -1
  35. package/dist/esm/components/session/UserInputForm/CustomFormFields.js +42 -2
  36. package/dist/esm/components/session/UserInputForm/CustomFormFields.js.map +1 -1
  37. package/dist/esm/components/session/UserInputForm/LegalRepFields.js +22 -0
  38. package/dist/esm/components/session/UserInputForm/LegalRepFields.js.map +1 -0
  39. package/dist/esm/components/session/UserInputForm.js +2 -1
  40. package/dist/esm/components/session/UserInputForm.js.map +1 -1
  41. package/dist/esm/components/signature-electronic/SignatureElectronic.js +4 -5
  42. package/dist/esm/components/signature-electronic/SignatureElectronic.js.map +1 -1
  43. package/dist/esm/components/template/TemplateNodeRenderer.js +1 -1
  44. package/dist/esm/components/template/TemplateNodeRenderer.js.map +1 -1
  45. package/dist/esm/constants/userInputForm.js +2 -2
  46. package/dist/esm/constants/userInputForm.js.map +1 -1
  47. package/dist/esm/hooks/useUserInputForm.js +17 -1
  48. package/dist/esm/hooks/useUserInputForm.js.map +1 -1
  49. package/dist/esm/i18n/documents/documents.en.json.js +3 -1
  50. package/dist/esm/i18n/documents/documents.en.json.js.map +1 -1
  51. package/dist/esm/i18n/documents/documents.fr.json.js +3 -1
  52. package/dist/esm/i18n/documents/documents.fr.json.js.map +1 -1
  53. package/dist/esm/i18n/en.json.js +4 -1
  54. package/dist/esm/i18n/en.json.js.map +1 -1
  55. package/dist/esm/i18n/fr.json.js +4 -1
  56. package/dist/esm/i18n/fr.json.js.map +1 -1
  57. package/dist/esm/types/session.js.map +1 -1
  58. package/dist/esm/utils/conditionEvaluator.js +27 -2
  59. package/dist/esm/utils/conditionEvaluator.js.map +1 -1
  60. package/dist/esm/utils/renderInlineMarkdown.js +73 -0
  61. package/dist/esm/utils/renderInlineMarkdown.js.map +1 -0
  62. package/dist/esm/utils/userInputForm.js +1 -0
  63. package/dist/esm/utils/userInputForm.js.map +1 -1
  64. package/package.json +1 -1
@@ -11,6 +11,7 @@ var useI18n = require('../../hooks/useI18n.js');
11
11
  var useUserInputForm = require('../../hooks/useUserInputForm.js');
12
12
  var IdentityFields = require('./UserInputForm/IdentityFields.js');
13
13
  var LegalEntityFields = require('./UserInputForm/LegalEntityFields.js');
14
+ var LegalRepFields = require('./UserInputForm/LegalRepFields.js');
14
15
  var ContactFields = require('./UserInputForm/ContactFields.js');
15
16
  var AddressFields = require('./UserInputForm/AddressFields.js');
16
17
  var NationalityField = require('./UserInputForm/NationalityField.js');
@@ -32,7 +33,7 @@ var UserInputForm = function (props) {
32
33
  return (jsxRuntime.jsxs(MobilePageLayout.default, { contentClassName: "h-full", footer: jsxRuntime.jsx(PageActions.default, { primary: jsxRuntime.jsx(Button.default, { onClick: goOnNextStep, children: t("user_input_form.buttons.continue") }), secondary: jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: goOnPreviousStep, children: t("user_input_form.buttons.back") }) }), children: [typeof process !== "undefined" &&
33
34
  ((_a = process.env) === null || _a === void 0 ? void 0 : _a.NODE_ENV) === "development" && (jsxRuntime.jsx("div", { className: "fixed right-0 top-0 z-50 bg-green-500 p-2 text-xs text-white", children: "UserInputForm Rendered \u2713" })), jsxRuntime.jsx("div", { className: "px-4 py-6 pt-11 md:px-8 md:py-8", children: jsxRuntime.jsxs("div", { className: "mx-auto w-full space-y-6 ".concat(hasListCustomField
34
35
  ? "max-w-[98vw] md:max-w-[1300px] lg:max-w-[1500px]"
35
- : "max-w-md"), children: [jsxRuntime.jsxs("div", { className: "space-y-4 text-center", children: [jsxRuntime.jsx(Title.default, { className: "text-xl md:text-2xl lg:text-3xl", children: pageTitle }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm leading-relaxed text-gray-600 md:text-base whitespace-pre-line", children: pageDescription })] }), jsxRuntime.jsxs("div", { className: "space-y-6 z-30 h-full", children: [informationType === "identity" && (jsxRuntime.jsx(IdentityFields.default, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange })), informationType === "identity-legal" && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(LegalEntityFields.default, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange }), requestedFields.has("adresse") && (jsxRuntime.jsxs("div", { className: "space-y-4", children: [jsxRuntime.jsx("h3", { className: "text-lg md:text-xl font-semibold text-gray-900", children: t("user_input_form.registered_office_address", "Adresse du siège social") }), jsxRuntime.jsx(AddressFields.default, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange, addressSuggestions: addressSuggestions, showSuggestions: showSuggestions, onAddressChange: handleAddressChange, onAddressFocus: handleAddressFocus, onAddressBlur: handleAddressBlur, onApplySuggestion: applyAddressSuggestion })] }))] })), informationType === "contact" && (jsxRuntime.jsx(ContactFields.default, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange })), informationType === "address" && (jsxRuntime.jsx(AddressFields.default, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange, addressSuggestions: addressSuggestions, showSuggestions: showSuggestions, onAddressChange: handleAddressChange, onAddressFocus: handleAddressFocus, onAddressBlur: handleAddressBlur, onApplySuggestion: applyAddressSuggestion })), informationType === "nationality" && (jsxRuntime.jsx(NationalityField.default, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange })), informationType === "custom" && props.node.customFields && (jsxRuntime.jsx(CustomFormFields.default, { customFields: props.node.customFields, formData: customFormData, errors: customFormErrors, cellErrors: customFormCellErrors, onFieldChange: handleCustomFieldChange, addressSuggestions: addressSuggestions, showSuggestions: showSuggestions, onAddressChange: function (fieldId, val) { return handleAddressChange(val); }, onAddressFocus: function (fieldId) { return handleAddressFocus(); }, onAddressBlur: function (fieldId) { return handleAddressBlur(); }, onApplySuggestion: function (fieldId, suggestion) {
36
+ : "max-w-md"), children: [jsxRuntime.jsxs("div", { className: "space-y-4 text-center", children: [jsxRuntime.jsx(Title.default, { className: "text-xl md:text-2xl lg:text-3xl", children: pageTitle }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm leading-relaxed text-gray-600 md:text-base whitespace-pre-line", children: pageDescription })] }), jsxRuntime.jsxs("div", { className: "space-y-6 z-30 h-full", children: [informationType === "identity" && (jsxRuntime.jsx(IdentityFields.default, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange })), informationType === "identity-legal-rep" && (jsxRuntime.jsx(LegalRepFields.default, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange })), informationType === "identity-legal" && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(LegalEntityFields.default, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange }), requestedFields.has("adresse") && (jsxRuntime.jsxs("div", { className: "space-y-4", children: [jsxRuntime.jsx("h3", { className: "text-lg md:text-xl font-semibold text-gray-900", children: t("user_input_form.registered_office_address", "Adresse du siège social") }), jsxRuntime.jsx(AddressFields.default, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange, addressSuggestions: addressSuggestions, showSuggestions: showSuggestions, onAddressChange: handleAddressChange, onAddressFocus: handleAddressFocus, onAddressBlur: handleAddressBlur, onApplySuggestion: applyAddressSuggestion })] }))] })), informationType === "contact" && (jsxRuntime.jsx(ContactFields.default, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange })), informationType === "address" && (jsxRuntime.jsx(AddressFields.default, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange, addressSuggestions: addressSuggestions, showSuggestions: showSuggestions, onAddressChange: handleAddressChange, onAddressFocus: handleAddressFocus, onAddressBlur: handleAddressBlur, onApplySuggestion: applyAddressSuggestion })), informationType === "nationality" && (jsxRuntime.jsx(NationalityField.default, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange })), informationType === "custom" && props.node.customFields && (jsxRuntime.jsx(CustomFormFields.default, { customFields: props.node.customFields, formData: customFormData, errors: customFormErrors, cellErrors: customFormCellErrors, onFieldChange: handleCustomFieldChange, addressSuggestions: addressSuggestions, showSuggestions: showSuggestions, onAddressChange: function (fieldId, val) { return handleAddressChange(val); }, onAddressFocus: function (fieldId) { return handleAddressFocus(); }, onAddressBlur: function (fieldId) { return handleAddressBlur(); }, onApplySuggestion: function (fieldId, suggestion) {
36
37
  return applyAddressSuggestion(suggestion);
37
38
  } }))] })] }) })] }));
38
39
  };
@@ -1 +1 @@
1
- {"version":3,"file":"UserInputForm.js","sources":["../../../../../src/components/session/UserInputForm.tsx"],"sourcesContent":["import type { UserInputFormProps } from \"../../types/userInput\";\nimport Button from \"../ui/Button\";\nimport PageActions from \"../ui/PageActions\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport { useUserInputForm } from \"../../hooks/useUserInputForm\";\nimport IdentityFields from \"./UserInputForm/IdentityFields\";\nimport LegalEntityFields from \"./UserInputForm/LegalEntityFields\";\nimport ContactFields from \"./UserInputForm/ContactFields\";\nimport AddressFields from \"./UserInputForm/AddressFields\";\nimport NationalityField from \"./UserInputForm/NationalityField\";\nimport CustomFormFields from \"./UserInputForm/CustomFormFields\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\n\nconst UserInputForm = (props: UserInputFormProps) => {\n const { t } = useI18n();\n const hasListCustomField =\n props.node.informationType === \"custom\" &&\n (props.node.customFields || []).some((field) => field.valueType === \"list\");\n\n const {\n form,\n errors,\n informationType,\n requestedFields,\n pageTitle,\n pageDescription,\n addressSuggestions,\n showSuggestions,\n handleFieldChange,\n handleAddressChange,\n handleAddressFocus,\n handleAddressBlur,\n applyAddressSuggestion,\n goOnNextStep,\n goOnPreviousStep,\n customFormData,\n customFormErrors,\n customFormCellErrors,\n handleCustomFieldChange,\n } = useUserInputForm(props);\n\n // DEBUG LOGS\n console.log(\"🔍 [UserInputForm] informationType:\", informationType);\n console.log(\n \"🔍 [UserInputForm] node.informationType:\",\n props.node.informationType,\n );\n console.log(\"🔍 [UserInputForm] node.customFields:\", props.node.customFields);\n console.log(\"🔍 [UserInputForm] customFormData:\", customFormData);\n console.log(\n \"🔍 [UserInputForm] requestedFields:\",\n Array.from(requestedFields),\n );\n\n return (\n <MobilePageLayout\n contentClassName=\"h-full\"\n footer={\n <PageActions\n primary={\n <Button onClick={goOnNextStep}>\n {t(\"user_input_form.buttons.continue\")}\n </Button>\n }\n secondary={\n <Button variant=\"secondary\" onClick={goOnPreviousStep}>\n {t(\"user_input_form.buttons.back\")}\n </Button>\n }\n />\n }\n >\n {typeof process !== \"undefined\" &&\n process.env?.NODE_ENV === \"development\" && (\n <div className=\"fixed right-0 top-0 z-50 bg-green-500 p-2 text-xs text-white\">\n UserInputForm Rendered ✓\n </div>\n )}\n\n <div className=\"px-4 py-6 pt-11 md:px-8 md:py-8\">\n <div\n className={`mx-auto w-full space-y-6 ${\n hasListCustomField\n ? \"max-w-[98vw] md:max-w-[1300px] lg:max-w-[1500px]\"\n : \"max-w-md\"\n }`}\n >\n <div className=\"space-y-4 text-center\">\n <Title className=\"text-xl md:text-2xl lg:text-3xl\">\n {pageTitle}\n </Title>\n <Subtitle className=\"text-sm leading-relaxed text-gray-600 md:text-base whitespace-pre-line\">\n {pageDescription}\n </Subtitle>\n </div>\n\n <div className=\"space-y-6 z-30 h-full\">\n {informationType === \"identity\" && (\n <IdentityFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n />\n )}\n\n {informationType === \"identity-legal\" && (\n <>\n <LegalEntityFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n />\n {requestedFields.has(\"adresse\") && (\n <div className=\"space-y-4\">\n <h3 className=\"text-lg md:text-xl font-semibold text-gray-900\">\n {t(\n \"user_input_form.registered_office_address\",\n \"Adresse du siège social\",\n )}\n </h3>\n <AddressFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n addressSuggestions={addressSuggestions}\n showSuggestions={showSuggestions}\n onAddressChange={handleAddressChange}\n onAddressFocus={handleAddressFocus}\n onAddressBlur={handleAddressBlur}\n onApplySuggestion={applyAddressSuggestion}\n />\n </div>\n )}\n </>\n )}\n\n {informationType === \"contact\" && (\n <ContactFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n />\n )}\n\n {informationType === \"address\" && (\n <AddressFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n addressSuggestions={addressSuggestions}\n showSuggestions={showSuggestions}\n onAddressChange={handleAddressChange}\n onAddressFocus={handleAddressFocus}\n onAddressBlur={handleAddressBlur}\n onApplySuggestion={applyAddressSuggestion}\n />\n )}\n\n {informationType === \"nationality\" && (\n <NationalityField\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n />\n )}\n\n {informationType === \"custom\" && props.node.customFields && (\n <CustomFormFields\n customFields={props.node.customFields}\n formData={customFormData}\n errors={customFormErrors}\n cellErrors={customFormCellErrors}\n onFieldChange={handleCustomFieldChange}\n addressSuggestions={addressSuggestions}\n showSuggestions={showSuggestions}\n onAddressChange={(fieldId, val) => handleAddressChange(val)}\n onAddressFocus={(fieldId) => handleAddressFocus()}\n onAddressBlur={(fieldId) => handleAddressBlur()}\n onApplySuggestion={(fieldId, suggestion) =>\n applyAddressSuggestion(suggestion)\n }\n />\n )}\n </div>\n </div>\n </div>\n </MobilePageLayout>\n );\n};\n\nexport default UserInputForm;\n"],"names":["useI18n","useUserInputForm","_jsxs","MobilePageLayout","_jsx","PageActions","Button","Title","Subtitle","IdentityFields","LegalEntityFields","AddressFields","ContactFields","NationalityField","CustomFormFields"],"mappings":";;;;;;;;;;;;;;;;;;;AAeA,IAA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m.js","sources":["../../../../../src/components/session/UserInputForm.tsx"],"sourcesContent":["import type { UserInputFormProps } from \"../../types/userInput\";\nimport Button from \"../ui/Button\";\nimport PageActions from \"../ui/PageActions\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport { useUserInputForm } from \"../../hooks/useUserInputForm\";\nimport IdentityFields from \"./UserInputForm/IdentityFields\";\nimport LegalEntityFields from \"./UserInputForm/LegalEntityFields\";\nimport LegalRepFields from \"./UserInputForm/LegalRepFields\";\nimport ContactFields from \"./UserInputForm/ContactFields\";\nimport AddressFields from \"./UserInputForm/AddressFields\";\nimport NationalityField from \"./UserInputForm/NationalityField\";\nimport CustomFormFields from \"./UserInputForm/CustomFormFields\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\n\nconst UserInputForm = (props: UserInputFormProps) => {\n const { t } = useI18n();\n const hasListCustomField =\n props.node.informationType === \"custom\" &&\n (props.node.customFields || []).some((field) => field.valueType === \"list\");\n\n const {\n form,\n errors,\n informationType,\n requestedFields,\n pageTitle,\n pageDescription,\n addressSuggestions,\n showSuggestions,\n handleFieldChange,\n handleAddressChange,\n handleAddressFocus,\n handleAddressBlur,\n applyAddressSuggestion,\n goOnNextStep,\n goOnPreviousStep,\n customFormData,\n customFormErrors,\n customFormCellErrors,\n handleCustomFieldChange,\n } = useUserInputForm(props);\n\n // DEBUG LOGS\n console.log(\"🔍 [UserInputForm] informationType:\", informationType);\n console.log(\n \"🔍 [UserInputForm] node.informationType:\",\n props.node.informationType,\n );\n console.log(\"🔍 [UserInputForm] node.customFields:\", props.node.customFields);\n console.log(\"🔍 [UserInputForm] customFormData:\", customFormData);\n console.log(\n \"🔍 [UserInputForm] requestedFields:\",\n Array.from(requestedFields),\n );\n\n return (\n <MobilePageLayout\n contentClassName=\"h-full\"\n footer={\n <PageActions\n primary={\n <Button onClick={goOnNextStep}>\n {t(\"user_input_form.buttons.continue\")}\n </Button>\n }\n secondary={\n <Button variant=\"secondary\" onClick={goOnPreviousStep}>\n {t(\"user_input_form.buttons.back\")}\n </Button>\n }\n />\n }\n >\n {typeof process !== \"undefined\" &&\n process.env?.NODE_ENV === \"development\" && (\n <div className=\"fixed right-0 top-0 z-50 bg-green-500 p-2 text-xs text-white\">\n UserInputForm Rendered ✓\n </div>\n )}\n\n <div className=\"px-4 py-6 pt-11 md:px-8 md:py-8\">\n <div\n className={`mx-auto w-full space-y-6 ${\n hasListCustomField\n ? \"max-w-[98vw] md:max-w-[1300px] lg:max-w-[1500px]\"\n : \"max-w-md\"\n }`}\n >\n <div className=\"space-y-4 text-center\">\n <Title className=\"text-xl md:text-2xl lg:text-3xl\">\n {pageTitle}\n </Title>\n <Subtitle className=\"text-sm leading-relaxed text-gray-600 md:text-base whitespace-pre-line\">\n {pageDescription}\n </Subtitle>\n </div>\n\n <div className=\"space-y-6 z-30 h-full\">\n {informationType === \"identity\" && (\n <IdentityFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n />\n )}\n\n {informationType === \"identity-legal-rep\" && (\n <LegalRepFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n />\n )}\n\n {informationType === \"identity-legal\" && (\n <>\n <LegalEntityFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n />\n {requestedFields.has(\"adresse\") && (\n <div className=\"space-y-4\">\n <h3 className=\"text-lg md:text-xl font-semibold text-gray-900\">\n {t(\n \"user_input_form.registered_office_address\",\n \"Adresse du siège social\",\n )}\n </h3>\n <AddressFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n addressSuggestions={addressSuggestions}\n showSuggestions={showSuggestions}\n onAddressChange={handleAddressChange}\n onAddressFocus={handleAddressFocus}\n onAddressBlur={handleAddressBlur}\n onApplySuggestion={applyAddressSuggestion}\n />\n </div>\n )}\n </>\n )}\n\n {informationType === \"contact\" && (\n <ContactFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n />\n )}\n\n {informationType === \"address\" && (\n <AddressFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n addressSuggestions={addressSuggestions}\n showSuggestions={showSuggestions}\n onAddressChange={handleAddressChange}\n onAddressFocus={handleAddressFocus}\n onAddressBlur={handleAddressBlur}\n onApplySuggestion={applyAddressSuggestion}\n />\n )}\n\n {informationType === \"nationality\" && (\n <NationalityField\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n />\n )}\n\n {informationType === \"custom\" && props.node.customFields && (\n <CustomFormFields\n customFields={props.node.customFields}\n formData={customFormData}\n errors={customFormErrors}\n cellErrors={customFormCellErrors}\n onFieldChange={handleCustomFieldChange}\n addressSuggestions={addressSuggestions}\n showSuggestions={showSuggestions}\n onAddressChange={(fieldId, val) => handleAddressChange(val)}\n onAddressFocus={(fieldId) => handleAddressFocus()}\n onAddressBlur={(fieldId) => handleAddressBlur()}\n onApplySuggestion={(fieldId, suggestion) =>\n applyAddressSuggestion(suggestion)\n }\n />\n )}\n </div>\n </div>\n </div>\n </MobilePageLayout>\n );\n};\n\nexport default UserInputForm;\n"],"names":["useI18n","useUserInputForm","_jsxs","MobilePageLayout","_jsx","PageActions","Button","Title","Subtitle","IdentityFields","LegalRepFields","_Fragment","LegalEntityFields","AddressFields","ContactFields","NationalityField","CustomFormFields"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgBA,IAAM,aAAa,GAAG,UAAC,KAAyB,EAAA;;AACtC,IAAA,IAAA,CAAC,GAAKA,eAAO,EAAE,EAAd;IACT,IAAM,kBAAkB,GACtB,KAAK,CAAC,IAAI,CAAC,eAAe,KAAK,QAAQ;QACvC,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,EAAE,IAAI,CAAC,UAAC,KAAK,EAAA,EAAK,OAAA,KAAK,CAAC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AChC,aAAa,EAAE,iBAAiB,EAChC,kBAAkB,EAAE,kBAAkB,EACtC,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,mBAAmB,EACpC,cAAc,EAAE,kBAAkB,EAClC,aAAa,EAAE,iBAAiB,EAChC,iBAAiB,EAAE,sBAAsB,EAAA,CACzC,CACH,EAEA,eAAe,KAAK,aAAa,KAChCT,eAACW,wBAAgB,EAAA,EACf,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,iBAAiB,GAChC,CACH,EAEA,eAAe,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC,YAAY,KACtDX,cAAA,CAACY,wBAAgB,EAAA,EACf,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,EACrC,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,gBAAgB,EACxB,UAAU,EAAE,oBAAoB,EAChC,aAAa,EAAE,uBAAuB,EACtC,kBAAkB,EAAE,kBAAkB,EACtC,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,UAAC,OAAO,EAAE,GAAG,EAAA,EAAK,OAAA,mBAAmB,CAAC,GAAG,CAAC,CAAA,CAAxB,CAAwB,EAC3D,cAAc,EAAE,UAAC,OAAO,EAAA,EAAK,OAAA,kBAAkB,EAAE,EAApB,CAAoB,EACjD,aAAa,EAAE,UAAC,OAAO,EAAA,EAAK,OAAA,iBAAiB,EAAE,CAAA,CAAnB,CAAmB,EAC/C,iBAAiB,EAAE,UAAC,OAAO,EAAE,UAAU,EAAA;wCACrC,OAAA,sBAAsB,CAAC,UAAU,CAAC;AAAlC,oCAAA,CAAkC,GAEpC,CACH,CAAA,EAAA,CACG,IACF,EAAA,CACF,CAAA,EAAA,CACW;AAEvB;;;;"}
@@ -27,7 +27,7 @@ var FIELD_KEY_TO_USER_INPUT = {
27
27
  tva: function (ui) { return ui.tva; },
28
28
  };
29
29
  var SignatureElectronic = function (_a) {
30
- var sessionId = _a.sessionId, stepObject = _a.stepObject, title = _a.title, description = _a.description, external_id = _a.external_id, fieldMappings = _a.fieldMappings, userInput = _a.userInput, contactInfo = _a.contactInfo;
30
+ var sessionId = _a.sessionId, stepObject = _a.stepObject, node = _a.node, session = _a.session, title = _a.title, description = _a.description, external_id = _a.external_id, fieldMappings = _a.fieldMappings, userInput = _a.userInput, contactInfo = _a.contactInfo;
31
31
  var t = reactI18next.useTranslation("translation", { i18n: index.default }).t;
32
32
  var signatureViewStorageKey = React.useMemo(function () { return "dk-signature-open:".concat(sessionId, ":").concat(external_id !== null && external_id !== void 0 ? external_id : "no-template"); }, [sessionId, external_id]);
33
33
  var _b = React.useState(function () {
@@ -105,8 +105,8 @@ var SignatureElectronic = function (_a) {
105
105
  console.error("[SignatureElectronic] Failed to update session status:", err_1);
106
106
  return [3 /*break*/, 4];
107
107
  case 4:
108
- // Progress to the next step in the journey
109
- stepObject.setStep(stepObject.step + 1);
108
+ // Progress to the next step via graph edges (pas d'arithmétique — évite de sauter dans la mauvaise branche)
109
+ stepObject.goToNextStep(node.id, session.template);
110
110
  return [2 /*return*/];
111
111
  }
112
112
  });
@@ -119,8 +119,7 @@ var SignatureElectronic = function (_a) {
119
119
  if (typeof window !== "undefined") {
120
120
  window.sessionStorage.removeItem(signatureViewStorageKey);
121
121
  }
122
- // Go back to the previous step in the journey
123
- stepObject.setStep(stepObject.step - 1);
122
+ stepObject.goBack();
124
123
  }
125
124
  };
126
125
  if (showSignature && external_id) {
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureElectronic.js","sources":["../../../../../src/components/signature-electronic/SignatureElectronic.tsx"],"sourcesContent":["import React, { useState, useMemo, useEffect } from \"react\";\nimport type { stepObject, SessionTemplateNode } from \"../../types/session\";\nimport type { UserInput } from \"../../types/userInput\";\nimport type { ContactInfo } from \"../../types/contactInfo\";\nimport { useTranslation } from \"react-i18next\";\nimport sdkI18n from \"../../i18n\";\nimport SignatureElectronicIntroduction from \"./SignatureElectronicIntroduction\";\nimport DocusealSignature from \"./DocusealSignature\";\nimport { updateSessionStatus } from \"../../services/sessionService\";\n\n/**\n * Maps an InformationFieldKey (journey field) to the corresponding UserInput key.\n * This bridges the admin-defined field names to the actual data collected in the SDK.\n */\nconst FIELD_KEY_TO_USER_INPUT: Record<string, (ui: UserInput, ci?: ContactInfo) => string | undefined> = {\n nom: (ui) => ui.lastName,\n prenom: (ui) => ui.firstName,\n date_naissance: (ui) => ui.birthDate,\n email: (ui, ci) => ui.email || ci?.email,\n sms: (ui, ci) => ui.sms || ui.phoneNumber || ci?.phoneNumber,\n adresse: (ui) => [ui.addressLine1, ui.addressLine2, ui.postalCode, ui.city, ui.countryCode].filter(Boolean).join(', '),\n nationalite: (ui) => ui.nationality,\n siret: (ui) => ui.siret,\n tva: (ui) => ui.tva,\n};\n\ninterface SignatureElectronicProps {\n sessionId: string;\n stepObject: stepObject;\n title?: string;\n description?: string;\n external_id?: string;\n fieldMappings?: SessionTemplateNode['fieldMappings'];\n userInput?: UserInput;\n contactInfo?: ContactInfo;\n}\n\nconst SignatureElectronic: React.FC<SignatureElectronicProps> = ({\n sessionId,\n stepObject,\n title,\n description,\n external_id,\n fieldMappings,\n userInput,\n contactInfo,\n}) => {\n const { t } = useTranslation(\"translation\", { i18n: sdkI18n });\n const signatureViewStorageKey = useMemo(() => `dk-signature-open:${sessionId}:${external_id ?? \"no-template\"}`, [sessionId, external_id]);\n const [showSignature, setShowSignature] = useState<boolean>(() => {\n if (typeof window === \"undefined\") return false;\n return window.sessionStorage.getItem(signatureViewStorageKey) === \"1\";\n });\n\n useEffect(() => {\n if (typeof window === \"undefined\") return;\n\n if (showSignature) {\n window.sessionStorage.setItem(signatureViewStorageKey, \"1\");\n } else {\n window.sessionStorage.removeItem(signatureViewStorageKey);\n }\n }, [showSignature, signatureViewStorageKey]);\n\n /**\n * Build the pre-fill values object from userInput + fieldMappings.\n * Maps each configured field to its value from userInput.\n * Used by DocusealForm's `values` prop for client-side pre-filling.\n */\n const prefillValues = useMemo<Record<string, string> | undefined>(() => {\n if (!fieldMappings || !userInput) return undefined;\n\n const values: Record<string, string> = {};\n\n fieldMappings.forEach(mapping => {\n const resolver = FIELD_KEY_TO_USER_INPUT[mapping.sourceFieldId];\n let value: string | undefined;\n\n if (resolver) {\n value = resolver(userInput, contactInfo);\n } else if (userInput.customFormData) {\n const raw = userInput.customFormData[mapping.sourceFieldId];\n value = raw != null ? String(raw) : undefined;\n }\n\n if (value !== undefined && value !== '') {\n values[mapping.sourceFieldId] = value;\n }\n });\n\n return Object.keys(values).length > 0 ? values : undefined;\n }, [fieldMappings, userInput, contactInfo]);\n\n /**\n * Build the list of field names that should be read-only in the signing form.\n * Only includes fields that are both mapped AND marked as readonly by the admin.\n */\n const readonlyFieldNames = useMemo<string[] | undefined>(() => {\n if (!fieldMappings) return undefined;\n\n const names = fieldMappings\n .filter(m => m.readonly)\n .map(m => m.sourceFieldId);\n\n return names.length > 0 ? names : undefined;\n }, [fieldMappings]);\n\n const handleContinue = () => {\n setShowSignature(true);\n };\n\n const handleComplete = async () => {\n if (typeof window !== \"undefined\") {\n window.sessionStorage.removeItem(signatureViewStorageKey);\n }\n try {\n await updateSessionStatus(sessionId, \"conform\");\n } catch (err) {\n console.error(\"[SignatureElectronic] Failed to update session status:\", err);\n // Non-bloquant : l'utilisateur avance quoi qu'il arrive\n }\n // Progress to the next step in the journey\n stepObject.setStep(stepObject.step + 1);\n };\n\n const handleBack = () => {\n if (showSignature) {\n setShowSignature(false);\n } else {\n if (typeof window !== \"undefined\") {\n window.sessionStorage.removeItem(signatureViewStorageKey);\n }\n // Go back to the previous step in the journey\n stepObject.setStep(stepObject.step - 1);\n }\n };\n\n if (showSignature && external_id) {\n return (\n <DocusealSignature\n sessionId={sessionId}\n templateId={external_id}\n templateName={title}\n onComplete={handleComplete}\n onBack={handleBack}\n prefillValues={prefillValues}\n readonlyFieldNames={readonlyFieldNames}\n />\n );\n }\n\n if (showSignature && !external_id) {\n // No template configured — show error instead of silently falling back to intro\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(\"signature.error_title\", \"Erreur\")}\n </h2>\n <p className=\"text-gray-600 mb-4\">\n {t(\"signature.no_template\", \"Le modèle de signature n'est pas configuré.\")}\n </p>\n <button\n className=\"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors\"\n onClick={handleBack}\n >\n {t(\"buttons.back\", \"Retour\")}\n </button>\n </div>\n );\n }\n\n return (\n <SignatureElectronicIntroduction\n onContinue={handleContinue}\n onBack={handleBack}\n title={title}\n description={description}\n />\n );\n};\n\nexport default SignatureElectronic;\n"],"names":["useTranslation","sdkI18n","useMemo","useState","useEffect","__awaiter","updateSessionStatus","_jsx","DocusealSignature","_jsxs","SignatureElectronicIntroduction"],"mappings":";;;;;;;;;;;;;AAUA;;;AAGG;AACH,IAAM,uBAAuB,GAA4E;IACrG,GAAG,EAAE,UAAC,EAAE,EAAA,EAAK,OAAA,EAAE,CAAC,QAAQ,CAAA,CAAX,CAAW;IACxB,MAAM,EAAE,UAAC,EAAE,EAAA,EAAK,OAAA,EAAE,CAAC,SAAS,CAAA,CAAZ,CAAY;IAC5B,cAAc,EAAE,UAAC,EAAE,EAAA,EAAK,OAAA,EAAE,CAAC,SAAS,CAAA,CAAZ,CAAY;IACpC,KAAK,EAAE,UAAC,EAAE,EAAE,EAAE,EAAA,EAAK,OAAA,EAAE,CAAC,KAAK,KAAI,EAAE,KAAA,IAAA,IAAF,EAAE,KAAA,MAAA,GAAA,MAAA,GAAF,EAAE,CAAE,KAAK,CAAA,EAArB,CAAqB;IACxC,GAAG,EAAE,UAAC,EAAE,EAAE,EAAE,IAAK,OAAA,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,WAAW,KAAI,EAAE,KAAA,IAAA,IAAF,EAAE,KAAA,MAAA,GAAA,MAAA,GAAF,EAAE,CAAE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AA,EAElB,CAAC,CAAC,cAAc,EAAE,QAAQ,CAAC,EAAA,CACvB,CAAA,EAAA,CACP;IAEd;IAEA,QACIA,eAACG,uCAA+B,EAAA,EAC5B,UAAU,EAAE,cAAc,EAC1B,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EAAA,CAC1B;AAEV;;;;"}
1
+ {"version":3,"file":"SignatureElectronic.js","sources":["../../../../../src/components/signature-electronic/SignatureElectronic.tsx"],"sourcesContent":["import React, { useState, useMemo, useEffect } from \"react\";\nimport type { stepObject, SessionTemplateNode, SessionData } from \"../../types/session\";\nimport type { UserInput } from \"../../types/userInput\";\nimport type { ContactInfo } from \"../../types/contactInfo\";\nimport { useTranslation } from \"react-i18next\";\nimport sdkI18n from \"../../i18n\";\nimport SignatureElectronicIntroduction from \"./SignatureElectronicIntroduction\";\nimport DocusealSignature from \"./DocusealSignature\";\nimport { updateSessionStatus } from \"../../services/sessionService\";\n\n/**\n * Maps an InformationFieldKey (journey field) to the corresponding UserInput key.\n * This bridges the admin-defined field names to the actual data collected in the SDK.\n */\nconst FIELD_KEY_TO_USER_INPUT: Record<string, (ui: UserInput, ci?: ContactInfo) => string | undefined> = {\n nom: (ui) => ui.lastName,\n prenom: (ui) => ui.firstName,\n date_naissance: (ui) => ui.birthDate,\n email: (ui, ci) => ui.email || ci?.email,\n sms: (ui, ci) => ui.sms || ui.phoneNumber || ci?.phoneNumber,\n adresse: (ui) => [ui.addressLine1, ui.addressLine2, ui.postalCode, ui.city, ui.countryCode].filter(Boolean).join(', '),\n nationalite: (ui) => ui.nationality,\n siret: (ui) => ui.siret,\n tva: (ui) => ui.tva,\n};\n\ninterface SignatureElectronicProps {\n sessionId: string;\n stepObject: stepObject;\n node: SessionTemplateNode;\n session: SessionData;\n title?: string;\n description?: string;\n external_id?: string;\n fieldMappings?: SessionTemplateNode['fieldMappings'];\n userInput?: UserInput;\n contactInfo?: ContactInfo;\n}\n\nconst SignatureElectronic: React.FC<SignatureElectronicProps> = ({\n sessionId,\n stepObject,\n node,\n session,\n title,\n description,\n external_id,\n fieldMappings,\n userInput,\n contactInfo,\n}) => {\n const { t } = useTranslation(\"translation\", { i18n: sdkI18n });\n const signatureViewStorageKey = useMemo(() => `dk-signature-open:${sessionId}:${external_id ?? \"no-template\"}`, [sessionId, external_id]);\n const [showSignature, setShowSignature] = useState<boolean>(() => {\n if (typeof window === \"undefined\") return false;\n return window.sessionStorage.getItem(signatureViewStorageKey) === \"1\";\n });\n\n useEffect(() => {\n if (typeof window === \"undefined\") return;\n\n if (showSignature) {\n window.sessionStorage.setItem(signatureViewStorageKey, \"1\");\n } else {\n window.sessionStorage.removeItem(signatureViewStorageKey);\n }\n }, [showSignature, signatureViewStorageKey]);\n\n /**\n * Build the pre-fill values object from userInput + fieldMappings.\n * Maps each configured field to its value from userInput.\n * Used by DocusealForm's `values` prop for client-side pre-filling.\n */\n const prefillValues = useMemo<Record<string, string> | undefined>(() => {\n if (!fieldMappings || !userInput) return undefined;\n\n const values: Record<string, string> = {};\n\n fieldMappings.forEach(mapping => {\n const resolver = FIELD_KEY_TO_USER_INPUT[mapping.sourceFieldId];\n let value: string | undefined;\n\n if (resolver) {\n value = resolver(userInput, contactInfo);\n } else if (userInput.customFormData) {\n const raw = userInput.customFormData[mapping.sourceFieldId];\n value = raw != null ? String(raw) : undefined;\n }\n\n if (value !== undefined && value !== '') {\n values[mapping.sourceFieldId] = value;\n }\n });\n\n return Object.keys(values).length > 0 ? values : undefined;\n }, [fieldMappings, userInput, contactInfo]);\n\n /**\n * Build the list of field names that should be read-only in the signing form.\n * Only includes fields that are both mapped AND marked as readonly by the admin.\n */\n const readonlyFieldNames = useMemo<string[] | undefined>(() => {\n if (!fieldMappings) return undefined;\n\n const names = fieldMappings\n .filter(m => m.readonly)\n .map(m => m.sourceFieldId);\n\n return names.length > 0 ? names : undefined;\n }, [fieldMappings]);\n\n const handleContinue = () => {\n setShowSignature(true);\n };\n\n const handleComplete = async () => {\n if (typeof window !== \"undefined\") {\n window.sessionStorage.removeItem(signatureViewStorageKey);\n }\n try {\n await updateSessionStatus(sessionId, \"conform\");\n } catch (err) {\n console.error(\"[SignatureElectronic] Failed to update session status:\", err);\n // Non-bloquant : l'utilisateur avance quoi qu'il arrive\n }\n // Progress to the next step via graph edges (pas d'arithmétique — évite de sauter dans la mauvaise branche)\n stepObject.goToNextStep(node.id, session.template);\n };\n\n const handleBack = () => {\n if (showSignature) {\n setShowSignature(false);\n } else {\n if (typeof window !== \"undefined\") {\n window.sessionStorage.removeItem(signatureViewStorageKey);\n }\n stepObject.goBack();\n }\n };\n\n if (showSignature && external_id) {\n return (\n <DocusealSignature\n sessionId={sessionId}\n templateId={external_id}\n templateName={title}\n onComplete={handleComplete}\n onBack={handleBack}\n prefillValues={prefillValues}\n readonlyFieldNames={readonlyFieldNames}\n />\n );\n }\n\n if (showSignature && !external_id) {\n // No template configured — show error instead of silently falling back to intro\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(\"signature.error_title\", \"Erreur\")}\n </h2>\n <p className=\"text-gray-600 mb-4\">\n {t(\"signature.no_template\", \"Le modèle de signature n'est pas configuré.\")}\n </p>\n <button\n className=\"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors\"\n onClick={handleBack}\n >\n {t(\"buttons.back\", \"Retour\")}\n </button>\n </div>\n );\n }\n\n return (\n <SignatureElectronicIntroduction\n onContinue={handleContinue}\n onBack={handleBack}\n title={title}\n description={description}\n />\n );\n};\n\nexport default SignatureElectronic;\n"],"names":["useTranslation","sdkI18n","useMemo","useState","useEffect","__awaiter","updateSessionStatus","_jsx","DocusealSignature","_jsxs","SignatureElectronicIntroduction"],"mappings":";;;;;;;;;;;;;AAUA;;;AAGG;AACH,IAAM,uBAAuB,GAA4E;IACrG,GAAG,EAAE,UAAC,EAAE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,aAAa,EAC5B,kBAAkB,EAAE,kBAAkB,EAAA,CACxC;IAEV;AAEA,IAAA,IAAI,aAAa,IAAI,CAAC,WAAW,EAAE;;QAE/B,QACIC,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,kEAAkE,EAAA,QAAA,EAAA,CAC7EF,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,EAC9C,CAAC,CAAC,uBAAuB,EAAE,QAAQ,CAAC,EAAA,CACpC,EACLA,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,oBAAoB,EAAA,QAAA,EAC5B,CAAC,CAAC,uBAAuB,EAAE,6CAA6C,CAAC,EAAA,CAC1E,EACJA,cAAA,CAAA,QAAA,EAAA,EACI,SAAS,EAAC,iFAAiF,EAC3F,OAAO,EAAE,UAAU,EAAA,QAAA,EAElB,CAAC,CAAC,cAAc,EAAE,QAAQ,CAAC,EAAA,CACvB,CAAA,EAAA,CACP;IAEd;IAEA,QACIA,eAACG,uCAA+B,EAAA,EAC5B,UAAU,EAAE,cAAc,EAC1B,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EAAA,CAC1B;AAEV;;;;"}
@@ -114,7 +114,7 @@ var TemplateNodeRenderer = function (_a) {
114
114
  case "selfie-capture":
115
115
  return (jsxRuntime.jsx(Selfie.default, { stepObject: stepObject, sessionId: sessionId, node: node, template: session.template }, "selfie-".concat(templateIndex)));
116
116
  case "signature-electronic":
117
- return (jsxRuntime.jsx(SignatureElectronic.default, { sessionId: sessionId, stepObject: stepObject, title: node.title, description: node.description,
117
+ return (jsxRuntime.jsx(SignatureElectronic.default, { sessionId: sessionId, stepObject: stepObject, node: node, session: session, title: node.title, description: node.description,
118
118
  // Always pass a stable node identifier so backend can resolve
119
119
  // either a static DocuSeal template OR a generated PDF source.
120
120
  external_id: node.templateId || node.external_id || node.id, fieldMappings: node.fieldMappings, userInput: userInput, contactInfo: contactInfo }, "signature-".concat(templateIndex)));
@@ -1 +1 @@
1
- {"version":3,"file":"TemplateNodeRenderer.js","sources":["../../../../../src/components/template/TemplateNodeRenderer.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport Selfie from \"../session/Selfie\";\nimport VideoWorkInProgress from \"../session/VideoWorkInProgress\";\nimport DocumentCheck, { NodeIdentityControl } from \"../session/DocumentCheck\";\nimport DocumentCollection, {\n DocumentTypeSide,\n NodeDocumentCollection,\n} from \"../document-collection/DocumentCollection\";\nimport EndFlow from \"../session/EndFlow\";\nimport LoadingState from \"../states/LoadingState\";\nimport JDDWorkInProgress from \"../jdi/JDDWorkInProgress\";\nimport { getOrderedJourneySteps, getRunPrefillData } from \"../../services/sessionService\";\nimport type { SessionData, stepObject } from \"../../types/session\";\nimport type { UserInput } from \"../../types/userInput\";\nimport type { ContactInfo } from \"../../types/contactInfo\";\nimport UserInputForm from \"../session/UserInputForm\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport ConditionNodeHandler from \"./ConditionNodeHandler\";\nimport SignatureElectronic from \"../signature-electronic/SignatureElectronic\";\nimport ExternalVerificationNodeHandler from \"./ExternalVerificationNodeHandler\";\nimport PdfGeneration from \"../session/PdfGeneration\";\nimport LegalConsentNode from \"../legal-consent/LegalConsentNode\";\n\ninterface TemplateNodeRendererProps {\n session: SessionData;\n sessionId: string;\n stepObject: stepObject;\n stepHistory: number[];\n templateIndex: number;\n onContinueOnPC: () => void;\n userInput: UserInput;\n setUserInput: React.Dispatch<React.SetStateAction<UserInput>>;\n contactInfo: ContactInfo;\n setContactInfo: React.Dispatch<React.SetStateAction<ContactInfo>>;\n isMobileTemplate: boolean;\n}\n\nconst TemplateNodeRenderer: React.FC<TemplateNodeRendererProps> = ({\n session,\n sessionId,\n stepObject,\n stepHistory,\n templateIndex,\n onContinueOnPC,\n userInput,\n setUserInput,\n contactInfo,\n setContactInfo,\n isMobileTemplate,\n}) => {\n const { t } = useI18n();\n\n if (!session?.template) {\n console.error(t(\"template.error.console_no_template\"));\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(\"template.error.configuration\")}\n </h2>\n <p className=\"text-gray-600 mb-4\">{t(\"template.error.no_template\")}</p>\n </div>\n );\n }\n\n // Check if session is ended before rendering nodes\n if (session.status === \"ended\") {\n return (\n <EndFlow\n sessionId={sessionId}\n sessionStatus={session.status}\n callbackURL={session.callbackURL}\n compliantCase={session.template?.endScreenConfig?.compliant}\n nonCompliantCase={session.template?.endScreenConfig?.nonCompliant}\n />\n );\n }\n\n // Use getOrderedWorkflowSteps to get sorted and filtered nodes\n const templateNodes = useMemo(\n () => getOrderedJourneySteps(session.template),\n [session.template],\n );\n\n // Check if index is valid\n if (templateNodes.length === 0) {\n console.warn(\"No valid template nodes found after filtering\");\n return (\n <EndFlow\n sessionId={sessionId}\n sessionStatus={session?.status}\n callbackURL={session?.callbackURL}\n />\n );\n }\n\n if (templateIndex < 0 || templateIndex >= templateNodes.length) {\n console.warn(\n `Invalid template index: ${templateIndex}, max index: ${templateNodes.length - 1\n }`,\n );\n\n // If we're beyond the maximum index, it means we've completed all nodes\n if (templateIndex >= templateNodes.length) {\n return (\n <EndFlow\n sessionId={sessionId}\n sessionStatus={session?.status}\n callbackURL={session?.callbackURL}\n compliantCase={session?.template?.endScreenConfig?.compliant}\n nonCompliantCase={session?.template?.endScreenConfig?.nonCompliant}\n />\n );\n }\n\n // If index is negative, redirect to start\n if (templateIndex < 0) {\n setTimeout(() => stepObject.setStep(0), 0);\n return <LoadingState message={t(\"loading.step\")} subtitle=\"\" />;\n }\n }\n\n // At this point, we should have a valid node\n const node = templateNodes[templateIndex];\n if (!node) {\n console.error(\n `Node at index ${templateIndex} is undefined. Available nodes:`,\n templateNodes,\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(\"template.error.render\")}\n </h2>\n <p className=\"text-gray-600 mb-4\">\n {t(\"template.error.node_not_found\")}\n </p>\n <button\n className=\"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors\"\n onClick={() => stepObject.setStep(0)}\n >\n {t(\"template.buttons.restart\")}\n </button>\n </div>\n );\n }\n\n switch (node.type) {\n case \"end\":\n console.log(\"📄 Rendering EndFlow component\");\n return (\n <EndFlow\n sessionId={sessionId}\n sessionStatus={session?.status}\n callbackURL={session?.callbackURL}\n endNodeId={node.id}\n expectedResult={node.expectedResult}\n compliantCase={session?.template?.endScreenConfig?.compliant}\n nonCompliantCase={session?.template?.endScreenConfig?.nonCompliant}\n />\n );\n\n case \"information-input\": {\n // runIndex = nombre de fois que ce step a déjà été visité dans l'historique\n // (0 = premier passage, 1 = deuxième, …).\n // On compte les occurrences de (templateIndex + 1) dans stepHistory,\n // minus 1 car le step courant est déjà dans l'historique.\n const currentStep = templateIndex + 1;\n const visitCount = stepHistory.filter((s) => s === currentStep).length;\n const runIndex = Math.max(0, visitCount - 1);\n\n // Pré-remplissage multi-ENTITÉS : si _list présent, utiliser _list[runIndex]\n // (ou {} hors borne). L'énumération de plusieurs entités successives passe\n // exclusivement par _list (cf. docs/multi-runs.md).\n // Sans _list : on pré-remplit TOUJOURS depuis le userInput persisté — y compris\n // sur une ré-entrée (boucle condition de correction, retour arrière, bouton\n // \"Corriger ma saisie\"). Une ré-entrée sans _list = corriger les MÊMES données,\n // pas en saisir de nouvelles → on ne doit pas vider le formulaire.\n const hasList = Array.isArray(\n (session.userInput as Record<string, unknown>)?._list,\n );\n let initialUserInput: UserInput;\n if (hasList) {\n const prefill = getRunPrefillData(\n session.userInput as Record<string, unknown>,\n runIndex,\n );\n initialUserInput = (prefill ?? {}) as UserInput;\n } else {\n initialUserInput = userInput;\n }\n return (\n // key={node.id} : remonte le formulaire à chaque changement de nœud, pour\n // qu'il se ré-initialise depuis initialUserInput (comportement \"refresh sans\n // refresh\"). Évite la réutilisation d'instance qui laissait customFormData\n // périmé au retour arrière entre deux nœuds information-input.\n <UserInputForm\n key={node.id}\n stepObject={stepObject}\n node={node}\n template={session.template}\n setUserInput={setUserInput}\n initialUserInput={initialUserInput}\n contactInfo={contactInfo}\n setContactInfo={setContactInfo}\n sessionId={sessionId}\n />\n );\n }\n\n case \"document-collection\": {\n return (\n <DocumentCollection\n key={`doc-collection-${templateIndex}`}\n node={node as NodeDocumentCollection}\n stepObject={stepObject}\n sessionId={sessionId}\n template={session.template}\n onContinueOnPC={onContinueOnPC}\n allowedDocumentTypes={(node.allowedDocumentTypes || []).map(\n (docType: any) => ({\n ...docType,\n side:\n typeof docType.side === \"string\" ||\n typeof docType.side === \"number\"\n ? (docType.side as DocumentTypeSide)\n : undefined,\n }),\n )}\n allowedAddingMethods={node.allowedAddingMethods || [\"download\"]}\n introductionPage={node.introductionPage}\n documentSelection={node.documentSelection}\n allowResubmission={node.allowResubmission}\n maxResubmissionAttempts={node.maxResubmissionAttempts}\n />\n );\n }\n\n case \"document-selection\":\n case \"controle-jdi\": {\n if (!node.requiredDocumentType) {\n console.error(\n \"Missing requiredDocumentType in document-selection node:\",\n node,\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 Erreur de configuration\n </h2>\n <p className=\"text-gray-600 mb-4\">\n Le type de document requis n'est pas spécifié dans le template.\n </p>\n <button\n className=\"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors\"\n onClick={() => stepObject.setStep(0)}\n >\n Recommencer\n </button>\n </div>\n );\n }\n\n // Determine if current device is mobile for capture method\n const isMobile =\n /Android|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i.test(\n navigator.userAgent,\n );\n\n return (\n <DocumentCheck\n key={`doc-check-${templateIndex}`}\n stepObject={stepObject}\n node={node as NodeIdentityControl}\n sessionId={sessionId}\n documentTypeId={node.requiredDocumentType}\n acceptedCountries={node.acceptedCountries}\n onContinueOnPC={onContinueOnPC}\n isMobileCapture={isMobileTemplate && isMobile}\n allowedAddingMethods={\n node.allowedAddingMethods || [\"download\", \"picture\"]\n }\n template={session.template}\n templateIndex={templateIndex}\n setUserInput={setUserInput}\n />\n );\n // }\n }\n\n case \"biometric-capture\":\n case \"selfie-capture\":\n return (\n <Selfie\n key={`selfie-${templateIndex}`}\n stepObject={stepObject}\n sessionId={sessionId}\n node={node}\n template={session.template}\n />\n );\n\n case \"signature-electronic\":\n return (\n <SignatureElectronic\n key={`signature-${templateIndex}`}\n sessionId={sessionId}\n stepObject={stepObject}\n title={node.title}\n description={node.description}\n // Always pass a stable node identifier so backend can resolve\n // either a static DocuSeal template OR a generated PDF source.\n external_id={node.templateId || node.external_id || node.id}\n fieldMappings={node.fieldMappings}\n userInput={userInput}\n contactInfo={contactInfo}\n />\n );\n\n case \"video-capture\":\n console.log(\"🎥 Rendering Video Work in Progress component\");\n return <VideoWorkInProgress onContinue={onContinueOnPC} />;\n\n case \"jdd\":\n console.log(\"🚧 Rendering JDD Work in Progress component\");\n return <JDDWorkInProgress onContinue={onContinueOnPC} />;\n\n case \"condition\":\n console.debug(\"🔀 Rendering Condition Node Handler component and well\");\n return (\n <ConditionNodeHandler\n node={node}\n session={session}\n templateNodes={templateNodes}\n stepObject={stepObject}\n userInput={userInput}\n contactInfo={contactInfo}\n />\n );\n\n case \"external-verification\":\n console.debug(\"🔍 Rendering External Verification Node Handler\");\n return (\n <ExternalVerificationNodeHandler\n node={node}\n session={session}\n userInput={userInput}\n setUserInput={setUserInput}\n onNext={() => stepObject.goToNextStep(node.id, session.template)}\n onPrevious={() => stepObject.goBack()}\n onNavigateToNode={(nodeId: string) => {\n const idx = templateNodes.findIndex((n: any) => n.id === nodeId);\n // idx est 0-based, les steps sont 1-based → idx + 1.\n // goBackToStep tronque l'historique pour que le nœud corrigé\n // redevienne runIndex 0 (formulaire pré-rempli).\n if (idx !== -1) stepObject.goBackToStep(idx + 1);\n else stepObject.goBack();\n }}\n />\n );\n\n case \"pdf-generation\":\n console.debug(\"📄 Rendering PDF Generation component\");\n return (\n <PdfGeneration\n key={`pdf-generation-${templateIndex}`}\n node={node}\n session={session}\n sessionId={sessionId}\n stepObject={stepObject}\n userInput={userInput}\n />\n );\n\n case \"legal-consent\":\n return (\n <LegalConsentNode\n node={node}\n session={session}\n sessionId={sessionId}\n stepObject={stepObject}\n />\n );\n\n case \"custom\":\n // For custom nodes, we provide a basic structure that can be extended\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-blue-500 text-4xl mb-4\">🔧</div>\n <h2 className=\"text-xl font-bold text-blue-600 mb-2\">\n Nœud personnalisé\n </h2>\n <p className=\"text-gray-600 mb-4\">\n Implémentation personnalisée requise pour: \"{node.title || node.id}\"\n </p>\n <div className=\"bg-blue-50 border border-blue-200 rounded p-3 text-left text-sm mb-4 max-w-md\">\n <p className=\"font-semibold text-blue-700 mb-2\">\n Configuration du nœud:\n </p>\n <pre className=\"text-xs overflow-auto max-h-32\">\n {JSON.stringify(\n {\n id: node.id,\n title: node.title,\n description: node.description,\n options: node.options,\n selectedOptions: node.selectedOptions,\n },\n null,\n 2,\n )}\n </pre>\n </div>\n <button\n className=\"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors\"\n onClick={() => {\n console.log(\"Custom node action:\", node);\n stepObject.goToNextStep(node.id, session.template);\n }}\n >\n {t(\"template.buttons.continue\")}\n </button>\n </div>\n );\n\n default:\n console.warn(`❌ Type de nœud non supporté: ${node.type}`, node);\n console.log(\"❓ Available supported types:\", [\n \"end\",\n \"information-input\",\n \"document-collection\",\n \"document-selection\",\n \"document-upload\",\n \"controle-jdi\",\n \"selfie-capture\",\n \"video-capture\",\n \"country-selection\",\n \"identity-control\",\n \"jdd\",\n \"condition\",\n \"custom\",\n ]);\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-yellow-500 text-4xl mb-4\">⚠️</div>\n <h2 className=\"text-xl font-bold text-yellow-600 mb-2\">\n Étape non supportée\n </h2>\n <p className=\"text-gray-600 mb-4\">\n Le type d'étape \"{node.type}\" n'est pas pris en charge.\n </p>\n <div className=\"bg-gray-100 p-4 rounded mb-4 text-left text-xs overflow-auto max-h-32\">\n <pre>{JSON.stringify(node, null, 2)}</pre>\n </div>\n <button\n className=\"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors\"\n onClick={() => {\n stepObject.goToNextStep(node.id, session.template);\n }}\n >\n {t(\"template.buttons.continue\")}\n </button>\n </div>\n );\n }\n};\n\nexport default TemplateNodeRenderer;\n"],"names":["useI18n","_jsxs","_jsx","EndFlow","useMemo","getOrderedJourneySteps","LoadingState","getRunPrefillData","UserInputForm","DocumentCollection","__assign","DocumentCheck","Selfie","SignatureElectronic","VideoWorkInProgress","JDDWorkInProgress","ConditionNodeHandler","ExternalVerificationNodeHandler","PdfGeneration","LegalConsentNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqCA,IAAM,oBAAoB,GAAwC,UAAC,EAYlE,EAAA;;AAXC,IAAA,IAAA,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,aAAa,mBAAA,EACb,cAAc,GAAA,EAAA,CAAA,cAAA,EACd,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,YAAY,GAAA,EAAA,CAAA,YAAA,EACZ,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,cAAc,GAAA,EAAA,CAAA,cAAA,EACd,gBAAgB,GAAA,EAAA,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oB,EAAA,QAAA,EAAA,CAAA,yBAAA,EACb,IAAI,CAAC,IAAI,oCACzB,EACJC,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,uEAAuE,EAAA,QAAA,EACpFA,kCAAM,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAA,CAAO,EAAA,CACtC,EACNA,cAAA,CAAA,QAAA,EAAA,EACE,SAAS,EAAC,iFAAiF,EAC3F,OAAO,EAAE,YAAA;4BACP,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,QAAQ,CAAC;wBACpD,CAAC,EAAA,QAAA,EAEA,CAAC,CAAC,2BAA2B,CAAC,EAAA,CACxB,CAAA,EAAA,CACL;;AAGd;;;;"}
1
+ {"version":3,"file":"TemplateNodeRenderer.js","sources":["../../../../../src/components/template/TemplateNodeRenderer.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport Selfie from \"../session/Selfie\";\nimport VideoWorkInProgress from \"../session/VideoWorkInProgress\";\nimport DocumentCheck, { NodeIdentityControl } from \"../session/DocumentCheck\";\nimport DocumentCollection, {\n DocumentTypeSide,\n NodeDocumentCollection,\n} from \"../document-collection/DocumentCollection\";\nimport EndFlow from \"../session/EndFlow\";\nimport LoadingState from \"../states/LoadingState\";\nimport JDDWorkInProgress from \"../jdi/JDDWorkInProgress\";\nimport { getOrderedJourneySteps, getRunPrefillData } from \"../../services/sessionService\";\nimport type { SessionData, stepObject } from \"../../types/session\";\nimport type { UserInput } from \"../../types/userInput\";\nimport type { ContactInfo } from \"../../types/contactInfo\";\nimport UserInputForm from \"../session/UserInputForm\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport ConditionNodeHandler from \"./ConditionNodeHandler\";\nimport SignatureElectronic from \"../signature-electronic/SignatureElectronic\";\nimport ExternalVerificationNodeHandler from \"./ExternalVerificationNodeHandler\";\nimport PdfGeneration from \"../session/PdfGeneration\";\nimport LegalConsentNode from \"../legal-consent/LegalConsentNode\";\n\ninterface TemplateNodeRendererProps {\n session: SessionData;\n sessionId: string;\n stepObject: stepObject;\n stepHistory: number[];\n templateIndex: number;\n onContinueOnPC: () => void;\n userInput: UserInput;\n setUserInput: React.Dispatch<React.SetStateAction<UserInput>>;\n contactInfo: ContactInfo;\n setContactInfo: React.Dispatch<React.SetStateAction<ContactInfo>>;\n isMobileTemplate: boolean;\n}\n\nconst TemplateNodeRenderer: React.FC<TemplateNodeRendererProps> = ({\n session,\n sessionId,\n stepObject,\n stepHistory,\n templateIndex,\n onContinueOnPC,\n userInput,\n setUserInput,\n contactInfo,\n setContactInfo,\n isMobileTemplate,\n}) => {\n const { t } = useI18n();\n\n if (!session?.template) {\n console.error(t(\"template.error.console_no_template\"));\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(\"template.error.configuration\")}\n </h2>\n <p className=\"text-gray-600 mb-4\">{t(\"template.error.no_template\")}</p>\n </div>\n );\n }\n\n // Check if session is ended before rendering nodes\n if (session.status === \"ended\") {\n return (\n <EndFlow\n sessionId={sessionId}\n sessionStatus={session.status}\n callbackURL={session.callbackURL}\n compliantCase={session.template?.endScreenConfig?.compliant}\n nonCompliantCase={session.template?.endScreenConfig?.nonCompliant}\n />\n );\n }\n\n // Use getOrderedWorkflowSteps to get sorted and filtered nodes\n const templateNodes = useMemo(\n () => getOrderedJourneySteps(session.template),\n [session.template],\n );\n\n // Check if index is valid\n if (templateNodes.length === 0) {\n console.warn(\"No valid template nodes found after filtering\");\n return (\n <EndFlow\n sessionId={sessionId}\n sessionStatus={session?.status}\n callbackURL={session?.callbackURL}\n />\n );\n }\n\n if (templateIndex < 0 || templateIndex >= templateNodes.length) {\n console.warn(\n `Invalid template index: ${templateIndex}, max index: ${templateNodes.length - 1\n }`,\n );\n\n // If we're beyond the maximum index, it means we've completed all nodes\n if (templateIndex >= templateNodes.length) {\n return (\n <EndFlow\n sessionId={sessionId}\n sessionStatus={session?.status}\n callbackURL={session?.callbackURL}\n compliantCase={session?.template?.endScreenConfig?.compliant}\n nonCompliantCase={session?.template?.endScreenConfig?.nonCompliant}\n />\n );\n }\n\n // If index is negative, redirect to start\n if (templateIndex < 0) {\n setTimeout(() => stepObject.setStep(0), 0);\n return <LoadingState message={t(\"loading.step\")} subtitle=\"\" />;\n }\n }\n\n // At this point, we should have a valid node\n const node = templateNodes[templateIndex];\n if (!node) {\n console.error(\n `Node at index ${templateIndex} is undefined. Available nodes:`,\n templateNodes,\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(\"template.error.render\")}\n </h2>\n <p className=\"text-gray-600 mb-4\">\n {t(\"template.error.node_not_found\")}\n </p>\n <button\n className=\"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors\"\n onClick={() => stepObject.setStep(0)}\n >\n {t(\"template.buttons.restart\")}\n </button>\n </div>\n );\n }\n\n switch (node.type) {\n case \"end\":\n console.log(\"📄 Rendering EndFlow component\");\n return (\n <EndFlow\n sessionId={sessionId}\n sessionStatus={session?.status}\n callbackURL={session?.callbackURL}\n endNodeId={node.id}\n expectedResult={node.expectedResult}\n compliantCase={session?.template?.endScreenConfig?.compliant}\n nonCompliantCase={session?.template?.endScreenConfig?.nonCompliant}\n />\n );\n\n case \"information-input\": {\n // runIndex = nombre de fois que ce step a déjà été visité dans l'historique\n // (0 = premier passage, 1 = deuxième, …).\n // On compte les occurrences de (templateIndex + 1) dans stepHistory,\n // minus 1 car le step courant est déjà dans l'historique.\n const currentStep = templateIndex + 1;\n const visitCount = stepHistory.filter((s) => s === currentStep).length;\n const runIndex = Math.max(0, visitCount - 1);\n\n // Pré-remplissage multi-ENTITÉS : si _list présent, utiliser _list[runIndex]\n // (ou {} hors borne). L'énumération de plusieurs entités successives passe\n // exclusivement par _list (cf. docs/multi-runs.md).\n // Sans _list : on pré-remplit TOUJOURS depuis le userInput persisté — y compris\n // sur une ré-entrée (boucle condition de correction, retour arrière, bouton\n // \"Corriger ma saisie\"). Une ré-entrée sans _list = corriger les MÊMES données,\n // pas en saisir de nouvelles → on ne doit pas vider le formulaire.\n const hasList = Array.isArray(\n (session.userInput as Record<string, unknown>)?._list,\n );\n let initialUserInput: UserInput;\n if (hasList) {\n const prefill = getRunPrefillData(\n session.userInput as Record<string, unknown>,\n runIndex,\n );\n initialUserInput = (prefill ?? {}) as UserInput;\n } else {\n initialUserInput = userInput;\n }\n return (\n // key={node.id} : remonte le formulaire à chaque changement de nœud, pour\n // qu'il se ré-initialise depuis initialUserInput (comportement \"refresh sans\n // refresh\"). Évite la réutilisation d'instance qui laissait customFormData\n // périmé au retour arrière entre deux nœuds information-input.\n <UserInputForm\n key={node.id}\n stepObject={stepObject}\n node={node}\n template={session.template}\n setUserInput={setUserInput}\n initialUserInput={initialUserInput}\n contactInfo={contactInfo}\n setContactInfo={setContactInfo}\n sessionId={sessionId}\n />\n );\n }\n\n case \"document-collection\": {\n return (\n <DocumentCollection\n key={`doc-collection-${templateIndex}`}\n node={node as NodeDocumentCollection}\n stepObject={stepObject}\n sessionId={sessionId}\n template={session.template}\n onContinueOnPC={onContinueOnPC}\n allowedDocumentTypes={(node.allowedDocumentTypes || []).map(\n (docType: any) => ({\n ...docType,\n side:\n typeof docType.side === \"string\" ||\n typeof docType.side === \"number\"\n ? (docType.side as DocumentTypeSide)\n : undefined,\n }),\n )}\n allowedAddingMethods={node.allowedAddingMethods || [\"download\"]}\n introductionPage={node.introductionPage}\n documentSelection={node.documentSelection}\n allowResubmission={node.allowResubmission}\n maxResubmissionAttempts={node.maxResubmissionAttempts}\n />\n );\n }\n\n case \"document-selection\":\n case \"controle-jdi\": {\n if (!node.requiredDocumentType) {\n console.error(\n \"Missing requiredDocumentType in document-selection node:\",\n node,\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 Erreur de configuration\n </h2>\n <p className=\"text-gray-600 mb-4\">\n Le type de document requis n'est pas spécifié dans le template.\n </p>\n <button\n className=\"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors\"\n onClick={() => stepObject.setStep(0)}\n >\n Recommencer\n </button>\n </div>\n );\n }\n\n // Determine if current device is mobile for capture method\n const isMobile =\n /Android|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i.test(\n navigator.userAgent,\n );\n\n return (\n <DocumentCheck\n key={`doc-check-${templateIndex}`}\n stepObject={stepObject}\n node={node as NodeIdentityControl}\n sessionId={sessionId}\n documentTypeId={node.requiredDocumentType}\n acceptedCountries={node.acceptedCountries}\n onContinueOnPC={onContinueOnPC}\n isMobileCapture={isMobileTemplate && isMobile}\n allowedAddingMethods={\n node.allowedAddingMethods || [\"download\", \"picture\"]\n }\n template={session.template}\n templateIndex={templateIndex}\n setUserInput={setUserInput}\n />\n );\n // }\n }\n\n case \"biometric-capture\":\n case \"selfie-capture\":\n return (\n <Selfie\n key={`selfie-${templateIndex}`}\n stepObject={stepObject}\n sessionId={sessionId}\n node={node}\n template={session.template}\n />\n );\n\n case \"signature-electronic\":\n return (\n <SignatureElectronic\n key={`signature-${templateIndex}`}\n sessionId={sessionId}\n stepObject={stepObject}\n node={node}\n session={session}\n title={node.title}\n description={node.description}\n // Always pass a stable node identifier so backend can resolve\n // either a static DocuSeal template OR a generated PDF source.\n external_id={node.templateId || node.external_id || node.id}\n fieldMappings={node.fieldMappings}\n userInput={userInput}\n contactInfo={contactInfo}\n />\n );\n\n case \"video-capture\":\n console.log(\"🎥 Rendering Video Work in Progress component\");\n return <VideoWorkInProgress onContinue={onContinueOnPC} />;\n\n case \"jdd\":\n console.log(\"🚧 Rendering JDD Work in Progress component\");\n return <JDDWorkInProgress onContinue={onContinueOnPC} />;\n\n case \"condition\":\n console.debug(\"🔀 Rendering Condition Node Handler component and well\");\n return (\n <ConditionNodeHandler\n node={node}\n session={session}\n templateNodes={templateNodes}\n stepObject={stepObject}\n userInput={userInput}\n contactInfo={contactInfo}\n />\n );\n\n case \"external-verification\":\n console.debug(\"🔍 Rendering External Verification Node Handler\");\n return (\n <ExternalVerificationNodeHandler\n node={node}\n session={session}\n userInput={userInput}\n setUserInput={setUserInput}\n onNext={() => stepObject.goToNextStep(node.id, session.template)}\n onPrevious={() => stepObject.goBack()}\n onNavigateToNode={(nodeId: string) => {\n const idx = templateNodes.findIndex((n: any) => n.id === nodeId);\n // idx est 0-based, les steps sont 1-based → idx + 1.\n // goBackToStep tronque l'historique pour que le nœud corrigé\n // redevienne runIndex 0 (formulaire pré-rempli).\n if (idx !== -1) stepObject.goBackToStep(idx + 1);\n else stepObject.goBack();\n }}\n />\n );\n\n case \"pdf-generation\":\n console.debug(\"📄 Rendering PDF Generation component\");\n return (\n <PdfGeneration\n key={`pdf-generation-${templateIndex}`}\n node={node}\n session={session}\n sessionId={sessionId}\n stepObject={stepObject}\n userInput={userInput}\n />\n );\n\n case \"legal-consent\":\n return (\n <LegalConsentNode\n node={node}\n session={session}\n sessionId={sessionId}\n stepObject={stepObject}\n />\n );\n\n case \"custom\":\n // For custom nodes, we provide a basic structure that can be extended\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-blue-500 text-4xl mb-4\">🔧</div>\n <h2 className=\"text-xl font-bold text-blue-600 mb-2\">\n Nœud personnalisé\n </h2>\n <p className=\"text-gray-600 mb-4\">\n Implémentation personnalisée requise pour: \"{node.title || node.id}\"\n </p>\n <div className=\"bg-blue-50 border border-blue-200 rounded p-3 text-left text-sm mb-4 max-w-md\">\n <p className=\"font-semibold text-blue-700 mb-2\">\n Configuration du nœud:\n </p>\n <pre className=\"text-xs overflow-auto max-h-32\">\n {JSON.stringify(\n {\n id: node.id,\n title: node.title,\n description: node.description,\n options: node.options,\n selectedOptions: node.selectedOptions,\n },\n null,\n 2,\n )}\n </pre>\n </div>\n <button\n className=\"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors\"\n onClick={() => {\n console.log(\"Custom node action:\", node);\n stepObject.goToNextStep(node.id, session.template);\n }}\n >\n {t(\"template.buttons.continue\")}\n </button>\n </div>\n );\n\n default:\n console.warn(`❌ Type de nœud non supporté: ${node.type}`, node);\n console.log(\"❓ Available supported types:\", [\n \"end\",\n \"information-input\",\n \"document-collection\",\n \"document-selection\",\n \"document-upload\",\n \"controle-jdi\",\n \"selfie-capture\",\n \"video-capture\",\n \"country-selection\",\n \"identity-control\",\n \"jdd\",\n \"condition\",\n \"custom\",\n ]);\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-yellow-500 text-4xl mb-4\">⚠️</div>\n <h2 className=\"text-xl font-bold text-yellow-600 mb-2\">\n Étape non supportée\n </h2>\n <p className=\"text-gray-600 mb-4\">\n Le type d'étape \"{node.type}\" n'est pas pris en charge.\n </p>\n <div className=\"bg-gray-100 p-4 rounded mb-4 text-left text-xs overflow-auto max-h-32\">\n <pre>{JSON.stringify(node, null, 2)}</pre>\n </div>\n <button\n className=\"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors\"\n onClick={() => {\n stepObject.goToNextStep(node.id, session.template);\n }}\n >\n {t(\"template.buttons.continue\")}\n </button>\n </div>\n );\n }\n};\n\nexport default TemplateNodeRenderer;\n"],"names":["useI18n","_jsxs","_jsx","EndFlow","useMemo","getOrderedJourneySteps","LoadingState","getRunPrefillData","UserInputForm","DocumentCollection","__assign","DocumentCheck","Selfie","SignatureElectronic","VideoWorkInProgress","JDDWorkInProgress","ConditionNodeHandler","ExternalVerificationNodeHandler","PdfGeneration","LegalConsentNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqCA,IAAM,oBAAoB,GAAwC,UAAC,EAYlE,EAAA;;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AAoB;gBACpB,iBAAiB;gBACjB,cAAc;gBACd,gBAAgB;gBAChB,eAAe;gBACf,mBAAmB;gBACnB,kBAAkB;gBAClB,KAAK;gBACL,WAAW;gBACX,QAAQ;AACT,aAAA,CAAC;YACF,QACED,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,kEAAkE,aAC/EC,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,+BAA+B,EAAA,QAAA,EAAA,cAAA,EAAA,CAAS,EACvDA,uBAAI,SAAS,EAAC,wCAAwC,EAAA,QAAA,EAAA,+BAAA,EAAA,CAEjD,EACLD,eAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,oBAAoB,EAAA,QAAA,EAAA,CAAA,yBAAA,EACb,IAAI,CAAC,IAAI,oCACzB,EACJC,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,uEAAuE,EAAA,QAAA,EACpFA,kCAAM,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAA,CAAO,EAAA,CACtC,EACNA,cAAA,CAAA,QAAA,EAAA,EACE,SAAS,EAAC,iFAAiF,EAC3F,OAAO,EAAE,YAAA;4BACP,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,QAAQ,CAAC;wBACpD,CAAC,EAAA,QAAA,EAEA,CAAC,CAAC,2BAA2B,CAAC,EAAA,CACxB,CAAA,EAAA,CACL;;AAGd;;;;"}
@@ -41,6 +41,7 @@ var ADDRESS_SUGGESTIONS = [
41
41
  var DEFAULT_FIELDS = {
42
42
  identity: ["nom", "prenom", "date_naissance"],
43
43
  "identity-legal": ["nom", "registrationNumber", "siret", "tva", "adresse"],
44
+ "identity-legal-rep": ["legalRepresentativeNom", "legalRepresentativePrenom"],
44
45
  contact: ["email", "sms"],
45
46
  address: ["adresse"],
46
47
  nationality: ["nationalite"],
@@ -56,8 +57,7 @@ var FIELD_LABELS = {
56
57
  company: "user_input_form.fields.company_name",
57
58
  siret: "user_input_form.fields.siret",
58
59
  tva: "user_input_form.fields.vat_number",
59
- registrationNumber: "user_input_form.fields.registration_number",
60
- };
60
+ registrationNumber: "user_input_form.fields.registration_number"};
61
61
  // Backend endpoint pour l'autocomplétion d'adresses (sécurisé)
62
62
  var GEOCODING_AUTOCOMPLETE_ENDPOINT = "/geocoding/autocomplete";
63
63
  var FALLBACK_ADDRESS_SUGGESTIONS = ADDRESS_SUGGESTIONS.map(function (label, index) { return ({
@@ -1 +1 @@
1
- {"version":3,"file":"userInputForm.js","sources":["../../../../src/constants/userInputForm.ts"],"sourcesContent":["import type {\n AddressSuggestion,\n InformationType,\n RequestedFieldKey,\n SelectOption,\n} from \"../types/userInputForm\";\n\nconst days = Array.from({ length: 31 }, (_, index) => index + 1);\nconst currentYear = new Date().getFullYear();\nconst years = Array.from({ length: 120 }, (_, index) => currentYear - index);\n\nconst monthLabels = [\n \"Janvier\",\n \"Février\",\n \"Mars\",\n \"Avril\",\n \"Mai\",\n \"Juin\",\n \"Juillet\",\n \"Août\",\n \"Septembre\",\n \"Octobre\",\n \"Novembre\",\n \"Décembre\",\n];\n\nexport const DAY_OPTIONS: SelectOption[] = days.map((value) => ({\n value: String(value).padStart(2, \"0\"),\n label: String(value).padStart(2, \"0\"),\n}));\n\nexport const MONTH_OPTIONS: SelectOption[] = monthLabels.map(\n (label, index) => ({\n value: String(index + 1).padStart(2, \"0\"),\n label,\n })\n);\n\nexport const YEAR_OPTIONS: SelectOption[] = years.map((value) => ({\n value: String(value),\n label: String(value),\n}));\n\n\nexport const ADDRESS_SUGGESTIONS: string[] = [\n \"10 Rue de Rivoli, 75001 Paris, France\",\n \"221B Baker Street, NW1 6XE Londres, Royaume-Uni\",\n \"1600 Amphitheatre Parkway, 94043 Mountain View, États-Unis\",\n \"55 Rue du Faubourg Saint-Honoré, 75008 Paris, France\",\n \"1 Place du Commerce, 44000 Nantes, France\",\n \"Piazza del Colosseo 1, 00184 Rome, Italie\",\n \"Av. Paulista 1578, 01310-200 São Paulo, Brésil\",\n];\n\nexport const DEFAULT_FIELDS: Record<InformationType, RequestedFieldKey[]> = {\n identity: [\"nom\", \"prenom\", \"date_naissance\"],\n \"identity-legal\": [\"nom\", \"registrationNumber\", \"siret\", \"tva\", \"adresse\"],\n contact: [\"email\", \"sms\"],\n address: [\"adresse\"],\n nationality: [\"nationalite\"],\n custom: [], // Custom forms use customFields instead\n};\n\nexport const FIELD_LABELS: Record<RequestedFieldKey, string> = {\n nom: \"user_input_form.fields.last_name\",\n prenom: \"user_input_form.fields.first_name\",\n date_naissance: \"user_input_form.fields.birth_date\",\n email: \"user_input_form.fields.email\",\n sms: \"user_input_form.fields.phone\",\n adresse: \"user_input_form.fields.address_line1\",\n nationalite: \"user_input_form.fields.nationality\",\n company: \"user_input_form.fields.company_name\",\n siret: \"user_input_form.fields.siret\",\n tva: \"user_input_form.fields.vat_number\",\n registrationNumber: \"user_input_form.fields.registration_number\",\n};\n\n// Backend endpoint pour l'autocomplétion d'adresses (sécurisé)\nexport const GEOCODING_AUTOCOMPLETE_ENDPOINT = \"/geocoding/autocomplete\";\n\nexport const FALLBACK_ADDRESS_SUGGESTIONS: AddressSuggestion[] =\n ADDRESS_SUGGESTIONS.map((label, index) => ({\n id: `fallback-${index}`,\n label,\n addressLine1: label,\n postalCode: \"\",\n city: \"\",\n country: \"\",\n }));\n"],"names":[],"mappings":";;AAOA,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,UAAC,CAAC,EAAE,KAAK,EAAA,EAAK,OAAA,KAAK,GAAG,CAAC,CAAA,CAAT,CAAS,CAAC;AAChE,IAAM,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AAC5C,IAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,UAAC,CAAC,EAAE,KAAK,EAAA,EAAK,OAAA,WA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,KAAK,EAAE,SAAS,CAAC;AAC1E,IAAA,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC;IACzB,OAAO,EAAE,CAAC,SAAS,CAAC;IACpB,WAAW,EAAE,CAAC,aAAa,CAAC;IAC5B,MAAM,EAAE,EAAE;;AAGL,IAAM,YAAY,GAAsC;AAC7D,IAAA,GAAG,EAAE,kCAAkC;AACvC,IAAA,MAAM,EAAE,mCAAmC;AAC3C,IAAA,cAAc,EAAE,mCAAmC;AACnD,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,GAAG,EAAE,8BAA8B;AACnC,IACA,WAAW,EAAE,oCAAoC;AACjD,IAAA,OAAO,EAAE,qCAAqC;AAC9C,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,GAAG,EAAE,mCAAmC;AACxC,IAAA,kBAAkB,EAAE,4CAA4C;;AAGlE;AACO,IAAM,+BAA+B,GAAG;AAExC,IAAM,4BAA4B,GACvC,mBAAmB,CAAC,GAAG,CAAC,UAAC,KAAK,EAAE,KAAK,EAAA,EAAK,QAAC;IACzC,EAAE,EAAE,WAAA,CAAA,MAAA,CAAY,KAAK,CAAE;AACvB,IAAA,KAAK,EAAA,KAAA;AACL,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,IAAI,EAAE,EAAE;AACR,IAAA,OAAO,EAAE,EAAE;CACZ,EAAC,CAPwC,CAOxC;;;;;;;;;;;"}
1
+ {"version":3,"file":"userInputForm.js","sources":["../../../../src/constants/userInputForm.ts"],"sourcesContent":["import type {\n AddressSuggestion,\n InformationType,\n RequestedFieldKey,\n SelectOption,\n} from \"../types/userInputForm\";\n\nconst days = Array.from({ length: 31 }, (_, index) => index + 1);\nconst currentYear = new Date().getFullYear();\nconst years = Array.from({ length: 120 }, (_, index) => currentYear - index);\n\nconst monthLabels = [\n \"Janvier\",\n \"Février\",\n \"Mars\",\n \"Avril\",\n \"Mai\",\n \"Juin\",\n \"Juillet\",\n \"Août\",\n \"Septembre\",\n \"Octobre\",\n \"Novembre\",\n \"Décembre\",\n];\n\nexport const DAY_OPTIONS: SelectOption[] = days.map((value) => ({\n value: String(value).padStart(2, \"0\"),\n label: String(value).padStart(2, \"0\"),\n}));\n\nexport const MONTH_OPTIONS: SelectOption[] = monthLabels.map(\n (label, index) => ({\n value: String(index + 1).padStart(2, \"0\"),\n label,\n })\n);\n\nexport const YEAR_OPTIONS: SelectOption[] = years.map((value) => ({\n value: String(value),\n label: String(value),\n}));\n\n\nexport const ADDRESS_SUGGESTIONS: string[] = [\n \"10 Rue de Rivoli, 75001 Paris, France\",\n \"221B Baker Street, NW1 6XE Londres, Royaume-Uni\",\n \"1600 Amphitheatre Parkway, 94043 Mountain View, États-Unis\",\n \"55 Rue du Faubourg Saint-Honoré, 75008 Paris, France\",\n \"1 Place du Commerce, 44000 Nantes, France\",\n \"Piazza del Colosseo 1, 00184 Rome, Italie\",\n \"Av. Paulista 1578, 01310-200 São Paulo, Brésil\",\n];\n\nexport const DEFAULT_FIELDS: Record<InformationType, RequestedFieldKey[]> = {\n identity: [\"nom\", \"prenom\", \"date_naissance\"],\n \"identity-legal\": [\"nom\", \"registrationNumber\", \"siret\", \"tva\", \"adresse\"],\n \"identity-legal-rep\": [\"legalRepresentativeNom\", \"legalRepresentativePrenom\"],\n contact: [\"email\", \"sms\"],\n address: [\"adresse\"],\n nationality: [\"nationalite\"],\n custom: [], // Custom forms use customFields instead\n};\n\nexport const FIELD_LABELS: Record<RequestedFieldKey, string> = {\n nom: \"user_input_form.fields.last_name\",\n prenom: \"user_input_form.fields.first_name\",\n date_naissance: \"user_input_form.fields.birth_date\",\n email: \"user_input_form.fields.email\",\n sms: \"user_input_form.fields.phone\",\n adresse: \"user_input_form.fields.address_line1\",\n nationalite: \"user_input_form.fields.nationality\",\n company: \"user_input_form.fields.company_name\",\n siret: \"user_input_form.fields.siret\",\n tva: \"user_input_form.fields.vat_number\",\n registrationNumber: \"user_input_form.fields.registration_number\",\n legalRepresentativeNom:\n \"user_input_form.fields.legal_representative_last_name\",\n legalRepresentativePrenom:\n \"user_input_form.fields.legal_representative_first_name\",\n};\n\n// Backend endpoint pour l'autocomplétion d'adresses (sécurisé)\nexport const GEOCODING_AUTOCOMPLETE_ENDPOINT = \"/geocoding/autocomplete\";\n\nexport const FALLBACK_ADDRESS_SUGGESTIONS: AddressSuggestion[] =\n ADDRESS_SUGGESTIONS.map((label, index) => ({\n id: `fallback-${index}`,\n label,\n addressLine1: label,\n postalCode: \"\",\n city: \"\",\n country: \"\",\n }));\n"],"names":[],"mappings":";;AAOA,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,UAAC,CAAC,EAAE,KAAK,EAAA,EAAK,OAAA,KAAK,GAAG,CAAC,CAAA,CAAT,CAAS,CAAC;AAChE,IAAM,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AAC5C,IAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,UAAC,CAAC,EAAE,KAAK,EAAA,EAAK,OAAA,WAAW,GAAG,KAAK,CAAA,CAAnB,CAAmB,CAAC;AAE5E,IAAM,WAAW,GAAG;IAClB,SAAS;IACT,SAAS;IACT,MAAM;IACN,OAAO;IACP,KAAK;IACL,MAAM;IACN,SAAS;IACT,MAAM;IACN,WAAW;IACX,SAAS;IACT,UAAU;IACV,UAAU;CACX;AAEM,IAAM,WAAW,GAAmB,IAAI,CAAC,GAAG,CAAC,UAAC,KAAK,EAAA,EAAK,QAAC;IAC9D,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;CACtC,EAAC,CAH6D,CAG7D;AAEK,IAAM,aAAa,GAAmB,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A,KAAK,EAAE,8BAA8B;AACrC,IAAA,GAAG,EAAE,mCAAmC;AACxC,IAAA,kBAAkB,EAAE;AAOtB;AACO,IAAM,+BAA+B,GAAG;AAExC,IAAM,4BAA4B,GACvC,mBAAmB,CAAC,GAAG,CAAC,UAAC,KAAK,EAAE,KAAK,EAAA,EAAK,QAAC;IACzC,EAAE,EAAE,WAAA,CAAA,MAAA,CAAY,KAAK,CAAE;AACvB,IAAA,KAAK,EAAA,KAAA;AACL,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,IAAI,EAAE,EAAE;AACR,IAAA,OAAO,EAAE,EAAE;CACZ,EAAC,CAPwC,CAOxC;;;;;;;;;;;"}
@@ -59,6 +59,8 @@ var useUserInputForm = function (_a) {
59
59
  siret: (initialUserInput === null || initialUserInput === void 0 ? void 0 : initialUserInput.siret) || "",
60
60
  tva: (initialUserInput === null || initialUserInput === void 0 ? void 0 : initialUserInput.tva) || "",
61
61
  registrationNumber: (initialUserInput === null || initialUserInput === void 0 ? void 0 : initialUserInput.registrationNumber) || "",
62
+ legalRepresentativeLastName: (initialUserInput === null || initialUserInput === void 0 ? void 0 : initialUserInput.legalRepresentativeLastName) || "",
63
+ legalRepresentativeFirstName: (initialUserInput === null || initialUserInput === void 0 ? void 0 : initialUserInput.legalRepresentativeFirstName) || "",
62
64
  }), form = _b[0], setForm = _b[1];
63
65
  var _c = React.useState({}), errors = _c[0], setErrors = _c[1];
64
66
  // Custom form state
@@ -367,6 +369,16 @@ var useUserInputForm = function (_a) {
367
369
  markError("registrationNumber");
368
370
  }
369
371
  }
372
+ if (informationType === "identity-legal-rep") {
373
+ if (requestedFields.has("legalRepresentativeNom") &&
374
+ !form.legalRepresentativeLastName) {
375
+ markError("legalRepresentativeLastName");
376
+ }
377
+ if (requestedFields.has("legalRepresentativePrenom") &&
378
+ !form.legalRepresentativeFirstName) {
379
+ markError("legalRepresentativeFirstName");
380
+ }
381
+ }
370
382
  if (informationType === "contact") {
371
383
  if (requestedFields.has("email")) {
372
384
  var emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
@@ -585,7 +597,7 @@ var useUserInputForm = function (_a) {
585
597
  if (!validateForm()) {
586
598
  return;
587
599
  }
588
- setUserInput(function (previous) { return (tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign({}, previous), (requestedFields.has("nom") && tslib_es6.__assign({}, (informationType === "identity-legal"
600
+ setUserInput(function (previous) { return (tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign({}, previous), (requestedFields.has("nom") && tslib_es6.__assign({}, (informationType === "identity-legal"
589
601
  ? { companyName: form.companyName }
590
602
  : { lastName: form.lastName })))), (requestedFields.has("prenom") && { firstName: form.firstName })), (requestedFields.has("date_naissance") && {
591
603
  birthDate: form.birthDate,
@@ -600,6 +612,10 @@ var useUserInputForm = function (_a) {
600
612
  countryCode: form.countryCode,
601
613
  })), (requestedFields.has("siret") && { siret: form.siret })), (requestedFields.has("tva") && { tva: form.tva })), (requestedFields.has("registrationNumber") && { registrationNumber: form.registrationNumber })), (requestedFields.has("siret") && !requestedFields.has("registrationNumber") && { registrationNumber: form.siret })), (requestedFields.has("nationalite") && {
602
614
  nationality: form.nationality,
615
+ })), (requestedFields.has("legalRepresentativeNom") && {
616
+ legalRepresentativeLastName: form.legalRepresentativeLastName,
617
+ })), (requestedFields.has("legalRepresentativePrenom") && {
618
+ legalRepresentativeFirstName: form.legalRepresentativeFirstName,
603
619
  }))); });
604
620
  if (informationType === "contact" && setContactInfo) {
605
621
  setContactInfo(function (previous) { return (tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign({}, previous), (requestedFields.has("email") && { email: form.email })), (requestedFields.has("sms") && { phoneNumber: form.phoneNumber }))); });