/g, '>').replace(/%/g, '%').replace(/\(/g, '(').replace(/\)/g, ')').replace(/\{/g, '{').replace(/\}/g, '}').replace(/\[/g, '[').replace(/\]/g, ']').trim(); }, sanitizer() { debugLog('Sanitizing form data'); Object.keys(this.formData).forEach((key) => { if (typeof this.formData[key] === 'string') { this.formData[key] = this.sanitizeInput(this.formData[key]); } }); }, submit(event) { event.preventDefault(); this.formStatus = 'loading'; this.cleanEmail(); this.sanitizer(); this.localTime = new Date().toISOString(); this.timezoneOffset = new Date().getTimezoneOffset(); debugLog('Submitting form with data:', this.formData); fetch(this.endpoint, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(this.formData) }) .then(response => { if (!response.ok) { this.formStatus = 'error'; this.errorMessage = 'There was an error submitting the form.
Please try again later.'; } return response.json(); }) .then(data => { debugLog('Form submitted successfully:', data); this.resetForm('success'); postMessage('form.waitlist.success'); }) }, init() { debugLog('Initializing waitlist form'); this._GET(); window.addEventListener('message', event => { if (event.data === 'form.waitlist.success') { debugLog('Received success message'); this.resetForm('success'); } }); } }">