class UploadArea extends HTMLElement { connectedCallback() { this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = `

Drag & drop your images here or click to browse

Supports JPG, PNG (max 100 images at once)

`; this.shadowRoot.querySelector('.upload-area').addEventListener('click', () => { this.shadowRoot.querySelector('input').click(); }); this.shadowRoot.querySelector('input').addEventListener('change', (e) => { if (e.target.files.length > 0) { this.handleFiles(e.target.files); } }); } handleFiles(files) { this.shadowRoot.innerHTML = `

${files.length} images selected

Ready for caption generation

`; feather.replace(); this.dispatchEvent(new CustomEvent('upload', { detail: { count: files.length } })); } } customElements.define('upload-area', UploadArea);