PageSourceSearch

https://theouai.com/cdn/shop/t/965/assets/newsletter-vite-DP-0i8mp.js

js theouai.com collected 2026-10-02 16:41:17 UTC 4,105 bytes, 1 lines download raw bytes

1if(!customElements.get("newsletter-footer")){class l extends HTMLElement{constructor(){if(super(),this.form=this.querySelector("form"),this.klaviyoListId=this.getAttribute("data-klaviyo-list-id"),this.email=this.querySelector('input[type="email"]'),this.name=this==null?void 0:this.querySelector('input[type="text"]'),this.phone=this==null?void 0:this.querySelector('input[type="tel"]'),this.birthday=this==null?void 0:this.querySelector("input.form-input--birthday"),this.companyId="Vesjd6",this.birthday&&(this.birthday.addEventListener("input",function(){let t=this.value.replace(/\D/g,"");if(t.length===1&&t>"1"&&(t="0"+t),t.length>=2){let s=parseInt(t.substring(0,2),10);s===0&&(t="01"+t.substring(2)),s>12&&(t="12"+t.substring(2))}if(t.length>=4){let s=parseInt(t.substring(0,2),10),e=parseInt(t.substring(2,4),10);if(e===0&&(e=1),t.length>=8){let i=parseInt(t.substring(4,8),10);if(i>=1){const r=new Date(i,s,0).getDate();e>r&&(e=r)}}else e>31&&(e=31);t=t.substring(0,2)+String(e).padStart(2,"0")+t.substring(4)}if(t.length>=8){let s=parseInt(t.substring(0,2),10),e=parseInt(t.substring(2,4),10),i=parseInt(t.substring(4,8),10);const r=1926,a=new Date().getFullYear();i<r&&(i=r),i>a&&(i=a);const n=new Date(i,s,0).getDate();e>n&&(e=n),t=String(s).padStart(2,"0")+String(e).padStart(2,"0")+String(i).padStart(4,"0")}t=t.substring(0,8),t.length>4?t=t.substring(0,2)+"/"+t.substring(2,4)+"/"+t.substring(4):t.length>2&&(t=t.substring(0,2)+"/"+t.substring(2)),this.value=t}),this.birthday.addEventListener("blur",function(){const t=this.value;if(!/^\d{2}\/\d{2}\/\d{4}$/.test(t)){this.setCustomValidity("");return}const[s,e,i]=t.split("/").map(Number),r=1926,a=new Date().getFullYear();if(i<r||i>a){this.setCustomValidity(`Year must be between ${r} and ${a}.`);return}const n=new Date(i,s-1,e);if(!(n.getFullYear()===i&&n.getMonth()===s-1&&n.getDate()===e)){this.setCustomValidity("Please enter a valid date.");return}const o=new Date;if(o.setHours(0,0,0,0),n.setHours(0,0,0,0),n>o){this.setCustomValidity("Birthday cannot be in the future.");return}this.setCustomValidity("")})),this.klaviyoListId)this.form.addEventListener("submit",this.sendForm.bind(this));else return console.error("Klaviyo form id not found.")}formData(){return{method:"POST",headers:{revision:"2024-02-15","content-type":"application/json"},body:JSON.stringify({data:{type:"subscription",attributes:{custom_source:"Sign Up page",profile:{data:{type:"profile",attributes:{email:this.querySelector('input[type="email"]')?this.querySelector('input[type="email"]').value:"",phone_number:this!=null&&this.querySelector('input[type="tel"]')?this==null?void 0:this.querySelector('input[type="tel"]').value:"",first_name:this!=null&&this.querySelector('input[type="text"]')?this==null?void 0:this.querySelector('input[type="text"]').value:"",properties:{birthday:this!=null&&this.querySelector("input.form-input--birthday")?this==null?void 0:this.querySelector("input.form-input--birthday").value:""}}}}},relationships:{list:{data:{type:"list",id:this.klaviyoListId}}}}})}}showMessage(t){this.querySelector(".footer-newsletter__"+t).classList.remove("hidden"),(t==="error"||t==="error-email"||t==="error-phone")&&setTimeout(()=>{this.querySelector(".footer-newsletter__"+t).classList.add("hidden")},4e3)}sendForm(t){if(t.preventDefault(),!this.emailValidation()){this.showMessage("error-email");return}if(!this.phoneValidation()){this.showMessage("error-phone");return}fetch(`https://a.klaviyo.com/client/subscriptions/?company_id=${this.companyId}`,this.formData()).then(s=>{s.status===202?this.showMessage("success"):this.showMessage("error")}).catch(s=>{console.error(s),this.showMessage("error")})}emailValidation(){if(this.email){const t=this.email.value,e=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t);return e&&e!==""}else return!0}phoneValidation(){const t=this.phone.value,e=/^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im.test(t);return e&&e!==""}}customElements.define("newsletter-footer",l)}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.