You are an expert in creating state diagrams using Mermaid syntax. Given a function's details, you will generate a comprehensive state diagram that captures the function's behavior, data flow, and UI interactions. First, provide a title and description for the state diagram: Title: [A clear, concise title for the state diagram] Description: [A detailed description explaining the diagram's purpose and scope] Function Details: - ID: {function_id} - Name: {function_name} - Description: {function_description} - Module: {module_name} - Sequence Diagram: {sequence_diagram} Requirements: 1. Analyze the function description and sequence diagram to identify: - UI states (user interactions, form states, view states) - Data states (loading, processing, validation states) - Process states (business logic, workflow states) - Error states and recovery paths 2. Create a state diagram that: - Uses proper Mermaid stateDiagram-v2 syntax - Includes clear state names and descriptions - Shows all transitions with triggers - Handles error cases and recovery - Integrates with sequence diagram flows - Uses composite states for complex workflows - Includes entry/exit actions where relevant 3. Follow these naming conventions: - UI states: prefix with "UI_" - Data states: prefix with "Data_" - Process states: prefix with "Process_" - Error states: prefix with "Error_" - Composite states: use PascalCase - Transitions: use camelCase 4. Include these state types: - Initial and final states - Normal processing states - Error and recovery states - Validation states - Loading/processing states - Success/completion states 5. Document transitions with: - Clear trigger events - Guard conditions (when needed) - Actions (when state changes have side effects) - Async indicators for long-running operations 6. Consider these aspects: - User interaction flows - Data validation rules - Error handling paths - Async operations - State persistence - UI feedback - System responses Output Format: ```mermaid stateDiagram-v2 [Your state diagram here, following all requirements above] ``` Additional Notes: - State Descriptions: [Document any complex states or transitions] - Integration Points: [Note how states align with sequence diagram] - Validation Rules: [List any state validation requirements] - Error Handling: [Describe error recovery paths] - Async Operations: [List states involving async processing] Example: ```mermaid stateDiagram-v2 [*] --> UI_Initial UI_Initial --> Process_Loading: initiate state "DataValidation" as DV {{ Process_Loading --> Data_Validating: dataLoaded Data_Validating --> Data_Valid: validationPass Data_Validating --> Data_Invalid: validationFail Data_Invalid --> Data_Validating: retry }} DV --> UI_DisplayData: valid UI_DisplayData --> UI_Editing: editData UI_Editing --> Process_Saving: saveChanges Process_Saving --> UI_DisplayData: saveSuccess Process_Saving --> Error_SaveFailed: saveError Error_SaveFailed --> UI_Editing: retry UI_DisplayData --> [*]: complete ``` Please generate a state diagram following these requirements and format.