(function () { 'use strict'; // Root colors - Base palette var rootColors = `:root{--grey-100:var(--mist);--grey-150:#cfcfd4;--grey-200:#c3c3c8;--grey-250:#b7b7bc;--grey-300:#ababaf;--grey-350:#9f9fa3;--grey-400:#939397;--grey-450:var(--graphite-5);--grey-500:#7a7a7f;--grey-550:#6e6e73;--grey-600:#626266;--grey-650:#56565a;--grey-700:#4a4a4e;--grey-750:var(--graphite-4);--grey-800:var(--graphite-3);--grey-850:var(--graphite-2);--grey-900:var(--graphite-1);--graphite-1:#18181b;--graphite-2:#252529;--graphite-3:#323236;--graphite-4:#3e3e42;--graphite-5:#8c8c8f;--graphite-10:rgba(24, 24, 27, 0.1);--graphite-30:rgba(24, 24, 27, 0.3);--mist:#dbdbe0;--mist-10:rgba(219, 219, 224, 0.1);--mist-30:rgba(219, 219, 224, 0.3);--flare:#fe531d;--black:black;--white:white;--tide:#00ffab;--sky:#00eaff;--spring:#4dff88;--iris:#8e44ad;--sunbeam:#ffc400;--blaze:#ff4d4d;--steel:#5c6bc0;--amber:#ffab00;--font-size-base:14px;--font-size-caption:0.857em;--font-size-small:0.929em}`; // Dark theme semantic tokens var themeDark = `:root{--text-primary:var(--grey-100);--text-secondary:var(--grey-300);--text-tertiary:var(--grey-500);--text-accent:var(--flare);--bg-primary:var(--grey-900);--bg-primary-transparent:#18181b00;--bg-secondary:var(--grey-850);--bg-tertiary:var(--grey-800);--icon-primary:var(--grey-100);--icon-secondary:var(--grey-600);--icon-accent:var(--flare);--border-weak:var(--mist-10);--border-medium:var(--mist-30);--overlay-inverted:#ffffff14;--overlay-weak:#00000014;--overlay-medium:#0000004d;--button-primary-bg:var(--text-primary);--button-primary-text:var(--bg-primary);--button-primary-text-overlay:var(--overlay-inverted);--button-primary-overlay:var(--overlay-weak);--button-secondary-bg:var(--overlay-inverted);--button-secondary-text:var(--grey-100)}`; // Light theme semantic tokens var themeLight = `:root{--text-primary:var(--grey-900);--text-secondary:var(--grey-700);--text-tertiary:var(--grey-500);--text-accent:var(--flare);--bg-primary:var(--grey-100);--bg-primary-transparent:rgba(219, 219, 224, 0);--bg-secondary:var(--grey-150);--bg-tertiary:var(--grey-200);--icon-primary:var(--grey-900);--icon-secondary:var(--grey-400);--icon-accent:var(--flare);--border-weak:var(--graphite-10);--border-medium:var(--graphite-30);--overlay-inverted:rgba(0, 0, 0, 0.08);--overlay-weak:rgba(255, 255, 255, 0.08);--overlay-medium:rgba(255, 255, 255, 0.3);--button-primary-bg:var(--grey-900);--button-primary-text:var(--grey-100);--button-primary-text-overlay:var(--overlay-inverted);--button-primary-overlay:var(--overlay-weak);--button-secondary-bg:rgba(0, 0, 0, 0.08);--button-secondary-text:var(--grey-900)}`; // Main form styles var formStyles = `body{font-family:Arial,sans-serif;min-height:100vh;margin:0}.hidden,.pd-hidden{display:none!important}form{--border-size:16px;position:relative;isolation:isolate;clip-path:polygon(var(--border-size) 0%,calc(100% - var(--border-size)) 0%,100% var(--border-size),100% calc(100% - var(--border-size)),calc(100% - var(--border-size)) 100%,var(--border-size) 100%,0% calc(100% - var(--border-size)),0% var(--border-size))}form p:not(.support-text){color:var(--text-secondary)!important}form.form{background:var(--bg-primary);padding:32px 24px;max-width:520px;margin:0 auto;display:flex;flex-direction:column;gap:16px}form.form p{margin:0}form.form p.form-field{position:relative;margin:0;transition:margin-bottom .3s}form.form p.form-field:not(.checkbox):not(.pd-checkbox):not(.submit):not(.select):not(:has(textarea)){display:flex;justify-content:flex-start;align-items:center;height:44px;border:0;border-bottom:1px solid var(--border-weak);overflow:visible;transition:.2s}form.form p.form-field:not(.checkbox):not(.pd-checkbox):not(.submit):not(.select):not(:has(textarea)):hover{background-color:var(--overlay-inverted)}form.form p.form-field:has(textarea){display:flex;justify-content:flex-start;align-items:center;border:0;border-bottom:1px solid var(--border-weak);overflow:visible;transition:.2s}form.form p.form-field:has(textarea):hover{background-color:var(--overlay-inverted)}form.form p.form-field.select{display:block;height:auto;border:0;overflow:visible;background:0 0}form.form p.form-field.has-support-text{margin-bottom:16px}form.form p.form-field:not(.select) label{position:absolute;top:14px;left:8px;margin-bottom:0;color:var(--text-secondary);font-size:var(--font-size-base);font-weight:500;line-height:1.4;letter-spacing:.01em;opacity:.7;pointer-events:none;transition:.2s}form.form p.form-field:not(.select):hover label{opacity:1}form.form p.form-field:not(.select) label.is-active{top:-5px;font-size:var(--font-size-caption);line-height:1.3;letter-spacing:.02em;opacity:1}form.form p.form-field.select label{display:block;margin-bottom:8px;color:var(--text-secondary);font-size:14px;font-weight:500;line-height:1.4;letter-spacing:.01em;pointer-events:auto;opacity:.7;transition:opacity .2s}form.form p.form-field.select.has-value label{opacity:1}form.form p.form-field.select:has(.custom-select:hover) label{opacity:1}form.form p.required label::after,form.form span.required label::after{content:" *";color:var(--flare)}form.form input:not([type=checkbox]),form.form select,form.form textarea{width:calc(100% - 40px)!important;height:44px;padding:16px 0 16px 8px;color:var(--text-primary);font-size:var(--font-size-base);line-height:1.4;letter-spacing:.01em;background-color:transparent;border:0;box-sizing:border-box}form.form input::placeholder{color:transparent}.form.form p.form-field.has-value{border-color:var(--border-medium)!important}form.form p.form-field.has-value input,form.form p.form-field.has-value select,form.form p.form-field:focus-within input,form.form p.form-field:focus-within select{padding-top:22px;padding-bottom:16px}form.form input:-webkit-autofill,form.form input:-webkit-autofill:active,form.form input:-webkit-autofill:focus,form.form input:-webkit-autofill:hover{-webkit-box-shadow:0 0 0 1000px transparent inset!important;-webkit-text-fill-color:var(--text-primary)!important;background-color:transparent!important;transition:background-color 5000s ease-in-out}form.form select{appearance:none;-webkit-appearance:none;-moz-appearance:none;width:100%!important;height:auto;padding:12px 40px 12px 16px;color:var(--text-primary);font-size:14px;font-weight:400;line-height:1.4;letter-spacing:.01em;background-color:var(--bg-secondary);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23939397' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 16px center;border:1px solid var(--border-weak);border-radius:8px;cursor:pointer;transition:.2s}form.form select:hover{border-color:var(--border-medium);background-color:var(--bg-tertiary)}form.form select:focus{border-color:var(--text-primary);background-color:var(--bg-secondary)}form.form select option{background-color:var(--bg-secondary);color:var(--text-primary);padding:12px 16px;font-size:14px;font-weight:400;line-height:1.4}form.form select option:checked,form.form select option:focus,form.form select option:hover{background-color:var(--bg-tertiary);color:var(--text-primary)}.custom-select{position:relative;width:100%;outline:0}.custom-select__selected{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background-color:var(--bg-secondary);border:1px solid var(--border-weak);border-radius:4px;cursor:pointer;transition:.2s;user-select:none;opacity:.7}.custom-select__selected:hover{border-color:var(--border-medium);background-color:var(--bg-tertiary);opacity:1}.custom-select.open .custom-select__selected{border-color:var(--text-primary);background-color:var(--bg-secondary);border-bottom-left-radius:0;border-bottom-right-radius:0;opacity:1}.custom-select.has-value .custom-select__selected{opacity:1}.custom-select__text{color:var(--text-primary);font-size:14px;font-weight:400;line-height:1.4;letter-spacing:.01em}.custom-select__arrow{display:flex;align-items:center;color:var(--icon-secondary);transition:transform .2s;flex-shrink:0;margin-left:12px}.custom-select.open .custom-select__arrow{transform:rotate(180deg)}.custom-select__options{display:none;position:absolute;top:100%;left:0;right:0;max-height:200px;overflow-y:auto;background-color:var(--bg-secondary);border:1px solid var(--text-primary);border-top:none;border-bottom-left-radius:8px;border-bottom-right-radius:8px;z-index:1000;box-shadow:0 4px 12px rgba(0,0,0,.15)}.custom-select__option{display:flex;align-items:center;justify-content:flex-start;padding:12px 16px;color:var(--text-secondary);font-size:14px;font-weight:400;line-height:1.4;cursor:pointer;transition:background-color .15s,opacity .15s;user-select:none;opacity:.7}.custom-select__option.focused,.custom-select__option:hover{background-color:var(--overlay-inverted);opacity:1}.custom-select__option.selected{background-color:var(--bg-tertiary);opacity:1}.custom-select__option.selected.focused,.custom-select__option.selected:hover{background-color:var(--overlay-inverted);opacity:1}.custom-select__check{display:none;color:var(--icon-primary);flex-shrink:0;margin-right:12px}.custom-select__option.selected .custom-select__check{display:flex;align-items:center}.custom-select__options::-webkit-scrollbar{width:8px}.custom-select__options::-webkit-scrollbar-track{background:var(--bg-primary);border-radius:4px}.custom-select__options::-webkit-scrollbar-thumb{background:var(--border-medium);border-radius:4px}.custom-select__options::-webkit-scrollbar-thumb:hover{background:var(--icon-secondary)}form.form textarea{height:44px;padding-top:16px;width:100%!important;resize:none;overflow:hidden;transition:height .2s cubic-bezier(0, 0, 0, 1),padding-top .2s;scrollbar-width:none;-ms-overflow-style:none}form.form textarea::-webkit-scrollbar{display:none}form.form p.form-field.has-value textarea,form.form textarea:focus{height:90px;overflow-y:auto}form.form input:focus,form.form select:focus,form.form textarea:focus{outline:0}form.form input:focus-visible,form.form select:focus-visible,form.form textarea:focus-visible{outline:0!important;outline-offset:0px}form.form .form-field__icon-close{position:absolute;right:8px;top:50%;transform:translateY(-50%);display:none;align-items:center;justify-content:center;cursor:pointer;border-radius:4px;transition:opacity .2s}form.form .form-field__icon-close:hover{opacity:.7}form.form p.form-field.has-value .form-field__icon-close{display:flex}form.form p.form-field.checkbox,form.form p.form-field.pd-checkbox{padding:0;background:0 0;border:none}form.form p.form-field.checkbox span.value,form.form p.form-field.pd-checkbox span.value span{display:flex;align-items:flex-start;gap:8px}form.form p.form-field.checkbox label,form.form p.form-field.pd-checkbox label{position:static;font-size:14px!important;font-style:normal;font-weight:500;line-height:130%;letter-spacing:-.14px;color:var(--text-secondary)!important;opacity:1;pointer-events:auto}form.form p.form-field.checkbox label a,form.form p.form-field.pd-checkbox label a{color:var(--text-tertiary)}form.form input[type=checkbox]{width:18px!important;height:18px!important;margin:2px 0 0;padding:0;appearance:none;-webkit-appearance:none;cursor:pointer;background-color:var(--grey-400);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18' fill='none'%3E%3Cpath d='M16 2V16H2V2H16ZM18 0H0V18H18V0Z' fill='black'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18' fill='none'%3E%3Cpath d='M16 2V16H2V2H16ZM18 0H0V18H18V0Z' fill='black'/%3E%3C/svg%3E");-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}form.form input[type=checkbox]:checked{background-color:var(--text-primary);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18' fill='none'%3E%3Cpath d='M18 0H0V18H18V0ZM7 14.414L2.293 9.707L3.707 8.293L7 11.586L14.293 4.293L15.707 5.707L7 14.414Z' fill='black'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18' fill='none'%3E%3Cpath d='M18 0H0V18H18V0ZM7 14.414L2.293 9.707L3.707 8.293L7 11.586L14.293 4.293L15.707 5.707L7 14.414Z' fill='black'/%3E%3C/svg%3E")}form.form p.submit{padding-top:14px}form.form p.submit input{font-size:16px;font-style:normal;font-weight:500;line-height:110%;letter-spacing:-.16px;color:var(--button-primary-text);--border-size:4px;width:100%!important;height:44px;padding:8px 24px;display:flex;justify-content:center;align-items:center;background-color:var(--button-primary-bg);color:var(--button-primary-text);text-decoration:none;cursor:pointer;position:relative;isolation:isolate;clip-path:polygon(var(--border-size) 0%,calc(100% - var(--border-size)) 0%,100% var(--border-size),100% calc(100% - var(--border-size)),calc(100% - var(--border-size)) 100%,var(--border-size) 100%,0% calc(100% - var(--border-size)),0% var(--border-size))}form.form p.submit input:hover{opacity:.9;transition:.2s}form.form p.form-field.error{border-color:var(--blaze)}form.form p.errors{padding:12px;color:var(--blaze);font-size:var(--font-size-base);background:rgba(255,77,77,.1);border-radius:6px}form.form .error.no-label{color:var(--blaze)!important;font-size:var(--font-size-caption)}.support{display:flex;align-items:center;gap:6px;font-size:var(--font-size-base)}.support .support-icon{display:flex;align-items:center;justify-content:center;flex-shrink:0}.support .support-text{margin:0}.support.success{color:var(--spring)}.support.error{color:var(--blaze)!important}form.form .description{display:block;margin-top:-16px;margin-bottom:16px;font-size:var(--font-size-caption);color:var(--icon-secondary)}`; // Newsletter layout styles var newsletterStyles = `html[data-type=newsletter]{container-type:inline-size}html[data-type=newsletter] .form.form{display:grid;grid-template-columns:1fr auto;padding:10px;background-color:transparent}html[data-type=newsletter] form.form p.submit{padding:0}@container (max-width:479px){html[data-type=newsletter] .form.form{flex-flow:column;display:flex}}`; // Helper function to inject CSS function injectCSS(cssText) { var style = document.createElement('style'); style.textContent = cssText; document.head.appendChild(style); } // Inject root colors injectCSS(rootColors); // Inject theme based on data-theme attribute var theme = document.documentElement.getAttribute('data-theme') || 'dark'; var themeStyles = theme === 'light' ? themeLight : themeDark; injectCSS(themeStyles); // Inject main form styles injectCSS(formStyles); // Override form background for light mode if (theme === 'light') { injectCSS('form.form{background:var(--bg-secondary)}'); } // Inject newsletter layout styles injectCSS(newsletterStyles); // Form JavaScript (from pardot-form.js) document.addEventListener("DOMContentLoaded", function () { var form = document.querySelector("#pardot-form"); var submitBtn = form ? form.querySelector('p.submit input[type="submit"]') : null; if (!form || !submitBtn) return; var closeIconSvg = ''; var dropdownArrowSvg = ''; var checkmarkSvg = ''; var currentOpenDropdown = null; function closeAllDropdowns() { if ( currentOpenDropdown && typeof currentOpenDropdown.close === "function" ) { currentOpenDropdown.close(); currentOpenDropdown = null; } } function createCustomDropdown(selectElement) { var container = selectElement.closest("p.form-field"); if (!container) return; container.classList.add("select"); var customDropdown = document.createElement("div"); customDropdown.className = "custom-select"; customDropdown.setAttribute("tabindex", "0"); var selectedDisplay = document.createElement("div"); selectedDisplay.className = "custom-select__selected"; var selectedText = document.createElement("span"); selectedText.className = "custom-select__text"; selectedText.textContent = selectElement.options[selectElement.selectedIndex]?.text || "Select an option"; var arrow = document.createElement("span"); arrow.className = "custom-select__arrow"; arrow.innerHTML = dropdownArrowSvg; selectedDisplay.appendChild(selectedText); selectedDisplay.appendChild(arrow); var optionsList = document.createElement("div"); optionsList.className = "custom-select__options"; Array.from(selectElement.options).forEach(function (option, index) { if (option.value === "") return; var optionItem = document.createElement("div"); optionItem.className = "custom-select__option"; optionItem.setAttribute("data-value", option.value); optionItem.setAttribute("data-index", index); var check = document.createElement("span"); check.className = "custom-select__check"; check.innerHTML = checkmarkSvg; var optionText = document.createElement("span"); optionText.textContent = option.text; if (option.selected) { optionItem.classList.add("selected"); } optionItem.appendChild(check); optionItem.appendChild(optionText); optionsList.appendChild(optionItem); }); customDropdown.appendChild(selectedDisplay); customDropdown.appendChild(optionsList); selectElement.style.display = "none"; selectElement.parentNode.insertBefore( customDropdown, selectElement.nextSibling, ); if (selectElement.value && selectElement.value !== "") { container.classList.add("has-value"); customDropdown.classList.add("has-value"); } var isOpen = false; var focusedIndex = -1; function openDropdown() { closeAllDropdowns(); isOpen = true; customDropdown.classList.add("open"); optionsList.style.display = "block"; currentOpenDropdown = { close: closeDropdown }; var selectedOption = optionsList.querySelector( ".custom-select__option.selected", ); if (selectedOption) { focusedIndex = parseInt(selectedOption.getAttribute("data-index")); } else { focusedIndex = 0; } updateFocusedOption(); } function closeDropdown() { isOpen = false; customDropdown.classList.remove("open"); optionsList.style.display = "none"; focusedIndex = -1; removeAllFocus(); } function updateFocusedOption() { removeAllFocus(); var options = optionsList.querySelectorAll(".custom-select__option"); if (options[focusedIndex]) { options[focusedIndex].classList.add("focused"); options[focusedIndex].scrollIntoView({ block: "nearest" }); } } function removeAllFocus() { optionsList .querySelectorAll(".custom-select__option") .forEach(function (opt) { opt.classList.remove("focused"); }); } function selectOption(optionElement) { var value = optionElement.getAttribute("data-value"); var textSpans = optionElement.querySelectorAll("span"); var text = textSpans[textSpans.length - 1].textContent; selectElement.value = value; var event = new Event("change", { bubbles: true }); selectElement.dispatchEvent(event); selectedText.textContent = text; optionsList .querySelectorAll(".custom-select__option") .forEach(function (opt) { opt.classList.remove("selected"); }); optionElement.classList.add("selected"); if (value && value !== "") { container.classList.add("has-value"); customDropdown.classList.add("has-value"); } else { container.classList.remove("has-value"); customDropdown.classList.remove("has-value"); } closeDropdown(); customDropdown.focus(); } selectedDisplay.addEventListener("click", function (e) { e.stopPropagation(); if (isOpen) { closeDropdown(); } else { openDropdown(); } }); optionsList .querySelectorAll(".custom-select__option") .forEach(function (option) { option.addEventListener("click", function (e) { e.stopPropagation(); selectOption(option); }); }); customDropdown.addEventListener("keydown", function (e) { var options = optionsList.querySelectorAll(".custom-select__option"); switch (e.key) { case "Enter": case " ": e.preventDefault(); if (!isOpen) { openDropdown(); } else if (focusedIndex >= 0 && options[focusedIndex]) { selectOption(options[focusedIndex]); } break; case "Escape": e.preventDefault(); closeDropdown(); break; case "ArrowDown": e.preventDefault(); if (!isOpen) { openDropdown(); } else { focusedIndex = Math.min(focusedIndex + 1, options.length - 1); updateFocusedOption(); } break; case "ArrowUp": e.preventDefault(); if (!isOpen) { openDropdown(); } else { focusedIndex = Math.max(focusedIndex - 1, 0); updateFocusedOption(); } break; case "Home": e.preventDefault(); if (isOpen) { focusedIndex = 0; updateFocusedOption(); } break; case "End": e.preventDefault(); if (isOpen) { focusedIndex = options.length - 1; updateFocusedOption(); } break; } }); document.addEventListener("click", function () { if (isOpen) { closeDropdown(); } }); customDropdown.addEventListener("click", function (e) { e.stopPropagation(); }); } form.querySelectorAll("select").forEach(function (select) { createCustomDropdown(select); }); // Checkboxes are now styled via CSS targeting span.value form .querySelectorAll( "p.form-field:not(.checkbox):not(.select):not(.pd-checkbox", ) .forEach(function (container) { var label = container.querySelector("label"); var input = container.querySelector("input, textarea"); if (!label || !input) return; var isTextarea = input.tagName.toLowerCase() === "textarea"; if (!isTextarea) { var closeIcon = document.createElement("span"); closeIcon.className = "form-field__icon-close"; closeIcon.innerHTML = closeIconSvg; container.appendChild(closeIcon); } function updateState() { var hasValue = input.value && input.value.trim() !== ""; var isFocused = document.activeElement === input; label.classList.toggle("is-active", isFocused || hasValue); container.classList.toggle("has-value", hasValue); } input.addEventListener("focus", updateState); input.addEventListener("blur", updateState); input.addEventListener("input", updateState); input.addEventListener("change", updateState); if (!isTextarea && closeIcon) { closeIcon.addEventListener("click", function () { input.value = ""; updateState(); clearFieldError(input); clearSupportText(input); input.focus(); }); } updateState(); }); var successIcon = ''; var errorIcon = ''; function showSupportText(type, message, fieldElement) { var formField = fieldElement.closest("p.form-field"); if (!formField) return; var existingSupport = formField.querySelector(".support"); if (existingSupport) { existingSupport.remove(); } var supportDiv = document.createElement("div"); supportDiv.className = "support " + type; supportDiv.innerHTML = '
' + (type === "success" ? successIcon : errorIcon) + '

' + message + "

"; formField.appendChild(supportDiv); formField.classList.add("has-support-text"); void supportDiv.offsetWidth; supportDiv.classList.add("is-visible"); } function clearSupportText(fieldElement) { var formField = fieldElement.closest("p.form-field"); if (!formField) return; var existingSupport = formField.querySelector(".support"); if (existingSupport) { existingSupport.classList.remove("is-visible"); existingSupport.classList.add("is-hidden"); setTimeout(function () { existingSupport.remove(); formField.classList.remove("has-support-text"); }, 300); } } function clearAllSupportTexts() { form.querySelectorAll(".support").forEach(function (support) { support.classList.remove("is-visible"); support.classList.add("is-hidden"); setTimeout(function () { support.remove(); }, 300); }); form.querySelectorAll(".has-support-text").forEach(function (field) { field.classList.remove("has-support-text"); }); } function clearFieldError(field) { var wrapper = field.closest("p.form-field"); if (wrapper) { wrapper.classList.remove("error"); } clearSupportText(field); } function setFieldError(field, message) { var wrapper = field.closest("p.form-field"); if (wrapper) { wrapper.classList.add("error"); } if (message) { showSupportText("error", message, field); } } function processPardotErrors() { var pardotErrors = form.querySelectorAll( "p.error:not(.form-field).no-label", ); pardotErrors.forEach(function (errorP) { // Skip if already transformed if (errorP.classList.contains("support")) { return; } // Transform Pardot's error into our custom styled error var errorMessage = errorP.textContent.trim(); errorP.className = "support error is-visible"; errorP.style.position = "relative"; errorP.style.display = "flex"; errorP.style.marginBottom = "0"; errorP.innerHTML = '
' + errorIcon + '

' + errorMessage + "

"; }); var globalError = form.querySelector("p.errors"); if (globalError) { globalError.style.display = "none"; } } processPardotErrors(); var errorProcessingTimeout; var formObserver = new MutationObserver(function (mutations) { // Check if any Pardot error messages were added var hasNewErrors = mutations.some(function (mutation) { return Array.from(mutation.addedNodes).some(function (node) { return ( node.nodeType === 1 && node.tagName === "P" && node.classList && node.classList.contains("error") && node.classList.contains("no-label") ); }); }); if (hasNewErrors) { clearTimeout(errorProcessingTimeout); errorProcessingTimeout = setTimeout(processPardotErrors, 50); } }); formObserver.observe(form, { childList: true, subtree: true }); }); })();