var socialProofConfig = {"_id":"LxBpmJTmw8ntKz8MZ","name":"Business Starter kaufen","messages":[{"text":"Thomas W. aus Leipzig, DE hat dies auch gekauft vor","time":"3 Stunden","image":"https://static.convertlink.io/socialProof/image/rL6GHa3XyARyS5BDz.jpg"},{"text":"Christian B. aus Hamburg, DE hat dies auch gekauft vor","time":"7 Stunden","image":"https://static.convertlink.io/socialProof/image/m3DmB8FecroBpTccw.jpg"},{"text":"Julia H. aus Kassel, DE hat dies auch gekauft vor","time":"5 Stunden","image":"https://static.convertlink.io/socialProof/image/2QLjP8B5vbeAmHNzs.jpg"},{"text":"Teresa W. aus Wuppertal, DE hat dies auch gekauft vor","time":"16 Stunden","image":"https://static.convertlink.io/socialProof/image/mkaGAzTNQJoiudxXe.jpg"},{"text":"Michael R. aus Berlin, DE hat dies auch gekauft vor","time":"20 Stunden","image":"https://static.convertlink.io/socialProof/image/N6p4NevuAjAc4KXhe.jpg"}],"style":{},"displayTime":5,"initialWaitTime":5,"waitTime":5,"createdAt":"2024-07-09T15:00:47.736Z","userId":"mCzzFdGevt8P5r638"};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,t=t.args;e.apply(void 0,_toConsumableArray(t))}function runFunction(){0!==runArray.size&&(runArray.forEach(executeFn),runArray.clear())}var checkTick=function(a){return function(t,e){var n=t.nextTick,o=t.ms,i=t.mode;0<=a-n&&(runArray.add(t),i===MODE_TIMEOUT?fnStacks.delete(e):fnStacks.set(e,Object.assign({},t,{nextTick:n+o})))}};function loop(){var t=getTimeStamp();fnStacks.forEach(checkTick(t)),runFunction(),0===fnStacks.size?rafStarted=!1:window.requestAnimationFrame(loop)}function addId(t){var e,n=t.fn,o=t.ms,o=void 0===o?0:o,i=t.args,t=t.mode;return n?(e=startId,fnStacks.set(e,{fn:n,ms:o,nextTick:getTimeStamp()+o,args:i,mode:t}),rafStarted||(rafStarted=!0,window.requestAnimationFrame(loop)),startId+=1,e):null}function removeId(t){fnStacks.has(t)&&fnStacks.delete(t),0===fnStacks.size&&(rafStarted=!1)}var initialNotificationShown,shuffledNotifications,showNotificationContainer,rafSetTimeout=function(t){for(var e=arguments.length,n=Array(2<e?e-2:0),o=2;o<e;o++)n[o-2]=arguments[o];return addId({fn:t,ms:1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,args:n,mode:MODE_TIMEOUT})},rafClearTimeout=removeId,rafSetInterval=function(t){for(var e=arguments.length,n=Array(2<e?e-2:0),o=2;o<e;o++)n[o-2]=arguments[o];return addId({fn:t,ms:1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,args:n,mode:MODE_INTERVAL})},rafClearInterval=removeId;function shuffle(t){for(var e=t.length;0<e;){var n=Math.floor(Math.random()*e),o=t[--e];t[e]=t[n],t[n]=o}return t}function asyncLoop(t,e,n){var o=0,i=!1,a={next:function(){i||(o<t?(o++,e(a)):(i=!0,n()))},iteration:function(){return o-1},break:function(){i=!0,n()}};return a.next(),a}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,o){n&&(n.style.opacity=0,n.style.display="block",function t(){var e=parseFloat(n.style.opacity);1<(e+=.1)?"function"==typeof o&&o():(n.style.opacity=e,requestAnimationFrame(t))}())}socialProofConfig&&socialProofConfig.messages&&socialProofConfig.messages.length&&(initialNotificationShown=!1,shuffledNotifications=shuffle(Array.from(socialProofConfig.messages)),(showNotificationContainer=function(r){asyncLoop(r.length,function(e){var n,t,o,i,a=r[e.iteration()];(n=a).closing=!1,o=socialProofConfig.displayTime||5,a=socialProofConfig.initialWaitTime||socialProofConfig.waitTime||2,initialNotificationShown?t=socialProofConfig.waitTime||2:(t=a,initialNotificationShown=!0),(i=document.createElement("div")).className="cl-social-proof-message",i.style.borderRadius="100px",i.style.backgroundColor="#fff",i.style.position="fixed",i.style.zIndex="999",i.style.left="15px",i.style.bottom="15px",i.style.border="1px solid #ddd",i.style.boxSizing="border-box",i.style.padding="10px 15px",i.style.width="265px",i.style.maxWidth="100%",i.style.color="#666",i.style.clear="both",i.style.fontFamily="sans-serif",i.style.fontSize="13px",i.style.display="none",n.image&&((a=document.createElement("div")).style.backgroundImage="url("+n.image+")",a.style.backgroundRepeat="no-repeat",a.style.backgroundPosition="center",a.style.backgroundSize="cover",a.style.borderRadius="100px",a.style.float="left",a.style.marginRight="15px",a.style.width="40px",a.style.height="40px",i.appendChild(a)),(a=document.createElement("div")).innerHTML=n.text||"",a.style.fontWeight="bold",i.appendChild(a),n.time&&((a=document.createElement("div")).innerHTML=n.time||"",a.style.color="#999",a.style.fontSize="12px",a.style.marginTop="4px",i.appendChild(a)),(a=document.createElement("button")).style.backgroundColor="transparent",a.style.border="none",a.style.position="absolute",a.style.top="10px",a.style.right="10px",a.style.cursor="pointer",a.innerHTML="&times;",a.style.color="#999",a.style.top="50%",a.style.marginTop="-8px",a.addEventListener("click",function(t){t.preventDefault(),i&&!n.closing&&(n.closing=!0,fadeOut(i,100),e.next())}),i.appendChild(a),rafSetTimeout(function(){document.body.appendChild(i),i&&!n.closing&&"hidden"!==document.visibilityState&&fadeIn(i,300,function(){rafSetTimeout(function(){i&&!n.closing&&(fadeOut(i,100),rafSetTimeout(function(){i.parentNode.removeChild(i)},100),e.next())},1e3*o)})},1e3*t)},function(){showNotificationContainer(shuffledNotifications)})})(shuffledNotifications));