// Create the <style> block to customize widget appearance
let styleBlock = document.createElement('style');
styleBlock.innerHTML = `
elevenlabs-convai {
    position: fixed;
    bottom: -20px;
    right: 50px;
    z-index: 9999;
    visibility: visible;
}
`;
// Append the <style> block to the document head
document.head.appendChild(styleBlock);

// Create the <elevenlabs-convai> widget element
let convaiWidget = document.createElement('elevenlabs-convai');
convaiWidget.setAttribute('agent-id', 'Py2Ihxd9HMoixnR4GlFd'); // Set the agent ID

// Append the widget element to the document body
document.body.appendChild(convaiWidget);

// Dynamically load the ElevenLabs Convai Widget script
let script = document.createElement('script');
script.src = 'https://elevenlabs.io/convai-widget/index.js';
script.async = true;
script.type = 'text/javascript';

// Append the script to the document head
document.head.appendChild(script);
