var bubbleConfig = {"_id":"4gAWaa7ss93FKciCg","name":"Verway","style":{"backgroundColor":"#f80b0b","color":"#150101"},"image":"https://static.convertlink.io/bubble/image/Qf9bHjtjcjPpv6baF.jpg","text":"Erreiche mit Bernd deine Ziele","waitTime":10,"buttonText":"Hier klicken","url":"https://verway.com/?partnerid=58264712","buttonStyle":{"backgroundColor":"#1f04f1","color":"#f30808"},"createdAt":"2020-06-25T21:00:51.939Z","userId":"2wDYnvfqQjY6xbSMP"};function _toConsumableArray(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}var MODE_TIMEOUT=0,MODE_INTERVAL=1,fnStacks=new Map,runArray=new Set,rafStarted=!1,startId=0;function getTimeStamp(){return(new Date).getTime()}function executeFn(t){var e=t.fn,n=t.args;e.apply(void 0,_toConsumableArray(n))}function runFunction(){0!==runArray.size&&(runArray.forEach(executeFn),runArray.clear())}var checkTick=function(a){return function(t,e){var n=t.nextTick,i=t.ms,o=t.mode;0<=a-n&&(runArray.add(t),o===MODE_TIMEOUT?fnStacks.delete(e):fnStacks.set(e,Object.assign({},t,{nextTick:n+i})))}};function loop(){var t=getTimeStamp();fnStacks.forEach(checkTick(t)),runFunction(),0!==fnStacks.size?window.requestAnimationFrame(loop):rafStarted=!1}function addId(t){var e=t.fn,n=t.ms,i=void 0===n?0:n,o=t.args,a=t.mode;if(!e)return null;var l=startId;return fnStacks.set(l,{fn:e,ms:i,nextTick:getTimeStamp()+i,args:o,mode:a}),rafStarted||(rafStarted=!0,window.requestAnimationFrame(loop)),startId+=1,l}function removeId(t){fnStacks.has(t)&&fnStacks.delete(t),0===fnStacks.size&&(rafStarted=!1)}var xhr,showSeconds,waitTime,notification,content,image,contentText,cta,timeDiv,closer,img,notificationStyleDisplay,rafSetTimeout=function(t,e){for(var n=arguments.length,i=Array(2<n?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];return addId({fn:t,ms:1<arguments.length&&void 0!==e?e:0,args:i,mode:MODE_TIMEOUT})},rafClearTimeout=removeId,rafSetInterval=function(t,e){for(var n=arguments.length,i=Array(2<n?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];return addId({fn:t,ms:1<arguments.length&&void 0!==e?e:0,args:i,mode:MODE_INTERVAL})},rafClearInterval=removeId;function shuffle(t){for(var e=t.length;0<e;){var n=Math.floor(Math.random()*e),i=t[--e];t[e]=t[n],t[n]=i}return t}function fadeOut(e){e&&(e.style.opacity=1,function t(){(e.style.opacity-=.1)<0?e.style.display="none":requestAnimationFrame(t)}())}function fadeIn(n,t,e,i){n&&(n.style.opacity=0,n.style.display=e||"flex",function t(){var e=parseFloat(n.style.opacity);1<(e+=.1)?"function"==typeof i&&i():(n.style.opacity=e,requestAnimationFrame(t))}())}bubbleConfig&&((xhr=new XMLHttpRequest).open("POST","/bubble/"+bubbleConfig._id+"/track-shown"),xhr.send(),showSeconds=bubbleConfig.displayTime||0,waitTime=bubbleConfig.waitTime||2,(notification=document.createElement("div")).className="cl-bubble-message",notification.style.alignItems="center",notification.style.position="fixed",notification.style.zIndex="999",notification.style.left="15px",notification.style.bottom="15px",notification.style.maxWidth="100%",notification.style.width="425px",notification.style.fontFamily="sans-serif",notification.style.fontSize="13px",notification.style.display="none",notification.style.maxWidth="calc(100% - 30px)",notification.style.boxSizing="border-box",(content=document.createElement("div")).style.borderRadius="10px",content.style.display="flex",content.style.alignItems="center",content.style.width="350px",content.style.marginLeft="auto",content.style.padding="10px 15px",content.style.boxSizing="border-box",content.style.backgroundColor=(bubbleConfig.style||{}).backgroundColor||"#fff",content.style.color=(bubbleConfig.style||{}).color||"#333",content.style.boxShadow="1px 2px 8px rgba(0,0,0,0.2)",bubbleConfig.image&&((image=document.createElement("div")).style.backgroundImage="url("+bubbleConfig.image+")",image.style.backgroundRepeat="no-repeat",image.style.backgroundPosition="center",image.style.backgroundSize="cover",image.style.borderRadius="100px",image.style.width="50px",image.style.height="50px",notification.appendChild(image)),(contentText=document.createElement("div")).innerHTML=bubbleConfig.text||"",contentText.style.fontSize="16px",contentText.style.marginRight="auto",content.appendChild(contentText),(cta=document.createElement("a")).href=bubbleConfig.url,cta.target="_blank",cta.style.backgroundColor=(bubbleConfig.buttonStyle||{}).backgroundColor||"#4d76ff",cta.style.border="none",cta.style.marginLeft="10px",cta.style.borderRadius="4px",cta.style.padding="8px 16px",cta.style.fontWeight="bold",cta.style.fontSize="16px",cta.style.cursor="pointer",cta.style.border="none",cta.style.marginRight="20px",cta.style.textDecoration="none",cta.style.display="block",cta.innerHTML=bubbleConfig.buttonText||"",cta.style.color=(bubbleConfig.buttonStyle||{}).color||"#999",cta.style.top="10px",cta.addEventListener("click",function(t){var e=new XMLHttpRequest;e.open("POST","/bubble/"+bubbleConfig._id+"/track-clicked"),e.send()}),content.appendChild(cta),notification.appendChild(content),bubbleConfig.time&&((timeDiv=document.createElement("div")).innerHTML=bubbleConfig.time||"",timeDiv.style.color="#999",timeDiv.style.fontSize="12px",timeDiv.style.marginTop="4px",notification.appendChild(timeDiv)),(closer=document.createElement("button")).style.backgroundColor="transparent",closer.style.border="none",closer.style.position="absolute",closer.style.top="10px",closer.style.right="10px",closer.style.cursor="pointer",closer.innerHTML="&times;",closer.style.opacity="0.75",closer.style.color=(bubbleConfig.style||{}).color||"#999",closer.style.top="10px",closer.addEventListener("click",function(t){t.preventDefault(),notification&&!bubbleConfig.closing&&(bubbleConfig.closing=!0,fadeOut(notification,100))}),notification.appendChild(closer),notificationStyleDisplay="flex","fullWidth"===bubbleConfig.theme&&(notification.style.width="100%",notification.style.left="0",notification.style.bottom="0",image&&(image.style.width="75px",image.style.height="75px",image.style.borderRadius="0"),content.style.boxShadow="none",notification.style.backgroundColor=(bubbleConfig.style||{}).backgroundColor||"#fff",notification.style.boxShadow="1px 2px 8px rgba(0,0,0,0.2)",content.style.width="calc(100% - 75px)",content.style.borderRadius="0",cta.style.marginRight="30px"),"overlay"===bubbleConfig.theme&&(notificationStyleDisplay="block",notification.style.width="768px",notification.style.maxWidth="100%",notification.style.left="50%",notification.style.bottom="auto",notification.style.padding="25px",notification.style.maxHeight="calc(100vh - 150px)",notification.style.overflow="auto",notification.style.textAlign="center",768<=window.innerWidth?(notification.style.left="50%",notification.style.marginLeft="-384px",notification.style.top="35px"):(notification.style.top="15px",notification.style.left="15px",notification.style.right="15px"),bubbleConfig.image&&image&&((img=document.createElement("img")).src=bubbleConfig.image,img.style.maxWidth="100%",image.style.backgroundImage="",image.appendChild(img)),image&&(image.style.width="100%",image.style.height="auto",image.style.marginBottom="25px",image.style.borderRadius="0"),content.style.boxShadow="none",content.style.display="block",notification.style.backgroundColor=(bubbleConfig.style||{}).backgroundColor||"#fff",notification.style.boxShadow="1px 2px 8px rgba(0,0,0,0.2)",content.style.width="100%",content.style.borderRadius="0",content.style.padding="0",cta.style.margin="20px 0 0 0",cta.style.fontSize="18px"),rafSetTimeout(function(){document.body.appendChild(notification),notification&&!bubbleConfig.closing&&"hidden"!==document.visibilityState&&fadeIn(notification,300,notificationStyleDisplay,function(){showSeconds&&rafSetTimeout(function(){notification&&!bubbleConfig.closing&&(fadeOut(notification,100),rafSetTimeout(function(){notification.parentNode.removeChild(notification)},100))},1e3*showSeconds)})},1e3*waitTime));