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":["useI18n","useUserInputForm","_jsxs","MobilePageLayout","_jsx","PageActions","Button","Title","Subtitle","IdentityFields","LegalRepFields","_Fragment","LegalEntityFields","AddressFields","ContactFields","NationalityField","CustomFormFields"],"mappings":";;;;;;;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iB,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;;;;"}
|
|
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":["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,SAAS,KA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ChC,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;;;;"}
|
|
@@ -143,7 +143,7 @@ var SignatureElectronic = function (_a) {
|
|
|
143
143
|
// No template configured — show error instead of silently falling back to intro
|
|
144
144
|
return (jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center h-full p-4 text-center", children: [jsxRuntime.jsx("div", { className: "text-red-500 text-4xl mb-4", children: "\u26A0\uFE0F" }), jsxRuntime.jsx("h2", { className: "text-xl font-bold text-red-600 mb-2", children: t("signature.error_title", "Erreur") }), jsxRuntime.jsx("p", { className: "text-gray-600 mb-4", children: t("signature.no_template", "Le modèle de signature n'est pas configuré.") }), jsxRuntime.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") })] }));
|
|
145
145
|
}
|
|
146
|
-
return (jsxRuntime.jsx(SignatureElectronicIntroduction.default, { onContinue: handleContinue, onBack: handleBack, title: title, description: description }));
|
|
146
|
+
return (jsxRuntime.jsx(SignatureElectronicIntroduction.default, { onContinue: handleContinue, onBack: stepObject.canGoBack ? handleBack : undefined, title: title, description: description }));
|
|
147
147
|
};
|
|
148
148
|
|
|
149
149
|
exports.default = SignatureElectronic;
|
|
@@ -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":["useTranslation","sdkI18n","useMemo","useState","useEffect","__awaiter","updateSessionStatus","_jsx","SignedDocumentPreview","DocusealSignature","_jsxs","SignatureElectronicIntroduction"],"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,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,WAAW,CAAA,CAAA,CAA3C,CAA2C;AAC5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AAC9B,QAAA,QACID,cAAA,CAACE,yBAAiB,EAAA,EACd,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,WAAW,EACvB,YAAY,EAAE,KAAK,EACnB,UAAU,EAAE,cAAc,EAC1B,MAAM,EAAE,UAAU,EAClB,aAAa,EAAE,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,CAC7EH,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,eAACI,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 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":["useTranslation","sdkI18n","useMemo","useState","useEffect","__awaiter","updateSessionStatus","_jsx","SignedDocumentPreview","DocusealSignature","_jsxs","SignatureElectronicIntroduction"],"mappings":";;;;;;;;;;;;;;AAWA;;;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S,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;AAEA,IAAA,QACIA,cAAA,CAACI,uCAA+B,EAAA,EAC5B,UAAU,EAAE,cAAc,EAC1B,MAAM,EAAE,UAAU,CAAC,SAAS,GAAG,UAAU,GAAG,SAAS,EACrD,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EAAA,CAC1B;AAEV;;;;"}
|
|
@@ -25,9 +25,9 @@ var SignatureElectronicIntroduction = function (_a) {
|
|
|
25
25
|
var handleBackClick = function (event) {
|
|
26
26
|
event.preventDefault();
|
|
27
27
|
event.stopPropagation();
|
|
28
|
-
onBack();
|
|
28
|
+
onBack === null || onBack === void 0 ? void 0 : onBack();
|
|
29
29
|
};
|
|
30
|
-
return (jsxRuntime.jsx(MobilePageLayout.default, { footer: jsxRuntime.jsx(PageActions.default, { primary: jsxRuntime.jsx(Button.default, { onClick: handleContinueClick, type: "button", children: t("buttons.continue", "Commencer") }), secondary: jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: handleBackClick, type: "button", children: t("buttons.back", "Retour") }) }), children: jsxRuntime.jsx("div", { className: "px-4 py-6 md:px-8 md:py-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto space-y-6", children: [jsxRuntime.jsxs("div", { className: "text-center space-y-4", children: [jsxRuntime.jsx(Title.default, { className: "text-xl md:text-2xl lg:text-3xl", children: title }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm md:text-base text-gray-600 leading-relaxed whitespace-pre-line", children: description })] }), jsxRuntime.jsx("div", { className: "flex justify-center items-center w-full py-6", children: jsxRuntime.jsx(ElectronicIcon.default, { className: "w-full max-w-xs md:max-w-sm" }) }), jsxRuntime.jsx("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4", children: jsxRuntime.jsxs("div", { className: "flex", children: [jsxRuntime.jsx("div", { className: "shrink-0", children: jsxRuntime.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: jsxRuntime.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" }) }) }), jsxRuntime.jsxs("div", { className: "ml-3", children: [jsxRuntime.jsx("h3", { className: "text-sm font-medium text-blue-800", children: t("signature.info_title", "Instruction") }), jsxRuntime.jsx("div", { className: "mt-2 text-sm text-blue-700", children: jsxRuntime.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.") }) })] })] }) })] }) }) }));
|
|
30
|
+
return (jsxRuntime.jsx(MobilePageLayout.default, { footer: jsxRuntime.jsx(PageActions.default, { primary: jsxRuntime.jsx(Button.default, { onClick: handleContinueClick, type: "button", children: t("buttons.continue", "Commencer") }), secondary: onBack ? (jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: handleBackClick, type: "button", children: t("buttons.back", "Retour") })) : undefined }), children: jsxRuntime.jsx("div", { className: "px-4 py-6 md:px-8 md:py-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto space-y-6", children: [jsxRuntime.jsxs("div", { className: "text-center space-y-4", children: [jsxRuntime.jsx(Title.default, { className: "text-xl md:text-2xl lg:text-3xl", children: title }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm md:text-base text-gray-600 leading-relaxed whitespace-pre-line", children: description })] }), jsxRuntime.jsx("div", { className: "flex justify-center items-center w-full py-6", children: jsxRuntime.jsx(ElectronicIcon.default, { className: "w-full max-w-xs md:max-w-sm" }) }), jsxRuntime.jsx("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4", children: jsxRuntime.jsxs("div", { className: "flex", children: [jsxRuntime.jsx("div", { className: "shrink-0", children: jsxRuntime.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: jsxRuntime.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" }) }) }), jsxRuntime.jsxs("div", { className: "ml-3", children: [jsxRuntime.jsx("h3", { className: "text-sm font-medium text-blue-800", children: t("signature.info_title", "Instruction") }), jsxRuntime.jsx("div", { className: "mt-2 text-sm text-blue-700", children: jsxRuntime.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.") }) })] })] }) })] }) }) }));
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
exports.default = SignatureElectronicIntroduction;
|
|
@@ -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":["useTranslation","sdkI18n","_jsx","MobilePageLayout","PageActions","Button","_jsxs","Title","Subtitle","ElectronicIcon"],"mappings":";;;;;;;;;;;;;;AAiBA,IAAM,+BAA+B,GAAmD,UAAC,EAKxF,EAAA;QAJG,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,MAAM,GAAA,EAAA,CAAA,MAAA,EACC,SAAS,GAAA,EAAA,CAAA,KAAA,EACH,eAAe,GAAA,EAAA,CAAA,WAAA;AAEpB,IAAA,IAAA,CAAC,GAAKA,2BAAc,CAAC,aAAa,EAAE,EAAE,IAAI,EAAEC,a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|
|
|
23
23
|
prenom: ['firstName', 'first_name', 'prenom'],
|
|
24
24
|
nom: ['lastName', 'last_name', 'surname', 'familyName', 'nom'],
|
|
25
25
|
date_naissance: ['birthDate', 'birth_date', 'dateOfBirth', 'date_naissance'],
|
|
26
|
+
// Champs d'un nœud identity-legal-rep (RL) : la clé de config (builder) diffère
|
|
27
|
+
// de la clé réellement soumise par LegalRepFields — sans cet alias, la
|
|
28
|
+
// résolution échouait silencieusement dès qu'un nœud identity-legal-rep était
|
|
29
|
+
// choisi comme "Nœud source Nom/Prénom" (compareTargets ne trouvait jamais la
|
|
30
|
+
// valeur, causant un person_mismatch systématique).
|
|
31
|
+
legalRepresentativePrenom: ['legalRepresentativeFirstName', 'legalRepresentativePrenom'],
|
|
32
|
+
legalRepresentativeNom: ['legalRepresentativeLastName', 'legalRepresentativeNom'],
|
|
26
33
|
};
|
|
27
34
|
var normalizeReferenceField = function (field) {
|
|
28
35
|
if (!field)
|
|
@@ -62,6 +69,9 @@ var ExternalVerificationNodeHandler = function (_a) {
|
|
|
62
69
|
var nodeData = node;
|
|
63
70
|
var apiType = String(nodeData.targetApi || 'INSEE');
|
|
64
71
|
var isInpiRbe = apiType === 'INPI_RBE';
|
|
72
|
+
// Paramétrable depuis le journey builder (panneau "Configuration de la base
|
|
73
|
+
// externe"), par nœud. Absent/true = comportement actuel inchangé.
|
|
74
|
+
var allowContinueOnFailure = nodeData.allowContinueOnFailure !== false;
|
|
65
75
|
var _o = React.useState('loading'), phase = _o[0], setPhase = _o[1];
|
|
66
76
|
var _p = React.useState(null), errorScreenData = _p[0], setErrorScreenData = _p[1];
|
|
67
77
|
var _q = React.useState(function () {
|
|
@@ -108,10 +118,10 @@ var ExternalVerificationNodeHandler = function (_a) {
|
|
|
108
118
|
React.useEffect(function () {
|
|
109
119
|
var abortController = new AbortController();
|
|
110
120
|
var run = function () { return tslib_es6.__awaiter(void 0, void 0, void 0, function () {
|
|
111
|
-
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;
|
|
112
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
113
|
-
return tslib_es6.__generator(this, function (
|
|
114
|
-
switch (
|
|
121
|
+
var result, referenceField, referenceValueMasked, resolvedReferenceValue, referenceNodeId, referenceVariable, submittedFirstName, submittedLastName, submittedSiren, nodeInput, userInputFlat, lookupKeys, referenceValue, allCustomFields, _i, _a, _b, value, str, comparisonConfig, cfg, personNodeInput, flat, isPersonneMorale, sirenKeys, firstNameKeys, lastNameKeys, birthDateKeys, dateOfBirth, response, res, apiErr_1, apiResult, inpi, cfg, isPersonneMorale_1;
|
|
122
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
123
|
+
return tslib_es6.__generator(this, function (_v) {
|
|
124
|
+
switch (_v.label) {
|
|
115
125
|
case 0:
|
|
116
126
|
result = {
|
|
117
127
|
isVerified: false,
|
|
@@ -124,9 +134,10 @@ var ExternalVerificationNodeHandler = function (_a) {
|
|
|
124
134
|
referenceVariable = String(nodeData.referenceVariable || '');
|
|
125
135
|
submittedFirstName = '';
|
|
126
136
|
submittedLastName = '';
|
|
127
|
-
|
|
137
|
+
submittedSiren = '';
|
|
138
|
+
_v.label = 1;
|
|
128
139
|
case 1:
|
|
129
|
-
|
|
140
|
+
_v.trys.push([1, 9, , 10]);
|
|
130
141
|
if (!(session === null || session === void 0 ? void 0 : session.id))
|
|
131
142
|
throw new Error('Session ID is missing');
|
|
132
143
|
referenceField = normalizeReferenceField(String(nodeData.referenceField || referenceVariable || ''));
|
|
@@ -176,45 +187,62 @@ var ExternalVerificationNodeHandler = function (_a) {
|
|
|
176
187
|
cfg = nodeData.comparisonConfig;
|
|
177
188
|
personNodeInput = (_d = userInput[cfg.personReferenceNodeId]) !== null && _d !== void 0 ? _d : {};
|
|
178
189
|
flat = userInput;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
190
|
+
isPersonneMorale = cfg.personType === 'MORALE';
|
|
191
|
+
if (isPersonneMorale) {
|
|
192
|
+
sirenKeys = expandFieldKey((_e = cfg.personSirenField) !== null && _e !== void 0 ? _e : '').filter(Boolean);
|
|
193
|
+
submittedSiren = (_f = resolveFieldValue(personNodeInput, flat, sirenKeys)) !== null && _f !== void 0 ? _f : '';
|
|
194
|
+
if (submittedSiren) {
|
|
195
|
+
comparisonConfig = {
|
|
196
|
+
personType: 'MORALE',
|
|
197
|
+
siren: submittedSiren,
|
|
198
|
+
// Un RBE est toujours une personne physique en droit
|
|
199
|
+
// français : forcé à 'mandataires' quel que soit le
|
|
200
|
+
// contenu de cfg.compareTargets (défense en profondeur).
|
|
201
|
+
compareTargets: ['mandataires'],
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
firstNameKeys = expandFieldKey((_g = cfg.personFirstNameField) !== null && _g !== void 0 ? _g : '').filter(Boolean);
|
|
207
|
+
lastNameKeys = expandFieldKey((_h = cfg.personLastNameField) !== null && _h !== void 0 ? _h : '').filter(Boolean);
|
|
208
|
+
birthDateKeys = cfg.personBirthDateField
|
|
209
|
+
? expandFieldKey(cfg.personBirthDateField).filter(Boolean)
|
|
210
|
+
: [];
|
|
211
|
+
submittedFirstName = (_j = resolveFieldValue(personNodeInput, flat, firstNameKeys)) !== null && _j !== void 0 ? _j : '';
|
|
212
|
+
submittedLastName = (_k = resolveFieldValue(personNodeInput, flat, lastNameKeys)) !== null && _k !== void 0 ? _k : '';
|
|
213
|
+
dateOfBirth = cfg.compareBirthDate && birthDateKeys.length
|
|
214
|
+
? resolveFieldValue(personNodeInput, flat, birthDateKeys)
|
|
215
|
+
: undefined;
|
|
216
|
+
if (submittedFirstName && submittedLastName) {
|
|
217
|
+
comparisonConfig = tslib_es6.__assign({ firstName: submittedFirstName, lastName: submittedLastName, compareTargets: (_l = cfg.compareTargets) !== null && _l !== void 0 ? _l : ['mandataires'] }, (dateOfBirth ? { dateOfBirth: dateOfBirth } : {}));
|
|
218
|
+
}
|
|
191
219
|
}
|
|
192
220
|
}
|
|
193
221
|
if (isInpiRbe)
|
|
194
222
|
advanceStep(1);
|
|
195
|
-
|
|
223
|
+
_v.label = 4;
|
|
196
224
|
case 4:
|
|
197
|
-
|
|
225
|
+
_v.trys.push([4, 7, , 8]);
|
|
198
226
|
return [4 /*yield*/, api.apiService.post("/session/sdk/".concat(session.id, "/verify-external/").concat(node.id), tslib_es6.__assign({ apiType: apiType, referenceValue: referenceValue, referenceField: referenceField, enableRnaFallback: isInpiRbe && nodeData.rnaFallbackEnabled === true }, (comparisonConfig ? { comparisonConfig: comparisonConfig } : {})), { signal: abortController.signal })];
|
|
199
227
|
case 5:
|
|
200
|
-
response =
|
|
228
|
+
response = _v.sent();
|
|
201
229
|
if (isInpiRbe)
|
|
202
230
|
advanceStep(2);
|
|
203
231
|
return [4 /*yield*/, new Promise(function (r) { return setTimeout(r, 600); })];
|
|
204
232
|
case 6:
|
|
205
|
-
|
|
206
|
-
res = (
|
|
233
|
+
_v.sent();
|
|
234
|
+
res = (_m = response.data) === null || _m === void 0 ? void 0 : _m.data;
|
|
207
235
|
if (res && typeof res.isVerified === 'boolean') {
|
|
208
236
|
result = res;
|
|
209
237
|
}
|
|
210
238
|
return [3 /*break*/, 8];
|
|
211
239
|
case 7:
|
|
212
|
-
apiErr_1 =
|
|
240
|
+
apiErr_1 = _v.sent();
|
|
213
241
|
if (abortController.signal.aborted)
|
|
214
242
|
return [2 /*return*/];
|
|
215
243
|
if (isInpiRbe)
|
|
216
244
|
advanceStep(2);
|
|
217
|
-
apiResult = (
|
|
245
|
+
apiResult = (_p = (_o = apiErr_1 === null || apiErr_1 === void 0 ? void 0 : apiErr_1.response) === null || _o === void 0 ? void 0 : _o.data) === null || _p === void 0 ? void 0 : _p.data;
|
|
218
246
|
if (apiResult && typeof apiResult.isVerified === 'boolean') {
|
|
219
247
|
result = apiResult;
|
|
220
248
|
}
|
|
@@ -229,7 +257,7 @@ var ExternalVerificationNodeHandler = function (_a) {
|
|
|
229
257
|
return [3 /*break*/, 8];
|
|
230
258
|
case 8: return [3 /*break*/, 10];
|
|
231
259
|
case 9:
|
|
232
|
-
|
|
260
|
+
_v.sent();
|
|
233
261
|
result = {
|
|
234
262
|
isVerified: false,
|
|
235
263
|
status: 'external_error',
|
|
@@ -259,13 +287,21 @@ var ExternalVerificationNodeHandler = function (_a) {
|
|
|
259
287
|
if (result.status === 'person_mismatch') {
|
|
260
288
|
inpi = result.inpiData;
|
|
261
289
|
cfg = nodeData.comparisonConfig;
|
|
290
|
+
isPersonneMorale_1 = (cfg === null || cfg === void 0 ? void 0 : cfg.personType) === 'MORALE';
|
|
262
291
|
setErrorScreenData({
|
|
263
292
|
submittedLastName: submittedLastName,
|
|
264
293
|
submittedFirstName: submittedFirstName,
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
294
|
+
submittedSiren: isPersonneMorale_1 ? submittedSiren : undefined,
|
|
295
|
+
// En mode personne morale, seuls les mandataires personne morale ont
|
|
296
|
+
// un sens (un RBE est toujours une personne physique) ; en mode
|
|
297
|
+
// physique, comportement inchangé (mandataires individus uniquement).
|
|
298
|
+
mandataires: ((_q = inpi === null || inpi === void 0 ? void 0 : inpi.mandataires) !== null && _q !== void 0 ? _q : []).filter(function (m) {
|
|
299
|
+
return isPersonneMorale_1 ? m.type === 'personne_morale' : m.type === 'individu';
|
|
300
|
+
}),
|
|
301
|
+
beneficiairesEffectifs: (_r = inpi === null || inpi === void 0 ? void 0 : inpi.beneficiairesEffectifs) !== null && _r !== void 0 ? _r : [],
|
|
302
|
+
compareTargets: isPersonneMorale_1 ? ['mandataires'] : ((_s = cfg === null || cfg === void 0 ? void 0 : cfg.compareTargets) !== null && _s !== void 0 ? _s : ['mandataires']),
|
|
303
|
+
personNodeId: (_t = cfg === null || cfg === void 0 ? void 0 : cfg.personReferenceNodeId) !== null && _t !== void 0 ? _t : '',
|
|
304
|
+
targetDenomination: (_u = inpi === null || inpi === void 0 ? void 0 : inpi.identite) === null || _u === void 0 ? void 0 : _u.denomination,
|
|
269
305
|
siren: resolvedReferenceValue,
|
|
270
306
|
sirenNodeId: referenceNodeId,
|
|
271
307
|
source: inpi === null || inpi === void 0 ? void 0 : inpi.source,
|
|
@@ -340,20 +376,22 @@ var ExternalVerificationNodeHandler = function (_a) {
|
|
|
340
376
|
: ((_l = d === null || d === void 0 ? void 0 : d.compareTargets) === null || _l === void 0 ? void 0 : _l.includes('mandataires')) && !((_m = d === null || d === void 0 ? void 0 : d.compareTargets) === null || _m === void 0 ? void 0 : _m.includes('beneficiairesEffectifs'))
|
|
341
377
|
? t('inpi_verification.mandataires_label', 'Mandataires renseignés au RNE')
|
|
342
378
|
: t('inpi_verification.persons_label', 'Personnes renseignées au RNE');
|
|
343
|
-
return (jsxRuntime.jsxs("div", { className: "flex flex-col justify-between h-full w-full", children: [jsxRuntime.jsx("div", { className: "flex-1 px-4 py-6 pt-11 md:px-8 md:py-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto space-y-6", children: [jsxRuntime.jsx("div", { className: "text-center", children: jsxRuntime.jsx("div", { className: "mx-auto w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mb-4", children: jsxRuntime.jsx("div", { className: "w-8 h-8 bg-red-500 rounded-full flex items-center justify-center", children: jsxRuntime.jsx("span", { className: "text-white text-lg", children: "\u2715" }) }) }) }), jsxRuntime.jsxs("div", { className: "text-center space-y-4", children: [jsxRuntime.jsx(Title.default, { className: "text-xl md:text-2xl lg:text-3xl text-red-600", children: t('inpi_verification.mismatch_title', 'Identité non confirmée') }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm text-gray-600 leading-relaxed", children:
|
|
344
|
-
|
|
345
|
-
|
|
379
|
+
return (jsxRuntime.jsxs("div", { className: "flex flex-col justify-between h-full w-full", children: [jsxRuntime.jsx("div", { className: "flex-1 px-4 py-6 pt-11 md:px-8 md:py-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto space-y-6", children: [jsxRuntime.jsx("div", { className: "text-center", children: jsxRuntime.jsx("div", { className: "mx-auto w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mb-4", children: jsxRuntime.jsx("div", { className: "w-8 h-8 bg-red-500 rounded-full flex items-center justify-center", children: jsxRuntime.jsx("span", { className: "text-white text-lg", children: "\u2715" }) }) }) }), jsxRuntime.jsxs("div", { className: "text-center space-y-4", children: [jsxRuntime.jsx(Title.default, { className: "text-xl md:text-2xl lg:text-3xl text-red-600", children: t('inpi_verification.mismatch_title', 'Identité non confirmée') }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm text-gray-600 leading-relaxed", children: (d === null || d === void 0 ? void 0 : d.targetDenomination)
|
|
380
|
+
? t('inpi_verification.mismatch_desc_denomination', "Le responsable l\u00E9gal saisi ne fait pas partie des responsables l\u00E9gaux ou b\u00E9n\u00E9ficiaires effectifs de la soci\u00E9t\u00E9 ".concat(d.targetDenomination))
|
|
381
|
+
: t('inpi_verification.mismatch_desc', "Les informations saisies ne correspondent à aucune personne déclarée à l'INPI pour cette société.") })] }), d && (d.submittedLastName || d.submittedFirstName || d.submittedSiren) && (jsxRuntime.jsxs("div", { className: "bg-red-50 border border-red-200 rounded-lg p-4", children: [jsxRuntime.jsx("h3", { className: "font-medium text-red-900 mb-2", children: t('errors.problems_detected', 'Problèmes détectés') }), jsxRuntime.jsxs("div", { className: "text-sm text-red-800 space-y-1", children: [d.submittedSiren && (jsxRuntime.jsxs("p", { children: [t('inpi_verification.submitted_siren', 'SIREN saisi'), ' : ', jsxRuntime.jsx("strong", { children: d.submittedSiren })] })), d.submittedLastName && (jsxRuntime.jsxs("p", { children: [t('inpi_verification.submitted_last_name', 'Nom saisi'), ' : ', jsxRuntime.jsx("strong", { children: d.submittedLastName })] })), d.submittedFirstName && (jsxRuntime.jsxs("p", { children: [t('inpi_verification.submitted_first_name', 'Prénom saisi'), ' : ', jsxRuntime.jsx("strong", { children: d.submittedFirstName })] }))] })] })), (showMandataires || showBeneficiaires) && (jsxRuntime.jsxs("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4", children: [jsxRuntime.jsx("h3", { className: "font-medium text-blue-900 mb-2", children: personListLabel }), jsxRuntime.jsxs("div", { className: "text-sm text-blue-800 space-y-1", children: [showMandataires && d.mandataires.map(function (m, i) {
|
|
382
|
+
var _a, _b, _c;
|
|
383
|
+
return (jsxRuntime.jsx("p", { children: m.type === 'personne_morale' ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("strong", { children: (_a = m.denominationSociale) !== null && _a !== void 0 ? _a : '—' }), m.siren && " (SIREN ".concat(m.siren, ")")] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("strong", { children: (_b = m.nom) !== null && _b !== void 0 ? _b : '—' }), ((_c = m.prenoms) !== null && _c !== void 0 ? _c : []).length > 0 && " ".concat(m.prenoms.join(' '))] })) }, "m-".concat(i)));
|
|
346
384
|
}), showBeneficiaires && d.beneficiairesEffectifs.map(function (b, i) {
|
|
347
385
|
var _a, _b;
|
|
348
386
|
return (jsxRuntime.jsxs("p", { children: [jsxRuntime.jsx("strong", { children: (_a = b.nom) !== null && _a !== void 0 ? _a : '—' }), ((_b = b.prenoms) !== null && _b !== void 0 ? _b : []).length > 0 && " ".concat(b.prenoms.join(' '))] }, "b-".concat(i)));
|
|
349
|
-
})] })] }))] }) }), jsxRuntime.jsx("div", { className: "sticky bottom-0 md:static bg-white border-t md:border-t-0 p-4 md:p-0 md:pb-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto", children: [jsxRuntime.jsxs("div", { className: "flex flex-col space-y-3 md:hidden", children: [jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-mismatch-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), jsxRuntime.jsx(Button.default, { onClick: onNext, "data-cy": "inpi-mismatch-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') })] }), jsxRuntime.jsxs("div", { className: "hidden md:flex justify-center space-x-3", children: [jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-mismatch-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), jsxRuntime.jsx(Button.default, { onClick: onNext, "data-cy": "inpi-mismatch-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') })] })] }) })] }));
|
|
387
|
+
})] })] }))] }) }), jsxRuntime.jsx("div", { className: "sticky bottom-0 md:static bg-white border-t md:border-t-0 p-4 md:p-0 md:pb-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto", children: [jsxRuntime.jsxs("div", { className: "flex flex-col space-y-3 md:hidden", children: [jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-mismatch-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), allowContinueOnFailure && (jsxRuntime.jsx(Button.default, { onClick: onNext, "data-cy": "inpi-mismatch-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') }))] }), jsxRuntime.jsxs("div", { className: "hidden md:flex justify-center space-x-3", children: [jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-mismatch-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), allowContinueOnFailure && (jsxRuntime.jsx(Button.default, { onClick: onNext, "data-cy": "inpi-mismatch-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') }))] })] }) })] }));
|
|
350
388
|
}
|
|
351
389
|
// ─── Not found phase ───────────────────────────────────────────────────────
|
|
352
390
|
if (phase === 'not_found') {
|
|
353
391
|
var d = errorScreenData;
|
|
354
|
-
return (jsxRuntime.jsxs("div", { className: "flex flex-col justify-between h-full w-full", children: [jsxRuntime.jsx("div", { className: "flex-1 px-4 py-6 pt-11 md:px-8 md:py-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto space-y-6", children: [jsxRuntime.jsx("div", { className: "text-center", children: jsxRuntime.jsx("div", { className: "mx-auto w-16 h-16 bg-orange-100 rounded-full flex items-center justify-center mb-4", children: jsxRuntime.jsx("div", { className: "w-8 h-8 bg-orange-500 rounded-full flex items-center justify-center", children: jsxRuntime.jsx("span", { className: "text-white text-lg font-bold", children: "!" }) }) }) }), jsxRuntime.jsxs("div", { className: "text-center space-y-4", children: [jsxRuntime.jsx(Title.default, { className: "text-xl md:text-2xl lg:text-3xl text-orange-600", children: t('inpi_verification.not_found_title', 'Société introuvable') }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm text-gray-600 leading-relaxed", children: t('inpi_verification.not_found_desc', "Le numéro saisi ne correspond à aucune société enregistrée dans le Registre National des Entreprises.") })] }), jsxRuntime.jsxs("div", { className: "bg-orange-50 border border-orange-200 rounded-lg p-4", children: [jsxRuntime.jsx("h3", { className: "font-medium text-orange-900 mb-2", children: t('errors.problems_detected', 'Problèmes détectés') }), jsxRuntime.jsxs("div", { className: "text-sm text-orange-800 space-y-1", children: [(d === null || d === void 0 ? void 0 : d.siren) && (jsxRuntime.jsxs("p", { children: [t('inpi_verification.siren_label', 'SIREN'), ' : ', jsxRuntime.jsx("strong", { children: d.siren })] })), jsxRuntime.jsx("p", { children: (d === null || d === void 0 ? void 0 : d.isDoubleNotFound)
|
|
392
|
+
return (jsxRuntime.jsxs("div", { className: "flex flex-col justify-between h-full w-full", children: [jsxRuntime.jsx("div", { className: "flex-1 px-4 py-6 pt-11 md:px-8 md:py-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto space-y-6", children: [jsxRuntime.jsx("div", { className: "text-center", children: jsxRuntime.jsx("div", { className: "mx-auto w-16 h-16 bg-orange-100 rounded-full flex items-center justify-center mb-4", children: jsxRuntime.jsx("div", { className: "w-8 h-8 bg-orange-500 rounded-full flex items-center justify-center", children: jsxRuntime.jsx("span", { className: "text-white text-lg font-bold", children: "!" }) }) }) }), jsxRuntime.jsxs("div", { className: "text-center space-y-4", children: [jsxRuntime.jsx(Title.default, { className: "text-xl md:text-2xl lg:text-3xl text-orange-600", children: t('inpi_verification.not_found_title', 'Société introuvable') }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm text-gray-600 leading-relaxed", children: t('inpi_verification.not_found_desc', "Le numéro saisi ne correspond à aucune société enregistrée dans le Registre National des Entreprises.") }), jsxRuntime.jsx("span", { className: "inline-block rounded-full bg-red-100 px-3 py-1 text-xs font-semibold text-red-700", children: t('inpi_verification.not_found_rejected_label', 'Dossier rejeté') })] }), jsxRuntime.jsxs("div", { className: "bg-orange-50 border border-orange-200 rounded-lg p-4", children: [jsxRuntime.jsx("h3", { className: "font-medium text-orange-900 mb-2", children: t('errors.problems_detected', 'Problèmes détectés') }), jsxRuntime.jsxs("div", { className: "text-sm text-orange-800 space-y-1", children: [(d === null || d === void 0 ? void 0 : d.siren) && (jsxRuntime.jsxs("p", { children: [t('inpi_verification.siren_label', 'SIREN'), ' : ', jsxRuntime.jsx("strong", { children: d.siren })] })), jsxRuntime.jsx("p", { children: (d === null || d === void 0 ? void 0 : d.isDoubleNotFound)
|
|
355
393
|
? t('inpi_verification.not_found_detail_rne_rna', "Aucune société ni association trouvée, ni dans le Registre National des Entreprises (RNE), ni dans le Répertoire National des Associations (RNA).")
|
|
356
|
-
: t('inpi_verification.not_found_detail', 'Aucune société trouvée dans le Registre National des Entreprises.') })] })] })] }) }), jsxRuntime.jsx("div", { className: "sticky bottom-0 md:static bg-white border-t md:border-t-0 p-4 md:p-0 md:pb-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto", children: [jsxRuntime.jsxs("div", { className: "flex flex-col space-y-3 md:hidden", children: [jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-not-found-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), jsxRuntime.jsx(Button.default, { onClick: onNext, "data-cy": "inpi-not-found-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') })] }), jsxRuntime.jsxs("div", { className: "hidden md:flex justify-center space-x-3", children: [jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-not-found-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), jsxRuntime.jsx(Button.default, { onClick: onNext, "data-cy": "inpi-not-found-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') })] })] }) })] }));
|
|
394
|
+
: t('inpi_verification.not_found_detail', 'Aucune société trouvée dans le Registre National des Entreprises.') })] })] })] }) }), jsxRuntime.jsx("div", { className: "sticky bottom-0 md:static bg-white border-t md:border-t-0 p-4 md:p-0 md:pb-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto", children: [jsxRuntime.jsxs("div", { className: "flex flex-col space-y-3 md:hidden", children: [jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-not-found-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), allowContinueOnFailure && (jsxRuntime.jsx(Button.default, { onClick: onNext, "data-cy": "inpi-not-found-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') }))] }), jsxRuntime.jsxs("div", { className: "hidden md:flex justify-center space-x-3", children: [jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: handleCorrect, "data-cy": "inpi-not-found-go-back", children: t('inpi_verification.mismatch_correct', 'Corriger ma saisie') }), allowContinueOnFailure && (jsxRuntime.jsx(Button.default, { onClick: onNext, "data-cy": "inpi-not-found-continue", children: t('inpi_verification.mismatch_continue', 'Continuer quand même') }))] })] }) })] }));
|
|
357
395
|
}
|
|
358
396
|
// ─── Error / fallback ─────────────────────────────────────────────────────
|
|
359
397
|
return (jsxRuntime.jsx(LoadingState.default, { message: t('verification_node.verifying_title', 'Vérification en cours…'), subtitle: t('verification_node.verifying_desc', 'Vérification en cours…') }));
|