(()=>{"use strict";const e={generic:[(e,n)=>{return n.hasAttribute("required")?((n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)&&0===n.value.length&&(e=[...e,(t="generic",r="required",window.NelioFormsErrorMessages&&((null===(o=null===(i=window.NelioFormsErrorMessages)||void 0===i?void 0:i[t])||void 0===o?void 0:o[r])||(null===(d=null===(l=window.NelioFormsErrorMessages)||void 0===l?void 0:l.generic)||void 0===d?void 0:d.unknown))||"Unknown error")]),e):e;var t,r,i,o,l,d}]};function n(n,t){var r;e[n]=null!==(r=e[n])&&void 0!==r?r:[],e[n]=t?[...e[n],t]:e[n]}const t=function(){let n=0;return(...t)=>{const r=()=>{(n=>{var t,r;const i=(e=>{var n;return e.dataset.fieldType||(null!==(n=Array.from(e.classList).filter(e=>e.includes("__value--")&&!e.includes("required"))[0])&&void 0!==n?n:"").split("--")[1]||""})(n);if(void 0===e[i])return;const o=[...null!==(t=e.generic)&&void 0!==t?t:[],...null!==(r=e[i])&&void 0!==r?r:[]],l=(e=>{var n;const t=document.getElementById(null!==(n=e.id.split("__")[0])&&void 0!==n?n:"");return t instanceof HTMLFormElement?t:null})(n);if(!l)return;const d=(e=>e.id.split("__")[1]||"")(n);!function(e,n,t){const r=function(e,n){return document.getElementById(`${e.id}__${n}`)||void 0}(e,n);if(!r)return;const i=function(e,n){return document.getElementById(`${e.id}__${n}-error`)||function(e,n){var t,r,i;const o=document.createElement("label");o.setAttribute("id",`${e.id}__${n}-error`),o.setAttribute("for",`${e.id}__${n}`),o.classList.add("nelio-forms-field__error-label");const l=null===(t=document.getElementById(`${e.id}__${n}`))||void 0===t?void 0:t.parentElement;return(null===(r=null==l?void 0:l.classList)||void 0===r?void 0:r.contains("nelio-forms-field__value-container"))?null===(i=null==l?void 0:l.parentNode)||void 0===i||i.appendChild(o):null==l||l.appendChild(o),o}(e,n)}(e,n);r.classList.remove("nelio-forms-field__value--error"),i.innerHTML="",t.length&&(r.classList.add("nelio-forms-field__value--error"),t.forEach(e=>{const n=document.createElement("div");n.textContent=e,i.appendChild(n)}))}(l,d,o.reduce((e,t)=>t(e,n),[]))})(...t),n=0};if(n)return clearTimeout(n),void(n=setTimeout(r,0));n=setTimeout(r,0)}}();!function(e){if("undefined"!=typeof document){if("complete"!==document.readyState&&"interactive"!==document.readyState)return document.addEventListener("DOMContentLoaded",e);e()}}(()=>Array.from(document.querySelectorAll(".nelio-forms-field__value")).forEach(e=>(e=>{e.addEventListener("keyup",()=>t(e)),e.addEventListener("change",()=>t(e)),e.addEventListener("blur",()=>t(e))})(e))),n("date"),n("time"),n("datetime")})();