Merged in feat/sentry-errors-fixes (pull request #1216)
Removed VWO and cookie-bot * Removed VWO and cookie-bot * Merged master into feat/sentry-errors-fixes Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -7,7 +7,6 @@ import TrpcProvider from "@/lib/trpc/Provider"
|
||||
|
||||
import TokenRefresher from "@/components/Auth/TokenRefresher"
|
||||
import CookieBotConsent from "@/components/CookieBot"
|
||||
import VwoScript from "@/components/Current/VwoScript"
|
||||
import StorageCleaner from "@/components/HotelReservation/EnterDetails/StorageCleaner"
|
||||
import { ToastHandler } from "@/components/TempDesignSystem/Toasts"
|
||||
import { preloadUserTracking } from "@/components/TrackingSDK"
|
||||
@@ -44,7 +43,6 @@ export default async function RootLayout({
|
||||
<head>
|
||||
<AdobeSDKScript />
|
||||
<GTMScript />
|
||||
<Script data-cookieconsent="ignore" src="/_static/js/cookie-bot.js" />
|
||||
<Script
|
||||
strategy="beforeInteractive"
|
||||
data-blockingmode="auto"
|
||||
@@ -56,7 +54,6 @@ export default async function RootLayout({
|
||||
<Script id="ensure-adobeDataLayer">{`
|
||||
window.adobeDataLayer = window.adobeDataLayer || []
|
||||
`}</Script>
|
||||
<VwoScript />
|
||||
</head>
|
||||
<body>
|
||||
<ServerIntlProvider intl={{ defaultLocale, locale, messages }}>
|
||||
|
||||
@@ -41,7 +41,6 @@ export default async function RootLayout({
|
||||
<link rel="stylesheet" href="/_static/css/core.css" />
|
||||
{/* eslint-disable-next-line @next/next/no-css-tags */}
|
||||
<link rel="stylesheet" href="/_static/css/scandic.css" />
|
||||
<Script data-cookieconsent="ignore" src="/_static/js/cookie-bot.js" />
|
||||
<Script
|
||||
strategy="beforeInteractive"
|
||||
data-blockingmode="auto"
|
||||
@@ -54,12 +53,6 @@ export default async function RootLayout({
|
||||
window.datalayer = window.datalayer || {}
|
||||
`}</Script>
|
||||
<AdobeScript />
|
||||
<link rel="preconnect" href="https://dev.visualwebsiteoptimizer.com" />
|
||||
<Script
|
||||
id="vwoCode"
|
||||
src="/_static/dist/js/vwo.js?1714979036301"
|
||||
strategy="beforeInteractive"
|
||||
/>
|
||||
</head>
|
||||
<body className="theme-00Corecolours theme-X0Oldcorecolours">
|
||||
<LangPopup />
|
||||
|
||||
@@ -9,9 +9,8 @@ export default function CookieBotConsent() {
|
||||
const pathName = usePathname()
|
||||
const isWebview = webviews.includes(pathName)
|
||||
const CookiebotCallbackOnAccept = useCallback(() => {
|
||||
const cookie = window._satellite.cookie.get("CookieConsent")
|
||||
|
||||
if (window.Cookiebot?.changed && window.adobe) {
|
||||
const cookie = window._satellite?.cookie?.get("CookieConsent")
|
||||
// For webviews we always set the consent to true since we don't have cookiebot.
|
||||
if (isWebview) {
|
||||
window.adobe.optIn.approve(window.adobe.OptInCategories.ANALYTICS, true)
|
||||
|
||||
@@ -1,317 +0,0 @@
|
||||
import Script from "next/script"
|
||||
|
||||
export default function VWOScript() {
|
||||
return (
|
||||
<>
|
||||
{/* <!-- Start VWO Async SmartCode --> */}
|
||||
<link rel="preconnect" href="https://dev.visualwebsiteoptimizer.com" />
|
||||
<Script type="text/javascript" id="vwoCode">
|
||||
{`
|
||||
//DO NOT make any changes to smart code except for entering your account id
|
||||
window._vwo_code ||
|
||||
(function () {
|
||||
var account_id = 373511,
|
||||
version = 2.0,
|
||||
settings_tolerance = 2000,
|
||||
hide_element = "body",
|
||||
hide_element_style =
|
||||
"opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important",
|
||||
/* DO NOT EDIT BELOW THIS LINE */
|
||||
f = false,
|
||||
w = window,
|
||||
d = document,
|
||||
v = d.querySelector("#vwoCode"),
|
||||
cK = "_vwo_" + account_id + "_settings",
|
||||
cc = {};
|
||||
try {
|
||||
var c = JSON.parse(
|
||||
localStorage.getItem("_vwo_" + account_id + "_config")
|
||||
);
|
||||
cc = c && typeof c === "object" ? c : {};
|
||||
} catch (e) {}
|
||||
var stT = cc.stT === "session" ? w.sessionStorage : w.localStorage;
|
||||
code = {
|
||||
use_existing_jquery: function () {
|
||||
return typeof use_existing_jquery !== "undefined"
|
||||
? use_existing_jquery
|
||||
: undefined;
|
||||
},
|
||||
library_tolerance: function () {
|
||||
return typeof library_tolerance !== "undefined"
|
||||
? library_tolerance
|
||||
: undefined;
|
||||
},
|
||||
settings_tolerance: function () {
|
||||
return cc.sT || settings_tolerance;
|
||||
},
|
||||
hide_element_style: function () {
|
||||
return "{" + (cc.hES || hide_element_style) + "}";
|
||||
},
|
||||
hide_element: function () {
|
||||
return typeof cc.hE === "string" ? cc.hE : hide_element;
|
||||
},
|
||||
getVersion: function () {
|
||||
return version;
|
||||
},
|
||||
finish: function () {
|
||||
if (!f) {
|
||||
f = true;
|
||||
var a = d.getElementById("_vis_opt_path_hides");
|
||||
if (a) a.parentNode.removeChild(a);
|
||||
}
|
||||
},
|
||||
finished: function () {
|
||||
return f;
|
||||
},
|
||||
load: function (a) {
|
||||
var s = this.getSettings(),
|
||||
b = d.createElement("script"),
|
||||
t = this;
|
||||
if (s) {
|
||||
b.textContent = s;
|
||||
d.getElementsByTagName("head")[0].appendChild(b);
|
||||
if (!w.VWO || VWO.caE) {
|
||||
stT.removeItem(cK);
|
||||
t.load(a);
|
||||
}
|
||||
} else {
|
||||
b.fetchPriority = "high";
|
||||
b.src = a;
|
||||
b.type = "text/javascript";
|
||||
b.onerror = function () {
|
||||
window._vwo_code.finish();
|
||||
};
|
||||
d.getElementsByTagName("head")[0].appendChild(b);
|
||||
}
|
||||
},
|
||||
getSettings: function () {
|
||||
try {
|
||||
var i = stT.getItem(cK);
|
||||
if (!i) {
|
||||
return;
|
||||
}
|
||||
i = JSON.parse(i);
|
||||
if (Date.now() > i.e) {
|
||||
stT.removeItem(cK);
|
||||
return;
|
||||
}
|
||||
return i.s;
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
init: function () {
|
||||
if (d.URL.indexOf("__vwo_disable__") > -1) return;
|
||||
var sT = this.settings_tolerance();
|
||||
w._vwo_settings_timer = setTimeout(function () {
|
||||
window._vwo_code.finish();
|
||||
stT.removeItem(cK);
|
||||
window._vwo_code.removeLoaderAndOverlay();
|
||||
}, sT);
|
||||
var filterConfig = this.filterConfig;
|
||||
if (!filterConfig || filterConfig.filterTime === "balanced") {
|
||||
var cS = d.currentScript,
|
||||
a = d.createElement("style"),
|
||||
hE = this.hide_element(),
|
||||
b =
|
||||
cS && !cS.async && hE
|
||||
? hE + "{" + this.hide_element_style() + "}"
|
||||
: "",
|
||||
h = d.getElementsByTagName("head")[0];
|
||||
a.setAttribute("id", "_vis_opt_path_hides");
|
||||
v && a.setAttribute("nonce", v.nonce);
|
||||
a.setAttribute("type", "text/css");
|
||||
if (a.styleSheet) a.styleSheet.cssText = b;
|
||||
else a.appendChild(d.createTextNode(b));
|
||||
h.appendChild(a);
|
||||
}
|
||||
if (filterConfig && filterConfig.filterTime === "early") {
|
||||
this.removeLoaderAndOverlay();
|
||||
}
|
||||
this.load(
|
||||
"https://dev.visualwebsiteoptimizer.com/j.php?a=" +
|
||||
account_id +
|
||||
"&u=" +
|
||||
encodeURIComponent(d.URL) +
|
||||
"&vn=" +
|
||||
version
|
||||
);
|
||||
},
|
||||
setFilterConfigAndApplyFilter: function (config) {
|
||||
if (!config) {
|
||||
// No config will lead to early return and no addition of smart code
|
||||
return;
|
||||
}
|
||||
var state = this.isNonLiveMode(account_id) || config.isConsentGiven();
|
||||
if (state === "1") {
|
||||
// if cookie consent was already given and the cookies were already accepted, execute out normal flow
|
||||
hide_element = "body";
|
||||
w._vwo_settings_timer = window._vwo_code.init();
|
||||
return;
|
||||
} else if (state === "2") {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!config.filterTolerance) {
|
||||
// Execute removal logic immediately when filterTolerance is 0 or empty
|
||||
return;
|
||||
}
|
||||
|
||||
function clearIntervals(timerIds) {
|
||||
for (var i = 0; i < timerIds.length; i++) {
|
||||
clearInterval(timerIds[i]);
|
||||
}
|
||||
}
|
||||
this.filterConfig = config;
|
||||
var popupTimer = setInterval(function () {
|
||||
if (window._vwo_code.applyFilters(config)) {
|
||||
clearInterval(popupTimer);
|
||||
}
|
||||
}, 100);
|
||||
var timer = setInterval(function () {
|
||||
var state = config.isConsentGiven();
|
||||
var shouldClearAllIntervals;
|
||||
if (state === "1") {
|
||||
window._vwo_code.showLoader();
|
||||
w._vwo_settings_timer = window._vwo_code.init();
|
||||
shouldClearAllIntervals = true;
|
||||
} else if (state === "2") {
|
||||
window._vwo_code.filterConfig = undefined;
|
||||
window._vwo_code.removeLoaderAndOverlay();
|
||||
shouldClearAllIntervals = true;
|
||||
}
|
||||
if (shouldClearAllIntervals) {
|
||||
clearIntervals([timer, popupTimer]);
|
||||
clearInterval(filterToleranceTimer);
|
||||
}
|
||||
}, 100);
|
||||
var filterToleranceTimer;
|
||||
|
||||
// RECOMMENDED: When using Best Approach
|
||||
filterToleranceTimer = setTimeout(function () {
|
||||
window._vwo_code.removeLoaderAndOverlay();
|
||||
clearIntervals([timer, popupTimer]);
|
||||
}, config.filterTolerance);
|
||||
},
|
||||
showLoader: function () {
|
||||
var vwoOverlay = d.getElementsByClassName("vwo-overlay")[0];
|
||||
if (!vwoOverlay) return;
|
||||
var vwoContentLoader = d.createElement("div");
|
||||
vwoContentLoader.classList.add("vwo-content-loader");
|
||||
vwoOverlay.parentNode.insertBefore(
|
||||
vwoContentLoader,
|
||||
vwoOverlay.nextSibling
|
||||
);
|
||||
},
|
||||
applyFilters: function (config) {
|
||||
var popup = d.querySelector(config.popupSelector);
|
||||
var popupZIndex;
|
||||
if (!popup && d.getElementById("_vis_opt_overlay")) {
|
||||
return;
|
||||
}
|
||||
var maxZIndex = 2147483647;
|
||||
if (popup) {
|
||||
var popupStyle = w.getComputedStyle(popup);
|
||||
popupZIndex = popupStyle.getPropertyValue("z-index");
|
||||
if (!popupZIndex || popupZIndex === "auto") {
|
||||
popupZIndex = maxZIndex;
|
||||
}
|
||||
popup.style.zIndex = popupZIndex;
|
||||
}
|
||||
popupZIndex = popupZIndex || maxZIndex;
|
||||
// You can change the styling to suit your requirements
|
||||
// This is the default CSS filters VWO provides
|
||||
// NOTE: do not change any class names IMPORTANT ...
|
||||
var vwoFilter =
|
||||
"position: fixed; top: 0; left: 0; right: 0; bottom: 0; height: 100%; width: 100%; -webkit-filter: blur(5px); filter: blur(5px); backdrop-filter: saturate(180%) blur(3px); -webkit-backdrop-filter: saturate(180%) blur(3px); z-index:" +
|
||||
(popupZIndex - 1) +
|
||||
";",
|
||||
vwoLoaderCss =
|
||||
" .vwo-content-loader{ border: 16px solid #f3f3f3; border-top: 16px solid #3498db; border-radius: 50%; width: 90px; height: 90px; position: fixed; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); -ms-transform: translate(-50%, -50%); transform: translate(-50%, -50%); animation: vwo-spin 2s linear infinite; z-index:" +
|
||||
(popupZIndex - 1) +
|
||||
"; }" +
|
||||
"@keyframes vwo-spin { 0% { -webkit-transform: translate(-50%, -50%) rotate(0deg); transform: translate(-50%, -50%) rotate(0deg); } 100% { -webkit-transform: translate(-50%, -50%) rotate(360deg); transform: translate(-50%, -50%) rotate(360deg); } }";
|
||||
/**
|
||||
* This below written code should not be tweaked
|
||||
* */
|
||||
var overlayStyleTag = d.getElementById("_vis_opt_overlay"),
|
||||
overlayCSS = ".vwo-overlay{" + vwoFilter + "}" + vwoLoaderCss;
|
||||
if (overlayStyleTag) {
|
||||
if (overlayStyleTag.styleSheet) {
|
||||
overlayStyleTag.styleSheet.cssText = overlayCSS;
|
||||
} else {
|
||||
var _vwo_textNode = d.createTextNode(overlayCSS);
|
||||
overlayStyleTag.appendChild(_vwo_textNode);
|
||||
overlayStyleTag.removeChild(overlayStyleTag.childNodes[0]);
|
||||
}
|
||||
} else {
|
||||
var a = d.createElement("style"),
|
||||
h = d.getElementsByTagName("head")[0],
|
||||
body = d.getElementsByTagName("body")[0];
|
||||
var vwoOverlay = d.createElement("div");
|
||||
vwoOverlay.classList.add("vwo-overlay");
|
||||
body.prepend(vwoOverlay);
|
||||
// CAUTION Do not remove this id from your style tag. It is required by VWO
|
||||
a.setAttribute("id", "_vis_opt_overlay");
|
||||
a.setAttribute("type", "text/css");
|
||||
if (a.styleSheet) a.styleSheet.cssText = overlayCSS;
|
||||
else a.appendChild(d.createTextNode(overlayCSS));
|
||||
h.appendChild(a);
|
||||
}
|
||||
return !!popup;
|
||||
},
|
||||
removeLoaderAndOverlay: function () {
|
||||
var overlay = d.getElementsByClassName("vwo-overlay");
|
||||
var loader = d.getElementsByClassName("vwo-content-loader");
|
||||
var overlayStyleTag = d.getElementById("_vis_opt_overlay");
|
||||
overlay &&
|
||||
(overlay = overlay[0]) &&
|
||||
overlay.parentElement.removeChild(overlay);
|
||||
loader &&
|
||||
(loader = loader[0]) &&
|
||||
loader.parentElement.removeChild(loader);
|
||||
overlayStyleTag &&
|
||||
overlayStyleTag.parentElement.removeChild(overlayStyleTag);
|
||||
},
|
||||
isNonLiveMode: function (accountId) {
|
||||
var wName = w.name;
|
||||
if (!wName) {
|
||||
return;
|
||||
}
|
||||
return (
|
||||
(wName.indexOf("_vis_editor") > -1 ||
|
||||
wName.indexOf("_vis_preview_" + accountId) > -1 ||
|
||||
wName.indexOf("_vis_heatmap_" + accountId) > -1) &&
|
||||
"1"
|
||||
);
|
||||
},
|
||||
};
|
||||
w._vwo_code = code;
|
||||
})();
|
||||
window._vwo_code.setFilterConfigAndApplyFilter({
|
||||
popupSelector: "#CybotCookiebotDialog",
|
||||
filterTime: "best",
|
||||
isConsentGiven: function () {
|
||||
/** your custom Code */
|
||||
if (document.cookie.indexOf("CookieConsent") != -1) {
|
||||
var ccValue = decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent("CookieConsent").replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null;
|
||||
let consentValue = "2";
|
||||
if (ccValue) {
|
||||
ccValue = ccValue.substring(ccValue.indexOf(",statistics")+12);
|
||||
ccValue = ccValue.substring(0, ccValue.indexOf(","));
|
||||
consentValue = ccValue === "true" ? "1" : "2";
|
||||
}
|
||||
return consentValue;
|
||||
} else {
|
||||
return "3";
|
||||
}
|
||||
},
|
||||
filterTolerance: 400,
|
||||
});
|
||||
`}
|
||||
</Script>
|
||||
{/* <!-- End VWO Async SmartCode --> */}
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -1,136 +0,0 @@
|
||||
import Script from "next/script"
|
||||
|
||||
export default function VwoScript() {
|
||||
return (
|
||||
<Script id="initialize-vwo" data-cookieconsent="statistics">{`
|
||||
// VWO initialization code
|
||||
// Note ------------
|
||||
// Any update in this file should also update the cache burst parameter manually in the layout files
|
||||
// Updated snippet for cookie consent handling - 07-Mar-2023
|
||||
|
||||
var _vwo_clicks = 50;
|
||||
//DO NOT make any changes to smart code except for entering your account id
|
||||
window._vwo_code = window._vwo_code || (function() {
|
||||
var account_id = 373511,
|
||||
settings_tolerance = 2500,
|
||||
library_tolerance = 3000,
|
||||
use_existing_jquery = false,
|
||||
/* DO NOT EDIT BELOW THIS LINE */
|
||||
f = false,
|
||||
d = document,
|
||||
filterToleranceTimer,
|
||||
code = {
|
||||
use_existing_jquery: function() {
|
||||
return use_existing_jquery;
|
||||
},
|
||||
library_tolerance: function() {
|
||||
return library_tolerance;
|
||||
},
|
||||
finish: function() {
|
||||
if (!f) {
|
||||
f = true;
|
||||
var a = d.getElementById('_vis_opt_path_hides');
|
||||
if (a) a.parentNode.removeChild(a);
|
||||
}
|
||||
},
|
||||
finished: function() {
|
||||
return f;
|
||||
},
|
||||
load: function(a) {
|
||||
var b = d.createElement('script');
|
||||
b.src = a;
|
||||
b.type = 'text/javascript';
|
||||
b.innerText;
|
||||
b.onerror = function() {
|
||||
_vwo_code.finish();
|
||||
};
|
||||
d.getElementsByTagName('head')[0].appendChild(b);
|
||||
},
|
||||
init: function() {
|
||||
window.settings_timer = setTimeout(function() {
|
||||
_vwo_code.finish();
|
||||
}, settings_tolerance);
|
||||
|
||||
var filterConfig = this.filterConfig;
|
||||
if (!filterConfig) {
|
||||
var a = d.createElement('style'),
|
||||
b = hide_element ? hide_element + '{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}' : '',
|
||||
h = d.getElementsByTagName('head')[0];
|
||||
a.setAttribute('id', '_vis_opt_path_hides');
|
||||
a.setAttribute('type', 'text/css');
|
||||
if (a.styleSheet) a.styleSheet.cssText = b;
|
||||
else a.appendChild(d.createTextNode(b));
|
||||
h.appendChild(a);
|
||||
}
|
||||
this.load('https://dev.visualwebsiteoptimizer.com/j.php?a=' + account_id + '&u=' + encodeURIComponent(d.URL) + '&r=' + Math.random());
|
||||
return settings_timer;
|
||||
},
|
||||
setFilterConfigAndApplyFilter: function(config) {
|
||||
if (!config) {
|
||||
// No config will lead to early return and no addition of smart code
|
||||
return;
|
||||
}
|
||||
var state = this.isNonLiveMode(account_id) || config.isConsentGiven();
|
||||
if (state === "1") {
|
||||
// if cookie consent was already given and the cookies were already accepted, execute out normal flow
|
||||
hide_element = 'body';
|
||||
window._vwo_settings_timer = _vwo_code.init();
|
||||
return;
|
||||
} else if (state === "2") {
|
||||
return;
|
||||
}
|
||||
|
||||
this.filterConfig = config;
|
||||
var timer = setInterval(function() {
|
||||
var state = config.isConsentGiven();
|
||||
var shouldClearAllIntervals;
|
||||
if (state === "1") {
|
||||
window._vwo_settings_timer = _vwo_code.init();
|
||||
shouldClearAllIntervals = true;
|
||||
} else if (state === "2") {
|
||||
_vwo_code.filterConfig = undefined;
|
||||
shouldClearAllIntervals = true;
|
||||
}
|
||||
if (shouldClearAllIntervals) {
|
||||
clearInterval(timer);
|
||||
clearInterval(filterToleranceTimer);
|
||||
}
|
||||
}, 100)
|
||||
},
|
||||
isNonLiveMode: function(accountId) {
|
||||
var wName = window.name;
|
||||
if (!wName) {
|
||||
return;
|
||||
}
|
||||
return (
|
||||
(wName.indexOf('_vis_editor') > -1 ||
|
||||
wName.indexOf('_vis_preview_' + accountId) > -1 ||
|
||||
wName.indexOf('_vis_heatmap_' + accountId) > -1) &&
|
||||
'1'
|
||||
);
|
||||
}
|
||||
};
|
||||
return code;
|
||||
}());
|
||||
|
||||
_vwo_code.setFilterConfigAndApplyFilter({
|
||||
popupSelector: '#CybotCookiebotDialog',
|
||||
isConsentGiven: function() {
|
||||
/** your custom Code */
|
||||
if (document.cookie.indexOf("CookieConsent") != -1) {
|
||||
var ccValue = decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent("CookieConsent").replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null;
|
||||
let consentValue = "2";
|
||||
if (ccValue) {
|
||||
ccValue = ccValue.substring(ccValue.indexOf(",statistics")+12);
|
||||
ccValue = ccValue.substring(0, ccValue.indexOf(","));
|
||||
consentValue = ccValue === "true" ? "1" : "2";
|
||||
}
|
||||
return consentValue;
|
||||
} else {
|
||||
return "3";
|
||||
}
|
||||
}
|
||||
});
|
||||
`}</Script>
|
||||
)
|
||||
}
|
||||
211
public/_static/dist/js/vwo.js
vendored
211
public/_static/dist/js/vwo.js
vendored
@@ -1,211 +0,0 @@
|
||||
// The smart code script generated by VWO includes the instruction:
|
||||
//"DO NOT make any changes to smart code except for entering your account id"
|
||||
//
|
||||
// HOWEVER, changes have been made in order to remove the unwanted blur filter/loader logic
|
||||
// Example of said logic: https://help.vwo.com/hc/en-us/articles/4402914949401-Executing-VWO-SmartCode-on-Valid-Consent
|
||||
|
||||
window._vwo_code ||
|
||||
(function () {
|
||||
var account_id = 373511,
|
||||
version = 2.0,
|
||||
settings_tolerance = 2000,
|
||||
hide_element = "body",
|
||||
hide_element_style =
|
||||
"opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important",
|
||||
/* DO NOT EDIT BELOW THIS LINE */
|
||||
f = false,
|
||||
w = window,
|
||||
d = document,
|
||||
v = d.querySelector("#vwoCode"),
|
||||
cK = "_vwo_" + account_id + "_settings",
|
||||
cc = {};
|
||||
try {
|
||||
var c = JSON.parse(
|
||||
localStorage.getItem("_vwo_" + account_id + "_config")
|
||||
);
|
||||
cc = c && typeof c === "object" ? c : {};
|
||||
} catch (e) {}
|
||||
var stT = cc.stT === "session" ? w.sessionStorage : w.localStorage;
|
||||
code = {
|
||||
use_existing_jquery: function () {
|
||||
return typeof use_existing_jquery !== "undefined"
|
||||
? use_existing_jquery
|
||||
: undefined;
|
||||
},
|
||||
library_tolerance: function () {
|
||||
return typeof library_tolerance !== "undefined"
|
||||
? library_tolerance
|
||||
: undefined;
|
||||
},
|
||||
settings_tolerance: function () {
|
||||
return cc.sT || settings_tolerance;
|
||||
},
|
||||
hide_element_style: function () {
|
||||
return "{" + (cc.hES || hide_element_style) + "}";
|
||||
},
|
||||
hide_element: function () {
|
||||
return typeof cc.hE === "string" ? cc.hE : hide_element;
|
||||
},
|
||||
getVersion: function () {
|
||||
return version;
|
||||
},
|
||||
finish: function () {
|
||||
if (!f) {
|
||||
f = true;
|
||||
var a = d.getElementById("_vis_opt_path_hides");
|
||||
if (a) a.parentNode.removeChild(a);
|
||||
}
|
||||
},
|
||||
finished: function () {
|
||||
return f;
|
||||
},
|
||||
load: function (a) {
|
||||
var s = this.getSettings(),
|
||||
b = d.createElement("script"),
|
||||
t = this;
|
||||
if (s) {
|
||||
b.textContent = s;
|
||||
d.getElementsByTagName("head")[0].appendChild(b);
|
||||
if (!w.VWO || VWO.caE) {
|
||||
stT.removeItem(cK);
|
||||
t.load(a);
|
||||
}
|
||||
} else {
|
||||
b.fetchPriority = "high";
|
||||
b.src = a;
|
||||
b.type = "text/javascript";
|
||||
b.onerror = function () {
|
||||
window._vwo_code.finish();
|
||||
};
|
||||
d.getElementsByTagName("head")[0].appendChild(b);
|
||||
}
|
||||
},
|
||||
getSettings: function () {
|
||||
try {
|
||||
var i = stT.getItem(cK);
|
||||
if (!i) {
|
||||
return;
|
||||
}
|
||||
i = JSON.parse(i);
|
||||
if (Date.now() > i.e) {
|
||||
stT.removeItem(cK);
|
||||
return;
|
||||
}
|
||||
return i.s;
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
init: function () {
|
||||
if (d.URL.indexOf("__vwo_disable__") > -1) return;
|
||||
var sT = this.settings_tolerance();
|
||||
w._vwo_settings_timer = setTimeout(function () {
|
||||
window._vwo_code.finish();
|
||||
stT.removeItem(cK);
|
||||
}, sT);
|
||||
var filterConfig = this.filterConfig;
|
||||
if (!filterConfig || filterConfig.filterTime === "balanced") {
|
||||
var cS = d.currentScript,
|
||||
a = d.createElement("style"),
|
||||
hE = this.hide_element(),
|
||||
b =
|
||||
cS && !cS.async && hE
|
||||
? hE + "{" + this.hide_element_style() + "}"
|
||||
: "",
|
||||
h = d.getElementsByTagName("head")[0];
|
||||
a.setAttribute("id", "_vis_opt_path_hides");
|
||||
v && a.setAttribute("nonce", v.nonce);
|
||||
a.setAttribute("type", "text/css");
|
||||
if (a.styleSheet) a.styleSheet.cssText = b;
|
||||
else a.appendChild(d.createTextNode(b));
|
||||
h.appendChild(a);
|
||||
}
|
||||
this.load(
|
||||
"https://dev.visualwebsiteoptimizer.com/j.php?a=" +
|
||||
account_id +
|
||||
"&u=" +
|
||||
encodeURIComponent(d.URL) +
|
||||
"&vn=" +
|
||||
version
|
||||
);
|
||||
},
|
||||
setFilterConfigAndApplyFilter: function (config) {
|
||||
if (!config) {
|
||||
// No config will lead to early return and no addition of smart code
|
||||
return;
|
||||
}
|
||||
var state = this.isNonLiveMode(account_id) || config.isConsentGiven();
|
||||
if (state === "1") {
|
||||
// if cookie consent was already given and the cookies were already accepted, execute out normal flow
|
||||
hide_element = "body";
|
||||
w._vwo_settings_timer = window._vwo_code.init();
|
||||
return;
|
||||
} else if (state === "2") {
|
||||
return;
|
||||
}
|
||||
|
||||
this.filterConfig = config;
|
||||
|
||||
var timer = setInterval(function () {
|
||||
var state = config.isConsentGiven();
|
||||
var shouldClearInterval;
|
||||
if (state === "1") {
|
||||
w._vwo_settings_timer = window._vwo_code.init();
|
||||
shouldClearInterval = true;
|
||||
} else if (state === "2") {
|
||||
window._vwo_code.filterConfig = undefined;
|
||||
shouldClearInterval = true;
|
||||
}
|
||||
if (shouldClearInterval) {
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
isNonLiveMode: function (accountId) {
|
||||
var wName = w.name;
|
||||
if (!wName) {
|
||||
return;
|
||||
}
|
||||
return (
|
||||
(wName.indexOf("_vis_editor") > -1 ||
|
||||
wName.indexOf("_vis_preview_" + accountId) > -1 ||
|
||||
wName.indexOf("_vis_heatmap_" + accountId) > -1) &&
|
||||
"1"
|
||||
);
|
||||
},
|
||||
};
|
||||
w._vwo_code = code;
|
||||
})();
|
||||
window._vwo_code.setFilterConfigAndApplyFilter({
|
||||
popupSelector: "#CybotCookiebotDialog",
|
||||
filterTime: "balanced",
|
||||
isConsentGiven: function () {
|
||||
/** your custom Code */
|
||||
if (document.cookie.indexOf("CookieConsent") != -1) {
|
||||
var ccValue =
|
||||
decodeURIComponent(
|
||||
document.cookie.replace(
|
||||
new RegExp(
|
||||
"(?:(?:^|.*;)\\s*" +
|
||||
encodeURIComponent("CookieConsent").replace(
|
||||
/[\-\.\+\*]/g,
|
||||
"\\$&"
|
||||
) +
|
||||
"\\s*\\=\\s*([^;]*).*$)|^.*$"
|
||||
),
|
||||
"$1"
|
||||
)
|
||||
) || null;
|
||||
let consentValue = "2";
|
||||
if (ccValue) {
|
||||
ccValue = ccValue.substring(ccValue.indexOf(",statistics") + 12);
|
||||
ccValue = ccValue.substring(0, ccValue.indexOf(","));
|
||||
consentValue = ccValue === "true" ? "1" : "2";
|
||||
}
|
||||
return consentValue;
|
||||
} else {
|
||||
return "3";
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -1,85 +0,0 @@
|
||||
/**
|
||||
* Makes some brute force adjustments on the open cookiebot dialog and adds our own styling
|
||||
*/
|
||||
var fixCookieBotDialog = function() {
|
||||
document.querySelector("head").insertAdjacentHTML("beforeend", "<link type='text/css' href='/_static/css/cookie-bot.css' rel='stylesheet' />");
|
||||
var e = function(e) {
|
||||
i = !!(e = !!e) || i;
|
||||
var t = document.querySelector("#CybotCookiebotDialogBodyLevelButtonLevelOptinAllowallSelection")
|
||||
, o = document.querySelector("#CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll");
|
||||
t.style.display = "none" != t.style.display || e ? "none" : "block",
|
||||
o.style.display = "none" == o.style.display || e ? "block" : "none"
|
||||
};
|
||||
document.querySelector("#CybotCookiebotDialogBodyLevelButtonLevelOptinAllowallSelection").style.display = "none",
|
||||
document.querySelector("#CybotCookiebotDialogBodyLevelDetailsWrapper").setAttribute("class", "custom-select");
|
||||
var t = document.querySelector("#CybotCookiebotDialogBody")
|
||||
, o = document.querySelector("#CybotCookiebotDialogBodyLevelWrapper");
|
||||
t.insertBefore(document.querySelector("#CybotCookiebotDialogDetail"), o);
|
||||
var n = document.querySelector("#CybotCookiebotDialogBodyLevelButtonsSelectPane");
|
||||
t.insertBefore(n, o),
|
||||
n.style.display = "none",
|
||||
window.innerWidth > 740 && window.dispatchEvent(new Event("resize")),
|
||||
document.querySelector("#CybotCookiebotDialogBodyLevelDetailsWrapper").addEventListener("click", (function() {
|
||||
n.style.display = "none" == n.style.display ? "block" : "none";
|
||||
var t = document.querySelector("#CybotCookiebotDialogBodyLevelDetailsWrapper").classList;
|
||||
if (t.contains("active"))
|
||||
t.remove("active"),
|
||||
document.querySelector("#CybotCookiebotDialog").classList.remove("expanded"),
|
||||
e(!0);
|
||||
else {
|
||||
t.add("active"),
|
||||
document.querySelector("#CybotCookiebotDialog").classList.add("expanded"),
|
||||
a();
|
||||
var o = document.querySelectorAll(".CybotCookiebotDialogDetailBodyContentCookieTypeTableContainer");
|
||||
if ("none" != o[0].parentElement.style.display)
|
||||
for (var i = o[0].querySelector("table").clientWidth, l = 0; l < o.length; l++)
|
||||
o[l].previousElementSibling.style.minWidth = i + "px",
|
||||
o[l].style.minWidth = i + "px"
|
||||
}
|
||||
}
|
||||
));
|
||||
for (var i = !0, l = document.querySelectorAll("#CybotCookiebotDialogBodyLevelButtonsSelectPane input[type=checkbox]"), a = function() {
|
||||
for (var t = !0, o = 0; o < l.length; o++)
|
||||
l[o].checked || (t = !1);
|
||||
i != t && (i = t,
|
||||
e())
|
||||
}, r = 0; r < l.length; r++)
|
||||
l[r].addEventListener("change", a)
|
||||
};
|
||||
|
||||
window.addEventListener("CookiebotOnDialogDisplay", fixCookieBotDialog);
|
||||
// If the cookiebot dialog was opened before this file was run we run the fix function "manually"
|
||||
if (document.querySelector("#CybotCookiebotDialog")) {
|
||||
fixCookieBotDialog();
|
||||
}
|
||||
|
||||
window.addEventListener("load", (function() {
|
||||
var e = document.querySelector("#CookieDeclarationChangeConsent > a")
|
||||
, t = document.querySelector("#CookieDeclarationChangeConsent > span > a");
|
||||
if (e)
|
||||
switch (document.documentElement.lang) {
|
||||
default:
|
||||
e.text = "Change your consent",
|
||||
t.text = "Withdraw your consent";
|
||||
break;
|
||||
case "sv":
|
||||
e.text = "Ändra mitt samtycke",
|
||||
t.text = "Ångra mitt samtycke";
|
||||
break;
|
||||
case "no":
|
||||
e.text = "Trække dit samtykke tilbage",
|
||||
t.text = "Trekk tilbake ditt samtykke";
|
||||
break;
|
||||
case "da":
|
||||
e.text = "Ændre dit samtykke",
|
||||
t.text = "Trække dit samtykke tilbage";
|
||||
break;
|
||||
case "de":
|
||||
e.text = "Ihre Einwilligung ändern",
|
||||
t.text = "Ihre Einwilligung zurückziehen";
|
||||
break;
|
||||
case "fi":
|
||||
e.text = "Muuta hyväksyntäsi",
|
||||
t.text = "Peru hyväksyntäsi"
|
||||
}
|
||||
}));
|
||||
Reference in New Issue
Block a user