(()=>{const EmbedVariables={newPotentialVisitorTrackingId:"lovx04h0nj1oxzm6r6acnpcruo8jezqo00g8n07qjlb7y6znxcdpwbb6xdj5l7w3",visitorTrackingIdCookieName:"clive-visitor-tid-21",currentCliveId:"5790",currentCliveType:"form",domainName:"live.clive.cloud",formId:"5790",smartContentVersionQueryParam:""},visitorTrackingIdCookieName=EmbedVariables.visitorTrackingIdCookieName,getCookie=(e,t)=>{const n=e+"=",r=t.split(";");for(let i=0;i<r.length;i++){let o=r[i];for(;o.charAt(0)==" ";)o=o.substring(1);if(o.indexOf(n)==0)return o.substring(n.length,o.length)}return""},getCookieDomain=()=>{const e=window.location.hostname;if(!isNaN(Number(e.replace(/\\./gi,""))))return null;const t=e.split("."),n=t.length;return n<2?null:"."+t[n-2]+"."+t[n-1]},setCookie=(e,t,n)=>{const r=new Date;r.setTime(r.getTime()+n*24*60*60*1e3);const i="expires="+r.toUTCString(),o=getCookieDomain(),s=o?";Domain="+encodeURIComponent(o):"";document.cookie=e+"="+t+";"+i+";path=/"+s,getCookie(e,document.cookie)||(document.cookie=e+"="+t+";"+i+";path=/")},setVisitorTrackingIdCookie=e=>{setCookie(visitorTrackingIdCookieName,e,3650)},determineVisitorTrackingId=()=>{let e=getCookie(visitorTrackingIdCookieName,document.cookie);return e||(e=EmbedVariables.newPotentialVisitorTrackingId,setVisitorTrackingIdCookie(EmbedVariables.newPotentialVisitorTrackingId)),e},ajax=(e,t,n,r,i)=>{const o=new XMLHttpRequest;o.withCredentials=i!==!1,o.open(t,appendReferer(e),!0);for(let s in r)o[s]=r[s];o.send(n)},appendReferer=e=>{const t=new URL(e);return t.searchParams.set("referer",window.location.href),t.toString()},findScriptNode=()=>{const e=document.currentScript;if(e)return e;const t=document.getElementsByTagName("script");for(let n=0;n<t.length;n++){const r=t[n],i=r.getAttribute("data-clive-id"),o=r.getAttribute("data-clive-type");if(i==EmbedVariables.currentCliveId&&o==EmbedVariables.currentCliveType)return r}return null},visitorTrackingId=determineVisitorTrackingId(),scriptNode=findScriptNode();scriptNode&&scriptNode.parentNode&&ajax(`https://${EmbedVariables.domainName}/forms/${EmbedVariables.formId}/visitors/${visitorTrackingId}/render${EmbedVariables.smartContentVersionQueryParam}`,"GET",null,{onload:function(){const newNode=document.createElement("DIV");newNode.innerHTML=this.responseText;const form=newNode.querySelector("form"),script=newNode.getElementsByTagName("SCRIPT")[0];if(scriptNode&&scriptNode.parentNode&&(scriptNode.parentNode.insertBefore(newNode,scriptNode),script))try{eval(script.innerHTML)}catch(e){console.log("Error: ",e,e.stack)}}});})();