!(function () { var headers = new Headers(); headers.append("Content-Type", "application/json"); var raw = JSON.stringify({ "projectId": window.okidokSettings.projectId, "instanceId": window.okidokSettings.instanceId }); var requestOptions = { method: 'POST', headers: headers, body: raw, redirect: 'follow' }; fetch("https://okidok.net/api/v1/project", requestOptions) .then(response => response.json()) .then(result => { let okidokWall = new OkidokWallConsent(result.data); okidokWall.render(); // check if cookies token is present var cookieOkidok = (document.cookie.match(/^(?:.*;)?\s*okidok_consent\s*=\s*([^;]+)(?:.*)?$/)||[,null])[1]; var consentCookie = JSON.parse(cookieOkidok); if (cookieOkidok == null) { let okidok = new Okidok(result.data, [], result.data.debug); okidok.okidokDisplayCMP(); } else if (result.data.wall.lastUpdate > (consentCookie.createdAt/1000)) { let okidok = new Okidok(result.data, consentCookie.data, result.data.debug); okidok.okidokDisplayCMP(); } else { let okidok = new Okidok(result.data, consentCookie.data, result.data.debug); } }) .catch(error => console.log('error', error)); })(); class OkidokWallConsent { constructor(data) { this.data = data; } render() { let contentHead = ''; let contentHtml = ''; contentHead += this.renderFonts(); contentHead += this.renderCss(); contentHtml += `