class ChipiChipiClass { active = 0; launch = 0; counter = 0; counter_max = 500; offer = ''; dealjs = atob(''); selector = ''; domain = ''; client = '6b3bee7efbb6fb07e401819466a97042e4e84e0b'; originals = {}; constructor() {} init() { if( this.launch || !this.selector || !this.offer || this.cookie_get('chipichipi') == 1 ) { return; } this.launch = 1; this.buttons(); } cookie_get(name) { name += "="; var ca = document.cookie.split(';'); for( var i = 0; i < ca.length; i++ ) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(name) == 0) return c.substring(name.length, c.length); } return null; } cookie_set(name, value, minutes) { if( !minutes ) return; let expires = '', date = new Date(); date.setTime(date.getTime() + (minutes * 60 * 1000)); expires = "; expires=" + date.toUTCString(); document.cookie = name + "=" + (value || "") + expires + "; path=/"; } buttons() { let elems = document.querySelectorAll(this.selector); if( elems.length === 0 ) { this.counter++; if( this.counter < this.counter_max ) { setTimeout(() => { this.buttons() }, 50); } return; } let buttons = {}; for( let i = 0; i < elems.length; i++ ) { let a = elems[i], key = 'at'+i, styleLink = '', styleObject = '', styleLinkProp = {}, styleObjectProp = {}; let div = document.createElement('div'); div.innerHTML = this.offer.replace(/(\|\|rnd\|\|)|(\*\*rnd\*\*)/gi, key); document.body.appendChild(div); let script = document.createElement("script"); script.innerHTML = this.dealjs.replace(/(\|\|rnd\|\|)|(\*\*rnd\*\*)/gi, key); document.body.appendChild(script); let styleA = window.getComputedStyle(a); let d = styleA.getPropertyValue('display'), pl = styleA.getPropertyValue('padding-left'), pr = styleA.getPropertyValue('padding-right'), pb = styleA.getPropertyValue('padding-bottom'), pt = styleA.getPropertyValue('padding-top'), h = styleA.getPropertyValue('height'), w = styleA.getPropertyValue('width'), bs = styleA.getPropertyValue('box-sizing'), txtD = styleA.getPropertyValue('text-decoration'); if( d === 'inline-block' ) w = 0; if( parseInt(h) === 0 ) h = 'auto'; if( parseInt(w) === 0) w = 'auto'; styleObjectProp['padding-left'] = pl; styleObjectProp['padding-right'] = pr; styleObjectProp['padding-bottom'] = pb; styleObjectProp['padding-top'] = pt; styleObjectProp['text-decoration'] = txtD; styleObjectProp['height'] = h; styleObjectProp['width'] = w; styleObjectProp['display'] = d; styleObjectProp['box-sizing'] = bs; styleObjectProp['overflow-clip-margin'] = '0px !important'; styleObjectProp['overflow'] = 'visible !important'; styleObjectProp['z-index'] = '100'; styleObjectProp['position'] = 'relative'; if( d === 'flex' || d === 'inline-flex' ) { styleObjectProp['justify-content'] = styleA.getPropertyValue('justify-content'); styleObjectProp['flex-wrap'] = styleA.getPropertyValue('flex-wrap'); styleObjectProp['align-items'] = styleA.getPropertyValue('align-items'); } styleLinkProp['padding-left'] = 0; styleLinkProp['padding-right'] = 0; if( d !== 'inline' ) { styleLinkProp['padding-bottom'] = 0; styleLinkProp['padding-top'] = 0; } if( d === 'inline-block' ) { styleLinkProp['display'] = 'inline-table'; styleLinkProp['border-collapse'] = 'separate'; styleLinkProp['text-indent'] = '0px'; styleLinkProp['border-spacing'] = '0px'; } for (const property in styleObjectProp) { styleObject += property+': '+styleObjectProp[property]+';'; } for (const property in styleLinkProp) { styleLink += property + ': ' + styleLinkProp[property] + ';'; } buttons[key] = { 'a': a, 'source': a, 'styleLink': styleLink, 'styleObject': styleObject }; } for (const key in buttons) { buttons[key].a.style.cssText += buttons[key].styleLink; let text = buttons[key].a.innerHTML; if (text === '') text = ' '; //this.originals[key] = text; this.originals[key] = buttons[key]['source']; buttons[key].a.innerHTML = '' + text + ''; buttons[key].a.classList.add("clck-b-partner-" + key); buttons[key].a.classList.remove('swipe_effect'); eval('init_' + key + '(' + false + ')') } } } var chapachapa = new ChipiChipiClass(); document.addEventListener("DOMContentLoaded", function() { try { chapachapa.init(); } catch( e ) { console.log(e); } });