showModal('

Draft loaded successfully ✅

'); } catch (error) { showModal('

Error loading draft: ' + error.message + '

'); } } function resetForm() { if (confirm('Are you sure you want to reset the form? All data will be lost.')) { document.querySelectorAll('.form-control').forEach(el => { if (el.type === 'checkbox') { el.checked = false; } else { el.value = ''; } }); sunoBlockOut.textContent = 'Suno block will appear here...'; warningsDisplay.textContent = ''; document.getElementById('songPrompt').value = ''; document.getElementById('artPrompt').value = ''; document.getElementById('videoPrompt').value = ''; imgGrid.innerHTML = ''; videoPreview.innerHTML = ''; videoOut.textContent = 'Video status...'; removeSongFile(); clearClips(); showModal('

Form reset successfully ✅

'); } } function randomizeForm() { const adjectives = ['Happy', 'Romantic', 'Exciting', 'Melancholic', 'Energetic']; const genres = ['Pop', 'Rock', 'Jazz', 'Hip Hop', 'Classical']; const relationships = ['Mother', 'Father', 'Friend', 'Partner', 'Sibling']; const occasions = ['Birthday', 'Anniversary', 'Graduation', 'Wedding', 'Retirement']; document.getElementById('songTitle').value = `Song for ${getRandom(occasions)}`; document.getElementById('occasion').value = getRandom(occasions); document.getElementById('buyerName').value = 'John Doe'; document.getElementById('recipientName').value = 'Jane Smith'; document.getElementById('relationship').value = getRandom(relationships); document.getElementById('tone').value = getRandom(adjectives); document.getElementById('mainGenre').value = getRandom(genres); document.getElementById('secondaryGenres').value = getRandom(genres); document.getElementById('tempo').value = getRandom(['Fast', 'Medium', 'Slow']); document.getElementById('vocalStyle').value = getRandom(['Male', 'Female', 'Duet']); document.getElementById('instrumentationNotes').value = 'Piano, guitar, soft drums'; document.getElementById('keyFacts').value = 'Loves music\nEnjoys traveling\nKind-hearted'; document.getElementById('stories').value = 'First met in college\nTravel to Paris together'; document.getElementById('mainMessage').value = 'Thank you for being you'; document.getElementById('namesPlaces').value = 'Jane\nParis\nCollege'; document.getElementById('visualStyle').value = 'Cartoon'; document.getElementById('visualMood').value = 'Bright'; document.getElementById('visualPlacesThemes').value = 'Beach\nMountains\nCity'; document.getElementById('visualText').value = 'Happy Birthday!'; showModal('

Form randomized successfully ✅

'); } function getRandom(array) { return array[Math.floor(Math.random() * array.length)]; } function runDiagnostics() { const diagnostics = []; const formData = getFormData(); // Check API key diagnostics.push(`API Key: ${apiKey ? '✅ Present' : '❌ Missing'}`); // Check required fields diagnostics.push(`Buyer Name: ${formData.buyerName ? '✅ Present' : '❌ Missing'}`); diagnostics.push(`Recipient Name: ${formData.recipientName ? '✅ Present' : '❌ Missing'}`); // Check song file diagnostics.push(`Song File: ${songFile ? '✅ Uploaded' : '❌ Not uploaded'}`); // Check video clips diagnostics.push(`Video Clips: ${videoClips.length > 0 ? '✅ Uploaded' : '❌ Not uploaded'}`); // Check prompts diagnostics.push(`Song Prompt: ${formData.mainMessage ? '✅ Present' : '❌ Missing'}`); diagnostics.push(`Art Prompt: ${formData.visualStyle ? '✅ Present' : '❌ Missing'}`); diagnostics.push(`Video Prompt: ${formData.visualMood ? '✅ Present' : '❌ Missing'}`); diagOut.innerHTML = diagnostics.join('
'); diagOut.style.display = 'block'; } // Initialize the app init();