@jumpgroup/avacy-banner
Version:
oil.js Opt-In Layer for consent management based on the IAB TCF Standard
25 lines (24 loc) • 15.3 kB
HTML
<html lang="de" class="no-js">
<head>
<meta charset="utf-8"/>
<title>OIL - Hub-HTML</title>
<script>/*! 1.1.1-RELEASE */!function(e){var o={};function n(t){if(o[t])return o[t].exports;var i=o[t]={i:t,l:!1,exports:{}};return e[t].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=o,n.d=function(e,o,t){n.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:t})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(o,"a",o),o},n.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},n.p="//oil.axelspringer.com/release/1.1.1/",n(n.s=144)}({10:function(e,o,n){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.logError=function(){((0,t.isDev)()||(0,i.isVerboseCookieSet)())&&window.console&&_(window.console.error,arguments)},o.logInfo=function(){((0,t.isDev)()||(0,i.isVerboseCookieSet)())&&window.console&&_(window.console.info,arguments)},o.logPreviewInfo=function(){((0,t.isDev)()||(0,r.isPreviewMode)()||(0,i.isPreviewCookieSet)()||(0,i.isVerboseCookieSet)())&&_(window.console.info,arguments)};var t=n(12),i=n(26),r=n(21),a="OIL: ";function _(e,o){window.console||(window.console={}),window.console.log||(window.console.log=function(){});var n=[a].concat(Array.prototype.slice.call(o));if(e)try{e.apply(window.console,n)}catch(o){try{e(c(n))}catch(e){}}else window.console.log(c(n))}function c(e){for(var o="",n=0;n<e.length;n++)o+=e[n];return o}},12:function(e,o,n){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.OilVersion=void 0,o.isProd=function(){return!1},o.isDev=function(){return!1},o.getOrigin=r,o.sendEventToHostSite=function(e){window.postMessage(e,r()),(0,t.logInfo)("Sent postmessage event: "+e)},o.removeMessageListener=function(e){u(s,e,!1)},o.registerMessageListener=function(e){c(l,e,!1)},o.getClientTimestamp=function(){return Date.now||(Date.now=function(){return(new Date).getTime()}),Date.now()},o.arrayContains=function(e,o){for(var n=e.length,t=0;t<n;t++)if(e[t]===o)return!0;return!1},o.setGlobalOilObject=function(e,o){window[i.OIL_GLOBAL_OBJECT_NAME]||(window[i.OIL_GLOBAL_OBJECT_NAME]={}),window[i.OIL_GLOBAL_OBJECT_NAME][e]=o},o.getGlobalOilObject=O,o.getLocaleVariantVersion=function(){var e=O("LOCALE");return e&&e.version?e.version:0},o.getCommandCollection=function(){return window.__cmp?window.__cmp.commandCollection:void 0},o.fetchJsonData=function(e){return new Promise(function(o,n){var i=new XMLHttpRequest;(0,t.logInfo)("Fetching data from url: "+e),i.open("GET",e),i.onreadystatechange=function(){if(i.readyState===this.DONE)if(200===i.status)o(JSON.parse(i.responseText));else{var t=void 0;if(0!==i.status){var r=JSON.parse(i.responseText);t=new Error(r.errorMessage)}else t=new Error("Connection error occurred while fetching JSON data from "+e+"!");n(t)}},i.send()})},o.isObject=function(e){return e instanceof Object&&e.constructor===Object};var t=n(10),i=n(13);function r(){return window.location.origin||(window.location.origin=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),window.location.origin}var a=window.addEventListener?"addEventListener":"attachEvent",_=window.removeEventListener?"removeEventListener":"removeEvent",c=window[a],u=window[_],l="attachEvent"===a?"onmessage":"message",s="removeEvent"===_?"onmessage":"message";function O(e){return window[i.OIL_GLOBAL_OBJECT_NAME]?window[i.OIL_GLOBAL_OBJECT_NAME][e]:void 0}o.OilVersion={get:function(){return"1.1.1-RELEASE"},getLatestReleaseVersion:function(){return"1.1.1"}}},13:function(e,o,n){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.OIL_SPEC={CMP_ID:1,CMP_VERSION:1},o.OIL_CONFIG={ATTR_ACTIVATE_POI:"poi_activate_poi",ATTR_HUB_ORIGIN:"poi_hub_origin",ATTR_HUB_PATH:"poi_hub_path",ATTR_HUB_LOCATION:"poi_hub_location",ATTR_SUB_SET_COOKIE:"poi_subscriber_set_cookie",ATTR_PREVIEW_MODE:"preview_mode",ATTR_COOKIE_EXPIRES_IN_DAYS:"cookie_expires_in_days",ATTR_TIMESTAMP:"timestamp",ATTR_PRIVACY_PAGE_URL:"privacy_page_url",ATTR_POI_GROUP_NAME:"poi_group_name",ATTR_ADVANCED_SETTINGS:"advanced_settings",ATTR_PERSIST_MINIMUM_TRACKING:"persist_min_tracking",ATTR_LOCALE:"locale",ATTR_THEME:"theme",ATTR_TIMEOUT:"timeout",ATTR_OIL_BACKEND_URL:"oilBackendUrl",ATTR_IAB_VENDOR_LIST_URL:"iabVendorListUrl",ATTR_CUSTOM_PURPOSES:"customPurposes",ATTR_IAB_VENDOR_BLACKLIST:"iabVendorBlacklist",ATTR_IAB_VENDOR_WHITELIST:"iabVendorWhitelist",ATTR_DEFAULT_TO_OPTIN:"default_to_optin"},o.EVENT_NAME_OPT_IN="oil_optin_done",o.EVENT_NAME_SOI_OPT_IN="oil_soi_optin_done",o.EVENT_NAME_POI_OPT_IN="oil_poi_optin_done",o.PRIVACY_MINIMUM_TRACKING=0,o.PRIVACY_FULL_TRACKING=1,o.EVENT_NAME_AS_PRIVACY_SELECTED="oil_as_cpc_privacy_selected",o.EVENT_NAME_ADVANCED_SETTINGS="oil_click_advanced_settings",o.EVENT_NAME_TIMEOUT="oil_hide_layer",o.EVENT_NAME_COMPANY_LIST="oil_click_company_list",o.EVENT_NAME_THIRD_PARTY_LIST="oil_click_thirdparty_list",o.EVENT_NAME_BACK_TO_MAIN="oil_click_back_to_main",o.EVENT_NAME_NO_COOKIES_ALLOWED="oil_no_cookies_allowed",o.EVENT_NAME_OIL_SHOWN="oil_shown",o.EVENT_NAME_HAS_OPTED_IN="oil_has_optedin",o.POI_FALLBACK_NAME="fallback",o.POI_FALLBACK_GROUP_NAME="group_name",o.POI_PAYLOAD="payload",o.DATAQA_PRIVACY_PAGE="oil-PrivacyPage",o.DATA_CONTEXT_YES="YES",o.DATA_CONTEXT_ADVANCED_SETTINGS="ADVANCEDSETTINGS",o.DATA_CONTEXT_BACK="BACK",o.OIL_PAYLOAD_PRIVACY="p",o.OIL_PAYLOAD_VERSION="v",o.OIL_PAYLOAD_LOCALE_VARIANT_NAME="lvn",o.OIL_PAYLOAD_LOCALE_VARIANT_VERSION="lvv",o.OIL_GLOBAL_OBJECT_NAME="AS_OIL"},144:function(e,o,n){"use strict";var t,i=n(145);t="",location&&location.search&&location.search.substr(1)&&(t=location.search.substr(1)),(0,i.initOilHub)(t)},145:function(e,o,n){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};o.initOilHub=function(e){if((0,i.logInfo)("Init OilHub (version "+_.OilVersion.get()+")"),function(e){return-1!==e.indexOf(r.POI_FALLBACK_NAME)}(e)){(0,i.logInfo)("Fallback mode, doing round trip...");var n="";(function(e){return-1!==e.indexOf(r.POI_FALLBACK_GROUP_NAME)})(e)&&(n=(0,c.getStringParam)(e,r.POI_FALLBACK_GROUP_NAME),(0,i.logInfo)("Using group name:",n));var t={};if(function(e){return-1!==e.indexOf(r.POI_PAYLOAD)}(e)){var u=decodeURIComponent((0,c.getStringParam)(e,r.POI_PAYLOAD));t=JSON.parse(u),(0,i.logInfo)("Using payload:",t)}(0,a.setPoiOptIn)(n,t),o.redirectBack()}else l||((0,_.removeMessageListener)(s),(0,_.registerMessageListener)(s))},o.redirectBack=function(){window.location.replace(document.referrer)};var i=n(10),r=n(13),a=n(146),_=n(12),c=n(147),u=n(26),l=!1;function s(e){var o=function(e){try{return"object"!==(void 0===e?"undefined":t(e))?JSON.parse(e):e}catch(o){return(0,i.logInfo)("OIL Hub - couldnt parse following data:",e),!1}}(e.data),n=null;if((0,i.logInfo)("OIL Hub - Got following parent data:",o),o){if(o.event&&-1!==o.event.indexOf("oil-")){var r=o.event,_=o.origin,c=o.payload,s=o.group_name;switch(r){case"oil-poi-activate":(0,i.logInfo)("OIL Hub - activating POI "),(0,i.logInfo)("Using groupName:",s),(0,i.logInfo)("Using payload:",c),(0,a.setPoiOptIn)(s,c);break;case"oil-status-read":n=(0,a.getPoiCookie)(s),(0,i.logInfo)("OIL Hub - read the following poi status:",n.power_opt_in),parent.postMessage(JSON.stringify(n)||!1,_);break;case"oil-poi-delete":(0,i.logInfo)("OIL Hub - remove POI cookie."),(0,u.removeHubCookie)(s)}}l=!0}}},146:function(e,o,n){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.getPoiCookie=function(){var e=s(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"");return(0,_.logInfo)("Oil Hub Domain Cookie: ",e),e},o.setPoiOptIn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments[1],n=function(e){return e?e[r.OIL_PAYLOAD_PRIVACY]?e[r.OIL_PAYLOAD_PRIVACY]:e:r.PRIVACY_MINIMUM_TRACKING}(o),t=function(e){return e&&e[r.OIL_PAYLOAD_VERSION]?e[r.OIL_PAYLOAD_VERSION]:u}(o),_=s(e),c=l(e);_.power_opt_in=!0,_.privacy=n,_.timestamp=(0,i.getClientTimestamp)(),_.version=t,_.localeVariantName=function(e){return e&&e[r.OIL_PAYLOAD_LOCALE_VARIANT_NAME]?e[r.OIL_PAYLOAD_LOCALE_VARIANT_NAME]:u}(o),_.localeVariantVersion=function(e){return e&&e[r.OIL_PAYLOAD_LOCALE_VARIANT_VERSION]?e[r.OIL_PAYLOAD_LOCALE_VARIANT_VERSION]:u}(o),(0,a.setDomainCookie)(c.name,_,c.expires)};var t=n(21),i=n(12),r=n(13),a=n(26),_=n(10),c="oil_data",u="unknown";function l(e){return{name:function(e){return e?e+"_"+c:c}(e),expires:(0,t.getCookieExpireInDays)(),default_content:{power_opt_in:!1,timestamp:(0,i.getClientTimestamp)(),version:u,localeVariantName:u,localeVariantVersion:0,privacy:r.PRIVACY_MINIMUM_TRACKING}}}function s(e){return(0,a.getOilCookie)(l(e))}},147:function(e,o,n){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.getStringParam=function(e,o){var n=void 0,t=void 0,i=e.split("&");for(n=0;n<i.length;n++)if((t=i[n].split("="))[0]===o)return t[1];return null}},21:function(e,o,n){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.getConfigValue=_,o.isPreviewMode=function(){return _(t.OIL_CONFIG.ATTR_PREVIEW_MODE,!1)},o.isPoiActive=function(){return _(t.OIL_CONFIG.ATTR_ACTIVATE_POI,!1)},o.isSubscriberSetCookieActive=function(){return _(t.OIL_CONFIG.ATTR_SUB_SET_COOKIE,!0)},o.getHubOrigin=c,o.getHubPath=u,o.getOilBackendUrl=function(){return _(t.OIL_CONFIG.ATTR_OIL_BACKEND_URL,"https://oil-backend.herokuapp.com/oil")},o.getIabVendorListUrl=function(){return _(t.OIL_CONFIG.ATTR_IAB_VENDOR_LIST_URL,void 0)},o.getIabVendorBlacklist=function(){return _(t.OIL_CONFIG.ATTR_IAB_VENDOR_BLACKLIST,void 0)},o.getIabVendorWhitelist=function(){return _(t.OIL_CONFIG.ATTR_IAB_VENDOR_WHITELIST,void 0)},o.getPoiGroupName=function(){return _(t.OIL_CONFIG.ATTR_POI_GROUP_NAME,"default")},o.getCookieExpireInDays=function(){return _(t.OIL_CONFIG.ATTR_COOKIE_EXPIRES_IN_DAYS,31)},o.getLocaleVariantName=function(){var e=_(t.OIL_CONFIG.ATTR_LOCALE,void 0);return e||(e="enEN_01",(0,i.logError)("The locale is not set, falling back to "+e+".")),e&&(0,r.isObject)(e)?e.localeId:e},o.getHubLocation=function(){return c()&&u()?c()+u():null},o.resetConfiguration=function(){a=null},o.getCustomPurposes=function(){return _(t.OIL_CONFIG.ATTR_CUSTOM_PURPOSES,[])},o.getDefaultToOptin=function(){return _(t.OIL_CONFIG.ATTR_DEFAULT_TO_OPTIN,!1)};var t=n(13),i=n(10),r=n(12),a=null;function _(e,o){var t=function(){if(!a){var e=document.querySelector('script[type="application/configuration"]#oil-configuration');null===e&&(0,i.logInfo)("Using default config"),function(e){(0,r.isObject)(e.locale)&&(0,r.setGlobalOilObject)("LOCALE",e.locale),e.publicPath&&(n.p=e.publicPath)}(a=function(e){var o={};try{e&&e.text&&(o=JSON.parse(e.text),(0,i.logInfo)("Parsed config",o))}catch(e){(0,i.logError)("Error config",e)}return o}(e))}return a}();return t&&t[e]?t[e]:o}function c(){var e=_(t.OIL_CONFIG.ATTR_HUB_ORIGIN,"//oil.axelspringer.com");return e?-1!==e.indexOf("http")?e:location.protocol+e:null}function u(){return _(t.OIL_CONFIG.ATTR_HUB_PATH,"/release/"+r.OilVersion.getLatestReleaseVersion()+"/hub.html")}},26:function(e,o,n){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.setSessionCookie=f,o.setDomainCookie=A,o.getOilCookie=T,o.setSoiOptIn=function(e){var o=p();o.opt_in=!0,o.privacy=e,o.timestamp=(0,c.getClientTimestamp)(),o.version=c.OilVersion.get(),o.localeVariantName=(0,a.getLocaleVariantName)(),o.localeVariantVersion=(0,c.getLocaleVariantVersion)(),A(d().name,o,d().expires)},o.getSoiCookie=function(){var e=p();return(0,r.logInfo)("Current Oil Domain Cookie: ",e),e},o.setPreviewCookie=function(){f(u,"true")},o.setVerboseCookie=function(){f(l,"true")},o.removePreviewCookie=function(){i.default.remove(u)},o.removeVerboseCookie=function(){i.default.remove(l)},o.isPreviewCookieSet=function(){return"true"===i.default.get(u)},o.isVerboseCookieSet=function(){return"true"===i.default.get(l)},o.removeSubscriberCookies=E,o.removeHubCookie=function(e){E(),e&&i.default.remove(e+"_"+s)},o.isBrowserCookieEnabled=function(){i.default.set("oil_cookie_exp","cookiedata");var e=I("oil_cookie_exp");return i.default.remove("oil_cookie_exp"),e};var t,i=(t=n(51))&&t.__esModule?t:{default:t},r=n(10),a=n(21),_=n(13),c=n(12),u="oil_preview",l="oil_verbose",s="oil_data",O="oil_data_session";function f(e,o){i.default.set(e,o)}function A(e,o,n){i.default.set(e,o,{expires:n})}function I(e){return void 0!==i.default.get(e)}function d(){return{name:s,expires:(0,a.getCookieExpireInDays)(),default_content:{opt_in:!1,timestamp:(0,c.getClientTimestamp)(),version:c.OilVersion.get(),localeVariantName:(0,a.getLocaleVariantName)(),localeVariantVersion:(0,c.getLocaleVariantVersion)(),privacy:(0,a.getDefaultToOptin)()?_.PRIVACY_FULL_TRACKING:_.PRIVACY_MINIMUM_TRACKING}}}function p(){return T(d())}function T(e){return I(e.name)&&function(e,o){if("string"==typeof e&&Array.isArray(o)&&I(e)){var n=i.default.getJSON(e);return o.every(function(e){return n.hasOwnProperty(e)})}return!1}(e.name,Object.keys(e.default_content))?i.default.getJSON(e.name):e.default_content}function E(){i.default.remove(s),i.default.remove(O)}},51:function(e,o,n){var t,i,r;
/*!
* JavaScript Cookie v2.1.4
* https://github.com/js-cookie/js-cookie
*
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
* Released under the MIT license
*/
/*!
* JavaScript Cookie v2.1.4
* https://github.com/js-cookie/js-cookie
*
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
* Released under the MIT license
*/
void 0===(i="function"==typeof(t=r=function(){function e(){for(var e=0,o={};e<arguments.length;e++){var n=arguments[e];for(var t in n)o[t]=n[t]}return o}return function o(n){function t(o,i,r){var a;if("undefined"!=typeof document){if(arguments.length>1){if("number"==typeof(r=e({path:"/"},t.defaults,r)).expires){var _=new Date;_.setMilliseconds(_.getMilliseconds()+864e5*r.expires),r.expires=_}r.expires=r.expires?r.expires.toUTCString():"";try{a=JSON.stringify(i),/^[\{\[]/.test(a)&&(i=a)}catch(e){}i=n.write?n.write(i,o):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),o=(o=(o=encodeURIComponent(String(o))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var c="";for(var u in r)r[u]&&(c+="; "+u,!0!==r[u]&&(c+="="+r[u]));return document.cookie=o+"="+i+c}o||(a={});for(var l=document.cookie?document.cookie.split("; "):[],s=/(%[0-9A-Z]{2})+/g,O=0;O<l.length;O++){var f=l[O].split("="),A=f.slice(1).join("=");'"'===A.charAt(0)&&(A=A.slice(1,-1));try{var I=f[0].replace(s,decodeURIComponent);if(A=n.read?n.read(A,I):n(A,I)||A.replace(s,decodeURIComponent),this.json)try{A=JSON.parse(A)}catch(e){}if(o===I){a=A;break}o||(a[I]=A)}catch(e){}}return a}}return t.set=t,t.get=function(e){return t.call(t,e)},t.getJSON=function(){return t.apply({json:!0},[].slice.call(arguments))},t.defaults={},t.remove=function(o,n){t(o,"",e(n,{expires:-1}))},t.withConverter=o,t}(function(){})})?t.call(o,n,o,e):t)||(e.exports=i),e.exports=r()}});</script>
</head>
<body>Axel Springer Ideas Engineering - Opt-In Layer (OIL) HUB</body>
</html>