PageSourceSearch

https://forumrefugies.org/templates/frc/js/tarteaucitron/tarteaucitron.js

js forumrefugies.org collected 2026-10-02 04:32:52 UTC 126,228 bytes, 2,388 lines download raw bytes

1/*jslint browser: true, evil: true */
2/* min ready */
3
4var scripts = document.getElementsByTagName('script'),
5    tarteaucitronPath = (document.currentScript || scripts[scripts.length - 1]).src.split('?')[0],
6    tarteaucitronForceCDN = (tarteaucitronForceCDN === undefined) ? '' : tarteaucitronForceCDN,
7    tarteaucitronUseMin = (tarteaucitronUseMin === undefined) ? '' : tarteaucitronUseMin,
8    cdn = (tarteaucitronForceCDN === '') ? tarteaucitronPath.split('/').slice(0, -1).join('/') + '/' : tarteaucitronForceCDN,
9    alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch,
10    tarteaucitronForceLanguage = (tarteaucitronForceLanguage === undefined) ? '' : tarteaucitronForceLanguage,
11    tarteaucitronForceExpire = (tarteaucitronForceExpire === undefined) ? '' : tarteaucitronForceExpire,
12    tarteaucitronCustomText = (tarteaucitronCustomText === undefined) ? '' : tarteaucitronCustomText,
13    // tarteaucitronExpireInDay: true for day(s) value - false for hour(s) value
14    tarteaucitronExpireInDay = (tarteaucitronExpireInDay === undefined || typeof tarteaucitronExpireInDay !== "boolean") ? true : tarteaucitronExpireInDay,
15    timeExpire = 31536000000,
16    tarteaucitronProLoadServices,
17    tarteaucitronNoAdBlocker = false,
18    tarteaucitronIsLoaded = false;
19
20
21
22var tarteaucitron = {
23    "version": 1.19,
24    "cdn": cdn,
25    "user": {},
26    "lang": {},
27    "services": {},
28    "added": [],
29    "idprocessed": [],
30    "state": {},
31    "launch": [],
32    "parameters": {},
33    "isAjax": false,
34    "reloadThePage": false,
35    "events": {
36        "init": function () {},
37        "load": function () {},
38    },
39    "init": function (params) {
40        "use strict";
41        var origOpen;
42
43        tarteaucitron.parameters = params;
44        if (alreadyLaunch === 0) {
45            alreadyLaunch = 1;
46            if (window.addEventListener) {
47                window.addEventListener("load", function () {
48                    tarteaucitron.initEvents.loadEvent(false);
49                }, false);
50                window.addEventListener("scroll", function () {
51                    tarteaucitron.initEvents.scrollEvent();
52                }, false);
53
54                window.addEventListener("keydown", function (evt) {
55                    tarteaucitron.initEvents.keydownEvent(false, evt);
56                }, false);
57                window.addEventListener("hashchange", function () {
58                    tarteaucitron.initEvents.hashchangeEvent();
59                }, false);
60                window.addEventListener("resize", function () {
61                    tarteaucitron.initEvents.resizeEvent();
62                }, false);
63            } else {
64                window.attachEvent("onload", function () {
65                    tarteaucitron.initEvents.loadEvent(true);
66                });
vendor: 5,913 bytes, lines 66-207
66
67                window.attachEvent("onscroll", function () {
68                    tarteaucitron.initEvents.scrollEvent();
69                });
70                window.attachEvent("onkeydown", function (evt) {
71                    tarteaucitron.initEvents.keydownEvent(true, evt);
72
73                });
74                window.attachEvent("onhashchange", function () {
75                    tarteaucitron.initEvents.hashchangeEvent();
76                });
77                window.attachEvent("onresize", function () {
78                    tarteaucitron.initEvents.resizeEvent();
79                });
80            }
81
82            if (typeof XMLHttpRequest !== 'undefined') {
83                origOpen = XMLHttpRequest.prototype.open;
84                XMLHttpRequest.prototype.open = function () {
85
86                    if (window.addEventListener) {
87                        this.addEventListener("load", function () {
88                            if (typeof tarteaucitronProLoadServices === 'function') {
89                                tarteaucitronProLoadServices();
90                            }
91                        }, false);
92                    } else if (typeof this.attachEvent !== 'undefined') {
93                        this.attachEvent("onload", function () {
94                            if (typeof tarteaucitronProLoadServices === 'function') {
95                                tarteaucitronProLoadServices();
96                            }
97                        });
98                    } else {
99                        if (typeof tarteaucitronProLoadServices === 'function') {
100                            setTimeout(tarteaucitronProLoadServices, 1000);
101                        }
102                    }
103
104                    try {
105                        origOpen.apply(this, arguments);
106                    } catch (err) {}
107                };
108            }
109        }
110
111        if(tarteaucitron.events.init) {
112            tarteaucitron.events.init();
113        }
114    },
115    "initEvents": {
116        "loadEvent": function (isOldBrowser) {
117            tarteaucitron.load();
118            tarteaucitron.fallback(['tarteaucitronOpenPanel'], function (elem) {
119                if (isOldBrowser) {
120                    elem.attachEvent("onclick", function (event) {
121                        tarteaucitron.userInterface.openPanel();
122                        event.preventDefault();
123                    });
124                } else {
125                    elem.addEventListener("click", function (event) {
126                        tarteaucitron.userInterface.openPanel();
127                        event.preventDefault();
128                    }, false);
129                }
130            }, true);
131        },
132        "keydownEvent": function (isOldBrowser, evt) {
133            if (evt.keyCode === 27) {
134                tarteaucitron.userInterface.closePanel();
135            }
136
137            if (isOldBrowser) {
138                if ( evt.keyCode === 9 && focusableEls.indexOf(evt.target) >= 0) {
139                    if ( evt.shiftKey ) /* shift + tab */ {
140                        if (document.activeElement === firstFocusableEl) {
141                            lastFocusableEl.focus();
142                            evt.preventDefault();
143                        }
144                    } else /* tab */ {
145                        if (document.activeElement === lastFocusableEl) {
146                            firstFocusableEl.focus();
147                            evt.preventDefault();
148                        }
149                    }
150                }
151            }
152        },
153        "hashchangeEvent": function () {
154            if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
155                tarteaucitron.userInterface.openPanel();
156            }
157        },
158        "resizeEvent": function () {
159            var tacElem = document.getElementById('tarteaucitron');
160            var tacCookieContainer = document.getElementById('tarteaucitronCookiesListContainer');
161
162            if (tacElem && tacElem.style.display === 'block') {
163                tarteaucitron.userInterface.jsSizing('main');
164            }
165
166            if (tacCookieContainer && tacCookieContainer.style.display === 'block') {
167                tarteaucitron.userInterface.jsSizing('cookie');
168            }
169        },
170        "scrollEvent": function () {
171            var scrollPos = window.pageYOffset || document.documentElement.scrollTop;
172            var heightPosition;
173            var tacPercentage = document.getElementById('tarteaucitronPercentage');
174            var tacAlertBig = document.getElementById('tarteaucitronAlertBig');
175
176            if (tacAlertBig && !tarteaucitron.highPrivacy) {
177                if (tacAlertBig.style.display === 'block') {
178                    heightPosition = tacAlertBig.offsetHeight + 'px';
179
180                    if (scrollPos > (screen.height * 2)) {
181                        tarteaucitron.userInterface.respondAll(true);
182                    } else if (scrollPos > (screen.height / 2)) {
183                        document.getElementById('tarteaucitronDisclaimerAlert').innerHTML = '<strong>' + tarteaucitron.lang.alertBigScroll + '</strong> ' + tarteaucitron.lang.alertBig;
184                    }
185
186                    if (tacPercentage) {
187                        if (tarteaucitron.orientation === 'top') {
188                            tacPercentage.style.top = heightPosition;
189                        } else {
190                            tacPercentage.style.bottom = heightPosition;
191                        }
192                        tacPercentage.style.width = ((100 / (screen.height * 2)) * scrollPos) + '%';
193                    }
194                }
195            }
196        },
197    },
198    "load": function () {
199        "use strict";
200
201        if (tarteaucitronIsLoaded === true) {
202            return;
203        }
204
205        var cdn = tarteaucitron.cdn,
206            language = tarteaucitron.getLanguage(),
207            useMinifiedJS = ((
vendor: 10,668 bytes, lines 207-442
207cdn.indexOf('cdn.jsdelivr.net') >= 0) || (tarteaucitronPath.indexOf('.min.') >= 0) || (tarteaucitronUseMin !== '')),
208            pathToLang = cdn + 'lang/tarteaucitron.' + language + (useMinifiedJS ? '.min' : '') + '.js',
209            pathToServices = cdn + 'tarteaucitron.services' + (useMinifiedJS ? '.min' : '') + '.js',
210            linkElement = document.createElement('link'),
211            defaults = {
212                "adblocker": false,
213                "hashtag": '#tarteaucitron',
214                "cookieName": 'tarteaucitron',
215                "highPrivacy": true,
216                "orientation": "middle",
217                "bodyPosition": "bottom",
218                "removeCredit": false,
219                "showAlertSmall": false,
220                "showDetailsOnClick": true,
221                "showIcon": true,
222                "iconPosition": "BottomRight",
223                "cookieslist": false,
224                "handleBrowserDNTRequest": false,
225                "DenyAllCta": true,
226                "AcceptAllCta" : true,
227                "moreInfoLink": true,
228                "privacyUrl": "",
229                "useExternalCss": false,
230                "useExternalJs": false,
231                "mandatory": true,
232                "mandatoryCta": true,
233                "closePopup": false,
234                "groupServices": false,
235                "serviceDefaultState": 'wait',
236                "googleConsentMode": true,
237                "partnersList": false,
238                "alwaysNeedConsent": false
239            },
240            params = tarteaucitron.parameters;
241
242        // flag the tac load
243        tarteaucitronIsLoaded = true;
244
245        // Don't show the middle bar if we are on the privacy policy or more page
246        if (((tarteaucitron.parameters.readmoreLink !== undefined && window.location.href == tarteaucitron.parameters.readmoreLink) || window.location.href == tarteaucitron.parameters.privacyUrl) && tarteaucitron.parameters.orientation == "middle") {
247            tarteaucitron.parameters.orientation = "bottom";
248        }
249
250        // Step -1
251        if (typeof tarteaucitronCustomPremium !== 'undefined') {
252            tarteaucitronCustomPremium();
253        }
254
255        // Step 0: get params
256        if (params !== undefined) {
257
258            for (var k in defaults) {
259                if(!tarteaucitron.parameters.hasOwnProperty(k)) {
260                    tarteaucitron.parameters[k] = defaults[k];
261                }
262            }
263        }
264
265        // global
266        tarteaucitron.orientation = tarteaucitron.parameters.orientation;
267        tarteaucitron.hashtag = tarteaucitron.parameters.hashtag;
268        tarteaucitron.highPrivacy = tarteaucitron.parameters.highPrivacy;
269        tarteaucitron.handleBrowserDNTRequest = tarteaucitron.parameters.handleBrowserDNTRequest;
270        tarteaucitron.customCloserId = tarteaucitron.parameters.customCloserId;
271
272        // google consent mode
273        if (tarteaucitron.parameters.googleConsentMode === true) {
274
275            // set the dataLayer and a function to update
276            window.dataLayer = window.dataLayer || [];
277            window.tac_gtag = function tac_gtag() {
278                dataLayer.push(arguments);
279            };
280
281            // default consent to denied
282            window.tac_gtag('consent', 'default', {
283                ad_storage: 'denied',
284                analytics_storage: 'denied',
285                ad_user_data: 'denied',
286                ad_personalization: 'denied',
287                wait_for_update: 800
288            });
289
290            // if google ads, add a service for personalized ads
291            document.addEventListener('googleads_added', function() {
292
293                // skip if already added
294                if (tarteaucitron.added["gcmads"] === true) {
295                    return;
296                }
297
298                // simple service to control gcm with event
299                tarteaucitron.services.gcmads = {
300                    "key": "gcmads",
301                    "type": "ads",
302                    "name": "Google Ads (personalized ads)",
303                    "uri": "https://support.google.com/analytics/answer/9976101",
304                    "needConsent": true,
305                    "cookies": [],
306                    "js": function() {},
307                    "fallback": function() {}
308                };
309                tarteaucitron.job.push('gcmads');
310
311                // fix the event handler on the buttons
312                var i,
313                    allowBtns = document.getElementsByClassName("tarteaucitronAllow"),
314                    denyBtns = document.getElementsByClassName("tarteaucitronDeny");
315                for (i = 0; i < allowBtns.length; i++) {
316                    tarteaucitron.addClickEventToElement(allowBtns[i], function() {
317                        tarteaucitron.userInterface.respond(this, true);
318                    });
319                }
320                for (i = 0; i < denyBtns.length; i++) {
321                    tarteaucitron.addClickEventToElement(denyBtns[i], function() {
322                        tarteaucitron.userInterface.respond(this, false);
323                    });
324                }
325            });
326
327            // when personalized ads are accepted, accept googleads
328            document.addEventListener('gcmads_allowed', function() {
329                tarteaucitron.setConsent('googleads', true);
330            });
331
332            // personalized ads loaded/allowed, set gcm to granted
333            document.addEventListener('gcmads_loaded', function() {
334                window.tac_gtag('consent', 'update', {
335                    ad_user_data: 'granted',
336                    ad_personalization: 'granted'
337                });
338            });
339            document.addEventListener('gcmads_allowed', function() {
340                window.tac_gtag('consent', 'update', {
341                    ad_user_data: 'granted',
342                    ad_personalization: 'granted'
343                });
344            });
345
346            // personalized ads disallowed, set gcm to denied
347            document.addEventListener('gcmads_disallowed', function() {
348                window.tac_gtag('consent', 'update', {
349                    ad_user_data: 'denied',
350                    ad_personalization: 'denied'
351                });
352            });
353
354            // google ads loaded/allowed, set gcm to granted
355            document.addEventListener('googleads_loaded', function() {
356                window.tac_gtag('consent', 'update', {
357                    ad_storage: 'granted'
358                });
359            });
360            document.addEventListener('googleads_allowed', function() {
361                window.tac_gtag('consent', 'update', {
362                    ad_storage: 'granted'
363                });
364            });
365
366            // google ads disallowed, disable personalized ads and update gcm
367            document.addEventListener('googleads_disallowed', function() {
368                tarteaucitron.setConsent('gcmads', false);
369                window.tac_gtag('consent', 'update', {
370                    ad_storage: 'denied'
371                });
372            });
373
374            // ga4 loaded/allowed, set gcm to granted
375            document.addEventListener('gtag_loaded', function() {
376                window.tac_gtag('consent', 'update', {
377                    analytics_storage: 'granted'
378                });
379            });
380            document.addEventListener('gtag_allowed', function() {
381                window.tac_gtag('consent', 'update', {
382                    analytics_storage: 'granted'
383                });
384            });
385
386            // ga4 disallowed, update gcm
387            document.addEventListener('gtag_disallowed', function() {
388                window.tac_gtag('consent', 'update', {
389                    analytics_storage: 'denied'
390                });
391            });
392
393            // multiple ga4 loaded/allowed, set gcm to granted
394            document.addEventListener('multiplegtag_loaded', function() {
395                window.tac_gtag('consent', 'update', {
396                    analytics_storage: 'granted'
397                });
398            });
399            document.addEventListener('multiplegtag_allowed', function() {
400                window.tac_gtag('consent', 'update', {
401                    analytics_storage: 'granted'
402                });
403            });
404
405            // multiple ga4 disallowed, update gcm
406            document.addEventListener('multiplegtag_disallowed', function() {
407                window.tac_gtag('consent', 'update', {
408                    analytics_storage: 'denied'
409                });
410            });
411
412            // allow gtag/googleads by default if consent mode is on
413            window.addEventListener('tac.root_available', function() {
414                if (typeof tarteaucitron_block !== 'undefined') {
415                    tarteaucitron_block.unblock(/www\.googletagmanager\.com\/gtag\/js/);
416                    tarteaucitron_block.unblock(/www\.googleadservices\.com\/pagead\/conversion/);
417                    tarteaucitron_block.unblock(/AW-/);
418                    tarteaucitron_block.unblock(/google-analytics\.com\/analytics\.js/);
419                    tarteaucitron_block.unblock(/google-analytics\.com\/ga\.js/);
420                }
421            });
422        }
423
424        // Step 1: load css
425        if ( !tarteaucitron.parameters.useExternalCss ) {
426            linkElement.rel = 'stylesheet';
427            linkElement.type = 'text/css';
428            linkElement.href = cdn + 'css/tarteaucitron' + (useMinifiedJS ? '.min' : '') + '.css';
429            document.getElementsByTagName('head')[0].appendChild(linkElement);
430        }
431        // Step 2: load language and services
432        tarteaucitron.addInternalScript(pathToLang, '', function () {
433
434          if(tarteaucitronCustomText !== ''){
435            tarteaucitron.lang = tarteaucitron.AddOrUpdate(tarteaucitron.lang, tarteaucitronCustomText);
436          }
437            tarteaucitron.addInternalScript(pathToServices, '', function () {
438
439                // css for the middle bar TODO: add it on the css file
440                if (tarteaucitron.orientation === 'middle') {
441                    var customThemeMiddle = document.createElement('style'),
442                        cssRuleMiddle = 'div#tarteaucitronRoot.tarteaucitronBeforeVisible:before {content: \'\';position: fixed;width: 100%;height: 100%;background: white;top: 0;left: 0;z-index: 999;opacity: 0.5;}div#tarteaucitronAlertBig:before {content: \'' + tarteaucitron.lang.middleBarHead + '\';font-size: 35px;}body #tarteaucitronRoot div#tarteaucitronAlertBig {width: 60%;min-width: 285px;height: auto;margin: auto;left: 50%;top: 50%;transform: translate(-50%, -50%);box-shadow: 0 0 9000px #000;border-radius: 20px;padding: 35px 25px;}
442span#tarteaucitronDisclaimerAlert {padding: 0 30px;}#tarteaucitronRoot span#tarteaucitronDisclaimerAlert {margin: 10px 0 30px;display: block;text-align: center;font-size: 21px;}@media screen and (max-width: 900px) {div#tarteaucitronAlertBig button {margin: 0 auto 10px!important;display: block!important;}}';
443
444                    customThemeMiddle.type = 'text/css';
445                    if (customThemeMiddle.styleSheet) {
446                        customThemeMiddle.styleSheet.cssText = cssRuleMiddle;
447                    } else {
448                        customThemeMiddle.appendChild(document.createTextNode(cssRuleMiddle));
449                    }
450                    document.getElementsByTagName('head')[0].appendChild(customThemeMiddle);
451                }
452
453                // disable the expand option if services grouped by category
454                if (tarteaucitron.parameters.groupServices == true) {
455                    tarteaucitron.parameters.showDetailsOnClick = true;
456                }
457
458                // css for the popup bar TODO: add it on the css file
459                if (tarteaucitron.orientation === 'popup') {
460                    var customThemePopup = document.createElement('style'),
461                        cssRulePopup = 'div#tarteaucitronAlertBig:before {content: \'' + tarteaucitron.lang.middleBarHead + '\';font-size: 22px;}body #tarteaucitronRoot div#tarteaucitronAlertBig {bottom: 0;top: auto!important;left: 8px!important;right: auto!important;transform: initial!important;border-radius: 5px 5px 0 0!important;max-width: 250px!important;width: calc(100% - 16px)!important;min-width: 0!important;padding: 25px 0;}span#tarteaucitronDisclaimerAlert {padding: 0 30px;font-size: 15px!important;}#tarteaucitronRoot span#tarteaucitronDisclaimerAlert {margin: 10px 0 30px;display: block;text-align: center;font-size: 21px;}div#tarteaucitronAlertBig button {margin: 0 auto 10px!important;display: block!important;width: calc(100% - 60px);box-sizing: border-box;}';
462
463                    customThemePopup.type = 'text/css';
464                    if (customThemePopup.styleSheet) {
465                        customThemePopup.styleSheet.cssText = cssRulePopup;
466                    } else {
467                        customThemePopup.appendChild(document.createTextNode(cssRulePopup));
468                    }
469                    document.getElementsByTagName('head')[0].appendChild(customThemePopup);
470                }
471
472                var body = document.body,
473                    div = document.createElement('div'),
474                    html = '',
475                    index,
476                    orientation = 'Top',
477                    modalAttrs = '',
478                    cat = ['ads', 'analytic', 'api', 'comment', 'social', 'support', 'video', 'other', 'google'],
479                    i;
480
481                cat = cat.sort(function (a, b) {
482                    if (tarteaucitron.lang[a].title > tarteaucitron.lang[b].title) { return 1; }
483                    if (tarteaucitron.lang[a].title < tarteaucitron.lang[b].title) { return -1; }
484                    return 0;
485                });
486
487                // Step 3: prepare the html
488                html += '<div role="heading" aria-level="1" id="tac_title" class="tac_visually-hidden">' + tarteaucitron.lang.title + '</div>';
489                html += '<div id="tarteaucitronPremium"></div>';
490                if (tarteaucitron.reloadThePage) {
491                    html += '<button type="button" id="tarteaucitronBack" aria-label="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')" title="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')"></button>';
492                } else {
493                    html += '<button type="button" id="tarteaucitronBack" aria-label="' + tarteaucitron.lang.close + '" title="' + tarteaucitron.lang.close + '"></button>';
494                }
495                html += '<div id="tarteaucitron" role="dialog" aria-modal="true" aria-labelledby="dialogTitle" tabindex="-1">';
496                if (tarteaucitron.reloadThePage) {
497                    html += '   <button type="button" id="tarteaucitronClosePanel" aria-label="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')" title="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')">';
498                } else {
499                    html += '   <button type="button" id="tarteaucitronClosePanel">';
500                }
501                html += '       ' + tarteaucitron.lang.close;
502                html += '   </button>';
503                html += '   <div id="tarteaucitronServices">';
504                html += '      <div class="tarteaucitronLine tarteaucitronMainLine" id="tarteaucitronMainLineOffset">';
vendor: 10,104 bytes, lines 505-626
505                html += '         <span class="tarteaucitronH1" role="heading" aria-level="1" id="dialogTitle">'+ tarteaucitron.lang.title + '</span>';
506                html += '         <div id="tarteaucitronInfo">';
507                html += '         ' + tarteaucitron.lang.disclaimer;
508                if (tarteaucitron.parameters.privacyUrl !== "") {
509                    html += '   <br/><br/>';
510                    html += '   <button type="button" id="tarteaucitronPrivacyUrlDialog" role="link">';
511                    html += '       ' + tarteaucitron.lang.privacyUrl;
512                    html += '   </button>';
513                }
514                html += '         </div>';
515                html += '         <div class="tarteaucitronName">';
516                html += '            <span class="tarteaucitronH2" role="heading" aria-level="2">' + tarteaucitron.lang.all + '</span>';
517                html += '         </div>';
518                html += '         <div class="tarteaucitronAsk" id="tarteaucitronScrollbarAdjust">';
519                html += '            <button type="button" id="tarteaucitronAllAllowed" class="tarteaucitronAllow">';
520                html += '               <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allowAll;
521                html += '            </button> ';
522                html += '            <button type="button" id="tarteaucitronAllDenied" class="tarteaucitronDeny">';
523                html += '               <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.denyAll;
524                html += '            </button>';
525                html += '         </div>';
526                html += '      </div>';
527                html += '      <div class="tarteaucitronBorder">';
528                html += '         <div class="clear"></div><ul>';
529
530
531                if (tarteaucitron.parameters.mandatory == true) {
532                   html += '<li id="tarteaucitronServicesTitle_mandatory">';
533                   html += '<div class="tarteaucitronTitle">';
534                    if(tarteaucitron.parameters.showDetailsOnClick){
535                        html += '   <button type="button" tabindex="-1"><span class="tarteaucitronPlus" aria-hidden="true"></span> ' + tarteaucitron.lang.mandatoryTitle + '</button>';
536                    }else{
537                        html += '   <span class="asCatToggleBtn">' + tarteaucitron.lang.mandatoryTitle + '</span>';
538                    }
539                   html += '</div>';
540                   html += '<ul id="tarteaucitronServices_mandatory">';
541                   html += '<li class="tarteaucitronLine">';
542                   html += '   <div class="tarteaucitronName">';
543                   html += '       <span class="tarteaucitronH3" role="heading" aria-level="3">' + tarteaucitron.lang.mandatoryText + '</span>';
544                   html += '       <span class="tarteaucitronListCookies" aria-hidden="true"></span><br/>';
545                   html += '   </div>';
546                   if (tarteaucitron.parameters.mandatoryCta == true) {
547                       html += '   <div class="tarteaucitronAsk">';
548                       html += '       <button type="button" class="tarteaucitronAllow" tabindex="-1" disabled>';
549                       html += '           <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allow;
550                       html += '       </button> ';
551                       html += '       <button type="button" class="tarteaucitronDeny" tabindex="-1">';
552                       html += '           <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.deny;
553                       html += '       </button> ';
554                       html += '   </div>';
555                   }
556                   html += '</li>';
557                   html += '</ul></li>';
558                }
559
560                for (i = 0; i < cat.length; i += 1) {
561                    html += '         <li id="tarteaucitronServicesTitle_' + cat[i] + '" class="tarteaucitronHidden">';
562                    html += '            <div class="tarteaucitronTitle" role="heading" aria-level="2">';
563                    if(tarteaucitron.parameters.showDetailsOnClick)
564                    {
565                        html += '               <button type="button" class="catToggleBtn" aria-expanded="false" data-cat="tarteaucitronDetails' + cat[i] + '"><span class="tarteaucitronPlus" aria-hidden="true"></span> ' + tarteaucitron.lang[cat[i]].title + '</button>';
566                    }else{
567                        html += '               <span class="asCatToggleBtn" data-cat="tarteaucitronInlineDetails' + cat[i] + '">' + tarteaucitron.lang[cat[i]].title + '</span>';
568                    }
569                    html += '            </div>';
570                    html += '            <div id="tarteaucitronDetails' + cat[i] + '" class="tarteaucitronDetails '+ (tarteaucitron.parameters.showDetailsOnClick ? 'tarteaucitronInfoBox' : 'tarteaucitronDetailsInline')+'">';
571                    html += '               ' + tarteaucitron.lang[cat[i]].details;
572                    html += '            </div>';
573                    html += '         <ul id="tarteaucitronServices_' + cat[i] + '"></ul></li>';
574                }
575                html += '             <li id="tarteaucitronNoServicesTitle" class="tarteaucitronLine">' + tarteaucitron.lang.noServices + '</li>';
576                html += '         </ul>';
577                html += '         <div class="tarteaucitronHidden tarteaucitron-spacer-20" id="tarteaucitronScrollbarChild"></div>';
578                if (tarteaucitron.parameters.removeCredit === false) {
579                    html += '     <a class="tarteaucitronSelfLink" href="https://tarteaucitron.io/" rel="nofollow noreferrer noopener" target="_blank" title="tarteaucitron ' + tarteaucitron.lang.newWindow + '"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHcAAAAeCAYAAAAWwoEYAAADl0lEQVRoge1Y0W3bQAx9CjKARlC+9GVUmqDJBHEmiDyB6wkcTxBngtgTxJ0gzgQW4C/9aYOmE6g4lTQo+k6y3Rb94QOERNQd+cjj8XiGwWAwGAwGg8FgMBgMBoPB8F8RNRXe+whEKe7c36ZCAeCRxC9Rig2PUd8kPgAsoxSfQ3YAzAA8D/HwYYCb05kBKKO0teFkmbC1jlKsAnq/Abjn+QBqAIsoRS30ttwG/HNz1wH/XIxWTicLdvtW7xTAGEAMtP685CNsBTe2d/BLydfXAG57SEnMAST0zgYZSUCPk02bCvkJduIzuJzDLfPolbY+tLKmar+/8+IRePy4qdpE03qHuH8fipFb4N2+XdA3AJ/0vaQxt7s9FvkIS2XvtqnwM0rxpOQfbnE5G2LhTCmUO2fHIngOmcv+KG3HafDchB6ntwjYqenR2PqC7sOZ3E7FXHB0vqxoFyUyLh7OEH7LOGouvhhN3eIBeKXv0n5MsufdHqXcwYR5U2EbpV35lSspVPJmQj4TcgRK7jTg5IzmPUhhwM5a2WHUFCx+NgiDucmgh7idikLovHFlL0pxQ9xzX+IIP9Y6FrJsqhjlQpZRAkFVDCjZfcCHt6bqJDmuh5ylCWx0RVnk3oumaknqTH5sqrY0fBWyULaHUIgAgxb46MxV3DbieAhxOxUxjSuljig9lMQ/Bcfoi9BTEv9aLORSndVxYOH525sUDC6u2gWxcNzBNRxPanyh3ktKinOgy3WoxPbtUM0t6RkbQnzBnFPgi9GCOEubY9UffIryz9iKRe8s/FUfEWosJJGxagp85bpUO3VywQ46lOtAWfNxKwa4JXQ+628+bpxYGXXMzp5rXH401VEyXwIdowXFaKWSMFHvMTVmGnc+P3oXV2QOiBCfgex8QtcQCbcQE/H+eoHzrkFo1KM7zVO4jVVj5s6lRiWF7zyXyfRMc97J3tzj87mYqZ7E2YjzUct9GUi4tjHLR8dVkBLjQcuHFleWvQfRNEhFR7uX7pkctOwvZXsft7sAtyldEUIN2UTeLxnEfxKYswzdi88BdbZ8hifUoSMftQvP+muRwN6+Q3DeqqRExP9QmTtcheiHh0Ot1x2i2km1bP9pbufw5zZdyWsOrh7vQae5OZWbsMv30pi7cd/CKj3coPEVaCP4Zhx4eQWhOZ1Y9MTXGyP8/iGjEyfa1T4fO/4Lea9vBoPBYDAYDAaDwWAwGAwGwz8GgF8siXCCbrSRhgAAAABJRU5ErkJggg==" alt="tarteaucitron.io" /></a>';
580                }
581                html += '       </div>';
582                html += '   </div>';
583                html += '</div>';
584
585                if (tarteaucitron.parameters.orientation === 'bottom') {
586                    orientation = 'Bottom';
587                }
588
589                if (tarteaucitron.parameters.orientation === 'middle' || tarteaucitron.parameters.orientation === 'popup') {
590                    modalAttrs = ' role="dialog" aria-modal="true" aria-labelledby="tac_title"';
591                }
592
593                if (tarteaucitron.parameters.highPrivacy && !tarteaucitron.parameters.AcceptAllCta) {
594                    html += '<div tabindex="-1" id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '"' + modalAttrs + '>';
595                    //html += '<div class="tarteaucitronAlertBigWrapper">';
596                    html += '   <span id="tarteaucitronDisclaimerAlert" role="paragraph">';
597                    html += '       ' + tarteaucitron.lang.alertBigPrivacy;
598                    html += '   </span>';
599                    //html += '   <span class="tarteaucitronAlertBigBtnWrapper">';
600                    html += '   <button type="button" id="tarteaucitronPersonalize" aria-label="' + tarteaucitron.lang.personalize + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.personalize + ' ' + tarteaucitron.lang.modalWindow + '">';
601                    html += '       ' + tarteaucitron.lang.personalize;
602                    html += '   </button>';
603
604                    if (tarteaucitron.parameters.privacyUrl !== "") {
605                        html += '   <button role="link" type="button" id="tarteaucitronPrivacyUrl">';
606                        html += '       ' + tarteaucitron.lang.privacyUrl;
607                        html += '   </button>';
608                    }
609
610                    //html += '   </span>';
611                    //html += '</div>';
612                    html += '</div>';
613                } else {
614                    html += '<div tabindex="-1" id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '"' + modalAttrs + '>';
615                    //html += '<div class="tarteaucitronAlertBigWrapper">';
616                    html += '   <span id="tarteaucitronDisclaimerAlert" role="paragraph">';
617
618                    if (tarteaucitron.parameters.highPrivacy) {
619                        html += '       ' + tarteaucitron.lang.alertBigPrivacy;
620                    } else {
621                        html += '       ' + tarteaucitron.lang.alertBigClick + ' ' + tarteaucitron.lang.alertBig;
622                    }
623
624                    html += '   </span>';
625                    //html += '   <span class="tarteaucitronAlertBigBtnWrapper">';
626                    html += '   <button type="button" class="tarteaucitronCTAButton tarteaucitronAllow" id="tarteaucitronPersonalize2">';
627                    html += '       <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.acceptAll;
628                    html += '   </button>';
629
630
631                    if (tarteaucitron.parameters.DenyAllCta) {
632                        if (tarteaucitron.reloadThePage) {
633                                    html += '   <button type="button" class="tarteaucitronCTAButton tarteaucitronDeny" id="tarteaucitronAllDenied2" aria-label="' + tarteaucitron.lang.denyAll + ' (' + tarteaucitron.lang.reload + ')" title="' + tarteaucitron.lang.denyAll + ' (' + tarteaucitron.lang.reload + ')">';
634                        } else {
635                                    html += '   <button type="button" class="tarteaucitronCTAButton tarteaucitronDeny" id="tarteaucitronAllDenied2">';
636                        }
637                                    html += '       <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.denyAll;
638                                    html += '   </button>';
639                                    //html += '   <br/><br/>';
640                    }
641
642                    html += '   <button type="button" id="tarteaucitronClose
vendor: 5,924 bytes, lines 642-687
642Alert" aria-label="' + tarteaucitron.lang.personalize + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.personalize + ' ' + tarteaucitron.lang.modalWindow + '">';
643                    html += '       ' + tarteaucitron.lang.personalize;
644                    html += '   </button>';
645
646                    if (tarteaucitron.parameters.privacyUrl !== "") {
647                        html += '   <button type="button" id="tarteaucitronPrivacyUrl" role="link">';
648                        html += '       ' + tarteaucitron.lang.privacyUrl;
649                        html += '   </button>';
650                    }
651
652                    //html += '   </span>';
653                    //html += '</div>';
654                    html += '</div>';
655                    html += '<div id="tarteaucitronPercentage"></div>';
656                }
657
658                if (tarteaucitron.parameters.showIcon === true) {
659                    html += '<div id="tarteaucitronIcon" class="tarteaucitronIcon' + tarteaucitron.parameters.iconPosition + '">';
660                    html += '   <button type="button" id="tarteaucitronManager" aria-label="' + tarteaucitron.lang.icon + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.icon + ' ' + tarteaucitron.lang.modalWindow + '">';
661                    html += '       <img src="' + (tarteaucitron.parameters.iconSrc ? tarteaucitron.parameters.iconSrc : 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGA0lEQVRoge1a207bWBRdBtJwLYZhKDMVmlSK1LxNkPo+ZH6g8B6p5AuALwC+APoFoVLeoT8whPeRSt+CZKmZVu3AiIsRlEtCktGyjy8xzuXYhvahS0JJHJ/4rLP3XnuffcAPfGdQ7mM6jRLSAF4BxqsbewB2lRS2o35mpEQaJcwCyANIdLi1DGBNSWEzqmdHRqRRwjqAJclhtExOSUEP+/xIiDRKhhUWfL7ShTtBuJnqcw+/z4Ql0xNmMEwSSz4kuNIzSgpjSsqYJP/GeE185wYJroedRyiLNEpGLLzzrHSuk+83SgbxvOcyyRaDziWsRVZkSRDinpzPbwVGWIucuohsKynMS47fAQyls/BMSRmKJo3AFhG5wm2N1wF+Zs3zebbFfR0RxrXcJHQlgH+LMW616pR/WiIMEXfW3mtzXyeEGWsjKot8c4TOI98L+iKaR5PS6IUk88RLAO9F8UjrbYoYMOosNavpfmODIiwRXRR/G3ohaWVo1RU/c30jV8ab2mV8qVGzHWBOLyTLZiWs5Rolg/C3ySOi0tXP/k4aEwOwSBKPJs7Rp16ABJTe+p1xVX0It/owqqdDEMRoqd3RFxqDPh20Ig6VEPVC0i5RSCD+6wl6HlW7GksSlUMV11/GrUs5NasFLusDE9ELSVphXemtJwaT/8JyIRvxNNCfBmIiNdR04LII3DSrbe0yjqvyJF/ppptqVlt+MCLCEh/oOkPPP6N38Mb5cnQBGFsEqmXg5j3QMwoMzwGnr4HYbybBq13gZAOom/FO63zdf2qQArCsZrUN2TlJy69eSDKYV+6Q4MpP75ivHzPA53ngaBW4eGuSOt0A/lsGPmXMz0+3TFJcTfFbPfFbfnwlhON+iQhlWmA82CQ4ocQ7c6KcfL3DHuls0yT6Sx4YnLXJDCQOIRRv5yGIJBgP8Sdisj2qubpc5UGJmo+W49ifVmzL8HcpGhQPvZCUKiCliIhEN0tr2OCqHuSA8gwQ/92MkU7gxEmeVqGrTTgpxPXbUrtGWYus0I9thRIraagRQUIDf7Qn4yZhKRiFQIyhfMfUr3yblokVWSJ6k8xSnc7eNN/RjowfCYiFoDUFer1S3gW6JiJ8Nt30EMbEhU+vzSIztuRYjRLsR8IHLjlf7HZ+MrWWEXxNmbvapt4jGSqZRYSkGUetSNTPzHsui5YMQ2ajJUNks6mw4wT54Ok2ShnzzIPCUGshzawCRKy5FqvrTZe0RWzQGvw79m67XZjKmxJrLsICjtZa55gxXy+6F4sYsEtxTqhXdRTLC8ulSDaWoCLsolfN+8YUhOsJV709H7Cudr0LlVEtzqBcN+shEyThdR941OnAbF8pirKJqXyupTRTtQSReiVmXW1j7oBErB0d9xM2WEd5J9ZKYtuR4WKwwBSoORbpGrJ5ZI9lt71irJmGX1px0JYE26uNErawr2zfIcP4OHEKXm66PA3wjpCNEfpJunI4muifPjKvsFCkGjExTq63yxMJsZNMYF/J4HmDC5A3Yq36jy0ClePHVhwuu/b1HSFlEfHD5ZtD1bEK44Qu1mWys6tbWmZyPWckzlPTGiRw/XHCuk+q4Rek+mVrVL/UppwrdDEGNV2kpyuhccgc5Oxm9vWnn+19vJrVpLor0kTUrGacMplb1CfOFyTD4o9uNrHqr2Z+ZMSp1c2XcVSORnh9Q81q3k599ETgkNnjg0nGzi10K7rX+bZpHbrblPcY5A4Zxk2xcjzCvTpd9027Aa0QtouyyrKFRR6D/04DwkFGvHPXM3Qda/Jb4nPgI7hQLVM1q5HIBt2MzQNa57Z1DiiLAGa5Mi+O4Sz3Mpp6laPHO6InII3ITnX1QtI+EOX+m9ZxleOZ/j9PiuKoLi3aqXPuEoSye/Vhkm+LalbLtHhMS0R6zu7aZ3vP2jOjL7QVv4McxhcDnZIelAQibGIbULOapf3PuE1Vs9qeaOTdkVKr00gCQiw4NlBzDvf1Lxx+uP5r3Dgv5KQZRzWn+GRwz8jmDS8itUg7iB6vLuJCF5Uty4A9mVKkFR6MiJDachST/oHvHgD+B4SoUIitpF05AAAAAElFTkSuQmCC') + '" alt="' + tarteaucitron.lang.icon + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.icon + ' ' + tarteaucitron.lang.modalWindow + '">';
662                    html += '   </button>';
663                    html += '</div>';
664                }
665
666                if (tarteaucitron.parameters.showAlertSmall === true) {
667                    html += '<div id="tarteaucitronAlertSmall" class="tarteaucitronAlertSmall' + orientation + '">';
668                    html += '   <button type="button" id="tarteaucitronManager" aria-label="' + tarteaucitron.lang.alertSmall + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.alertSmall + ' ' + tarteaucitron.lang.modalWindow + '">';
669                    html += '       ' + tarteaucitron.lang.alertSmall;
670                    html += '       <span id="tarteaucitronDot">';
671                    html += '           <span id="tarteaucitronDotGreen"></span>';
672                    html += '           <span id="tarteaucitronDotYellow"></span>';
673                    html += '           <span id="tarteaucitronDotRed"></span>';
674                    html += '       </span>';
675                    if (tarteaucitron.parameters.cookieslist === true) {
676                        html += '   </button><!-- @whitespace';
677                        html += '   --><button type="button" id="tarteaucitronCookiesNumber" aria-expanded="false" aria-controls="tarteaucitronCookiesListContainer">0</button>';
678                        html += '   <div id="tarteaucitronCookiesListContainer">';
679                        if (tarteaucitron.reloadThePage) {
680                            html += '       <button type="button" id="tarteaucitronClosePanelCookie" aria-label="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')" title="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')">';
681                        } else {
682                            html += '       <button type="button" id="tarteaucitronClosePanelCookie">';
683                        }
684                        html += '           ' + tarteaucitron.lang.close;
685                        html += '       </button>';
686                        html += '       <div class="tarteaucitronCookiesListMain" id="tarteaucitronCookiesTitle">';
687                        html += '            <span class="tarteaucitronH2" role="heading" aria-level="
vendor: 8,780 bytes, lines 687-844
6872" id="tarteaucitronCookiesNumberBis">0 cookie</span>';
688                        html += '       </div>';
689                        html += '       <div id="tarteaucitronCookiesList"></div>';
690                        html += '    </div>';
691                    } else {
692                        html += '   </div>';
693                    }
694                    html += '</div>';
695                }
696
697                tarteaucitron.addInternalScript(tarteaucitron.cdn + 'advertising' + (useMinifiedJS ? '.min' : '') + '.js', '', function () {
698                    if (tarteaucitronNoAdBlocker === true || tarteaucitron.parameters.adblocker === false) {
699
700                        // create a wrapper container at the same level than tarteaucitron so we can add an aria-hidden when tarteaucitron is opened
701                        /*var wrapper = document.createElement('div');
702                        wrapper.id = "tarteaucitronContentWrapper";
703
704                        while (document.body.firstChild)
705                        {
706                            wrapper.appendChild(document.body.firstChild);
707                        }
708
709                        // Append the wrapper to the body
710                        document.body.appendChild(wrapper);*/
711
712                        div.id = 'tarteaucitronRoot';
713                        if (tarteaucitron.parameters.bodyPosition === 'top') {
714                            // Prepend tarteaucitron: #tarteaucitronRoot first-child of the body for better accessibility
715                            var bodyFirstChild = body.firstChild;
716                            body.insertBefore(div, bodyFirstChild);
717                        }
718                        else {
719                            // Append tarteaucitron: #tarteaucitronRoot last-child of the body
720                            body.appendChild(div, body);
721                        }
722
723                        div.setAttribute('data-nosnippet', 'true');
724                        div.setAttribute('lang', language);
725                        div.setAttribute('role', 'region');
726                        div.setAttribute('aria-labelledby', 'tac_title');
727
728                        div.innerHTML = html;
729
730                        //ie compatibility
731                        var tacRootAvailableEvent;
732                        if(typeof(Event) === 'function') {
733                            tacRootAvailableEvent = new Event("tac.root_available");
734                        }else if (typeof(document.createEvent) === 'function'){
735                            tacRootAvailableEvent = document.createEvent('Event');
736                            tacRootAvailableEvent.initEvent("tac.root_available", true, true);
737                        }
738                        //end ie compatibility
739
740                        if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacRootAvailableEvent);}
741
742                        if (tarteaucitron.job !== undefined) {
743                            tarteaucitron.job = tarteaucitron.cleanArray(tarteaucitron.job);
744                            for (index = 0; index < tarteaucitron.job.length; index += 1) {
745                                tarteaucitron.addService(tarteaucitron.job[index]);
746                            }
747                        } else {
748                            tarteaucitron.job = [];
749                        }
750
751                        if (tarteaucitron.job.length === 0) {
752                            tarteaucitron.userInterface.closeAlert();
753                        }
754
755                        tarteaucitron.isAjax = true;
756
757                        tarteaucitron.job.push = function (id) {
758
759                            // ie <9 hack
760                            if (typeof tarteaucitron.job.indexOf === 'undefined') {
761                                tarteaucitron.job.indexOf = function (obj, start) {
762                                    var i,
763                                        j = this.length;
764                                    for (i = (start || 0); i < j; i += 1) {
765                                        if (this[i] === obj) { return i; }
766                                    }
767                                    return -1;
768                                };
769                            }
770
771                            if (tarteaucitron.job.indexOf(id) === -1) {
772                                Array.prototype.push.call(this, id);
773                            }
774                            tarteaucitron.launch[id] = false;
775                            tarteaucitron.addService(id);
776                        };
777
778                        if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
779                            tarteaucitron.userInterface.openPanel();
780                        }
781
782                        tarteaucitron.cookie.number();
783                        setInterval(tarteaucitron.cookie.number, 60000);
784                    }
785                }, tarteaucitron.parameters.adblocker);
786
787                if (tarteaucitron.parameters.adblocker === true) {
788                    setTimeout(function () {
789                        if (tarteaucitronNoAdBlocker === false) {
790                            html = '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + ' tarteaucitron-display-block" role="alert" aria-live="polite">';
791                            html += '   <p id="tarteaucitronDisclaimerAlert">';
792                            html += '       ' + tarteaucitron.lang.adblock + '<br/>';
793                            html += '       <strong>' + tarteaucitron.lang.adblock_call + '</strong>';
794                            html += '   </p>';
795                            html += '   <button type="button" class="tarteaucitronCTAButton" id="tarteaucitronCTAButton">';
796                            html += '       ' + tarteaucitron.lang.reload;
797                            html += '   </button>';
798                            html += '</div>';
799                            html += '<div role="heading" aria-level="1" id="tac_title" class="tac_visually-hidden">' + tarteaucitron.lang.title + '</div>';
800                            html += '<div id="tarteaucitronPremium"></div>';
801
802                            div.id = 'tarteaucitronRoot';
803                            if (tarteaucitron.parameters.bodyPosition === 'top') {
804                                // Prepend tarteaucitron: #tarteaucitronRoot first-child of the body for better accessibility
805                                var bodyFirstChild = body.firstChild;
806                                body.insertBefore(div, bodyFirstChild);
807                            }
808                            else {
809                                // Append tarteaucitron: #tarteaucitronRoot last-child of the body
810                                body.appendChild(div, body);
811                            }
812
813                            div.setAttribute('data-nosnippet', 'true');
814                            div.setAttribute('lang', language);
815                            div.setAttribute('role', 'region');
816                            div.setAttribute('aria-labelledby', 'tac_title');
817
818                            div.innerHTML = html;
819                        }
820                    }, 1500);
821                }
822                if(tarteaucitron.parameters.closePopup === true){
823                    setTimeout(function() {
824                        var closeElement = document.getElementById('tarteaucitronAlertBig'),
825                            closeButton = document.createElement('button');
826                        if (closeElement) {
827                            closeButton.innerHTML = '<span aria-hidden="true">X</span><span class="tac_visually-hidden">' + tarteaucitron.lang.closeBanner + '</span>';
828                            closeButton.setAttribute('id', 'tarteaucitronCloseCross');
829                            closeElement.insertAdjacentElement('beforeend', closeButton);
830                        }
831                    }, 100);
832                }
833
834                if(tarteaucitron.parameters.groupServices === true) {
835                    var tac_group_style = document.createElement('style');
836                    tac_group_style.innerHTML = '.tarteaucitronTitle{display:none}';
837                    document.head.appendChild(tac_group_style);
838                    var cats = document.querySelectorAll('[id^="tarteaucitronServicesTitle_"]')
839                    Array.prototype.forEach.call(cats, function(item) {
840                        var cat = item.getAttribute('id').replace(/^(tarteaucitronServicesTitle_)/, "");
841                        if (cat !== "mandatory") {
842                            var html = '';
843                            html += '<li  class="tarteaucitronLine">';
844                            html += '   <div class="tarteaucitronName">';
845                            html += '       <span class="tarteaucitronH3" role="heading" aria-level="2">'+tarteaucitron.lang[cat].title+'</span>';
846                            html += '       <span>'+tarteaucitron.lang[cat].details+'</span>';
847                            html += '   <button type="button" aria-expanded="false" class="tarteaucitron-toggle-group" id="tarteaucitron-toggle-group-'+cat+'">'+tarteaucitron.lang.alertSmall+' ('+document.getElementById("tarteaucitronServices_"+cat).childElementCount+')</button>';
848                            html += '   </div>';
849                            html += '   <div class="tarteaucitronAsk" id="tarteaucitron-group-'+cat+'">';
850                            html += '       <button type="button" aria-label="' + tarteaucitron.lang.allow + ' ' + tarteaucitron.lang[cat].title + '" class="tarteaucitronAllow" id="tarteaucitron-accept-group-'+cat+'">';
851                            html += '           <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allow;
852                            html += '       </button> ';
853                            html += '       <button type="button" aria-label="' + tarteaucitron.lang.deny + ' ' + tarteaucitron.lang[cat].title + '" class="tarteaucitronDeny" id="tarteaucitron-reject-group-'+cat+'">';
854                            html += '           <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.deny;
855                            html += '       </button>';
856                            html += '   </div>';
857                            html += '</li>';
858                            var ul = document.createElement('ul');
859                            ul.innerHTML = html;
860                            item.insertBefore(ul, item.querySelector('#tarteaucitronServices_'+cat+''));
861                            document.querySelector('#tarteaucitronServices_' + cat).style.display = 'none';
862                            tarteaucitron.addClickEventToId("tarteaucitron-toggle-group-" + cat, function () {
863                                tarteaucitron.userInterface.toggle('tarteaucitronServices_' + cat);
864                               if (document.getElementById('tarteaucitronServices_' + cat).style.display == 'block') {
865                                    tarteaucitron.userInterface.addClass('tarteaucitronServicesTitle_' + cat, 'tarteaucitronIsExpanded');
866                                    document.getElementById('tarteaucitron-toggle-group-'+cat).setAttribute('aria-expanded', 'true');
867                                } else {
868                                    tarteaucitron.userInterface.removeClass('tarteaucitronServicesTitle_' + cat, 'tarteaucitronIsExpanded');
869                                    document.getElementById('tarteaucitron-toggle-group-'+cat).setAttribute('aria-expanded', 'false');
870                                }
871                                //tarteaucitron.initEvents.resizeEvent();
872                            });
873                            tarteaucitron.addClickEventToId("tarteaucitron-accept-group-" + cat, function () {
874                                tarteaucitron.userInterface.respondAll(true, cat);
875                            });
876                            tarteaucitron.addClickEventToId("tarteaucitron-reject-group-" + cat, function () {
877                                tarteaucitron.userInterface.respondAll(false, cat);
878                            });
879                        }
880                    });
881                }
882
883                // add info about the services on the main banner
884                if (tarteaucitron.parameters.partnersList === true && (tarteaucitron.parameters.orientation === "middle" || tarteaucitron.parameters.orientation === "popup")) {
885                    setTimeout(function() {
886                        var liPartners = "";
887                        var tarteaucitronPartnersCat = [];
888                        tarteaucitron.job.forEach(function (id) {
889                            if (tarteaucitronPartnersCat[tarteaucitron.services[id].type] === undefined) {
890                                tarteaucitronPartnersCat[tarteaucitron.services[id].type] = true;
891                                liPartners += "<li>" + tarteaucitron.lang[tarteaucitron.services[id].type].title + "</li>";
892                            }
893                        });
894                        var tacPartnersInfoParent = document.getElementById('tarteaucitronDisclaimerAlert');
895                        if (tacPartnersInfoParent !== null) {
896                            tacPartnersInfoParent.insertAdjacentHTML('beforeend', '<div class="tarteaucitronPartnersList"><b>
896' + tarteaucitron.lang.ourpartners + ' (' + tarteaucitron.job.length + ')</b> <ul>' + liPartners + '</ul></div>');
897                        }
898                    }, 100);
899                }
900
901                // add a save button
902                setTimeout(function() {
903                    var tacSaveButtonParent = document.getElementById('tarteaucitronServices');
904                    if (tacSaveButtonParent !== null) {
905                        tacSaveButtonParent.insertAdjacentHTML('beforeend', '<div id="tarteaucitronSave"><button class="tarteaucitronAllow" id="tarteaucitronSaveButton">' + tarteaucitron.lang.save + '</button></div>');
906                    }
907                }, 100);
908
909                tarteaucitron.userInterface.color("", true);
910
911                // add a little timeout to be sure everything is accessible
912                setTimeout(function () {
913
914                    // Setup events
915                    tarteaucitron.addClickEventToId("tarteaucitronCloseCross", function () {
916                        tarteaucitron.userInterface.closeAlert();
917                    });
918                    tarteaucitron.addClickEventToId("tarteaucitronPersonalize", function () {
919                        tarteaucitron.userInterface.openPanel();
920                    });
921                    tarteaucitron.addClickEventToId("tarteaucitronPersonalize2", function () {
922                        tarteaucitron.userInterface.respondAll(true);
923                    });
924                    tarteaucitron.addClickEventToId("tarteaucitronManager", function () {
925                        tarteaucitron.userInterface.openPanel();
926                    });
927                    tarteaucitron.addClickEventToId("tarteaucitronBack", function () {
928                        tarteaucitron.userInterface.closePanel();
929                    });
930                    tarteaucitron.addClickEventToId("tarteaucitronClosePanel", function () {
931                        tarteaucitron.userInterface.closePanel();
932                    });
933                    tarteaucitron.addClickEventToId("tarteaucitronClosePanelCookie", function () {
934                        tarteaucitron.userInterface.closePanel();
935                    });
936                    tarteaucitron.addClickEventToId("tarteaucitronPrivacyUrl", function () {
937                        document.location = tarteaucitron.parameters.privacyUrl;
938                    });
939                    tarteaucitron.addClickEventToId("tarteaucitronPrivacyUrlDialog", function () {
940                        document.location = tarteaucitron.parameters.privacyUrl;
941                    });
942                    tarteaucitron.addClickEventToId("tarteaucitronCookiesNumber", function () {
943                        tarteaucitron.userInterface.toggleCookiesList();
944                    });
945                    tarteaucitron.addClickEventToId("tarteaucitronAllAllowed", function () {
946                        tarteaucitron.userInterface.respondAll(true);
947                    });
948                    tarteaucitron.addClickEventToId("tarteaucitronAllDenied", function () {
949                        tarteaucitron.userInterface.respondAll(false);
950                    });
951                    tarteaucitron.addClickEventToId("tarteaucitronAllDenied2", function () {
952                        tarteaucitron.userInterface.respondAll(false, '', true);
953                        if (tarteaucitron.reloadThePage === true) {
954                            window.location.reload();
955                        }
956                    });
957                    tarteaucitron.addClickEventToId("tarteaucitronCloseAlert", function () {
vendor: 38,985 bytes, lines 958-1726
958                        tarteaucitron.userInterface.openPanel();
959                    });
960                    tarteaucitron.addClickEventToId("tarteaucitronCTAButton", function () {
961                        location.reload();
962                    });
963                    tarteaucitron.addClickEventToId("tarteaucitronSaveButton", function () {
964                        var timeoutSaveButton = 0;
965                        tarteaucitron.job.forEach(function(id) {
966                            if (tarteaucitron.state[id] !== true && tarteaucitron.state[id] !== false) {
967                                timeoutSaveButton = 500;
968                                tarteaucitron.setConsent(id, false);
969                            }
970                        });
971                        setTimeout(tarteaucitron.userInterface.closePanel, timeoutSaveButton);
972                    });
973                    var toggleBtns = document.getElementsByClassName("catToggleBtn"), i;
974                    for (i = 0; i < toggleBtns.length; i++) {
975                        toggleBtns[i].dataset.index = i;
976                        tarteaucitron.addClickEventToElement(toggleBtns[i], function () {
977                            if(!tarteaucitron.parameters.showDetailsOnClick) return false;
978                            tarteaucitron.userInterface.toggle('tarteaucitronDetails' + cat[this.dataset.index], 'tarteaucitronInfoBox');
979                            if (document.getElementById('tarteaucitronDetails' + cat[this.dataset.index]).style.display === 'block') {
980                                this.setAttribute('aria-expanded', 'true');
981                            } else {
982                                this.setAttribute('aria-expanded', 'false');
983                            }
984                            return false;
985                        });
986                    }
987
988                    // accessibility: on click on "Allow" in the site (not in TAC module), move focus to the loaded service's parent 
989                    var allowBtnsInSite = document.querySelectorAll(".tac_activate .tarteaucitronAllow");
990                    for (i = 0; i < allowBtnsInSite.length; i++) {
991                        tarteaucitron.addClickEventToElement(allowBtnsInSite[i], function () {
992                            if(this.closest('.tac_activate') !== null && this.closest('.tac_activate').parentNode !== null) {
993                                this.closest('.tac_activate').parentNode.setAttribute("tabindex", "-1");
994                                this.closest('.tac_activate').parentNode.focus();
995                            }
996                        });
997                    }
998
999                    var allowBtns = document.getElementsByClassName("tarteaucitronAllow");
1000                    for (i = 0; i < allowBtns.length; i++) {
1001                        tarteaucitron.addClickEventToElement(allowBtns[i], function () {
1002                            tarteaucitron.userInterface.respond(this, true);
1003                        });
1004                    }
1005                    var denyBtns = document.getElementsByClassName("tarteaucitronDeny");
1006                    for (i = 0; i < denyBtns.length; i++) {
1007                        tarteaucitron.addClickEventToElement(denyBtns[i], function () {
1008                            tarteaucitron.userInterface.respond(this, false);
1009                        });
1010                    }
1011                    if(tarteaucitron.events.load) {
1012                        tarteaucitron.events.load();
1013                    }
1014                }, 500);
1015
1016            });
1017        });
1018    },
1019    "addService": function (serviceId) {
1020        "use strict";
1021        var html = '',
1022            s = tarteaucitron.services,
1023            service = s[serviceId];
1024
1025        if (tarteaucitron.parameters.alwaysNeedConsent === true) {
1026            service.needConsent = true;
1027        }
1028
1029        var cookie = tarteaucitron.cookie.read(),
1030            hostname = document.location.hostname,
1031            hostRef = document.referrer.split('/')[2],
1032            isNavigating = (hostRef === hostname && window.location.href !== tarteaucitron.parameters.privacyUrl),
1033            isAutostart = (!service.needConsent),
1034            isWaiting = (cookie.indexOf(service.key + '=wait') >= 0),
1035            isDenied = (cookie.indexOf(service.key + '=false') >= 0),
1036            isAllowed = ((cookie.indexOf(service.key + '=true') >= 0) || (!service.needConsent && cookie.indexOf(service.key + '=false') < 0)),
1037            isResponded = (cookie.indexOf(service.key + '=false') >= 0 || cookie.indexOf(service.key + '=true') >= 0),
1038            isDNTRequested = (navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1" || window.doNotTrack === "1"),
1039            currentStatus = (isAllowed) ? tarteaucitron.lang.allowed : tarteaucitron.lang.disallowed,
1040            state = (undefined !== service.defaultState) ? service.defaultState :
1041                    (undefined !== tarteaucitron.parameters.serviceDefaultState ? tarteaucitron.parameters.serviceDefaultState : 'wait');
1042
1043
1044        if (tarteaucitron.added[service.key] !== true) {
1045            tarteaucitron.added[service.key] = true;
1046
1047            html += '<li id="' + service.key + 'Line" class="tarteaucitronLine">';
1048            html += '   <div class="tarteaucitronName">';
1049            html += '       <span class="tarteaucitronH3" role="heading" aria-level="3">' + service.name + '</span>';
1050            html += '       <div class="tarteaucitronStatusInfo">';
1051            html += '          <span class="tacCurrentStatus" id="tacCurrentStatus' + service.key + '">'+currentStatus+'</span>';
1052            html += '          <span class="tarteaucitronReadmoreSeparator"> - </span>';
1053            html += '          <span id="tacCL' + service.key + '" class="tarteaucitronListCookies"></span>';
1054            html += '       </div>';
1055            if (tarteaucitron.parameters.moreInfoLink == true) {
1056
1057                var link = 'https://tarteaucitron.io/service/' + service.key + '/';
1058                if (service.readmoreLink !== undefined && service.readmoreLink !== '') {
1059                    link = service.readmoreLink;
1060                }
1061                if (tarteaucitron.parameters.readmoreLink !== undefined && tarteaucitron.parameters.readmoreLink !== '') {
1062                    link = tarteaucitron.parameters.readmoreLink;
1063                }
1064                html += '       <a href="' + link + '" target="_blank" rel="noreferrer noopener nofollow" title="' + tarteaucitron.lang.more + ' : '+ tarteaucitron.lang.cookieDetail + ' ' + service.name + ' ' + tarteaucitron.lang.ourSite + ' ' + tarteaucitron.lang.newWindow +'" class="tarteaucitronReadmoreInfo">' + tarteaucitron.lang.more + '</a>';
1065                html += '       <span class="tarteaucitronReadmoreSeparator"> - </span>';
1066                html += '       <a href="' + service.uri + '" target="_blank" rel="noreferrer noopener" title="' + tarteaucitron.lang.source + ' ' + service.name + ' ' + tarteaucitron.lang.newWindow + '" class="tarteaucitronReadmoreOfficial">' + tarteaucitron.lang.source + '</a>';
1067            }
1068
1069            html += '   </div>';
1070            html += '   <div class="tarteaucitronAsk">';
1071            html += '       <button type="button" aria-label="' + tarteaucitron.lang.allow + ' ' + service.name + '" id="' + service.key + 'Allowed" class="tarteaucitronAllow">';
1072            html += '           <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allow;
1073            html += '       </button> ';
1074            html += '       <button type="button" aria-label="' + tarteaucitron.lang.deny + ' ' + service.name + '" id="' + service.key + 'Denied" class="tarteaucitronDeny">';
1075            html += '           <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.deny;
1076            html += '       </button>';
1077            html += '   </div>';
1078            html += '</li>';
1079
1080            tarteaucitron.userInterface.css('tarteaucitronServicesTitle_' + service.type, 'display', 'block');
1081
1082            if (document.getElementById('tarteaucitronServices_' + service.type) !== null) {
1083                document.getElementById('tarteaucitronServices_' + service.type).innerHTML += html;
1084            }
1085
1086            tarteaucitron.userInterface.css('tarteaucitronNoServicesTitle', 'display', 'none');
1087
1088            tarteaucitron.userInterface.order(service.type);
1089
1090            tarteaucitron.addClickEventToId(service.key + 'Allowed', function () {
1091                tarteaucitron.userInterface.respond(this, true);
1092            });
1093
1094            tarteaucitron.addClickEventToId(service.key + 'Denied', function () {
1095                tarteaucitron.userInterface.respond(this, false);
1096            });
1097        }
1098
1099        tarteaucitron.pro('!' + service.key + '=' + isAllowed);
1100
1101        // allow by default for non EU
1102        if (isResponded === false && tarteaucitron.user.bypass === true) {
1103            isAllowed = true;
1104            tarteaucitron.cookie.create(service.key, true);
1105        }
1106
1107        if ((!isResponded && (isAutostart || (isNavigating && isWaiting)) && !tarteaucitron.highPrivacy) || isAllowed) {
1108            if (!isAllowed || (!service.needConsent && cookie.indexOf(service.key + '=false') < 0)) {
1109                tarteaucitron.cookie.create(service.key, true);
1110            }
1111            if (tarteaucitron.launch[service.key] !== true) {
1112                tarteaucitron.launch[service.key] = true;
1113                if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) { service.js(); }
1114                tarteaucitron.sendEvent(service.key + '_loaded');
1115            }
1116            tarteaucitron.state[service.key] = true;
1117            tarteaucitron.userInterface.color(service.key, true);
1118        } else if (isDenied) {
1119            if (typeof service.fallback === 'function') {
1120                if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) { service.fallback(); }
1121            }
1122            tarteaucitron.state[service.key] = false;
1123            tarteaucitron.userInterface.color(service.key, false);
1124        } else if (!isResponded && isDNTRequested && tarteaucitron.handleBrowserDNTRequest) {
1125            tarteaucitron.cookie.create(service.key, 'false');
1126            if (typeof service.fallback === 'function') {
1127                if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) { service.fallback(); }
1128            }
1129            tarteaucitron.state[service.key] = false;
1130            tarteaucitron.userInterface.color(service.key, false);
1131        } else if (!isResponded) {
1132            tarteaucitron.cookie.create(service.key, state);
1133            if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) {
1134                if(true === state && typeof service.js === 'function') {
1135                    service.js();
1136                } else if (typeof service.fallback === 'function') {
1137                    service.fallback();
1138                }
1139            }
1140
1141            if (true === state) {
1142                tarteaucitron.sendEvent(service.key + '_loaded');
1143            }
1144
1145            if (true === state || false === state) {
1146                tarteaucitron.state[service.key] = state;
1147            }
1148            tarteaucitron.userInterface.color(service.key, state);
1149
1150            if( 'wait' === state ) {
1151                tarteaucitron.userInterface.openAlert();
1152            }
1153        }
1154
1155        tarteaucitron.cookie.checkCount(service.key);
1156        tarteaucitron.sendEvent(service.key + '_added');
1157    },
1158    "sendEvent" : function(event_key) {
1159        if(event_key !== undefined) {
1160            //ie compatibility
1161            var send_event_item;
1162            if(typeof(Event) === 'function') {
1163                send_event_item = new Event(event_key);
1164            }else if (typeof(document.createEvent) === 'function'){
1165                send_event_item = document.createEvent('Event');
1166                send_event_item.initEvent(event_key, true, true);
1167            }
1168            //end ie compatibility
1169
1170            document.dispatchEvent(send_event_item);
1171        }
1172    },
1173    "cleanArray": function cleanArray(arr) {
1174        "use strict";
1175        var i,
1176            len = arr.length,
1177            out = [],
1178            obj = {},
1179            s = tarteaucitron.services;
1180
1181        for (i = 0; i < len; i += 1) {
1182            if (!obj[arr[i]]) {
1183                obj[arr[i]] = {};
1184                if (tarteaucitron.services[arr[i]] !== undefined) {
1185                    out.push(arr[i]);
1186                }
1187            }
1188        }
1189
1190        out = out.sort(function (a, b) {
1191            if (s[a].type + s[a].key > s[b].type + s[b].key) { return 1; }
1192            if (s[a].type + s[a].key < s[b].type + s[b].key) { return -1; }
1193            return 0;
1194        });
1195
1196        return out;
1197    },
1198    "setConsent": function (id, status) {
1199        if (status === true) {
1200            tarteaucitron.userInterface.respond(document.getElementById(id + 'Allowed'), true);
1201        } else if (status === false) {
1202            tarteaucitron.userInterface.respond(document.getElementById(id + 'Denied'), false);
1203        }
1204    },
1205    "userInterface": {
1206        "css": function (id, property, value) {
1207            "use strict";
1208            if (document.getElementById(id) !== null) {
1209
1210                if (property == "display" && value == "none" && (id == "tarteaucitron" || id == "tarteaucitronBack" || id == "tarteaucitronAlertBig")) {
1211                    document.getElementById(id).style["opacity"] = "0";
1212
1213                    /*setTimeout(function() {*/document.getElementById(id).style[property] = value;/*}, 200);*/
1214                } else {
1215
1216                    document.getElementById(id).style[property] = value;
1217
1218                    if (property == "display" && value == "block" && (id == "tarteaucitron" || id == "tarteaucitronAlertBig")) {
1219                        document.getElementById(id).style["opacity"] = "1";
1220                    }
1221
1222                    if (property == "display" && value == "block" && id == "tarteaucitronBack") {
1223                        document.getElementById(id).style["opacity"] = "0.7";
1224                    }
1225
1226                    if (property == "display" && value == "block" && id == "tarteaucitronAlertBig" && (tarteaucitron.parameters.orientation == "middle"|| tarteaucitron.parameters.orientation == "popup")) {
1227                        tarteaucitron.userInterface.focusTrap('tarteaucitronAlertBig');
1228                    }
1229                }
1230            }
1231        },
1232        "addClass": function (id, className) {
1233            "use strict";
1234            if (document.getElementById(id) !== null && document.getElementById(id).classList !== undefined) {
1235                document.getElementById(id).classList.add(className);
1236            }
1237        },
1238        "removeClass": function (id, className) {
1239            "use strict";
1240            if (document.getElementById(id) !== null && document.getElementById(id).classList !== undefined) {
1241                document.getElementById(id).classList.remove(className);
1242            }
1243        },
1244        "respondAll": function (status, type, allowSafeAnalytics) {
1245            "use strict";
1246            var s = tarteaucitron.services,
1247                service,
1248                key,
1249                index = 0;
1250
1251            for (index = 0; index < tarteaucitron.job.length; index += 1) {
1252
1253                if (typeof type !== 'undefined' && type !== '' && s[tarteaucitron.job[index]].type !== type) {
1254                    continue;
1255                }
1256
1257                if (allowSafeAnalytics && typeof s[tarteaucitron.job[index]].safeanalytic !== "undefined" && s[tarteaucitron.job[index]].safeanalytic === true) {
1258                    continue;
1259                }
1260
1261                service = s[tarteaucitron.job[index]];
1262                key = service.key;
1263                if (tarteaucitron.state[key] !== status) {
1264                    if (status === false && tarteaucitron.launch[key] === true) {
1265                        tarteaucitron.reloadThePage = true;
1266                        if (tarteaucitron.checkIfExist('tarteaucitronClosePanel')) {
1267                            var ariaCloseValue = document.getElementById('tarteaucitronClosePanel').textContent.trim() + ' (' + tarteaucitron.lang.reload + ')';
1268                            document.getElementById('tarteaucitronClosePanel').setAttribute("aria-label", ariaCloseValue);
1269                            document.getElementById('tarteaucitronClosePanel').setAttribute("title", ariaCloseValue);
1270                        }
1271                    }
1272                    if (tarteaucitron.launch[key] !== true && status === true) {
1273
1274                        tarteaucitron.pro('!' + key + '=engage');
1275
1276                        tarteaucitron.launch[key] = true;
1277                        if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + key + "_") < 0) { tarteaucitron.services[key].js(); }
1278                        tarteaucitron.sendEvent(key + '_loaded');
1279                    }
1280                    var itemStatusElem = document.getElementById('tacCurrentStatus'+key);
1281                    tarteaucitron.state[key] = status;
1282                    tarteaucitron.cookie.create(key, status);
1283                    tarteaucitron.userInterface.color(key, status);
1284                    if (status == true) {
1285                        itemStatusElem.innerHTML = tarteaucitron.lang.allowed;
1286                        tarteaucitron.sendEvent(key + '_allowed');
1287                    } else {
1288                        itemStatusElem.innerHTML = tarteaucitron.lang.disallowed;
1289                        tarteaucitron.sendEvent(key + '_disallowed');
1290                    }
1291                }
1292            }
1293        },
1294        "respond": function (el, status) {
1295            "use strict";
1296            if (el.id === '') {
1297                return;
1298            }
1299            var key = el.id.replace(new RegExp("(Eng[0-9]+|Allow|Deni)ed", "g"), '');
1300
1301            if (key.substring(0, 13) === 'tarteaucitron' || key === '') {return;}
1302
1303            // return if same state
1304            if (tarteaucitron.state[key] === status) {
1305                return;
1306            }
1307
1308            if (status === false && tarteaucitron.launch[key] === true) {
1309                tarteaucitron.reloadThePage = true;
1310                if (tarteaucitron.checkIfExist('tarteaucitronClosePanel')) {
1311                    var ariaCloseValue = document.getElementById('tarteaucitronClosePanel').textContent.trim() + ' (' + tarteaucitron.lang.reload + ')';
1312                    document.getElementById('tarteaucitronClosePanel').setAttribute("aria-label", ariaCloseValue);
1313                    document.getElementById('tarteaucitronClosePanel').setAttribute("title", ariaCloseValue);
1314                }
1315            }
1316
1317            // if not already launched... launch the service
1318            if (status === true) {
1319                if (tarteaucitron.launch[key] !== true) {
1320
1321                    tarteaucitron.pro('!' + key + '=engage');
1322
1323                    tarteaucitron.launch[key] = true;
1324                    if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + key + "_") < 0) { tarteaucitron.services[key].js(); }
1325                    tarteaucitron.sendEvent(key + '_loaded');
1326                }
1327            }
1328            var itemStatusElem = document.getElementById('tacCurrentStatus'+key);
1329            tarteaucitron.state[key] = status;
1330            tarteaucitron.cookie.create(key, status);
1331            tarteaucitron.userInterface.color(key, status);
1332            if (status == true) {
1333                itemStatusElem.innerHTML = tarteaucitron.lang.allowed;
1334                tarteaucitron.sendEvent(key + '_allowed');
1335            } else {
1336                itemStatusElem.innerHTML = tarteaucitron.lang.disallowed;
1337                tarteaucitron.sendEvent(key + '_disallowed');
1338            }
1339        },
1340        "color": function (key, status) {
1341            "use strict";
1342            var c = 'tarteaucitron',
1343                nbDenied = 0,
1344                nbPending = 0,
1345                nbAllowed = 0,
1346                sum = tarteaucitron.job.length,
1347                index,
1348                s = tarteaucitron.services;
1349
1350            if (key !== "") {
1351
1352            if (status === true) {
1353                tarteaucitron.userInterface.addClass(key + 'Line', 'tarteaucitronIsAllowed');
1354                tarteaucitron.userInterface.removeClass(key + 'Line', 'tarteaucitronIsDenied');
1355                document.getElementById(key + 'Allowed').setAttribute('aria-pressed', 'true');
1356                document.getElementById(key + 'Denied').setAttribute('aria-pressed', 'false');
1357            } else if (status === false) {
1358                tarteaucitron.userInterface.removeClass(key + 'Line', 'tarteaucitronIsAllowed');
1359                tarteaucitron.userInterface.addClass(key + 'Line', 'tarteaucitronIsDenied');
1360                document.getElementById(key + 'Allowed').setAttribute('aria-pressed', 'false');
1361                document.getElementById(key + 'Denied').setAttribute('aria-pressed', 'true');
1362            } else {
1363                document.getElementById(key + 'Allowed').setAttribute('aria-pressed', 'false');
1364                document.getElementById(key + 'Denied').setAttribute('aria-pressed', 'false');
1365            }
1366
1367            // check if all services are allowed
1368            var sumToRemove = 0;
1369            for (index = 0; index < sum; index += 1) {
1370
1371                if (typeof s[tarteaucitron.job[index]].safeanalytic !== "undefined" && s[tarteaucitron.job[index]].safeanalytic === true) {
1372                    sumToRemove += 1;
1373                    continue;
1374                }
1375
1376                if (tarteaucitron.state[tarteaucitron.job[index]] === false) {
1377                    nbDenied += 1;
1378                } else if (tarteaucitron.state[tarteaucitron.job[index]] === undefined) {
1379                    nbPending += 1;
1380                } else if (tarteaucitron.state[tarteaucitron.job[index]] === true) {
1381                    nbAllowed += 1;
1382                }
1383            }
1384            sum -= sumToRemove;
1385
1386            tarteaucitron.userInterface.css(c + 'DotGreen', 'width', ((100 / sum) * nbAllowed) + '%');
1387            tarteaucitron.userInterface.css(c + 'DotYellow', 'width', ((100 / sum) * nbPending) + '%');
1388            tarteaucitron.userInterface.css(c + 'DotRed', 'width', ((100 / sum) * nbDenied) + '%');
1389
1390            if (nbDenied === 0 && nbPending === 0) {
1391                tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected');
1392                tarteaucitron.userInterface.addClass(c + 'AllAllowed', c + 'IsSelected');
1393
1394                tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsAllowed');
1395                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied');
1396
1397                document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'false');
1398                document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'true');
1399
1400            } else if (nbAllowed === 0 && nbPending === 0) {
1401                tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected');
1402                tarteaucitron.userInterface.addClass(c + 'AllDenied', c + 'IsSelected');
1403
1404                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed');
1405                tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsDenied');
1406
1407                document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'true');
1408                document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'false');
1409
1410            } else {
1411                tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected');
1412                tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected');
1413
1414                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed');
1415                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied');
1416
1417                document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'false');
1418                document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'false');
1419            }
1420
1421            // close the alert if all service have been reviewed
1422            if (nbPending === 0) {
1423                tarteaucitron.userInterface.closeAlert();
1424            }
1425
1426            if (tarteaucitron.services[key].cookies.length > 0 && status === false) {
1427                tarteaucitron.cookie.purge(tarteaucitron.services[key].cookies);
1428            }
1429
1430            if (status === true) {
1431                if (document.getElementById('tacCL' + key) !== null) {
1432                    document.getElementById('tacCL' + key).innerHTML = '...';
1433                }
1434                setTimeout(function () {
1435                    tarteaucitron.cookie.checkCount(key);
1436                }, 2500);
1437            } else {
1438                tarteaucitron.cookie.checkCount(key);
1439            }
1440
1441            }
1442
1443	    // groups
1444            var cats = document.querySelectorAll('[id^="tarteaucitronServicesTitle_"]')
1445            Array.prototype.forEach.call(cats, function(item) {
1446                var cat = item.getAttribute('id').replace(/^(tarteaucitronServicesTitle_)/, ""),
1447                    total = document.getElementById("tarteaucitronServices_"+cat).childElementCount;
1448                var doc = document.getElementById("tarteaucitronServices_"+cat),
1449                    groupdenied = 0,
1450                    groupallowed = 0;
1451                for (var ii = 0; ii < doc.children.length; ii++) {
1452                    if (doc.children[ii].className == "tarteaucitronLine tarteaucitronIsDenied") {
1453                        groupdenied++;
1454                    }
1455                    if (doc.children[ii].className == "tarteaucitronLine tarteaucitronIsAllowed") {
1456                        groupallowed++;
1457                    }
1458                }
1459                if (total === groupallowed) {
1460                    tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied');
1461                    tarteaucitron.userInterface.addClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed');
1462
1463                    if (document.getElementById('tarteaucitron-reject-group-'+cat)) {
1464                        document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'false');
1465                        document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'true');
1466                    }
1467                }
1468                if (total === groupdenied) {
1469                    tarteaucitron.userInterface.addClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied');
1470                    tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed');
1471
1472                    if (document.getElementById('tarteaucitron-reject-group-'+cat)) {
1473                        document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'true');
1474                        document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'false');
1475                    }
1476                }
1477                if (total !== groupdenied && total !== groupallowed) {
1478                    tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied');
1479                    tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed');
1480
1481                    if (document.getElementById('tarteaucitron-reject-group-'+cat)) {
1482                        document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'false');
1483                        document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'false');
1484                    }
1485                }
1486                groupdenied = 0;
1487                groupallowed = 0;
1488            });
1489
1490        },
1491        "openPanel": function () {
1492            "use strict";
1493
1494            tarteaucitron.userInterface.css('tarteaucitron', 'display', 'block');
1495            tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block');
1496            tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none');
1497
1498            document.getElementById('tarteaucitronClosePanel').focus();
1499            if (document.getElementsByTagName('body')[0].classList !== undefined) {
1500                document.getElementsByTagName('body')[0].classList.add('tarteaucitron-modal-open');
1501            }
1502            tarteaucitron.userInterface.focusTrap('tarteaucitron');
1503            tarteaucitron.userInterface.jsSizing('main');
1504
1505            //ie compatibility
1506            var tacOpenPanelEvent;
1507            if(typeof(Event) === 'function') {
1508                tacOpenPanelEvent = new Event("tac.open_panel");
1509            }else if (typeof(document.createEvent) === 'function'){
1510                tacOpenPanelEvent = document.createEvent('Event');
1511                tacOpenPanelEvent.initEvent("tac.open_panel", true, true);
1512            }
1513            //end ie compatibility
1514
1515            if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacOpenPanelEvent);}
1516        },
1517        "closePanel": function () {
1518            "use strict";
1519
1520            if (document.location.hash === tarteaucitron.hashtag) {
1521                if (window.history) {
1522                    window.history.replaceState('', document.title, window.location.pathname + window.location.search);
1523                } else {
1524                    document.location.hash = '';
1525                }
1526            }
1527            if (tarteaucitron.checkIfExist('tarteaucitron')) {
1528                // accessibility: manage focus on close panel
1529                if (tarteaucitron.checkIfExist('tarteaucitronCloseAlert')) {
1530                    document.getElementById('tarteaucitronCloseAlert').focus();
1531                } else if (tarteaucitron.checkIfExist('tarteaucitronManager')) {
1532                    document.getElementById('tarteaucitronManager').focus();
1533                } else if (tarteaucitron.customCloserId && tarteaucitron.checkIfExist(tarteaucitron.customCloserId)) {
1534                    document.getElementById(tarteaucitron.customCloserId).focus();
1535                }
1536                tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
1537            }
1538
1539            if (tarteaucitron.checkIfExist('tarteaucitronCookiesListContainer') && tarteaucitron.checkIfExist('tarteaucitronCookiesNumber')) {
1540                // accessibility: manage focus on close cookies list
1541                document.getElementById('tarteaucitronCookiesNumber').focus();
1542                document.getElementById('tarteaucitronCookiesNumber').setAttribute("aria-expanded", "false");
1543                tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none');
1544            }
1545
1546            tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) {
1547                elem.style.display = 'none';
1548            }, true);
1549
1550            if (tarteaucitron.reloadThePage === true) {
1551                window.location.reload();
1552            } else {
1553                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none');
1554            }
1555            if (document.getElementsByTagName('body')[0].classList !== undefined) {
1556                document.getElementsByTagName('body')[0].classList.remove('tarteaucitron-modal-open');
1557            }
1558
1559            //ie compatibility
1560            var tacClosePanelEvent;
1561            if(typeof(Event) === 'function') {
1562                tacClosePanelEvent = new Event("tac.close_panel");
1563            }else if (typeof(document.createEvent) === 'function'){
1564                tacClosePanelEvent = document.createEvent('Event');
1565                tacClosePanelEvent.initEvent("tac.close_panel", true, true);
1566            }
1567            //end ie compatibility
1568
1569            if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacClosePanelEvent);}
1570        },
1571        "focusTrap": function(parentElement) {
1572            "use strict";
1573
1574            var focusableEls,
1575                firstFocusableEl,
1576                lastFocusableEl,
1577                filtered;
1578
1579            focusableEls = document.getElementById(parentElement).querySelectorAll('a[href], button');
1580            filtered = [];
1581
1582            // get only visible items
1583            for (var i = 0, max = focusableEls.length; i < max; i++) {
1584                if (focusableEls[i].offsetHeight > 0) {
1585                   filtered.push(focusableEls[i]);
1586                }
1587            }
1588
1589            firstFocusableEl = filtered[0];
1590            lastFocusableEl = filtered[filtered.length - 1];
1591
1592            //loop focus inside tarteaucitron
1593            document.getElementById(parentElement).addEventListener("keydown", function (evt) {
1594
1595                if ( evt.key === 'Tab' || evt.keyCode === 9 ) {
1596
1597                    if ( evt.shiftKey ) /* shift + tab */ {
1598                        if (document.activeElement === firstFocusableEl) {
1599                            lastFocusableEl.focus();
1600                            evt.preventDefault();
1601                        }
1602                    } else /* tab */ {
1603                        if (document.activeElement === lastFocusableEl) {
1604                            firstFocusableEl.focus();
1605                            evt.preventDefault();
1606                        }
1607                    }
1608                }
1609            })
1610        },
1611        "openAlert": function () {
1612            "use strict";
1613            var c = 'tarteaucitron';
1614            tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'block');
1615            tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'none');
1616            tarteaucitron.userInterface.css(c + 'Icon', 'display', 'none');
1617            tarteaucitron.userInterface.css(c + 'AlertBig',   'display', 'block');
1618            tarteaucitron.userInterface.addClass(c + 'Root',   'tarteaucitronBeforeVisible');
1619
1620            //ie compatibility
1621            var tacOpenAlertEvent;
1622            if(typeof(Event) === 'function') {
1623                tacOpenAlertEvent = new Event("tac.open_alert");
1624            }else if (typeof(document.createEvent) === 'function'){
1625                tacOpenAlertEvent = document.createEvent('Event');
1626                tacOpenAlertEvent.initEvent("tac.open_alert", true, true);
1627            }
1628            //end ie compatibility
1629
1630            if (document.getElementById('tarteaucitronAlertBig') !== null && tarteaucitron.parameters.orientation === 'middle') {
1631                document.getElementById('tarteaucitronAlertBig').focus();
1632            }
1633
1634            if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacOpenAlertEvent);}
1635        },
1636        "closeAlert": function () {
1637            "use strict";
1638            var c = 'tarteaucitron';
1639            tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'none');
1640            tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'block');
1641            tarteaucitron.userInterface.css(c + 'Icon', 'display', 'block');
1642            tarteaucitron.userInterface.css(c + 'AlertBig',   'display', 'none');
1643            tarteaucitron.userInterface.removeClass(c + 'Root',   'tarteaucitronBeforeVisible');
1644            tarteaucitron.userInterface.jsSizing('box');
1645
1646            //ie compatibility
1647            var tacCloseAlertEvent;
1648            if(typeof(Event) === 'function') {
1649                tacCloseAlertEvent = new Event("tac.close_alert");
1650            }else if (typeof(document.createEvent) === 'function'){
1651                tacCloseAlertEvent = document.createEvent('Event');
1652                tacCloseAlertEvent.initEvent("tac.close_alert", true, true);
1653            }
1654            //end ie compatibility
1655
1656            if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacCloseAlertEvent);}
1657        },
1658        "toggleCookiesList": function () {
1659            "use strict";
1660            var div = document.getElementById('tarteaucitronCookiesListContainer'),
1661                togglediv = document.getElementById('tarteaucitronCookiesNumber');
1662
1663            if (div === null) {
1664                return;
1665            }
1666
1667            if (div.style.display !== 'block') {
1668                tarteaucitron.cookie.number();
1669                div.style.display = 'block';
1670                togglediv.setAttribute("aria-expanded", "true");
1671                tarteaucitron.userInterface.jsSizing('cookie');
1672                tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
1673                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block');
1674                tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) {
1675                    elem.style.display = 'none';
1676                }, true);
1677            } else {
1678                div.style.display = 'none';
1679                togglediv.setAttribute("aria-expanded", "false");
1680                tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
1681                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none');
1682            }
1683        },
1684        "toggle": function (id, closeClass) {
1685            "use strict";
1686            var div = document.getElementById(id);
1687
1688            if (div === null) {
1689                return;
1690            }
1691
1692            if (closeClass !== undefined) {
1693                tarteaucitron.fallback([closeClass], function (elem) {
1694                    if (elem.id !== id) {
1695                        elem.style.display = 'none';
1696                    }
1697                }, true);
1698            }
1699
1700            if (div.style.display !== 'block') {
1701                div.style.display = 'block';
1702            } else {
1703                div.style.display = 'none';
1704            }
1705        },
1706        "order": function (id) {
1707            "use strict";
1708            var main = document.getElementById('tarteaucitronServices_' + id),
1709                allDivs,
1710                store = [],
1711                i;
1712
1713            if (main === null) {
1714                return;
1715            }
1716
1717            allDivs = main.childNodes;
1718
1719            if (typeof Array.prototype.map === 'function' && typeof Enumerable === 'undefined') {
1720                Array.prototype.map.call(main.children, Object).sort(function (a, b) {
1721                //var mainChildren = Array.from(main.children);
1722                //mainChildren.sort(function (a, b) {
1723                    if (tarteaucitron.services[a.id.replace(/Line/g, '')].name > tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return 1; }
1724                    if (tarteaucitron.services[a.id.replace(/Line/g, '')].name < tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return -1; }
1725                    return 0;
1726                }
1726).forEach(function (element) {
1727                    main.appendChild(element);
1728                });
1729            }
1730        },
1731        "jsSizing": function (type) {
1732            "use strict";
1733            var scrollbarMarginRight = 10,
1734                scrollbarWidthParent,
1735                scrollbarWidthChild,
1736                servicesHeight,
1737                e = window,
1738                a = 'inner',
1739                windowInnerHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight,
1740                mainTop,
1741                mainHeight,
1742                closeButtonHeight,
1743                headerHeight,
1744                cookiesListHeight,
1745                cookiesCloseHeight,
1746                cookiesTitleHeight,
1747                paddingBox,
1748                alertSmallHeight,
1749                cookiesNumberHeight;
1750
1751            if (type === 'box') {
1752                if (document.getElementById('tarteaucitronAlertSmall') !== null && document.getElementById('tarteaucitronCookiesNumber') !== null) {
1753
1754                    // reset
1755                    tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', '0px 10px');
1756
1757                    // calculate
1758                    alertSmallHeight = document.getElementById('tarteaucitronAlertSmall').offsetHeight;
1759                    cookiesNumberHeight = document.getElementById('tarteaucitronCookiesNumber').offsetHeight;
1760                    paddingBox = (alertSmallHeight - cookiesNumberHeight) / 2;
1761
1762                    // apply
1763                    tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', paddingBox + 'px 10px');
1764                }
1765            } else if (type === 'main') {
1766
1767                // get the real window width for media query
1768                if (window.innerWidth === undefined) {
1769                    a = 'client';
1770                    e = document.documentElement || document.body;
1771                }
1772
1773                // height of the services list container
1774                if (document.getElementById('tarteaucitron') !== null && document.getElementById('tarteaucitronClosePanel') !== null && document.getElementById('tarteaucitronMainLineOffset') !== null) {
1775
1776                    // reset
1777                    tarteaucitron.userInterface.css('tarteaucitronServices', 'height', 'auto');
1778
1779                    // calculate
1780                    mainHeight = document.getElementById('tarteaucitron').offsetHeight;
1781                    closeButtonHeight = document.getElementById('tarteaucitronClosePanel').offsetHeight;
1782
1783                    // apply
1784                    servicesHeight = (mainHeight - closeButtonHeight + 4);
1785                    tarteaucitron.userInterface.css('tarteaucitronServices', 'height', servicesHeight + 'px');
1786                    tarteaucitron.userInterface.css('tarteaucitronServices', 'overflow-x', 'auto');
1787                }
1788
1789                // align the main allow/deny button depending on scrollbar width
1790                if (document.getElementById('tarteaucitronServices') !== null && document.getElementById('tarteaucitronScrollbarChild') !== null) {
1791
1792                    // media query
1793                    if (e[a + 'Width'] <= 479) {
1794                        //tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginLeft', '11px');
1795                    } else if (e[a + 'Width'] <= 767) {
1796                        scrollbarMarginRight = 12;
1797                    }
1798
1799                    scrollbarWidthParent = document.getElementById('tarteaucitronServices').offsetWidth;
1800                    scrollbarWidthChild = document.getElementById('tarteaucitronScrollbarChild').offsetWidth;
1801                    //tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginRight', ((scrollbarWidthParent - scrollbarWidthChild) + scrollbarMarginRight) + 'px');
1802                }
1803
1804                // center the main panel
1805                if (document.getElementById('tarteaucitron') !== null) {
1806
1807                    // media query
1808                    if (e[a + 'Width'] <= 767) {
1809                        mainTop = 0;
1810                    } else {
1811                        mainTop = ((windowInnerHeight - document.getElementById('tarteaucitron').offsetHeight) / 2) - 21;
1812                    }
1813
1814                    if (document.getElementById('tarteaucitronMainLineOffset') !== null) {
1815                        if (document.getElementById('tarteaucitron').offsetHeight < (windowInnerHeight / 2)) {
1816                            mainTop -= document.getElementById('tarteaucitronMainLineOffset').offsetHeight;
1817                        }
1818                    }
1819
1820                    // correct
1821                    if (mainTop < 0) {
1822                        mainTop = 0;
1823                    }
1824
1825                    // apply
1826                    tarteaucitron.userInterface.css('tarteaucitron', 'top', mainTop + 'px');
1827                }
1828
1829
1830            } else if (type === 'cookie') {
1831
1832                // put cookies list at bottom
1833                if (document.getElementById('tarteaucitronAlertSmall') !== null) {
1834                    tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'bottom', (document.getElementById('tarteaucitronAlertSmall').offsetHeight) + 'px');
1835                }
1836
1837                // height of cookies list
1838                if (document.getElementById('tarteaucitronCookiesListContainer') !== null) {
1839
1840                    // reset
1841                    tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', 'auto');
1842
1843                    // calculate
1844                    cookiesListHeight = document.getElementById('tarteaucitronCookiesListContainer').offsetHeight;
1845                    cookiesCloseHeight = document.getElementById('tarteaucitronClosePanelCookie').offsetHeight;
1846                    cookiesTitleHeight = document.getElementById('tarteaucitronCookiesTitle').offsetHeight;
1847
1848                    // apply
1849                    tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', (cookie
vendor: 15,408 bytes, lines 1849-2195
1849sListHeight - cookiesCloseHeight - cookiesTitleHeight - 2) + 'px');
1850                }
1851            }
1852        }
1853    },
1854    "cookie": {
1855        "owner": {},
1856        "create": function (key, status) {
1857            "use strict";
1858
1859            if (tarteaucitronForceExpire !== '') {
1860                // The number of day(s)/hour(s) can't be higher than 1 year
1861                if ((tarteaucitronExpireInDay && tarteaucitronForceExpire < 365) || (!tarteaucitronExpireInDay && tarteaucitronForceExpire < 8760)) {
1862                    if (tarteaucitronExpireInDay) {
1863                        // Multiplication to tranform the number of days to milliseconds
1864                        timeExpire = tarteaucitronForceExpire * 86400000;
1865                    } else {
1866                        // Multiplication to tranform the number of hours to milliseconds
1867                        timeExpire = tarteaucitronForceExpire * 3600000;
1868                    }
1869                }
1870            }
1871
1872            var d = new Date(),
1873                time = d.getTime(),
1874                expireTime = time + timeExpire, // 365 days
1875                regex = new RegExp("!" + key + "=(wait|true|false)", "g"),
1876                cookie = tarteaucitron.cookie.read().replace(regex, ""),
1877                value = tarteaucitron.parameters.cookieName + '=' + cookie + '!' + key + '=' + status,
1878                domain = (tarteaucitron.parameters.cookieDomain !== undefined && tarteaucitron.parameters.cookieDomain !== '') ? '; domain=' + tarteaucitron.parameters.cookieDomain : '',
1879                secure = location.protocol === 'https:' ? '; Secure' : '';
1880
1881            d.setTime(expireTime);
1882            document.cookie = value + '; expires=' + d.toGMTString() + '; path=/' + domain + secure + '; samesite=lax';
1883
1884            tarteaucitron.sendEvent('tac.consent_updated');
1885        },
1886        "read": function () {
1887            "use strict";
1888            var nameEQ = tarteaucitron.parameters.cookieName + "=",
1889                ca = document.cookie.split(';'),
1890                i,
1891                c;
1892
1893            for (i = 0; i < ca.length; i += 1) {
1894                c = ca[i];
1895                while (c.charAt(0) === ' ') {
1896                    c = c.substring(1, c.length);
1897                }
1898                if (c.indexOf(nameEQ) === 0) {
1899                    return c.substring(nameEQ.length, c.length);
1900                }
1901            }
1902            return '';
1903        },
1904        "purge": function (arr) {
1905            "use strict";
1906            var i;
1907
1908            for (i = 0; i < arr.length; i += 1) {
1909
1910                var rgxpCookie = new RegExp("^(.*;)?\\s*" + arr[i] + "\\s*=\\s*[^;]+(.*)?$");
1911                if (document.cookie.match(rgxpCookie)) {
1912                    document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/;';
1913                    document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname + ';';
1914                    document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname.split('.').slice(-2).join('.') + ';';
1915                }
1916            }
1917        },
1918        "checkCount": function (key) {
1919            "use strict";
1920            var arr = tarteaucitron.services[key].cookies,
1921                nb = arr.length,
1922                nbCurrent = 0,
1923                html = '',
1924                i,
1925                status = document.cookie.indexOf(key + '=true'),
1926                cookieLabel = "cookie";
1927
1928            if (tarteaucitron.getLanguage() === "de") {
1929                cookieLabel = "Cookie";
1930            }
1931
1932            if (status >= 0 && nb === 0) {
1933                html += tarteaucitron.lang.useNoCookie;
1934            } else if (status >= 0) {
1935                for (i = 0; i < nb; i += 1) {
1936                    if (document.cookie.indexOf(arr[i] + '=') !== -1) {
1937                        nbCurrent += 1;
1938                        if (tarteaucitron.cookie.owner[arr[i]] === undefined) {
1939                            tarteaucitron.cookie.owner[arr[i]] = [];
1940                        }
1941                        if (tarteaucitron.cookie.crossIndexOf(tarteaucitron.cookie.owner[arr[i]], tarteaucitron.services[key].name) === false) {
1942                            tarteaucitron.cookie.owner[arr[i]].push(tarteaucitron.services[key].name);
1943                        }
1944                    }
1945                }
1946
1947                if (nbCurrent > 0) {
1948                    html += tarteaucitron.lang.useCookieCurrent + ' ' + nbCurrent + ' ' + cookieLabel;
1949                    if (nbCurrent > 1) {
1950                        html += 's';
1951                    }
1952                    html += '.';
1953                } else {
1954                    html += tarteaucitron.lang.useNoCookie;
1955                }
1956            } else if (nb === 0) {
1957                html = tarteaucitron.lang.noCookie;
1958            } else {
1959                html += tarteaucitron.lang.useCookie + ' ' + nb + ' ' + cookieLabel;
1960                if (nb > 1) {
1961                    html += 's';
1962                }
1963                html += '.';
1964            }
1965
1966            if (document.getElementById('tacCL' + key) !== null) {
1967                document.getElementById('tacCL' + key).innerHTML = html;
1968            }
1969        },
1970        "crossIndexOf": function (arr, match) {
1971            "use strict";
1972            var i;
1973            for (i = 0; i < arr.length; i += 1) {
1974                if (arr[i] === match) {
1975                    return true;
1976                }
1977            }
1978            return false;
1979        },
1980        "number": function () {
1981            "use strict";
1982            var cookies = document.cookie.split(';'),
1983                nb = (document.cookie !== '') ? cookies.length : 0,
1984                html = '',
1985                i,
1986                name,
1987                namea,
1988                nameb,
1989                c,
1990                d,
1991                s = (nb > 1) ? 's' : '',
1992                savedname,
1993                regex = /^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i,
1994                regexedDomain = (tarteaucitron.cdn.match(regex) !== null) ? tarteaucitron.cdn.match(regex)[1] : tarteaucitron.cdn,
1995                host = (tarteaucitron.domain !== undefined) ? tarteaucitron.domain : regexedDomain;
1996
1997            cookies = cookies.sort(function (a, b) {
1998                namea = a.split('=', 1).toString().replace(/ /g, '');
1999                nameb = b.split('=', 1).toString().replace(/ /g, '');
2000                c = (tarteaucitron.cookie.owner[namea] !== undefined) ? tarteaucitron.cookie.owner[namea] : '0';
2001                d = (tarteaucitron.cookie.owner[nameb] !== undefined) ? tarteaucitron.cookie.owner[nameb] : '0';
2002                if (c + a > d + b) { return 1; }
2003                if (c + a < d + b) { return -1; }
2004                return 0;
2005            });
2006
2007            if (document.cookie !== '') {
2008                for (i = 0; i < nb; i += 1) {
2009                    name = cookies[i].split('=', 1).toString().replace(/ /g, '');
2010                    if (tarteaucitron.cookie.owner[name] !== undefined && tarteaucitron.cookie.owner[name].join(' // ') !== savedname) {
2011                        savedname = tarteaucitron.cookie.owner[name].join(' // ');
2012                        html += '<div class="tarteaucitronHidden">';
2013                        html += '     <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="3">';
2014                        html += '        ' + tarteaucitron.cookie.owner[name].join(' // ');
2015                        html += '    </span>';
2016                        html += '</div><ul class="cookie-list">';
2017                    } else if (tarteaucitron.cookie.owner[name] === undefined && host !== savedname) {
2018                        savedname = host;
2019                        html += '<div class="tarteaucitronHidden">';
2020                        html += '     <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="3">';
2021                        html += '        ' + host;
2022                        html += '    </span>';
2023                        html += '</div><ul class="cookie-list">';
2024                    }
2025                    html += '<li class="tarteaucitronCookiesListMain">';
2026                    html += '    <div class="tarteaucitronCookiesListLeft"><button type="button" class="purgeBtn" data-cookie="' + tarteaucitron.fixSelfXSS(cookies[i].split('=', 1)) + '"><strong>&times;</strong></button> <strong>' + tarteaucitron.fixSelfXSS(name) + '</strong>';
2027                    html += '    </div>';
2028                    html += '    <div class="tarteaucitronCookiesListRight">' + tarteaucitron.fixSelfXSS(cookies[i].split('=').slice(1).join('=')) + '</div>';
2029                    html += '</li>';
2030                }
2031                html += '</ul>';
2032            } else {
2033                html += '<div class="tarteaucitronCookiesListMain">';
2034                html += '    <div class="tarteaucitronCookiesListLeft"><strong>-</strong></div>';
2035                html += '    <div class="tarteaucitronCookiesListRight"></div>';
2036                html += '</div>';
2037            }
2038
2039            html += '<div class="tarteaucitronHidden tarteaucitron-spacer-20"></div>';
2040
2041            if (document.getElementById('tarteaucitronCookiesList') !== null) {
2042                document.getElementById('tarteaucitronCookiesList').innerHTML = html;
2043            }
2044
2045            if (document.getElementById('tarteaucitronCookiesNumber') !== null) {
2046                document.getElementById('tarteaucitronCookiesNumber').innerHTML = nb;
2047                document.getElementById('tarteaucitronCookiesNumber').setAttribute("aria-label", nb + ' cookie' + s + " - " + tarteaucitron.lang.toggleInfoBox);
2048                document.getElementById('tarteaucitronCookiesNumber').setAttribute("title", nb + ' cookie' + s + " - " + tarteaucitron.lang.toggleInfoBox);
2049            }
2050
2051            if (document.getElementById('tarteaucitronCookiesNumberBis') !== null) {
2052                document.getElementById('tarteaucitronCookiesNumberBis').innerHTML = nb + ' cookie' + s;
2053            }
2054
2055            var purgeBtns = document.getElementsByClassName("purgeBtn");
2056            for (i = 0; i < purgeBtns.length; i++) {
2057                tarteaucitron.addClickEventToElement(purgeBtns[i], function () {
2058                    tarteaucitron.cookie.purge([this.dataset.cookie]);
2059                    tarteaucitron.cookie.number();
2060                    tarteaucitron.userInterface.jsSizing('cookie');
2061                    return false;
2062                });
2063            }
2064
2065            for (i = 0; i < tarteaucitron.job.length; i += 1) {
2066                tarteaucitron.cookie.checkCount(tarteaucitron.job[i]);
2067            }
2068        }
2069    },
2070    "fixSelfXSS": function(html) {
2071        return html.toString().replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
2072    },
2073    "getLanguage": function () {
2074        "use strict";
2075
2076        var availableLanguages = 'ar,bg,ca,cn,cs,da,de,et,el,en,es,fi,fr,hr,hu,it,ja,ko,lb,lt,lv,nl,no,oc,pl,pt,ro,ru,se,sk,sv,tr,uk,vi,zh',
2077            defaultLanguage = 'en';
2078
2079        if (tarteaucitronForceLanguage !== '') {
2080            if (availableLanguages.indexOf(tarteaucitronForceLanguage) !== -1) {
2081                return tarteaucitronForceLanguage;
2082            }
2083        }
2084
2085        // get the html lang
2086        if (document.documentElement.getAttribute("lang") !== undefined && document.documentElement.getAttribute("lang") !== null && document.documentElement.getAttribute("lang") !== "") {
2087            if (availableLanguages.indexOf(document.documentElement.getAttribute("lang").substr(0, 2)) !== -1) {
2088                return document.documentElement.getAttribute("lang").substr(0, 2);
2089            }
2090        }
2091
2092        if (!navigator) { return defaultLanguage; }
2093
2094        var lang = navigator.language || navigator.browserLanguage ||
2095                navigator.systemLanguage || navigator.userLang || null,
2096            userLanguage = lang ? lang.substr(0, 2) : null;
2097
2098        if (availableLanguages.indexOf(userLanguage) !== -1) {
2099            return userLanguage;
2100        }
2101
2102        return defaultLanguage;
2103    },
2104    "getLocale": function () {
2105        "use strict";
2106        if (!navigator) { return 'en_US'; }
2107
2108        var lang = navigator.language || navigator.browserLanguage ||
2109                navigator.systemLanguage || navigator.userLang || null,
2110            userLanguage = lang ? lang.substr(0, 2) : null;
2111
2112        if (userLanguage === 'fr') {
2113            return 'fr_FR';
2114        } else if (userLanguage === 'en') {
2115            return 'en_US';
2116        } else if (userLanguage === 'de') {
2117            return 'de_DE';
2118        } else if (userLanguage === 'es') {
2119            return 'es_ES';
2120        } else if (userLanguage === 'it') {
2121            return 'it_IT';
2122        } else if (userLanguage === 'pt') {
2123            return 'pt_PT';
2124        } else if (userLanguage === 'nl') {
2125            return 'nl_NL';
2126        } else if (userLanguage === 'el') {
2127            return 'el_EL';
2128        } else {
2129            return 'en_US';
2130        }
2131    },
2132    "addScript": function (url, id, callback, execute, attrName, attrVal, internal) {
2133        "use strict";
2134        var script,
2135            done = false;
2136
2137        if (execute === false) {
2138            if (typeof callback === 'function') {
2139                callback();
2140            }
2141        } else {
2142            script = document.createElement('script');
2143            if (id !== undefined) {
2144                script.id = id;
2145            }
2146            script.async = true;
2147            script.src = url;
2148
2149            if (attrName !== undefined && attrVal !== undefined) {
2150                script.setAttribute(attrName, attrVal);
2151            }
2152
2153            if (typeof callback === 'function') {
2154                if ( !tarteaucitron.parameters.useExternalJs || !internal ) {
2155                    script.onreadystatechange = script.onload = function () {
2156                        var state = script.readyState;
2157                        if (!done && (!state || /loaded|complete/.test(state))) {
2158                            done = true;
2159                            callback();
2160                        }
2161                    };
2162                } else {
2163                    callback();
2164                }
2165            }
2166
2167            if ( !tarteaucitron.parameters.useExternalJs || !internal ) {
2168                document.getElementsByTagName('head')[0].appendChild(script);
2169            }
2170        }
2171    },
2172    "addInternalScript": function (url, id, callback, execute, attrName, attrVal) {
2173        tarteaucitron.addScript(url, id, callback, execute, attrName, attrVal, true);
2174    },
2175    "checkIfExist": function (elemId) {
2176        "use strict";
2177        return document.getElementById(elemId) !== null && document.getElementById(elemId).offsetWidth !== 0 && document.getElementById(elemId).offsetHeight !== 0;
2178    },
2179    "makeAsync": {
2180        "antiGhost": 0,
2181        "buffer": '',
2182        "init": function (url, id) {
2183            "use strict";
2184            var savedWrite = document.write,
2185                savedWriteln = document.writeln;
2186
2187            document.write = function (content) {
2188                tarteaucitron.makeAsync.buffer += content;
2189            };
2190            document.writeln = function (content) {
2191                tarteaucitron.makeAsync.buffer += content.concat("\n");
2192            };
2193
2194            setTimeout(function () {
2195                document.write = savedWrite;
2196                document.writeln = savedWriteln;
2197            }, 20000);
2198
2199            tarteaucitron.makeAsync.getAndParse(url, id);
2200        },
2201        "getAndParse": function (url, id) {
2202            "use strict";
2203            if (tarteaucitron.makeAsync.antiGhost > 9) {
2204                tarteaucitron.makeAsync.antiGhost = 0;
2205                return;
2206            }
2207            tarteaucitron.makeAsync.antiGhost += 1;
2208            tarteaucitron.addInternalScript(url, '', function () {
2209                if (document.getElementById(id) !== null) {
2210                    document.getElementById(id).innerHTML += "<span class='tarteaucitron-display-none'>&nbsp;</span>" + tarteaucitron.makeAsync.buffer;
2211                    tarteaucitron.makeAsync.buffer = '';
2212                    tarteaucitron.makeAsync.execJS(id);
2213                }
2214            });
2215        },
2216        "execJS": function (id) {
2217            /* not strict because third party scripts may have errors */
2218            var i,
2219                scripts,
2220                childId,
2221                type;
2222
2223            if (document.getElementById(id) === null) {
2224                return;
2225            }
2226
2227            scripts = document.getElementById(id).getElementsByTagName('script');
2228            for (i = 0; i < scripts.length; i += 1) {
2229                type = (scripts[i].getAttribute('type') !== null) ? scripts[i].getAttribute('type') : '';
2230                if (type === '') {
2231                    type = (scripts[i].getAttribute('language') !== null) ? scripts[i].getAttribute('language') : '';
2232                }
2233                if (scripts[i].getAttribute('src') !== null && scripts[i].getAttribute('src') !== '') {
2234                    childId = id + Math.floor(Math.random() * 99999999999);
2235                    document.getElementById(id).innerHTML += '<div id="' + childId + '"></div>';
2236                    tarteaucitron.makeAsync.getAndParse(scripts[i].getAttribute('src'), childId);
2237                } else if (type.indexOf('javascript') !== -1 || type === '') {
2238                    eval(scripts[i].innerHTML);
2239                }
2240            }
2241        }
2242    },
2243    "fallback": function (matchClass, content, noInner) {
2244        "use strict";
2245        var elems = document.getElementsByTagName('*'),
2246            i,
2247            index = 0;
2248
2249        for (i in elems) {
2250            if (elems[i] !== undefined) {
2251                for (index = 0; index < matchClass.length; index += 1) {
2252                    if ((' ' + elems[i].className + ' ')
2253                            .indexOf(' ' + matchClass[index] + ' ') > -1) {
2254                        if (typeof content === 'function') {
2255                            if (noInner === true) {
2256                                content(elems[i]);
2257                            } else {
2258                                elems[i].innerHTML = content(elems[i]);
2259                            }
2260                        } else {
2261                            elems[i].innerHTML = content;
2262                        }
2263                    }
2264                }
2265            }
2266        }
2267    },
2268    "engage": function (id) {
2269        "use strict";
2270        var html = '',
2271            r = Math.floor(Math.random() * 100000),
2272            engage = tarteaucitron.services[id].name + ' ' + tarteaucitron.lang.fallback;
2273
2274        if (tarteaucitron.lang['engage-' + id] !== undefined) {
2275            engage = tarteaucitron.lang['engage-' + id];
2276        }
2277
2278        html += '<div class="tac_activate tac_activate_' + id + '">';
2279        html += '   <div class="tac_float">';
2280        html += '      ' + engage;
2281        html += '      <button type="button" class="tarteaucitronAllow" id="Eng' + r + 'ed' + id + '">';
2282        html += '          <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allow;
2283        html += '       </button>';
2284        html += '   </div>';
2285        html += '</div>';
2286
2287        return html;
2288    },
2289    "extend": function (a, b) {
2290        "use strict";
2291        var prop;
2292        for (prop in b) {
2293            if (b.hasOwnProperty(prop)) {
2294                a[prop] = b[prop];
2295            }
2296        }
2297    },
2298    "proTemp": '',
2299    "proTimer": function () {
2300        "use strict";
2301        setTimeout(tarteaucitron.proPing, (Math.floor(Math.random() * (1200 - 500 + 1)) + 500));
2302    },
2303    "pro": function (list) {
2304        "use strict";
2305        tarteaucitron.proTemp += list;
2306        clearTimeout(tarteaucitron.proTimer);
2307        tarteaucitron.proTimer = setTimeout(tarteaucitron.proPing, (Math.floor(Math.random() * (1200 - 500 + 1)) + 500));
2308    },
2309    "proPing": function () {
2310        "use strict";
2311        if (tarteaucitron.uuid !== '' && tarteaucitron.uuid !== undefined && tarteaucitron.proTemp !== '' && tarteaucitronStatsEnabled) {
2312            var div = document.getElementById('tarteaucitronPremium'),
2313                timestamp = new Date().getTime(),
2314                url = 'https://tarteaucitron.io/log/?';
2315
2316            if (div === null) {
2317                return;
2318            }
2319
2320            url += 'account=' + tarteaucitron.uuid + '&';
2321            url += 'domain=' + tarteaucitron.domain + '&';
2322            url += 'status=' + encodeURIComponent(tarteaucitron.proTemp) + '&';
2323            url += '_time=' + timestamp;
2324
2325            div.innerHTML = '<img src="' + url + '" class="tarteaucitron-display-none" alt="" />';
2326
2327            tarteaucitron.proTemp = '';
2328        }
2329
2330        tarteaucitron.cookie.number();
2331    },
2332    "AddOrUpdate" : function(source, custom){
2333        /**
2334         Utility function to Add or update the fields of obj1 with the ones in obj2
2335         */
2336        for(var key in custom){
2337            if(custom[key] instanceof Object){
2338                source[key] = tarteaucitron.AddOrUpdate(source[key], custom[key]);
2339            }else{
2340                source[key] = custom[key];
2341            }
2342        }
2343        return source;
2344    },
2345    "getElemWidth": function(elem) {
2346        return tarteaucitron.getElemAttr(elem, 'width') || elem.clientWidth;
2347    },
2348    "getElemHeight": function(elem) {
2349        return tarteaucitron.getElemAttr(elem, 'height') || elem.clientHeight;
2350    },
2351    "getElemAttr": function (elem, attr) {
2352        var attribute = elem.getAttribute('data-' + attr) || elem.getAttribute(attr);
2353
2354        if (typeof attribute === 'string') {
2355            return tarteaucitron.fixSelfXSS(attribute);
2356        }
2357
2358        return "";
2359    },
2360    "addClickEventToId": function (elemId, func) {
2361        tarteaucitron.addClickEventToElement(document.getElementById(elemId), func);
2362    },
2363    "addClickEventToElement": function (e, func) {
2364        if (e) {
2365            if (e.addEventListener) {
2366                e.addEventListener("click", func);
2367            } else {
2368                e.attachEvent("onclick", func);
2369            }
2370        }
2371    },
2372    "triggerJobsAfterAjaxCall": function() {
2373        tarteaucitron.job.forEach(function(e) { tarteaucitron.job.push(e) });
2374        var i;
2375        var allowBtns = document.getElementsByClassName("tarteaucitronAllow");
2376        for (i = 0; i < allowBtns.length; i++) {
2377            tarteaucitron.addClickEventToElement(allowBtns[i], function () {
2378                tarteaucitron.userInterface.respond(this, true);
2379            });
2380        }
2381        var denyBtns = document.getElementsByClassName("tarteaucitronDeny");
2382        for (i = 0; i < denyBtns.length; i++) {
2383            tarteaucitron.addClickEventToElement(denyBtns[i], function () {
2384                tarteaucitron.userInterface.respond(this, false);
2385            });
2386        }
2387    }
2388};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.