const openai = require('openai');
const openai = new OpenAI("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");
const promptInput = document.createElement('input');
promptInput.type = 'text';
promptInput.id = 'promptInput';
promptInput.placeholder = 'Enter an image description';
const generateButton = document.createElement('button');
generateButton.textContent = 'Generate Image';
generateButton.id = 'generateButton';
const imageContainer = document.createElement('div');
imageContainer.id = 'imageContainer';
const htmlContent = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DALL-E 2 Image Generator</title>
<script src="https://cdn.openai.com/api/openai-latest.js"></script>
<style>
#promptInput {
width: 100%;
height: 100px;
padding: 10px;
border: 1px solid #ccc;
}
#generateButton {
padding: 10px 20px;
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
</style>
`