datakeen-session-react 1.1.181 → 1.1.183
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +115 -46
- package/dist/cjs/components/document-collection/DocumentCollection.js +4 -2
- package/dist/cjs/components/document-collection/DocumentCollection.js.map +1 -1
- package/dist/cjs/components/document-collection/DocumentCollectionIntroduction.js +1 -1
- package/dist/cjs/components/document-collection/DocumentCollectionIntroduction.js.map +1 -1
- package/dist/cjs/components/document-collection/DocumentCollectionMethodSelection.js +1 -1
- package/dist/cjs/components/document-collection/DocumentCollectionMethodSelection.js.map +1 -1
- package/dist/cjs/components/document-collection/DocumentCollectionSelection.js +1 -1
- package/dist/cjs/components/document-collection/DocumentCollectionSelection.js.map +1 -1
- package/dist/cjs/components/document-collection/DocumentCollectionUpload.js +1 -1
- package/dist/cjs/components/document-collection/DocumentCollectionUpload.js.map +1 -1
- package/dist/cjs/components/document-collection/DocumentError.js +1 -1
- package/dist/cjs/components/document-collection/DocumentError.js.map +1 -1
- package/dist/cjs/components/jdi/JDICountrySelection.js +1 -1
- package/dist/cjs/components/jdi/JDICountrySelection.js.map +1 -1
- package/dist/cjs/components/jdi/JDIDocumentSelection.js +1 -1
- package/dist/cjs/components/jdi/JDIDocumentSelection.js.map +1 -1
- package/dist/cjs/components/jdi/JDIDocumentUpload.js +1 -1
- package/dist/cjs/components/jdi/JDIDocumentUpload.js.map +1 -1
- package/dist/cjs/components/jdi/JDIError.js +1 -1
- package/dist/cjs/components/jdi/JDIError.js.map +1 -1
- package/dist/cjs/components/jdi/JDIPreIntroduction.js +1 -1
- package/dist/cjs/components/jdi/JDIPreIntroduction.js.map +1 -1
- package/dist/cjs/components/selfie/Video.js +2 -2
- package/dist/cjs/components/selfie/Video.js.map +1 -1
- package/dist/cjs/components/selfie/selfie-flow/SelfieFlow.js +2 -11
- package/dist/cjs/components/selfie/selfie-flow/SelfieFlow.js.map +1 -1
- package/dist/cjs/components/selfie/selfie-flow/SelfiePreIntroduction.js.map +1 -1
- package/dist/cjs/components/session/DocumentCheck.js +4 -2
- package/dist/cjs/components/session/DocumentCheck.js.map +1 -1
- package/dist/cjs/components/session/Selfie.js +6 -18
- package/dist/cjs/components/session/Selfie.js.map +1 -1
- package/dist/cjs/components/session/UserInputForm/LegalRepFields.js +5 -1
- package/dist/cjs/components/session/UserInputForm/LegalRepFields.js.map +1 -1
- package/dist/cjs/components/session/UserInputForm.js +1 -7
- package/dist/cjs/components/session/UserInputForm.js.map +1 -1
- package/dist/cjs/components/signature-electronic/SignatureElectronic.js +1 -1
- package/dist/cjs/components/signature-electronic/SignatureElectronic.js.map +1 -1
- package/dist/cjs/components/signature-electronic/SignatureElectronicIntroduction.js +2 -2
- package/dist/cjs/components/signature-electronic/SignatureElectronicIntroduction.js.map +1 -1
- package/dist/cjs/components/template/ExternalVerificationNodeHandler.js +74 -36
- package/dist/cjs/components/template/ExternalVerificationNodeHandler.js.map +1 -1
- package/dist/cjs/constants/userInputForm.js.map +1 -1
- package/dist/cjs/hooks/useStepNavigation.js +60 -12
- package/dist/cjs/hooks/useStepNavigation.js.map +1 -1
- package/dist/cjs/hooks/useUserInputForm.js +12 -3
- package/dist/cjs/hooks/useUserInputForm.js.map +1 -1
- package/dist/cjs/types/session.js.map +1 -1
- package/dist/esm/components/document-collection/DocumentCollection.js +4 -2
- package/dist/esm/components/document-collection/DocumentCollection.js.map +1 -1
- package/dist/esm/components/document-collection/DocumentCollectionIntroduction.js +1 -1
- package/dist/esm/components/document-collection/DocumentCollectionIntroduction.js.map +1 -1
- package/dist/esm/components/document-collection/DocumentCollectionMethodSelection.js +1 -1
- package/dist/esm/components/document-collection/DocumentCollectionMethodSelection.js.map +1 -1
- package/dist/esm/components/document-collection/DocumentCollectionSelection.js +1 -1
- package/dist/esm/components/document-collection/DocumentCollectionSelection.js.map +1 -1
- package/dist/esm/components/document-collection/DocumentCollectionUpload.js +1 -1
- package/dist/esm/components/document-collection/DocumentCollectionUpload.js.map +1 -1
- package/dist/esm/components/document-collection/DocumentError.js +1 -1
- package/dist/esm/components/document-collection/DocumentError.js.map +1 -1
- package/dist/esm/components/jdi/JDICountrySelection.js +1 -1
- package/dist/esm/components/jdi/JDICountrySelection.js.map +1 -1
- package/dist/esm/components/jdi/JDIDocumentSelection.js +1 -1
- package/dist/esm/components/jdi/JDIDocumentSelection.js.map +1 -1
- package/dist/esm/components/jdi/JDIDocumentUpload.js +1 -1
- package/dist/esm/components/jdi/JDIDocumentUpload.js.map +1 -1
- package/dist/esm/components/jdi/JDIError.js +1 -1
- package/dist/esm/components/jdi/JDIError.js.map +1 -1
- package/dist/esm/components/jdi/JDIPreIntroduction.js +1 -1
- package/dist/esm/components/jdi/JDIPreIntroduction.js.map +1 -1
- package/dist/esm/components/selfie/Video.js +2 -2
- package/dist/esm/components/selfie/Video.js.map +1 -1
- package/dist/esm/components/selfie/selfie-flow/SelfieFlow.js +2 -11
- package/dist/esm/components/selfie/selfie-flow/SelfieFlow.js.map +1 -1
- package/dist/esm/components/selfie/selfie-flow/SelfiePreIntroduction.js.map +1 -1
- package/dist/esm/components/session/DocumentCheck.js +4 -2
- package/dist/esm/components/session/DocumentCheck.js.map +1 -1
- package/dist/esm/components/session/Selfie.js +6 -18
- package/dist/esm/components/session/Selfie.js.map +1 -1
- package/dist/esm/components/session/UserInputForm/LegalRepFields.js +5 -1
- package/dist/esm/components/session/UserInputForm/LegalRepFields.js.map +1 -1
- package/dist/esm/components/session/UserInputForm.js +1 -7
- package/dist/esm/components/session/UserInputForm.js.map +1 -1
- package/dist/esm/components/signature-electronic/SignatureElectronic.js +1 -1
- package/dist/esm/components/signature-electronic/SignatureElectronic.js.map +1 -1
- package/dist/esm/components/signature-electronic/SignatureElectronicIntroduction.js +2 -2
- package/dist/esm/components/signature-electronic/SignatureElectronicIntroduction.js.map +1 -1
- package/dist/esm/components/template/ExternalVerificationNodeHandler.js +75 -37
- package/dist/esm/components/template/ExternalVerificationNodeHandler.js.map +1 -1
- package/dist/esm/constants/userInputForm.js.map +1 -1
- package/dist/esm/hooks/useStepNavigation.js +60 -12
- package/dist/esm/hooks/useStepNavigation.js.map +1 -1
- package/dist/esm/hooks/useUserInputForm.js +12 -3
- package/dist/esm/hooks/useUserInputForm.js.map +1 -1
- package/dist/esm/types/session.js.map +1 -1
- package/docs/navigation-history.md +18 -1
- package/package.json +1 -1
|
@@ -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 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":["_jsxs","_jsx","_Fragment"],"mappings":";;;;;;;;;;;;;;;;AAgBA,IAAM,aAAa,GAAG,UAAC,KAAyB,EAAA;;AACtC,IAAA,IAAA,CAAC,GAAK,OAAO,EAAE,EAAd;IAC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,IACF,EAAA,CACF,CAAA,EAAA,CACW;AAEvB;;;;"}
|
|
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 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 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={props.stepObject.canGoBack ? (\n <Button variant=\"secondary\" onClick={goOnPreviousStep}>\n {t(\"user_input_form.buttons.back\")}\n </Button>\n ) : undefined}\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":["_jsxs","_jsx","_Fragment"],"mappings":";;;;;;;;;;;;;;;;AAgBA,IAAM,aAAa,GAAG,UAAC,KAAyB,EAAA;;AACtC,IAAA,IAAA,CAAC,GAAK,OAAO,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,SAAS,KAAK,MAAM,CAAA,CAA1B,CAA0B,CAAC;AAEvE,IAAA,IAAA,EAAA,GAoBF,gBAAgB,CAAC,KAAK,CAAC,EAnBzB,IAAI,GAAA,EAAA,CAAA,IAAA,EACJ,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,eAAe,GAAA,EAAA,CAAA,eAAA,EACf,eAAe,GAAA,EAAA,CAAA,eAAA,EAC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AChC,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;;;;"}
|
|
@@ -139,7 +139,7 @@ var SignatureElectronic = function (_a) {
|
|
|
139
139
|
// No template configured — show error instead of silently falling back to intro
|
|
140
140
|
return (jsxs("div", { className: "flex flex-col items-center justify-center h-full p-4 text-center", children: [jsx("div", { className: "text-red-500 text-4xl mb-4", children: "\u26A0\uFE0F" }), jsx("h2", { className: "text-xl font-bold text-red-600 mb-2", children: t("signature.error_title", "Erreur") }), jsx("p", { className: "text-gray-600 mb-4", children: t("signature.no_template", "Le modèle de signature n'est pas configuré.") }), jsx("button", { className: "px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors", onClick: handleBack, children: t("buttons.back", "Retour") })] }));
|
|
141
141
|
}
|
|
142
|
-
return (jsx(SignatureElectronicIntroduction, { onContinue: handleContinue, onBack: handleBack, title: title, description: description }));
|
|
142
|
+
return (jsx(SignatureElectronicIntroduction, { onContinue: handleContinue, onBack: stepObject.canGoBack ? handleBack : undefined, title: title, description: description }));
|
|
143
143
|
};
|
|
144
144
|
|
|
145
145
|
export { SignatureElectronic as default };
|
|
@@ -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, 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 SignedDocumentPreview from \"./SignedDocumentPreview\";\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 denomination_sociale: (ui) => ui.companyName,\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 const [showSignedDocumentPreview, setShowSignedDocumentPreview] = useState<boolean>(false);\n const [signedAt, setSignedAt] = useState<string | null>(null);\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 // Toujours montrer le document réellement signé avant de continuer\n // (rassure l'utilisateur — pas de bascule directe vers l'étape suivante).\n setSignedAt(new Date().toISOString());\n setShowSignedDocumentPreview(true);\n };\n\n const handleContinueFromPreview = () => {\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 (showSignedDocumentPreview) {\n return (\n <SignedDocumentPreview\n sessionId={sessionId}\n nodeId={node.id}\n nodeTitle={node.pageTitle || node.title}\n completedAt={signedAt}\n logo={session?.template?.logo}\n onContinue={handleContinueFromPreview}\n />\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":["_js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,EAAA,cAAA,EAAA,CAAS,EACpDA,GAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,qCAAqC,EAAA,QAAA,EAC9C,CAAC,CAAC,uBAAuB,EAAE,QAAQ,CAAC,EAAA,CACpC,EACLA,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,oBAAoB,EAAA,QAAA,EAC5B,CAAC,CAAC,uBAAuB,EAAE,6CAA6C,CAAC,EAAA,CAC1E,EACJA,GAAA,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,IAAC,+BAA+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 SignedDocumentPreview from \"./SignedDocumentPreview\";\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 denomination_sociale: (ui) => ui.companyName,\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 const [showSignedDocumentPreview, setShowSignedDocumentPreview] = useState<boolean>(false);\n const [signedAt, setSignedAt] = useState<string | null>(null);\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 // Toujours montrer le document réellement signé avant de continuer\n // (rassure l'utilisateur — pas de bascule directe vers l'étape suivante).\n setSignedAt(new Date().toISOString());\n setShowSignedDocumentPreview(true);\n };\n\n const handleContinueFromPreview = () => {\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 (showSignedDocumentPreview) {\n return (\n <SignedDocumentPreview\n sessionId={sessionId}\n nodeId={node.id}\n nodeTitle={node.pageTitle || node.title}\n completedAt={signedAt}\n logo={session?.template?.logo}\n onContinue={handleContinueFromPreview}\n />\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={stepObject.canGoBack ? handleBack : undefined}\n title={title}\n description={description}\n />\n );\n};\n\nexport default SignatureElectronic;\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;AAWA;;;AAGG;AACH,IAAM,uBAAuB,GAA4E;IACrG,GAAG,EAAE,UAAC,EAAE,EAAA,EAAK,OAAA,EAAE,CAAC,QAAQ,CAAA,CAAX,CAAW;IACxB,oBAAoB,EAAE,UAAC,EAAE,EAAA,EAAK,OAAA,EAAE,CAAC,WAAW,CAAA,CAAd,CAAc;IAC5C,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,CAA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AAU,GAAG,SAAS,EACrD,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EAAA,CAC1B;AAEV;;;;"}
|
|
@@ -21,9 +21,9 @@ var SignatureElectronicIntroduction = function (_a) {
|
|
|
21
21
|
var handleBackClick = function (event) {
|
|
22
22
|
event.preventDefault();
|
|
23
23
|
event.stopPropagation();
|
|
24
|
-
onBack();
|
|
24
|
+
onBack === null || onBack === void 0 ? void 0 : onBack();
|
|
25
25
|
};
|
|
26
|
-
return (jsx(MobilePageLayout, { footer: jsx(PageActions, { primary: jsx(Button, { onClick: handleContinueClick, type: "button", children: t("buttons.continue", "Commencer") }), secondary: jsx(Button, { variant: "secondary", onClick: handleBackClick, type: "button", children: t("buttons.back", "Retour") }) }), children: jsx("div", { className: "px-4 py-6 md:px-8 md:py-8", children: jsxs("div", { className: "w-full max-w-md mx-auto space-y-6", children: [jsxs("div", { className: "text-center space-y-4", children: [jsx(Title, { className: "text-xl md:text-2xl lg:text-3xl", children: title }), jsx(Subtitle, { className: "text-sm md:text-base text-gray-600 leading-relaxed whitespace-pre-line", children: description })] }), jsx("div", { className: "flex justify-center items-center w-full py-6", children: jsx(ElectronicIcon, { className: "w-full max-w-xs md:max-w-sm" }) }), jsx("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4", children: jsxs("div", { className: "flex", children: [jsx("div", { className: "shrink-0", children: jsx("svg", { className: "h-5 w-5 text-blue-400", fill: "currentColor", viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }) }) }), jsxs("div", { className: "ml-3", children: [jsx("h3", { className: "text-sm font-medium text-blue-800", children: t("signature.info_title", "Instruction") }), jsx("div", { className: "mt-2 text-sm text-blue-700", children: jsx("p", { children: t("signature.info_description", "Vous allez être redirigé vers un formulaire de signature sécurisé. Assurez-vous d'avoir une connexion stable.") }) })] })] }) })] }) }) }));
|
|
26
|
+
return (jsx(MobilePageLayout, { footer: jsx(PageActions, { primary: jsx(Button, { onClick: handleContinueClick, type: "button", children: t("buttons.continue", "Commencer") }), secondary: onBack ? (jsx(Button, { variant: "secondary", onClick: handleBackClick, type: "button", children: t("buttons.back", "Retour") })) : undefined }), children: jsx("div", { className: "px-4 py-6 md:px-8 md:py-8", children: jsxs("div", { className: "w-full max-w-md mx-auto space-y-6", children: [jsxs("div", { className: "text-center space-y-4", children: [jsx(Title, { className: "text-xl md:text-2xl lg:text-3xl", children: title }), jsx(Subtitle, { className: "text-sm md:text-base text-gray-600 leading-relaxed whitespace-pre-line", children: description })] }), jsx("div", { className: "flex justify-center items-center w-full py-6", children: jsx(ElectronicIcon, { className: "w-full max-w-xs md:max-w-sm" }) }), jsx("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4", children: jsxs("div", { className: "flex", children: [jsx("div", { className: "shrink-0", children: jsx("svg", { className: "h-5 w-5 text-blue-400", fill: "currentColor", viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }) }) }), jsxs("div", { className: "ml-3", children: [jsx("h3", { className: "text-sm font-medium text-blue-800", children: t("signature.info_title", "Instruction") }), jsx("div", { className: "mt-2 text-sm text-blue-700", children: jsx("p", { children: t("signature.info_description", "Vous allez être redirigé vers un formulaire de signature sécurisé. Assurez-vous d'avoir une connexion stable.") }) })] })] }) })] }) }) }));
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export { SignatureElectronicIntroduction as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureElectronicIntroduction.js","sources":["../../../../../src/components/signature-electronic/SignatureElectronicIntroduction.tsx"],"sourcesContent":["import React from \"react\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport Button from \"../ui/Button\";\nimport PageActions from \"../ui/PageActions\";\nimport { useTranslation } from \"react-i18next\";\nimport sdkI18n from \"../../i18n\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\nimport ElectronicIcon from \"../icons/ElectronicIcon\";\n\ninterface SignatureElectronicIntroductionProps {\n onContinue: () => void;\n onBack
|
|
1
|
+
{"version":3,"file":"SignatureElectronicIntroduction.js","sources":["../../../../../src/components/signature-electronic/SignatureElectronicIntroduction.tsx"],"sourcesContent":["import React from \"react\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport Button from \"../ui/Button\";\nimport PageActions from \"../ui/PageActions\";\nimport { useTranslation } from \"react-i18next\";\nimport sdkI18n from \"../../i18n\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\nimport ElectronicIcon from \"../icons/ElectronicIcon\";\n\ninterface SignatureElectronicIntroductionProps {\n onContinue: () => void;\n onBack?: () => void;\n title?: string;\n description?: string;\n}\n\nconst SignatureElectronicIntroduction: React.FC<SignatureElectronicIntroductionProps> = ({\n onContinue,\n onBack,\n title: propTitle,\n description: propDescription,\n}) => {\n const { t } = useTranslation(\"translation\", { i18n: sdkI18n });\n\n const title = propTitle || t(\"signature.introduction_title\", \"Signature électronique\");\n const description = propDescription || t(\"signature.introduction_description\", \"Veuillez signer le document pour continuer.\");\n\n const handleContinueClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.stopPropagation();\n onContinue();\n };\n\n const handleBackClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.stopPropagation();\n onBack?.();\n };\n\n return (\n <MobilePageLayout\n footer={\n <PageActions\n primary={\n <Button onClick={handleContinueClick} type=\"button\">\n {t(\"buttons.continue\", \"Commencer\")}\n </Button>\n }\n secondary={onBack ? (\n <Button variant=\"secondary\" onClick={handleBackClick} type=\"button\">\n {t(\"buttons.back\", \"Retour\")}\n </Button>\n ) : undefined}\n />\n }\n >\n <div className=\"px-4 py-6 md:px-8 md:py-8\">\n <div className=\"w-full max-w-md mx-auto space-y-6\">\n {/* Header */}\n <div className=\"text-center space-y-4\">\n <Title className=\"text-xl md:text-2xl lg:text-3xl\">{title}</Title>\n <Subtitle className=\"text-sm md:text-base text-gray-600 leading-relaxed whitespace-pre-line\">\n {description}\n </Subtitle>\n </div>\n\n <div className=\"flex justify-center items-center w-full py-6\">\n <ElectronicIcon className=\"w-full max-w-xs md:max-w-sm\" />\n </div>\n\n {/* Information box */}\n <div className=\"bg-blue-50 border border-blue-200 rounded-lg p-4\">\n <div className=\"flex\">\n <div className=\"shrink-0\">\n <svg\n className=\"h-5 w-5 text-blue-400\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </div>\n <div className=\"ml-3\">\n <h3 className=\"text-sm font-medium text-blue-800\">\n {t(\"signature.info_title\", \"Instruction\")}\n </h3>\n <div className=\"mt-2 text-sm text-blue-700\">\n <p>{t(\"signature.info_description\", \"Vous allez être redirigé vers un formulaire de signature sécurisé. Assurez-vous d'avoir une connexion stable.\")}</p>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </MobilePageLayout>\n );\n};\n\nexport default SignatureElectronicIntroduction;\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;AAiBA,IAAM,+BAA+B,GAAmD,UAAC,EAKxF,EAAA;QAJG,UAAU,GAA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A4B,EAAE,+GAA+G,CAAC,EAAA,CAAK,GACvJ,CAAA,EAAA,CACJ,CAAA,EAAA,CACJ,GACJ,CAAA,EAAA,CACJ,EAAA,CACJ,EAAA,CACS;AAE3B;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __awaiter, __generator, __assign, __spreadArray } from '../../node_modules/tslib/tslib.es6.js';
|
|
2
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { useState, useEffect } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import sdkI18n from '../../i18n/index.js';
|
|
@@ -19,6 +19,13 @@ var STANDARD_FIELD_ALIASES = {
|
|
|
19
19
|
prenom: ['firstName', 'first_name', 'prenom'],
|
|
20
20
|
nom: ['lastName', 'last_name', 'surname', 'familyName', 'nom'],
|
|
21
21
|
date_naissance: ['birthDate', 'birth_date', 'dateOfBirth', 'date_naissance'],
|
|
22
|
+
// Champs d'un nœud identity-legal-rep (RL) : la clé de config (builder) diffère
|
|
23
|
+
// de la clé réellement soumise par LegalRepFields — sans cet alias, la
|
|
24
|
+
// résolution échouait silencieusement dès qu'un nœud identity-legal-rep était
|
|
25
|
+
// choisi comme "Nœud source Nom/Prénom" (compareTargets ne trouvait jamais la
|
|
26
|
+
// valeur, causant un person_mismatch systématique).
|
|
27
|
+
legalRepresentativePrenom: ['legalRepresentativeFirstName', 'legalRepresentativePrenom'],
|
|
28
|
+
legalRepresentativeNom: ['legalRepresentativeLastName', 'legalRepresentativeNom'],
|
|
22
29
|
};
|
|
23
30
|
var normalizeReferenceField = function (field) {
|
|
24
31
|
if (!field)
|
|
@@ -58,6 +65,9 @@ var ExternalVerificationNodeHandler = function (_a) {
|
|
|
58
65
|
var nodeData = node;
|
|
59
66
|
var apiType = String(nodeData.targetApi || 'INSEE');
|
|
60
67
|
var isInpiRbe = apiType === 'INPI_RBE';
|
|
68
|
+
// Paramétrable depuis le journey builder (panneau "Configuration de la base
|
|
69
|
+
// externe"), par nœud. Absent/true = comportement actuel inchangé.
|
|
70
|
+
var allowContinueOnFailure = nodeData.allowContinueOnFailure !== false;
|
|
61
71
|
var _o = useState('loading'), phase = _o[0], setPhase = _o[1];
|
|
62
72
|
var _p = useState(null), errorScreenData = _p[0], setErrorScreenData = _p[1];
|
|
63
73
|
var _q = useState(function () {
|
|
@@ -104,10 +114,10 @@ var ExternalVerificationNodeHandler = function (_a) {
|
|
|
104
114
|
useEffect(function () {
|
|
105
115
|
var abortController = new AbortController();
|
|
106
116
|
var run = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
107
|
-
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;
|
|
108
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
109
|
-
return __generator(this, function (
|
|
110
|
-
switch (
|
|
117
|
+
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;
|
|
118
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
119
|
+
return __generator(this, function (_v) {
|
|
120
|
+
switch (_v.label) {
|
|
111
121
|
case 0:
|
|
112
122
|
result = {
|
|
113
123
|
isVerified: false,
|
|
@@ -120,9 +130,10 @@ var ExternalVerificationNodeHandler = function (_a) {
|
|
|
120
130
|
referenceVariable = String(nodeData.referenceVariable || '');
|
|
121
131
|
submittedFirstName = '';
|
|
122
132
|
submittedLastName = '';
|
|
123
|
-
|
|
133
|
+
submittedSiren = '';
|
|
134
|
+
_v.label = 1;
|
|
124
135
|
case 1:
|
|
125
|
-
|
|
136
|
+
_v.trys.push([1, 9, , 10]);
|
|
126
137
|
if (!(session === null || session === void 0 ? void 0 : session.id))
|
|
127
138
|
throw new Error('Session ID is missing');
|
|
128
139
|
referenceField = normalizeReferenceField(String(nodeData.referenceField || referenceVariable || ''));
|
|
@@ -172,45 +183,62 @@ var ExternalVerificationNodeHandler = function (_a) {
|
|
|
172
183
|
cfg = nodeData.comparisonConfig;
|
|
173
184
|
personNodeInput = (_d = userInput[cfg.personReferenceNodeId]) !== null && _d !== void 0 ? _d : {};
|
|
174
185
|
flat = userInput;
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
186
|
+
isPersonneMorale = cfg.personType === 'MORALE';
|
|
187
|
+
if (isPersonneMorale) {
|
|
188
|
+
sirenKeys = expandFieldKey((_e = cfg.personSirenField) !== null && _e !== void 0 ? _e : '').filter(Boolean);
|
|
189
|
+
submittedSiren = (_f = resolveFieldValue(personNodeInput, flat, sirenKeys)) !== null && _f !== void 0 ? _f : '';
|
|
190
|
+
if (submittedSiren) {
|
|
191
|
+
comparisonConfig = {
|
|
192
|
+
personType: 'MORALE',
|
|
193
|
+
siren: submittedSiren,
|
|
194
|
+
// Un RBE est toujours une personne physique en droit
|
|
195
|
+
// français : forcé à 'mandataires' quel que soit le
|
|
196
|
+
// contenu de cfg.compareTargets (défense en profondeur).
|
|
197
|
+
compareTargets: ['mandataires'],
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
firstNameKeys = expandFieldKey((_g = cfg.personFirstNameField) !== null && _g !== void 0 ? _g : '').filter(Boolean);
|
|
203
|
+
lastNameKeys = expandFieldKey((_h = cfg.personLastNameField) !== null && _h !== void 0 ? _h : '').filter(Boolean);
|
|
204
|
+
birthDateKeys = cfg.personBirthDateField
|
|
205
|
+
? expandFieldKey(cfg.personBirthDateField).filter(Boolean)
|
|
206
|
+
: [];
|
|
207
|
+
submittedFirstName = (_j = resolveFieldValue(personNodeInput, flat, firstNameKeys)) !== null && _j !== void 0 ? _j : '';
|
|
208
|
+
submittedLastName = (_k = resolveFieldValue(personNodeInput, flat, lastNameKeys)) !== null && _k !== void 0 ? _k : '';
|
|
209
|
+
dateOfBirth = cfg.compareBirthDate && birthDateKeys.length
|
|
210
|
+
? resolveFieldValue(personNodeInput, flat, birthDateKeys)
|
|
211
|
+
: undefined;
|
|
212
|
+
if (submittedFirstName && submittedLastName) {
|
|
213
|
+
comparisonConfig = __assign({ firstName: submittedFirstName, lastName: submittedLastName, compareTargets: (_l = cfg.compareTargets) !== null && _l !== void 0 ? _l : ['mandataires'] }, (dateOfBirth ? { dateOfBirth: dateOfBirth } : {}));
|
|
214
|
+
}
|
|
187
215
|
}
|
|
188
216
|
}
|
|
189
217
|
if (isInpiRbe)
|
|
190
218
|
advanceStep(1);
|
|
191
|
-
|
|
219
|
+
_v.label = 4;
|
|
192
220
|
case 4:
|
|
193
|
-
|
|
221
|
+
_v.trys.push([4, 7, , 8]);
|
|
194
222
|
return [4 /*yield*/, apiService.post("/session/sdk/".concat(session.id, "/verify-external/").concat(node.id), __assign({ apiType: apiType, referenceValue: referenceValue, referenceField: referenceField, enableRnaFallback: isInpiRbe && nodeData.rnaFallbackEnabled === true }, (comparisonConfig ? { comparisonConfig: comparisonConfig } : {})), { signal: abortController.signal })];
|
|
195
223
|
case 5:
|
|
196
|
-
response =
|
|
224
|
+
response = _v.sent();
|
|
197
225
|
if (isInpiRbe)
|
|
198
226
|
advanceStep(2);
|
|
199
227
|
return [4 /*yield*/, new Promise(function (r) { return setTimeout(r, 600); })];
|
|
200
228
|
case 6:
|
|
201
|
-
|
|
202
|
-
res = (
|
|
229
|
+
_v.sent();
|
|
230
|
+
res = (_m = response.data) === null || _m === void 0 ? void 0 : _m.data;
|
|
203
231
|
if (res && typeof res.isVerified === 'boolean') {
|
|
204
232
|
result = res;
|
|
205
233
|
}
|
|
206
234
|
return [3 /*break*/, 8];
|
|
207
235
|
case 7:
|
|
208
|
-
apiErr_1 =
|
|
236
|
+
apiErr_1 = _v.sent();
|
|
209
237
|
if (abortController.signal.aborted)
|
|
210
238
|
return [2 /*return*/];
|
|
211
239
|
if (isInpiRbe)
|
|
212
240
|
advanceStep(2);
|
|
213
|
-
apiResult = (
|
|
241
|
+
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;
|
|
214
242
|
if (apiResult && typeof apiResult.isVerified === 'boolean') {
|
|
215
243
|
result = apiResult;
|
|
216
244
|
}
|
|
@@ -225,7 +253,7 @@ var ExternalVerificationNodeHandler = function (_a) {
|
|
|
225
253
|
return [3 /*break*/, 8];
|
|
226
254
|
case 8: return [3 /*break*/, 10];
|
|
227
255
|
case 9:
|
|
228
|
-
|
|
256
|
+
_v.sent();
|
|
229
257
|
result = {
|
|
230
258
|
isVerified: false,
|
|
231
259
|
status: 'external_error',
|
|
@@ -255,13 +283,21 @@ var ExternalVerificationNodeHandler = function (_a) {
|
|
|
255
283
|
if (result.status === 'person_mismatch') {
|
|
256
284
|
inpi = result.inpiData;
|
|
257
285
|
cfg = nodeData.comparisonConfig;
|
|
286
|
+
isPersonneMorale_1 = (cfg === null || cfg === void 0 ? void 0 : cfg.personType) === 'MORALE';
|
|
258
287
|
setErrorScreenData({
|
|
259
288
|
submittedLastName: submittedLastName,
|
|
260
289
|
submittedFirstName: submittedFirstName,
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
290
|
+
submittedSiren: isPersonneMorale_1 ? submittedSiren : undefined,
|
|
291
|
+
// En mode personne morale, seuls les mandataires personne morale ont
|
|
292
|
+
// un sens (un RBE est toujours une personne physique) ; en mode
|
|
293
|
+
// physique, comportement inchangé (mandataires individus uniquement).
|
|
294
|
+
mandataires: ((_q = inpi === null || inpi === void 0 ? void 0 : inpi.mandataires) !== null && _q !== void 0 ? _q : []).filter(function (m) {
|
|
295
|
+
return isPersonneMorale_1 ? m.type === 'personne_morale' : m.type === 'individu';
|
|
296
|
+
}),
|
|
297
|
+
beneficiairesEffectifs: (_r = inpi === null || inpi === void 0 ? void 0 : inpi.beneficiairesEffectifs) !== null && _r !== void 0 ? _r : [],
|
|
298
|
+
compareTargets: isPersonneMorale_1 ? ['mandataires'] : ((_s = cfg === null || cfg === void 0 ? void 0 : cfg.compareTargets) !== null && _s !== void 0 ? _s : ['mandataires']),
|
|
299
|
+
personNodeId: (_t = cfg === null || cfg === void 0 ? void 0 : cfg.personReferenceNodeId) !== null && _t !== void 0 ? _t : '',
|
|
300
|
+
targetDenomination: (_u = inpi === null || inpi === void 0 ? void 0 : inpi.identite) === null || _u === void 0 ? void 0 : _u.denomination,
|
|
265
301
|
siren: resolvedReferenceValue,
|
|
266
302
|
sirenNodeId: referenceNodeId,
|
|
267
303
|
source: inpi === null || inpi === void 0 ? void 0 : inpi.source,
|
|
@@ -336,20 +372,22 @@ var ExternalVerificationNodeHandler = function (_a) {
|
|
|
336
372
|
: ((_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'))
|
|
337
373
|
? t('inpi_verification.mandataires_label', 'Mandataires renseignés au RNE')
|
|
338
374
|
: t('inpi_verification.persons_label', 'Personnes renseignées au RNE');
|
|
339
|
-
return (jsxs("div", { className: "flex flex-col justify-between h-full w-full", children: [jsx("div", { className: "flex-1 px-4 py-6 pt-11 md:px-8 md:py-8", children: jsxs("div", { className: "w-full max-w-md mx-auto space-y-6", children: [jsx("div", { className: "text-center", children: jsx("div", { className: "mx-auto w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mb-4", children: jsx("div", { className: "w-8 h-8 bg-red-500 rounded-full flex items-center justify-center", children: jsx("span", { className: "text-white text-lg", children: "\u2715" }) }) }) }), jsxs("div", { className: "text-center space-y-4", children: [jsx(Title, { className: "text-xl md:text-2xl lg:text-3xl text-red-600", children: t('inpi_verification.mismatch_title', 'Identité non confirmée') }), jsx(Subtitle, { className: "text-sm text-gray-600 leading-relaxed", children:
|
|
340
|
-
|
|
341
|
-
|
|
375
|
+
return (jsxs("div", { className: "flex flex-col justify-between h-full w-full", children: [jsx("div", { className: "flex-1 px-4 py-6 pt-11 md:px-8 md:py-8", children: jsxs("div", { className: "w-full max-w-md mx-auto space-y-6", children: [jsx("div", { className: "text-center", children: jsx("div", { className: "mx-auto w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mb-4", children: jsx("div", { className: "w-8 h-8 bg-red-500 rounded-full flex items-center justify-center", children: jsx("span", { className: "text-white text-lg", children: "\u2715" }) }) }) }), jsxs("div", { className: "text-center space-y-4", children: [jsx(Title, { className: "text-xl md:text-2xl lg:text-3xl text-red-600", children: t('inpi_verification.mismatch_title', 'Identité non confirmée') }), jsx(Subtitle, { className: "text-sm text-gray-600 leading-relaxed", children: (d === null || d === void 0 ? void 0 : d.targetDenomination)
|
|
376
|
+
? 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))
|
|
377
|
+
: 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) && (jsxs("div", { className: "bg-red-50 border border-red-200 rounded-lg p-4", children: [jsx("h3", { className: "font-medium text-red-900 mb-2", children: t('errors.problems_detected', 'Problèmes détectés') }), jsxs("div", { className: "text-sm text-red-800 space-y-1", children: [d.submittedSiren && (jsxs("p", { children: [t('inpi_verification.submitted_siren', 'SIREN saisi'), ' : ', jsx("strong", { children: d.submittedSiren })] })), d.submittedLastName && (jsxs("p", { children: [t('inpi_verification.submitted_last_name', 'Nom saisi'), ' : ', jsx("strong", { children: d.submittedLastName })] })), d.submittedFirstName && (jsxs("p", { children: [t('inpi_verification.submitted_first_name', 'Prénom saisi'), ' : ', jsx("strong", { children: d.submittedFirstName })] }))] })] })), (showMandataires || showBeneficiaires) && (jsxs("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4", children: [jsx("h3", { className: "font-medium text-blue-900 mb-2", children: personListLabel }), jsxs("div", { className: "text-sm text-blue-800 space-y-1", children: [showMandataires && d.mandataires.map(function (m, i) {
|
|
378
|
+
var _a, _b, _c;
|
|
379
|
+
return (jsx("p", { children: m.type === 'personne_morale' ? (jsxs(Fragment, { children: [jsx("strong", { children: (_a = m.denominationSociale) !== null && _a !== void 0 ? _a : '—' }), m.siren && " (SIREN ".concat(m.siren, ")")] })) : (jsxs(Fragment, { children: [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)));
|
|
342
380
|
}), showBeneficiaires && d.beneficiairesEffectifs.map(function (b, i) {
|
|
343
381
|
var _a, _b;
|
|
344
382
|
return (jsxs("p", { children: [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)));
|
|
345
|
-
})] })] }))] }) }), 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: jsxs("div", { className: "w-full max-w-md mx-auto", children: [jsxs("div", { className: "flex flex-col space-y-3 md:hidden", children: [jsx(Button, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-mismatch-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), jsx(Button, { onClick: onNext, "data-cy": "inpi-mismatch-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') })] }), jsxs("div", { className: "hidden md:flex justify-center space-x-3", children: [jsx(Button, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-mismatch-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), jsx(Button, { onClick: onNext, "data-cy": "inpi-mismatch-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') })] })] }) })] }));
|
|
383
|
+
})] })] }))] }) }), 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: jsxs("div", { className: "w-full max-w-md mx-auto", children: [jsxs("div", { className: "flex flex-col space-y-3 md:hidden", children: [jsx(Button, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-mismatch-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), allowContinueOnFailure && (jsx(Button, { onClick: onNext, "data-cy": "inpi-mismatch-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') }))] }), jsxs("div", { className: "hidden md:flex justify-center space-x-3", children: [jsx(Button, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-mismatch-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), allowContinueOnFailure && (jsx(Button, { onClick: onNext, "data-cy": "inpi-mismatch-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') }))] })] }) })] }));
|
|
346
384
|
}
|
|
347
385
|
// ─── Not found phase ───────────────────────────────────────────────────────
|
|
348
386
|
if (phase === 'not_found') {
|
|
349
387
|
var d = errorScreenData;
|
|
350
|
-
return (jsxs("div", { className: "flex flex-col justify-between h-full w-full", children: [jsx("div", { className: "flex-1 px-4 py-6 pt-11 md:px-8 md:py-8", children: jsxs("div", { className: "w-full max-w-md mx-auto space-y-6", children: [jsx("div", { className: "text-center", children: jsx("div", { className: "mx-auto w-16 h-16 bg-orange-100 rounded-full flex items-center justify-center mb-4", children: jsx("div", { className: "w-8 h-8 bg-orange-500 rounded-full flex items-center justify-center", children: jsx("span", { className: "text-white text-lg font-bold", children: "!" }) }) }) }), jsxs("div", { className: "text-center space-y-4", children: [jsx(Title, { className: "text-xl md:text-2xl lg:text-3xl text-orange-600", children: t('inpi_verification.not_found_title', 'Société introuvable') }), jsx(Subtitle, { 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.") })] }), jsxs("div", { className: "bg-orange-50 border border-orange-200 rounded-lg p-4", children: [jsx("h3", { className: "font-medium text-orange-900 mb-2", children: t('errors.problems_detected', 'Problèmes détectés') }), jsxs("div", { className: "text-sm text-orange-800 space-y-1", children: [(d === null || d === void 0 ? void 0 : d.siren) && (jsxs("p", { children: [t('inpi_verification.siren_label', 'SIREN'), ' : ', jsx("strong", { children: d.siren })] })), jsx("p", { children: (d === null || d === void 0 ? void 0 : d.isDoubleNotFound)
|
|
388
|
+
return (jsxs("div", { className: "flex flex-col justify-between h-full w-full", children: [jsx("div", { className: "flex-1 px-4 py-6 pt-11 md:px-8 md:py-8", children: jsxs("div", { className: "w-full max-w-md mx-auto space-y-6", children: [jsx("div", { className: "text-center", children: jsx("div", { className: "mx-auto w-16 h-16 bg-orange-100 rounded-full flex items-center justify-center mb-4", children: jsx("div", { className: "w-8 h-8 bg-orange-500 rounded-full flex items-center justify-center", children: jsx("span", { className: "text-white text-lg font-bold", children: "!" }) }) }) }), jsxs("div", { className: "text-center space-y-4", children: [jsx(Title, { className: "text-xl md:text-2xl lg:text-3xl text-orange-600", children: t('inpi_verification.not_found_title', 'Société introuvable') }), jsx(Subtitle, { 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.") }), 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é') })] }), jsxs("div", { className: "bg-orange-50 border border-orange-200 rounded-lg p-4", children: [jsx("h3", { className: "font-medium text-orange-900 mb-2", children: t('errors.problems_detected', 'Problèmes détectés') }), jsxs("div", { className: "text-sm text-orange-800 space-y-1", children: [(d === null || d === void 0 ? void 0 : d.siren) && (jsxs("p", { children: [t('inpi_verification.siren_label', 'SIREN'), ' : ', jsx("strong", { children: d.siren })] })), jsx("p", { children: (d === null || d === void 0 ? void 0 : d.isDoubleNotFound)
|
|
351
389
|
? 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).")
|
|
352
|
-
: t('inpi_verification.not_found_detail', 'Aucune société trouvée dans le Registre National des Entreprises.') })] })] })] }) }), 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: jsxs("div", { className: "w-full max-w-md mx-auto", children: [jsxs("div", { className: "flex flex-col space-y-3 md:hidden", children: [jsx(Button, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-not-found-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), jsx(Button, { onClick: onNext, "data-cy": "inpi-not-found-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') })] }), jsxs("div", { className: "hidden md:flex justify-center space-x-3", children: [jsx(Button, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-not-found-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), jsx(Button, { onClick: onNext, "data-cy": "inpi-not-found-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') })] })] }) })] }));
|
|
390
|
+
: t('inpi_verification.not_found_detail', 'Aucune société trouvée dans le Registre National des Entreprises.') })] })] })] }) }), 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: jsxs("div", { className: "w-full max-w-md mx-auto", children: [jsxs("div", { className: "flex flex-col space-y-3 md:hidden", children: [jsx(Button, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-not-found-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), allowContinueOnFailure && (jsx(Button, { onClick: onNext, "data-cy": "inpi-not-found-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') }))] }), jsxs("div", { className: "hidden md:flex justify-center space-x-3", children: [jsx(Button, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-not-found-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), allowContinueOnFailure && (jsx(Button, { onClick: onNext, "data-cy": "inpi-not-found-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') }))] })] }) })] }));
|
|
353
391
|
}
|
|
354
392
|
// ─── Error / fallback ─────────────────────────────────────────────────────
|
|
355
393
|
return (jsx(LoadingState, { message: t('verification_node.verifying_title', 'Vérification en cours…'), subtitle: t('verification_node.verifying_desc', 'Vérification en cours…') }));
|