PageSourceSearch

https://www.riversol.com/cdn/shop/t/781/assets/klaviyo-subscribe.js?v=180463940279263672931789498418

js riversol.com collected 2026-09-25 20:30:17 UTC 3,557 bytes, 2 lines download raw bytes

1(function(global){"use strict";if(global.riversolKlaviyoSubscribe)return;var COMPANY_ID="TMwKL4",LIST_ID="W5Eva7",ENDPOINT="https://a.klaviyo.com/client/subscriptions/?company_id="+COMPANY_ID,REVISION="2025-07-15",EMAIL_RE=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function subscribe(options){var opts=options||{},email=String(opts.email||"").trim();if(!EMAIL_RE.test(email))return Promise.reject(new Error("invalid-email"));var profileAttrs={email:email};profileAttrs.subscriptions={email:{marketing:{consent:"SUBSCRIBED"}}},opts.properties&&typeof opts.properties=="object"&&(profileAttrs.properties=opts.properties);var body={data:{type:"subscription",attributes:{custom_source:opts.source||"Riversol theme (native)",profile:{data:{type:"profile",attributes:profileAttrs}}},relationships:{list:{data:{type:"list",id:LIST_ID}}}}};return fetch(ENDPOINT,{method:"POST",headers:{"Content-Type":"application/json",revision:REVISION},body:JSON.stringify(body),keepalive:!0}).then(function(res){if(!res.ok)return res.json().catch(function(){return null}).then(function(j){var detail=j&&j.errors&&j.errors[0]&&j.errors[0].detail;throw new Error("klaviyo-"+res.status+(detail?": "+detail:""))})})}global.riversolKlaviyoSubscribe=subscribe;function attr(form,name,fallback){var v=form.getAttribute(name);return v&&v.trim()?v:fallback}function setMessage(form,title,body,isError){var el=form.querySelector("[data-message]");if(el){var t=el.querySelector("[data-message-title]"),b=el.querySelector("[data-message-body]");t&&(t.textContent=title||""),b&&(b.textContent=body||"",b.hidden=!body),el.classList.toggle("newsletter-form__message--error",!!isError),el.classList.toggle("newsletter-form__message--success",!isError),el.hidden=!1}}function showSuccess(form){var wrapper=form.closest?form.closest(".
1newsletter-form"):null;wrapper&&wrapper.classList.add("newsletter-form--success"),setMessage(form,attr(form,"data-success-title","Thank you for subscribing!"),attr(form,"data-success-body",""),!1),form.reset();var el=form.querySelector("[data-message]");if(el&&el.focus)try{el.focus({preventScroll:!0})}catch(e){}}function showError(form,text){setMessage(form,text,"",!0)}global.document.addEventListener("submit",function(event){var form=event.target.closest&&event.target.closest("form[data-klaviyo-subscribe]");if(form&&form.getAttribute("data-klaviyo-subscribe")!=="manual"&&(event.preventDefault(),form.dataset.pending!=="1")){var trap=form.querySelector('input[name="company_website"]');if(trap&&trap.value){showSuccess(form);return}var input=form.querySelector('input[type="email"]'),button=form.querySelector("[data-submit]"),email=input?input.value:"",prior=form.querySelector("[data-message]");prior&&prior.classList.contains("newsletter-form__message--error")&&(prior.hidden=!0),form.dataset.pending="1",button&&button.setAttribute("aria-busy","true"),subscribe({email:email,source:form.getAttribute("data-source")||void 0}).then(function(){showSuccess(form)}).catch(function(err){if(showError(form,String(err&&err.message)==="invalid-email"?attr(form,"data-error-invalid","Please enter a valid email address."):attr(form,"data-error-generic","Something went wrong on our side. Please try again in a moment.")),input&&String(err&&err.message)==="invalid-email")try{input.focus()}catch(e){}window.console&&console.warn&&console.warn("[klaviyo-subscribe]",err)}).then(function(){form.dataset.pending="",button&&button.removeAttribute("aria-busy")})}})})(window);
2//# sourceMappingURL=/cdn/shop/t/781/assets/klaviyo-subscribe.js.map?v=180463940279263672931789498418

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.