PageSourceSearch

https://www.produitsdurables.fr/tarteaucitron/tarteaucitron.js

js produitsdurables.fr collected 2026-10-01 15:53:05 UTC 82,923 bytes, 1,752 lines download raw bytes

1/*jslint browser: true, evil: true */
2
3var scripts = document.getElementsByTagName('script'),
4    path = scripts[scripts.length - 1].src.split('?')[0],
5    tarteaucitronForceCDN = (tarteaucitronForceCDN === undefined) ? '' : tarteaucitronForceCDN,
6    cdn = (tarteaucitronForceCDN === '') ? path.split('/').slice(0, -1).join('/') + '/' : tarteaucitronForceCDN,
7    alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch,
8    tarteaucitronForceLanguage = (tarteaucitronForceLanguage === undefined) ? '' : tarteaucitronForceLanguage,
9    tarteaucitronForceExpire = (tarteaucitronForceExpire === undefined) ? '' : tarteaucitronForceExpire,
10    tarteaucitronCustomText = (tarteaucitronCustomText === undefined) ? '' : tarteaucitronCustomText,
11    // tarteaucitronExpireInDay: true for day(s) value - false for hour(s) value
12    tarteaucitronExpireInDay = (tarteaucitronExpireInDay === undefined || typeof tarteaucitronExpireInDay !== "boolean") ? true : tarteaucitronExpireInDay,
13    timeExpire = 31536000000,
14    tarteaucitronProLoadServices,
15    tarteaucitronNoAdBlocker = false;
16
17
18
19var tarteaucitron = {
20    "version": 20201005,
21    "cdn": cdn,
22    "user": {},
23    "lang": {},
24    "services": {},
25    "added": [],
26    "idprocessed": [],
27    "state": [],
28    "launch": [],
29    "parameters": {},
30    "isAjax": false,
31    "reloadThePage": false,
32    "events": {
33        "init": function () {},
34        "load": function () {},
35    },
36    "init": function (params) {
37        "use strict";
38        var origOpen;
39
40        tarteaucitron.parameters = params;
41        if (alreadyLaunch === 0) {
42            alreadyLaunch = 1;
43            if (window.addEventListener) {
44                window.addEventListener("load", function () {
45                    tarteaucitron.initEvents.loadEvent(false);
46                }, false);
47                window.addEventListener("scroll", function () {
48                    tarteaucitron.initEvents.scrollEvent();
49                }, false);
50
51                window.addEventListener("keydown", function (evt) {
52                    tarteaucitron.initEvents.keydownEvent(false, evt);
53                }, false);
54                window.addEventListener("hashchange", function () {
55                    tarteaucitron.initEvents.hashchangeEvent();
56                }, false);
57                window.addEventListener("resize", function () {
58                    tarteaucitron.initEvents.resizeEvent();
59                }, false);
60            } else {
61                window.attachEvent("onload", function () {
62                    tarteaucitron.initEvents.loadEvent(true);
63                });
vendor: 5,716 bytes, lines 63-196
63
64                window.attachEvent("onscroll", function () {
65                    tarteaucitron.initEvents.scrollEvent();
66                });
67                window.attachEvent("onkeydown", function (evt) {
68                    tarteaucitron.initEvents.keydownEvent(true, evt);
69
70                });
71                window.attachEvent("onhashchange", function () {
72                    tarteaucitron.initEvents.hashchangeEvent();
73                });
74                window.attachEvent("onresize", function () {
75                    tarteaucitron.initEvents.resizeEvent();
76                });
77            }
78
79            if (typeof XMLHttpRequest !== 'undefined') {
80                origOpen = XMLHttpRequest.prototype.open;
81                XMLHttpRequest.prototype.open = function () {
82
83                    if (window.addEventListener) {
84                        this.addEventListener("load", function () {
85                            if (typeof tarteaucitronProLoadServices === 'function') {
86                                tarteaucitronProLoadServices();
87                            }
88                        }, false);
89                    } else if (typeof this.attachEvent !== 'undefined') {
90                        this.attachEvent("onload", function () {
91                            if (typeof tarteaucitronProLoadServices === 'function') {
92                                tarteaucitronProLoadServices();
93                            }
94                        });
95                    } else {
96                        if (typeof tarteaucitronProLoadServices === 'function') {
97                            setTimeout(tarteaucitronProLoadServices, 1000);
98                        }
99                    }
100
101                    try {
102                        origOpen.apply(this, arguments);
103                    } catch (err) {}
104                };
105            }
106        }
107
108        if(tarteaucitron.events.init) {
109            tarteaucitron.events.init();
110        }
111    },
112    "initEvents": {
113        "loadEvent": function (isOldBrowser) {
114            tarteaucitron.load();
115            tarteaucitron.fallback(['tarteaucitronOpenPanel'], function (elem) {
116                if (isOldBrowser) {
117                    elem.attachEvent("onclick", function (event) {
118                        tarteaucitron.userInterface.openPanel();
119                        event.preventDefault();
120                    });
121                } else {
122                    elem.addEventListener("click", function (event) {
123                        tarteaucitron.userInterface.openPanel();
124                        event.preventDefault();
125                    }, false);
126                }
127            }, true);
128        },
129        "keydownEvent": function (isOldBrowser, evt) {
130            if (evt.keyCode === 27) {
131                tarteaucitron.userInterface.closePanel();
132            }
133
134            if (isOldBrowser) {
135                if ( evt.keyCode === 9 && focusableEls.indexOf(evt.target) >= 0) {
136                    if ( evt.shiftKey ) /* shift + tab */ {
137                        if (document.activeElement === firstFocusableEl) {
138                            lastFocusableEl.focus();
139                            evt.preventDefault();
140                        }
141                    } else /* tab */ {
142                        if (document.activeElement === lastFocusableEl) {
143                            firstFocusableEl.focus();
144                            evt.preventDefault();
145                        }
146                    }
147                }
148            }
149        },
150        "hashchangeEvent": function () {
151            if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
152                tarteaucitron.userInterface.openPanel();
153            }
154        },
155        "resizeEvent": function () {
156            var tacElem = document.getElementById('tarteaucitron');
157            var tacCookieContainer = document.getElementById('tarteaucitronCookiesListContainer');
158
159            if (tacElem && tacElem.style.display === 'block') {
160                tarteaucitron.userInterface.jsSizing('main');
161            }
162
163            if (tacCookieContainer && tacCookieContainer.style.display === 'block') {
164                tarteaucitron.userInterface.jsSizing('cookie');
165            }
166        },
167        "scrollEvent": function () {
168            var scrollPos = window.pageYOffset || document.documentElement.scrollTop;
169            var heightPosition;
170            var tacPercentage = document.getElementById('tarteaucitronPercentage');
171            var tacAlertBig = document.getElementById('tarteaucitronAlertBig');
172
173            if (tacAlertBig && !tarteaucitron.highPrivacy) {
174                if (tacAlertBig.style.display === 'block') {
175                    heightPosition = tacAlertBig.offsetHeight + 'px';
176
177                    if (scrollPos > (screen.height * 2)) {
178                        tarteaucitron.userInterface.respondAll(true);
179                    } else if (scrollPos > (screen.height / 2)) {
180                        document.getElementById('tarteaucitronDisclaimerAlert').innerHTML = '<strong>' + tarteaucitron.lang.alertBigScroll + '</strong> ' + tarteaucitron.lang.alertBig;
181                    }
182
183                    if (tacPercentage) {
184                        if (tarteaucitron.orientation === 'top') {
185                            tacPercentage.style.top = heightPosition;
186                        } else {
187                            tacPercentage.style.bottom = heightPosition;
188                        }
189                        tacPercentage.style.width = ((100 / (screen.height * 2)) * scrollPos) + '%';
190                    }
191                }
192            }
193        },
194    },
195    "load": function () {
196        "use strict";
197        var cdn = tarteaucitron.cdn,
198            language = tarteaucitron.getLanguage(),
199            pathToLang = cdn + 'lang/tarteaucitron.' + language + '.js?v=' + tarteaucitron.version,
200            pathToServices = cdn + 'tarteaucitron.services.js?v=' + tarteaucitron.version,
201            linkElement = document.createElement('link'),
202            defaults = {
203                "adblocker": false,
204                "hashtag": '#tarteaucitron',
205                "cookieName": 'tarteaucitron',
206                "highPrivacy": true,
207                "orientation": "middle",
208                "bodyPosition": "bottom",
209                "removeCredit": false,
210                "showAlertSmall": true,
211                "cookieslist": true,
212                "handleBrowserDNTRequest": false,
213                "DenyAllCta": true,
214                "AcceptAllCta" : true,
215                "moreInfoLink": true,
216                "privacyUrl": "",
217                "useExternalCss": false,
218                "useExternalJs": false,
219                "mandatory": false
220            },
221            params = tarteaucitron.parameters;
222
223        // Don't show the middle bar if we are on the privacy policy or more page
224        if (((tarteaucitron.parameters.readmoreLink !== undefined && window.location.href == tarteaucitron.parameters.readmoreLink) || window.location.href == tarteaucitron.parameters.privacyUrl) && tarteaucitron.parameters.orientation == "middle") {
225            tarteaucitron.parameters.orientation = "bottom";
226        }
227
228        // Step -1
229        if (typeof tarteaucitronCustomPremium !== 'undefined') {
230            tarteaucitronCustomPremium();
231        }
232
233        // Step 0: get params
234        if (params !== undefined) {
235
236            for (var k in defaults) {
237                if(!tarteaucitron.parameters.hasOwnProperty(k)) {
238                    tarteaucitron.parameters[k] = defaults[k];
239                }
240            }
241        }
242
243        // global
244        tarteaucitron.orientation = tarteaucitron.parameters.orientation;
245        tarteaucitron.hashtag = tarteaucitron.parameters.hashtag;
246        tarteaucitron.highPrivacy = tarteaucitron.parameters.highPrivacy;
247        tarteaucitron.handleBrowserDNTRequest = tarteaucitron.parameters.handleBrowserDNTRequest;
248
249        // Step 1: load css
250        if ( !tarteaucitron.parameters.useExternalCss ) {
251            linkElement.rel = 'stylesheet';
252            linkElement.type = 'text/css';
253            linkElement.href = cdn + 'css/tarteaucitron.css?v=' + tarteaucitron.version;
254            document.getElementsByTagName('head')[0].appendChild(linkElement);
255        }
256        // Step 2: load language and services
257        tarteaucitron.addInternalScript(pathToLang, '', function () {
258
259          if(tarteaucitronCustomText !== ''){
260            tarteaucitron.lang = tarteaucitron.AddOrUpdate(tarteaucitron.lang, tarteaucitronCustomText);
261          }
262            tarteaucitron.addInternalScript(pathToServices, '', function () {
263
264
265                // css for new middle bar
266                if (tarteaucitron.orientation === 'middle') {
267                    var customThemeMiddle = document.createElement('style'),
268                        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: 50px;}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: 50px 0;}span#tarteaucitronDisclaimerAlert {padding: 0 30px;}#tarteaucitronRoot span#tarteaucitronDisclaimerAlert {margin: 50px 0;display: block;text-align: center;font-size: 21px;}';
269
270                    customThemeMiddle.type = 'text/css';
271                    if (customThemeMiddle.styleSheet) {
272                        customThemeMiddle.styleSheet.cssText = cssRuleMiddle;
273                    } else {
274                        customThemeMiddle.appendChild(document.createTextNode(cssRuleMiddle));
275                    }
276                    document.getElementsByTagName('head')[0].appendChild(customThemeMiddle);
277                }
278
279                var body = document.body,
280                    div = document.createElement('div'),
281                    html = '',
282                    index,
283                    orientation = 'Top',
284                    cat = ['ads', 'analytic', 'api', 'comment', 'social', 'support', 'video', 'other'],
285                    i;
286
287                cat = cat.sort(function (a, b) {
288                    if (tarteaucitron.lang[a].title > tarteaucitron.lang[b].title) { return 1; }
289                    if (tarteaucitron.lang[a].title < tarteaucitron.lang[b].title) { return -1; }
290                    return 0;
291                });
292
293                // Step 3: prepare the html
294                html += '<div id="tarteaucitronPremium"></div>';
295                html += '<button type="button" id="tarteaucitronBack" aria-label="' + tarteaucitron.lang.close + '"></button>';
296                html += '<div id="tarteaucitron" role="dialog" aria-labelledby="dialogTitle">';
297                html += '   <button type="button" id="tarteaucitronClosePanel">';
298                html += '       ' + tarteaucitron.lang.close;
299                html += '   </button>';
300                html += '   <div id="tarteaucitronServices">';
301                html += '      <div class="tarteaucitronLine tarteaucitronMainLine" id="tarteaucitronMainLineOffset">';
302                html += '         <span class="tarteaucitronH1" role="heading" aria-level="1" id="dialogTitle">'+ tarteaucitron.lang.title + '</span>';
303                html += '         <div id="tarteaucitronInfo">';
304                html += '         ' + tarteaucitron.lang.disclaimer;
305                if (tarteaucitron.parameters.privacyUrl !== "") {
306                    html += '   <br/><br/>';
307                    html += '   <button type="button" id="tarteaucitronPrivacyUrlDialog">';
308                    html += '       ' + tarteaucitron.lang.privacyUrl;
309                    html += '   </button>';
310                }
311                html += '         </div>';
312                html += '         <div class="tarteaucitronName">';
313                html += '            <span class="tarteaucitronH2" role="heading" aria-level="2">' + tarteaucitron.lang.all + '</span>';
314                html += '         </div>';
315                html += '         <div class="tarteaucitronAsk" id="tarteaucitronScrollbarAdjust">';
316                html += '            <button type="button" id="tarteaucitronAllAllowed" class="tarteaucitronAllow">';
317                html += '               &#10003; ' + tarteaucitron.lang.allowAll;
318                html += '            </button> ';
319                html += '            <button type="button" id="tarteaucitronAllDenied" class="tarteaucitronDeny">';
320                html += '               &#10007; ' + tarteaucitron.lang.denyAll;
321                html += '            </button>';
322                html += '         </div>';
323                html += '      </div>';
324                html += '      <div class="tarteaucitronBorder">';
325                html += '         <div class="clear"></div><ul>';
326
327
328                if (tarteaucitron.parameters.mandatory == true) {
329                   html += '<li id="tarteaucitronServicesTitle_mandatory">';
330                   html += '<div class="tarteaucitronTitle">';
331                   html += '   <button type="button">&nbsp; ' + tarteaucitron.lang.mandatoryTitle + '</button>';
332                   html += '</div>';
333                   html += '<ul id="tarteaucitronServices_mandatory">';
334                   html += '<li class="tarteaucitronLine">';
335                   html += '   <div class="tarteaucitronName">';
336                   html += '       <span class="tarteaucitronH3" role="heading" aria-level="3">' + tarteaucitron.lang.mandatoryText + '</span>';
337                   html += '       <span class="tarteaucitronListCookies"></span><br/>';
338                   html += '   </div>';
339                   html += '   <div class="tarteaucitronAsk">';
340                   html += '       <button type="button" class="tarteaucitronAllow">';
341                   html += '           &#10003; ' + tarteaucitron.lang.allow;
342                   html += '       </button> ';
343                   html += '   </div>';
344                   html += '</li>';
345                   html += '</ul></li>';
346                }
347
348                for (i = 0; i < cat.length; i += 1) {
349                    html += '         <li id="tarteaucitronServicesTitle_' + cat[i] + '" class="tarteaucitronHidden">';
350                    html += '            <div class="tarteaucitronTitle">';
351                    html += '               <button type="button" class="catToggleBtn" data-cat="tarteaucitronDetails' + cat[i] + '">&#10011; ' + tarteaucitron.lang[cat[i]].title + '</button>';
352                    html += '            </div>';
353                    html += '            <div id="tarteaucitronDetails' + cat[i] + '" class="tarteaucitronDetails tarteaucitronInfoBox">';
354                    html += '               ' + tarteaucitron.lang[cat[i]].details;
355                    html += '            </div>';
356                    html += '         <ul id="tarteaucitronServices_' + cat[i] + '"></ul></li>';
357                }
358                html += '             <li id="tarteaucitronNoServicesTitle" class="tarteaucitronLine">' + tarteaucitron.lang.noServices + '</li>';
359                html += '         </ul>';
360                html += '         <div class="tarteaucitronHidden spacer-20" id="tarteaucitronScrollbarChild"></div>';
361                if (tarteaucitron.parameters.removeCredit === false) {
362                    html += '     <a class="tarteaucitronSelfLink" href="https://tarteaucitron.io/" rel="nofollow noreferrer noopener" target="_blank" title="tarteaucitron ' + tarteaucitron.lang.newWindow + '">🍋 ' + tarteaucitron.lang.credit + '</a>';
363                }
364                html += '       </div>';
365                html += '   </div>';
366                html += '</div>';
367
368                if (tarteaucitron.parameters.orientation === 'bottom') {
369                    orientation = 'Bottom';
370                }
371
372                if (tarteaucitron.parameters.highPrivacy && !tarteaucitron.parameters.AcceptAllCta) {
373                    html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
374                    //html += '<div class="tarteaucitronAlertBigWrapper">';
375                    html += '   <span id="tarteaucitronDisclaimerAlert">';
376                    html += '       ' + tarteaucitron.lang.alertBigPrivacy;
377                    html += '   </span>';
378                    //html += '   <span class="tarteaucitronAlertBigBtnWrapper">';
379                    html += '   <button type="button" id="tarteaucitronPersonalize">';
380                    html += '       ' + tarteaucitron.lang.personalize;
381                    html += '   </button>';
382
383                    if (tarteaucitron.parameters.privacyUrl !== "") {
384                        html += '   <button type="button" id="tarteaucitronPrivacyUrl">';
385                        html += '       ' + tarteaucitron.lang.privacyUrl;
386                        html += '   </button>';
387                    }
388
389                    //html += '   </span>';
390                    //html += '</div>';
391                    html += '</div>';
392                } else {
393                    html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
394                    //html += '<div class="tarteaucitronAlertBigWrapper">';
395                    html += '   <span id="tarteaucitronDisclaimerAlert">';
396
397                    if (tarteaucitron.parameters.highPrivacy) {
398                        html += '       ' + tarteaucitron.lang.alertBigPrivacy;
399                    } else {
400                        html += '       ' + tarteaucitron.lang.alertBigClick + ' ' + tarteaucitron.lang.alertBig;
401                    }
402
403                    html += '   </span>';
404                    //html += '   <span class="tarteaucitronAlertBigBtnWrapper">';
405                    html += '   <button type="button" id="tarteaucitronPersonalize2">';
406                    html += '       &#10003; ' + tarteaucitron.lang.acceptAll;
407                    html += '   </button>';
408
409
410                    if (tarteaucitron.parameters.DenyAllCta) {
411                                    html += '   <button type="button" class="tarteaucitronCTAButton tarteaucitronDeny" id="tarteaucitronAllDenied2">';
412                                    html += '       &#10007; ' + tarteaucitron.lang.denyAll;
413                                    html += '   </button>';
414                    }
415
416                    html += '   <button type="button" id="tarteaucitronCloseAlert">';
417                    html += '       ' + tarteaucitron.lang.personalize;
418                    html += '   </button>';
419
420                    if (tarteaucitron.parameters.privacyUrl !== "") {
421                        html += '   <button type="button" id="tarteaucitronPrivacyUrl">';
422                        html += '       ' + tarteaucitron.lang.privacyUrl;
423                        html += '   </button>';
424                    }
425
426                    //html += '   </span>';
427                    //html += '</div>';
428                    html += '</div>';
429                }
430
431                if (tarteaucitron.parameters.showAlertSmall === true) {
432                    html += '<div id="tarteaucitronAlertSmall" class="tarteaucitronAlertSmall' + orientation + '">';
433                    html += '   <button type="button" id="tarteaucitronManager">';
434                    html += '       <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 56.76 56.76"><title></title><circle cx="28.38" cy="28.38" r="27.63" style="fill:#fff;stroke:#0b1222;stroke-miterlimit:10;stroke-width:1.5px"></circle><path d="M43.93,26.52a5,5,0,0,1-4.66-3.14,5.09,5.09,0,0,1-2.48.65,5,5,0,0,1-4.17-7.85,5,5,0,0,1-3.39-4.74l-.85,0a17,17,0,0,0-17,17c0,9.39,5.24,17,17,17a17,17,0,0,0,17-17,17.66,17.66,0,0,0-.13-2.06A4.76,4.76,0,0,1,43.93,26.52Z" style="fill:none;stroke:#0b1222;stroke-miterlimit:10;stroke-width:1.5px"></path><circle cx="23.22" cy="20.72" r="1.57" style="fill:none;stroke:#0b1222;stroke-miterlimit:10;stroke-width:1.5px"></circle><circle cx="17.48" cy="29.02" r="1.57" style="fill:none;stroke:#0b1222;stroke-miterlimit:10;stroke-width:1.5px"></circle><circle cx="35.81" cy="34.9" r="1.57" style="fill:none;stroke:#0b1222;stroke-miterlimit:10;stroke-width:1.5px"></circle><circle cx="28.08" cy="27.46" r="2.57" style="fill:none;stroke:#0b1222;stroke-miterlimit:10;stroke-width:1.5px"></circle><circle cx="24.79" cy="36.47" r="3.76" style="fill:none;stroke:#0b1222;stroke-miterlimit:10;stroke-width:1.5px"></circle></svg>';
435                    if (tarteaucitron.parameters.cookieslist === true) {
436                        html += '   </button><!-- @whitespace';
437                        html += '   --><button type="button" id="tarteaucitronCookiesNumber">0</button>';
438                        html += '   <div id="tarteaucitronCookiesListContainer">';
439                        html += '       <button type="button" id="tarteaucitronClosePanelCookie">';
440                        html += '           ' + tarteaucitron.lang.close;
441                        html += '       </button>';
442                        html += '       <div class="tarteaucitronCookiesListMain" id="tarteaucitronCookiesTitle">';
443                        html += '            <span class="tarteaucitronH2" role="heading" aria-level="2" id="tarteaucitronCookiesNumberBis">0 cookie</span>';
444                        html += '       </div>';
445                        html += '       <div id="tarteaucitronCookiesList"></div>';
446                        html += '    </div>';
447                    } else {
448                        html += '   </div>';
449                    }
450                    html += '</div>';
451                }
452
453                tarteaucitron.addInternalScript(tarteaucitron.cdn + 'advertising.js?v=' + tarteaucitron.version, '', function () {
454                    if (tarteaucitronNoAdBlocker === true || tarteaucitron.parameters.adblocker === false) {
455
456                        // create a wrapper container at the same level than tarteaucitron so we can add an aria-hidden when tarteaucitron is opened
457                        /*var wrapper = document.createElement('div');
458                        wrapper.id = "contentWrapper";
459
460                        while (document.body.firstChild)
461                        {
462                            wrapper.appendChild(document.body.firstChild);
463                        }
464
465                        // Append the wrapper to the body
466                        document.body.appendChild(wrapper);*/
467
468                        div.id = 'tarteaucitronRoot';
469                        if (tarteaucitron.parameters.bodyPosition === 'top') {
470                            // Prepend tarteaucitron: #tarteaucitronRoot first-child of the body for better accessibility
471                            var bodyFirstChild = body.firstChild;
472                            body.insertBefore(div, bodyFirstChild);
473                        }
474                        else {
475                            // Append tarteaucitron: #tarteaucitronRoot last-child of the body
476                            body.appendChild(div, body);
477                        }
478                        div.innerHTML = html;
479
480                        //ie compatibility
481                        var tacRootAvailableEvent;
482                        if(typeof(Event) === 'function') {
483                            tacRootAvailableEvent = new Event("tac.root_available");
484                        }else{
485                            tacRootAvailableEvent = document.createEvent('Event');
486                            tacRootAvailableEvent.initEvent("tac.root_available", true, true);
487                        }
488                        //end ie compatibility
489
490                        window.dispatchEvent(tacRootAvailableEvent);
491
492                        if (tarteaucitron.job !== undefined) {
493                            tarteaucitron.job = tarteaucitron.cleanArray(tarteaucitron.job);
494                            for (index = 0; index < tarteaucitron.job.length; index += 1) {
495                                tarteaucitron.addService(tarteaucitron.job[index]);
496                            }
497                        } else {
498                            tarteaucitron.job = []
499                        }
500
501                        tarteaucitron.isAjax = true;
502
503                        tarteaucitron.job.push = function (id) {
504
505                            // ie <9 hack
506                            if (typeof tarteaucitron.job.indexOf === 'undefined') {
507                                tarteaucitron.job.indexOf = function (obj, start) {
508                                    var i,
509                                        j = this.length;
510                                    for (i = (start || 0); i < j; i += 1) {
511                                        if (this[i] === obj) { return i; }
512                                    }
513                                    return -1;
514                                };
515                            }
516
517                            if (tarteaucitron.job.indexOf(id) === -1) {
518                                Array.prototype.push.call(this, id);
519                            }
520                            tarteaucitron.launch[id] = false;
521                            tarteaucitron.addService(id);
522                        };
523
524                        if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
525                            tarteaucitron.userInterface.openPanel();
526                        }
527
528                        tarteaucitron.cookie.number();
529                        setInterval(tarteaucitron.cookie.number, 60000);
530                    }
531                }, tarteaucitron.parameters.adblocker);
532
533                if (tarteaucitron.parameters.adblocker === true) {
534                    setTimeout(function () {
535                        if (tarteaucitronNoAdBlocker === false) {
536                            html = '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + ' display-block" role="alert" aria-live="polite">';
537                            html += '   <p id="tarteaucitronDisclaimerAlert">';
538                            html += '       ' + tarteaucitron.lang.adblock + '<br/>';
539                            html += '       <strong>' + tarteaucitron.lang.adblock_call + '</strong>';
540                            html += '   </p>';
541                            html += '   <button type="button" class="tarteaucitronCTAButton" id="tarteaucitronCTAButton">';
542                            html += '       ' + tarteaucitron.lang.reload;
543                            html += '   </button>';
544                            html += '</div>';
545                            html += '<div id="tarteaucitronPremium"></div>';
546
547                            div.id = 'tarteaucitronRoot';
548                            if (tarteaucitron.parameters.bodyPosition === 'top') {
549                                // Prepend tarteaucitron: #tarteaucitronRoot first-child of the body for better accessibility
550                                var bodyFirstChild = body.firstChild;
551                                body.insertBefore(div, bodyFirstChild);
552                            }
553                            else {
554                                // Append tarteaucitron: #tarteaucitronRoot last-child of the body
555                                body.appendChild(div, body);
556                            }
557                            div.innerHTML = html;
558                        }
559                    }, 1500);
560                }
561
562                // add a little timeout to be sure everything is accessible
563                setTimeout(function () {
564                    
565                    // Setup events
566                    tarteaucitron.addClickEventToId("tarteaucitronPersonalize", function () {
567                        tarteaucitron.userInterface.openPanel();
568                    });
569                    tarteaucitron.addClickEventToId("tarteaucitronPersonalize2", function () {
570                        tarteaucitron.userInterface.respondAll(true);
571                    });
572                    tarteaucitron.addClickEventToId("tarteaucitronManager", function () {
573                        tarteaucitron.userInterface.openPanel();
574                    });
575                    tarteaucitron.addClickEventToId("tarteaucitronBack", function () {
576                        tarteaucitron.userInterface.closePanel();
577                    });
578                    tarteaucitron.addClickEventToId("tarteaucitronClosePanel", function () {
579                        tarteaucitron.userInterface.closePanel();
580                    });
581                    tarteaucitron.addClickEventToId("tarteaucitronClosePanelCookie", function () {
582                        tarteaucitron.userInterface.closePanel();
583                    });
584                    tarteaucitron.addClickEventToId("tarteaucitronPrivacyUrl", function () {
585                        document.location = tarteaucitron.parameters.privacyUrl;
586                    });
587                    tarteaucitron.addClickEventToId("tarteaucitronPrivacyUrlDialog", function () {
588                        document.location = tarteaucitron.parameters.privacyUrl;
589                    });
590                    tarteaucitron.addClickEventToId("tarteaucitronCookiesNumber", function () {
591                        tarteaucitron.userInterface.toggleCookiesList();
592                    });
593                    tarteaucitron.addClickEventToId("tarteaucitronAllAllowed", function () {
594                        tarteaucitron.userInterface.respondAll(true);
595                    });
596                    tarteaucitron.addClickEventToId("tarteaucitronAllDenied", function () {
597                        tarteaucitron.userInterface.respondAll(false);
598                    });
599                    tarteaucitron.addClickEventToId("tarteaucitronAllDenied2", function () {
600                        tarteaucitron.userInterface.respondAll(false);
601                    });
602                    tarteaucitron.addClickEventToId("tarteaucitronCloseAlert", function () {
603                        tarteaucitron.userInterface.openPanel();
604                    });
605                    tarteaucitron.addClickEventToId("tarteaucitronCTAButton", function () {
606                        location.reload();
607                    });
608                    var toggleBtns = document.getElementsByClassName("catToggleBtn");
609                    for (let i = 0; i < toggleBtns.length; i++) {
610                        tarteaucitron.addClickEventToElement(toggleBtns[i], function () {
611                            tarteaucitron.userInterface.toggle('tarteaucitronDetails' + cat[i], 'tarteaucitronInfoBox');
612                            return false;
613                        });
614                    }
615                    var allowBtns = document.getElementsByClassName("tarteaucitronAllow");
616                    for (let i = 0; i < allowBtns.length; i++) {
617                        tarteaucitron.addClickEventToElement(allowBtns[i], function () {
618                            tarteaucitron.userInterface.respond(this, true);
619                        });
620                    }
621                    var denyBtns = document.getElementsByClassName("tarteaucitronDeny");
622                    for (let i = 0; i < denyBtns.length; i++) {
623                        tarteaucitron.addClickEventToElement(denyBtns[i], function () {
624                            tarteaucitron.userInterface.respond(this, false);
625                        });
626                    }
627                }, 500);
628                
629            });
630        });
631
632        if(tarteaucitron.events.load) {
633            tarteaucitron.events.load();
634        }
635    },
636    "addService": function (serviceId) {
637        "use strict";
638        var html = '',
639            s = tarteaucitron.services,
640            service = s[serviceId],
641            cookie = tarteaucitron.cookie.read(),
642            hostname = document.location.hostname,
643            hostRef = document.referrer.split('/')[2],
644            isNavigating = (hostRef === hostname && window.location.href !== tarteaucitron.parameters.privacyUrl),
645            isAutostart = (!service.needConsent),
646            isWaiting = (cookie.indexOf(service.key + '=wait') >= 0),
647            isDenied = (cookie.indexOf(service.key + '=false') >= 0),
648            isAllowed = ((cookie.indexOf(service.key + '=true') >= 0) || (!service.needConsent && cookie.indexOf(service.key + '=false') < 0)),
649            isResponded = (cookie.indexOf(service.key + '=false') >= 0 || cookie.indexOf(service.key + '=true') >= 0),
650            isDNTRequested = (navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1" || window.doNotTrack === "1");
651
652        if (tarteaucitron.added[service.key] !== true) {
653            tarteaucitron.added[service.key] = true;
654
655            html += '<li id="' + service.key + 'Line" class="tarteaucitronLine">';
656            html += '   <div class="tarteaucitronName">';
657            html += '       <span class="tarteaucitronH3" role="heading" aria-level="3">' + service.name + '</span>';
658            html += '       <span id="tacCL' + service.key + '" class="tarteaucitronListCookies"></span><br/>';
659
660            if (tarteaucitron.parameters.moreInfoLink == true) {
661
662                var link = 'https://tarteaucitron.io/service/' + service.key + '/';
663                if (service.readmoreLink !== undefined && service.readmoreLink !== '') {
664                    link = service.readmoreLink;
665                }
666                if (tarteaucitron.parameters.readmoreLink !== undefined && tarteaucitron.parameters.readmoreLink !== '') {
667                    link = tarteaucitron.parameters.readmoreLink;
668                }
669                html += '       <a href="' + link + '" target="_blank" rel="noreferrer noopener" title="'+ tarteaucitron.lang.cookieDetail + ' ' + service.name + ' ' + tarteaucitron.lang.ourSite + ' ' + tarteaucitron.lang.newWindow +'">';
670                html += '           ' + tarteaucitron.lang.more;
671                html += '       </a>';
672                html += '        - ';
673                html += '       <a href="' + service.uri + '" target="_blank" rel="noreferrer noopener" title="' + service.name + ' ' + tarteaucitron.lang.newWindow + '">';
674                html += '           ' + tarteaucitron.lang.source;
675                html += '       </a>';
676            }
677
678            html += '   </div>';
679            html += '   <div class="tarteaucitronAsk">';
680            html += '       <button type="button" id="' + service.key + 'Allowed" class="tarteaucitronAllow">';
681            html += '           &#10003; ' + tarteaucitron.lang.allow;
682            html += '       </button> ';
683            html += '       <button type="button" id="' + service.key + 'Denied" class="tarteaucitronDeny">';
684            html += '           &#10007; ' + tarteaucitron.lang.deny;
685            html += '       </button>';
686            html += '   </div>';
687            html += '</li>';
688
689            tarteaucitron.userInterface.css('tarteaucitronServicesTitle_' + service.type, 'display', 'block');
690
691            if (document.getElementById('tarteaucitronServices_' + service.type) !== null) {
692                document.getElementById('tarteaucitronServices_' + service.type).innerHTML += html;
693            }
694
695            tarteaucitron.userInterface.css('tarteaucitronNoServicesTitle', 'display', 'none');
696
697            tarteaucitron.userInterface.order(service.type);
698        }
699
700        tarteaucitron.pro('!' + service.key + '=' + isAllowed);
701
702        // allow by default for non EU
703        if (isResponded === false && tarteaucitron.user.bypass === true) {
704            isAllowed = true;
705            tarteaucitron.cookie.create(service.key, true);
706        }
707
708        if ((!isResponded && (isAutostart || (isNavigating && isWaiting)) && !tarteaucitron.highPrivacy) || isAllowed) {
709            if (!isAllowed) {
710                tarteaucitron.cookie.create(service.key, true);
711            }
712            if (tarteaucitron.launch[service.key] !== true) {
713                tarteaucitron.launch[service.key] = true;
714                service.js();
715                tarteaucitron.sendEvent(service.key + '_loaded');
716            }
717            tarteaucitron.state[service.key] = true;
718            tarteaucitron.userInterface.color(service.key, true);
719        } else if (isDenied) {
720            if (typeof service.fallback === 'function') {
721                service.fallback();
722            }
723            tarteaucitron.state[service.key] = false;
724            tarteaucitron.userInterface.color(service.key, false);
725        } else if (!isResponded && isDNTRequested && tarteaucitron.handleBrowserDNTRequest) {
726            tarteaucitron.cookie.create(service.key, 'false');
727            if (typeof service.fallback === 'function') {
728                service.fallback();
729            }
730            tarteaucitron.state[service.key] = false;
731            tarteaucitron.userInterface.color(service.key, false);
732        } else if (!isResponded) {
733            tarteaucitron.cookie.create(service.key, 'wait');
734            if (typeof service.fallback === 'function') {
735                service.fallback();
736            }
737            tarteaucitron.userInterface.color(service.key, 'wait');
738            tarteaucitron.userInterface.openAlert();
739        }
740
741        tarteaucitron.cookie.checkCount(service.key);
742        tarteaucitron.sendEvent(service.key + '_added')
743    },
744    "sendEvent" : function(event_key) {
745        if(event_key !== undefined) {
746            //ie compatibility
747            var send_event_item;
748            if(typeof(Event) === 'function') {
749                send_event_item = new Event(event_key);
750            }else{
751                send_event_item = document.createEvent('Event');
752                send_event_item.initEvent(event_key, true, true);
753            }
754            //end ie compatibility
755
756            document.dispatchEvent(send_event_item);
757        }
758    },
759    "cleanArray": function cleanArray(arr) {
760        "use strict";
761        var i,
762            len = arr.length,
763            out = [],
764            obj = {},
765            s = tarteaucitron.services;
766
767        for (i = 0; i < len; i += 1) {
768            if (!obj[arr[i]]) {
769                obj[arr[i]] = {};
770                if (tarteaucitron.services[arr[i]] !== undefined) {
771                    out.push(arr[i]);
772                }
773            }
774        }
775
776        out = out.sort(function (a, b) {
777            if (s[a].type + s[a].key > s[b].type + s[b].key) { return 1; }
778            if (s[a].type + s[a].key < s[b].type + s[b].key) { return -1; }
779            return 0;
780        });
781
782        return out;
783    },
784    "userInterface": {
785        "css": function (id, property, value) {
786            "use strict";
787            if (document.getElementById(id) !== null) {
788                document.getElementById(id).style[property] = value;
789            }
790        },
791        "addClass": function (id, className) {
792            "use strict";
793            if (document.getElementById(id) !== null) {
794                document.getElementById(id).classList.add(className);
795            }
796        },
797        "removeClass": function (id, className) {
798            "use strict";
799            if (document.getElementById(id) !== null) {
800                document.getElementById(id).classList.remove(className);
801            }
802        },
803        "respondAll": function (status) {
804            "use strict";
805            var s = tarteaucitron.services,
806                service,
807                key,
808                index = 0;
809
810            for (index = 0; index < tarteaucitron.job.length; index += 1) {
811                service = s[tarteaucitron.job[index]];
812                key = service.key;
813                if (tarteaucitron.state[key] !== status) {
814                    if (status === false && tarteaucitron.launch[key] === true) {
815                        tarteaucitron.reloadThePage = true;
816                    }
817                    if (tarteaucitron.launch[key] !== true && status === true) {
818
819                        tarteaucitron.pro('!' + key + '=engage');
820
821                        tarteaucitron.launch[key] = true;
822                        tarteaucitron.services[key].js();
823                    }
824                    tarteaucitron.state[key] = status;
825                    tarteaucitron.cookie.create(key, status);
826                    tarteaucitron.userInterface.color(key, status);
827                }
828            }
829        },
830        "respond": function (el, status) {
831            "use strict";
832            var key = el.id.replace(new RegExp("(Eng[0-9]+|Allow|Deni)ed", "g"), '');
833
834            // return if same state
835            if (tarteaucitron.state[key] === status) {
836                return;
837            }
838
839            if (status === false && tarteaucitron.launch[key] === true) {
840                tarteaucitron.reloadThePage = true;
841            }
842
843            // if not already launched... launch the service
844            if (status === true) {
845                if (tarteaucitron.launch[key] !== true) {
846
847                    tarteaucitron.pro('!' + key + '=engage');
848
849                    tarteaucitron.launch[key] = true;
850                    tarteaucitron.sendEvent(key + '_loaded');
851                    tarteaucitron.services[key].js();
852                }
853            }
854            tarteaucitron.state[key] = status;
855            tarteaucitron.cookie.create(key, status);
856            tarteaucitron.userInterface.color(key, status);
857        },
858        "color": function (key, status) {
859            "use strict";
860            var c = 'tarteaucitron',
861                nbDenied = 0,
862                nbPending = 0,
863                nbAllowed = 0,
864                sum = tarteaucitron.job.length,
865                index;
866
867            if (status === true) {
868                document.getElementById(key + 'Line').classList.add('tarteaucitronIsAllowed');
869                document.getElementById(key + 'Line').classList.remove('tarteaucitronIsDenied');
870            } else if (status === false) {
871                document.getElementById(key + 'Line').classList.remove('tarteaucitronIsAllowed');
872                document.getElementById(key + 'Line').classList.add('tarteaucitronIsDenied');
873            }
874
875            // check if all services are allowed
876            for (index = 0; index < sum; index += 1) {
877                if (tarteaucitron.state[tarteaucitron.job[index]] === false) {
878                    nbDenied += 1;
879                } else if (tarteaucitron.state[tarteaucitron.job[index]] === undefined) {
880                    nbPending += 1;
881                } else if (tarteaucitron.state[tarteaucitron.job[index]] === true) {
882                    nbAllowed += 1;
883                }
884            }
885
886            tarteaucitron.userInterface.css(c + 'DotGreen', 'width', ((100 / sum) * nbAllowed) + '%');
887            tarteaucitron.userInterface.css(c + 'DotYellow', 'width', ((100 / sum) * nbPending) + '%');
888            tarteaucitron.userInterface.css(c + 'DotRed', 'width', ((100 / sum) * nbDenied) + '%');
889
890            if (nbDenied === 0 && nbPending === 0) {
891                tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected');
892                tarteaucitron.userInterface.addClass(c + 'AllAllowed', c + 'IsSelected');
893
894                tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsAllowed');
895                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied');
896            } else if (nbAllowed === 0 && nbPending === 0) {
897                tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected');
898                tarteaucitron.userInterface.addClass(c + 'AllDenied', c + 'IsSelected');
899
900                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed');
901                tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsDenied');
902            } else {
903                tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected');
904                tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected');
905
906                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed');
907                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied');
908            }
909
910            // close the alert if all service have been reviewed
911            if (nbPending === 0) {
912                tarteaucitron.userInterface.closeAlert();
913            }
914
915            if (tarteaucitron.services[key].cookies.length > 0 && status === false) {
916                tarteaucitron.cookie.purge(tarteaucitron.services[key].cookies);
917            }
918
919            if (status === true) {
920                if (document.getElementById('tacCL' + key) !== null) {
921                    document.getElementById('tacCL' + key).innerHTML = '...';
922                }
923                setTimeout(function () {
924                    tarteaucitron.cookie.checkCount(key);
925                }, 2500);
926            } else {
927                tarteaucitron.cookie.checkCount(key);
928            }
929        },
930        "openPanel": function () {
931            "use strict";
932
933            tarteaucitron.userInterface.css('tarteaucitron', 'display', 'block');
934            tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block');
935            tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none');
936
937            document.getElementById('tarteaucitronClosePanel').focus();
938            document.getElementsByTagName('body')[0].classList.add('modal-open');
939            tarteaucitron.userInterface.focusTrap();
940            tarteaucitron.userInterface.jsSizing('main');
941
942            //ie compatibility
943            var tacOpenPanelEvent;
944            if(typeof(Event) === 'function') {
945                tacOpenPanelEvent = new Event("tac.open_panel");
946            }else{
947                tacOpenPanelEvent = document.createEvent('Event');
948                tacOpenPanelEvent.initEvent("tac.open_panel", true, true);
949            }
950            //end ie compatibility
951
952            window.dispatchEvent(tacOpenPanelEvent);
953        },
954        "closePanel": function () {
955            "use strict";
956
957            if (document.location.hash === tarteaucitron.hashtag) {
958                if (window.history) {
959                    window.history.replaceState('', document.title, window.location.pathname + window.location.search);
960                } else {
961                    document.location.hash = '';
962                }
963            }
964            tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
965            tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none');
966
967            tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) {
968                elem.style.display = 'none';
969            }, true);
970
971            if (tarteaucitron.reloadThePage === true) {
972                window.location.reload();
973            } else {
974                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none');
975            }
976            if (document.getElementById('tarteaucitronCloseAlert') !== null) {
977                document.getElementById('tarteaucitronCloseAlert').focus();
978            }
979            document.getElementsByTagName('body')[0].classList.remove('modal-open');
980
981            //ie compatibility
982            var tacClosePanelEvent;
983            if(typeof(Event) === 'function') {
984                tacClosePanelEvent = new Event("tac.close_panel");
985            }else{
986                tacClosePanelEvent = document.createEvent('Event');
987                tacClosePanelEvent.initEvent("tac.close_panel", true, true);
988            }
989            //end ie compatibility
990
991            window.dispatchEvent(tacClosePanelEvent);
992        },
993        "focusTrap": function() {
994            "use strict";
995
996            var focusableEls,
997                firstFocusableEl,
998                lastFocusableEl,
999                filtered;
1000
1001            focusableEls = document.getElementById('tarteaucitron').querySelectorAll('a[href], button');
1002            filtered = [];
1003
1004            // get only visible items
vendor: 5,610 bytes, lines 1005-1139
1005            for (var i = 0, max = focusableEls.length; i < max; i++) {
1006                if (focusableEls[i].offsetHeight > 0) {
1007                   filtered.push(focusableEls[i]);
1008                }
1009            }
1010
1011            firstFocusableEl = filtered[0];
1012            lastFocusableEl = filtered[filtered.length - 1];
1013
1014            //loop focus inside tarteaucitron
1015            document.getElementById('tarteaucitron').addEventListener("keydown", function (evt) {
1016
1017                if ( evt.key === 'Tab' || evt.keyCode === 9 ) {
1018
1019                    if ( evt.shiftKey ) /* shift + tab */ {
1020                        if (document.activeElement === firstFocusableEl) {
1021                            lastFocusableEl.focus();
1022                            evt.preventDefault();
1023                        }
1024                    } else /* tab */ {
1025                        if (document.activeElement === lastFocusableEl) {
1026                            firstFocusableEl.focus();
1027                            evt.preventDefault();
1028                        }
1029                    }
1030                }
1031            })
1032        },
1033        "openAlert": function () {
1034            "use strict";
1035            var c = 'tarteaucitron';
1036            tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'block');
1037            tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'none');
1038            tarteaucitron.userInterface.css(c + 'AlertBig',   'display', 'block');
1039            tarteaucitron.userInterface.addClass(c + 'Root',   'tarteaucitronBeforeVisible');
1040
1041            //ie compatibility
1042            var tacOpenAlertEvent;
1043            if(typeof(Event) === 'function') {
1044                tacOpenAlertEvent = new Event("tac.open_alert");
1045            }else{
1046                tacOpenAlertEvent = document.createEvent('Event');
1047                tacOpenAlertEvent.initEvent("tac.open_alert", true, true);
1048            }
1049            //end ie compatibility
1050
1051            window.dispatchEvent(tacOpenAlertEvent);
1052        },
1053        "closeAlert": function () {
1054            "use strict";
1055            var c = 'tarteaucitron';
1056            tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'none');
1057            tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'block');
1058            tarteaucitron.userInterface.css(c + 'AlertBig',   'display', 'none');
1059            tarteaucitron.userInterface.removeClass(c + 'Root',   'tarteaucitronBeforeVisible');
1060            tarteaucitron.userInterface.jsSizing('box');
1061
1062            //ie compatibility
1063            var tacCloseAlertEvent;
1064            if(typeof(Event) === 'function') {
1065                tacCloseAlertEvent = new Event("tac.close_alert");
1066            }else{
1067                tacCloseAlertEvent = document.createEvent('Event');
1068                tacCloseAlertEvent.initEvent("tac.close_alert", true, true);
1069            }
1070            //end ie compatibility
1071
1072            window.dispatchEvent(tacCloseAlertEvent);
1073        },
1074        "toggleCookiesList": function () {
1075            "use strict";
1076            var div = document.getElementById('tarteaucitronCookiesListContainer');
1077
1078            if (div === null) {
1079                return;
1080            }
1081
1082            if (div.style.display !== 'block') {
1083                tarteaucitron.cookie.number();
1084                div.style.display = 'block';
1085                tarteaucitron.userInterface.jsSizing('cookie');
1086                tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
1087                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block');
1088                tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) {
1089                    elem.style.display = 'none';
1090                }, true);
1091            } else {
1092                div.style.display = 'none';
1093                tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
1094                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none');
1095            }
1096        },
1097        "toggle": function (id, closeClass) {
1098            "use strict";
1099            var div = document.getElementById(id);
1100
1101            if (div === null) {
1102                return;
1103            }
1104
1105            if (closeClass !== undefined) {
1106                tarteaucitron.fallback([closeClass], function (elem) {
1107                    if (elem.id !== id) {
1108                        elem.style.display = 'none';
1109                    }
1110                }, true);
1111            }
1112
1113            if (div.style.display !== 'block') {
1114                div.style.display = 'block';
1115            } else {
1116                div.style.display = 'none';
1117            }
1118        },
1119        "order": function (id) {
1120            "use strict";
1121            var main = document.getElementById('tarteaucitronServices_' + id),
1122                allDivs,
1123                store = [],
1124                i;
1125
1126            if (main === null) {
1127                return;
1128            }
1129
1130            allDivs = main.childNodes;
1131
1132            if (typeof Array.prototype.map === 'function' && typeof Enumerable === 'undefined') {
1133                Array.prototype.map.call(main.children, Object).sort(function (a, b) {
1134                //var mainChildren = Array.from(main.children);
1135                //mainChildren.sort(function (a, b) {
1136                    if (tarteaucitron.services[a.id.replace(/Line/g, '')].name > tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return 1; }
1137                    if (tarteaucitron.services[a.id.replace(/Line/g, '')].name < tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return -1; }
1138                    return 0;
1139                }
1139).forEach(function (element) {
1140                    main.appendChild(element);
1141                });
1142            }
1143        },
1144        "jsSizing": function (type) {
1145            "use strict";
1146            var scrollbarMarginRight = 10,
1147                scrollbarWidthParent,
1148                scrollbarWidthChild,
1149                servicesHeight,
1150                e = window,
1151                a = 'inner',
1152                windowInnerHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight,
1153                mainTop,
1154                mainHeight,
1155                closeButtonHeight,
1156                headerHeight,
1157                cookiesListHeight,
1158                cookiesCloseHeight,
1159                cookiesTitleHeight,
1160                paddingBox,
1161                alertSmallHeight,
1162                cookiesNumberHeight;
1163
1164            if (type === 'box') {
1165                if (document.getElementById('tarteaucitronAlertSmall') !== null && document.getElementById('tarteaucitronCookiesNumber') !== null) {
1166
1167                    // reset
1168                    tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', '0px 10px');
1169
1170                    // calculate
1171                    alertSmallHeight = document.getElementById('tarteaucitronAlertSmall').offsetHeight;
1172                    cookiesNumberHeight = document.getElementById('tarteaucitronCookiesNumber').offsetHeight;
1173                    paddingBox = (alertSmallHeight - cookiesNumberHeight) / 2;
1174
1175                    // apply
1176                    tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', paddingBox + 'px 10px');
1177                }
1178            } else if (type === 'main') {
1179
1180                // get the real window width for media query
1181                if (window.innerWidth === undefined) {
1182                    a = 'client';
1183                    e = document.documentElement || document.body;
1184                }
1185
1186                // height of the services list container
1187                if (document.getElementById('tarteaucitron') !== null && document.getElementById('tarteaucitronClosePanel') !== null && document.getElementById('tarteaucitronMainLineOffset') !== null) {
1188
1189                    // reset
1190                    tarteaucitron.userInterface.css('tarteaucitronServices', 'height', 'auto');
1191
1192                    // calculate
1193                    mainHeight = document.getElementById('tarteaucitron').offsetHeight;
1194                    closeButtonHeight = document.getElementById('tarteaucitronClosePanel').offsetHeight;
1195
1196                    // apply
1197                    servicesHeight = (mainHeight - closeButtonHeight + 2);
1198                    tarteaucitron.userInterface.css('tarteaucitronServices', 'height', servicesHeight + 'px');
1199                    tarteaucitron.userInterface.css('tarteaucitronServices', 'overflow-x', 'auto');
1200                }
1201
1202                // align the main allow/deny button depending on scrollbar width
1203                if (document.getElementById('tarteaucitronServices') !== null && document.getElementById('tarteaucitronScrollbarChild') !== null) {
1204
1205                    // media query
1206                    if (e[a + 'Width'] <= 479) {
1207                        //tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginLeft', '11px');
1208                    } else if (e[a + 'Width'] <= 767) {
1209                        scrollbarMarginRight = 12;
1210                    }
1211
1212                    scrollbarWidthParent = document.getElementById('tarteaucitronServices').offsetWidth;
1213                    scrollbarWidthChild = document.getElementById('tarteaucitronScrollbarChild').offsetWidth;
1214                    //tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginRight', ((scrollbarWidthParent - scrollbarWidthChild) + scrollbarMarginRight) + 'px');
1215                }
1216
1217                // center the main panel
1218                if (document.getElementById('tarteaucitron') !== null) {
1219
1220                    // media query
1221                    if (e[a + 'Width'] <= 767) {
1222                        mainTop = 0;
1223                    } else {
1224                        mainTop = ((windowInnerHeight - document.getElementById('tarteaucitron').offsetHeight) / 2) - 21;
1225                    }
1226
1227                    if (document.getElementById('tarteaucitronMainLineOffset') !== null) {
1228                        if (document.getElementById('tarteaucitron').offsetHeight < (windowInnerHeight / 2)) {
1229                            mainTop -= document.getElementById('tarteaucitronMainLineOffset').offsetHeight;
1230                        }
1231                    }
1232
1233                    // correct
1234                    if (mainTop < 0) {
1235                        mainTop = 0;
1236                    }
1237
1238                    // apply
1239                    tarteaucitron.userInterface.css('tarteaucitron', 'top', mainTop + 'px');
1240                }
1241
1242
1243            } else if (type === 'cookie') {
1244
1245                // put cookies list at bottom
1246                if (document.getElementById('tarteaucitronAlertSmall') !== null) {
1247                    tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'bottom', (document.getElementById('tarteaucitronAlertSmall').offsetHeight) + 'px');
1248                }
1249
1250                // height of cookies list
1251                if (document.getElementById('tarteaucitronCookiesListContainer') !== null) {
1252
1253                    // reset
1254                    tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', 'auto');
1255
1256                    // calculate
1257                    cookiesListHeight = document.getElementById('tarteaucitronCookiesListContainer').offsetHeight;
1258                    cookiesCloseHeight = document.getElementById('tarteaucitronClosePanelCookie').offsetHeight;
1259                    cookiesTitleHeight = document.getElementById('tarteaucitronCookiesTitle').offsetHeight;
1260
1261                    // apply
1262                    tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', (cookie
vendor: 9,707 bytes, lines 1262-1461
1262sListHeight - cookiesCloseHeight - cookiesTitleHeight - 2) + 'px');
1263                }
1264            }
1265        }
1266    },
1267    "cookie": {
1268        "owner": {},
1269        "create": function (key, status) {
1270            "use strict";
1271
1272            if (tarteaucitronForceExpire !== '') {
1273                // The number of day(s)/hour(s) can't be higher than 1 year
1274                if ((tarteaucitronExpireInDay && tarteaucitronForceExpire < 365) || (!tarteaucitronExpireInDay && tarteaucitronForceExpire < 8760)) {
1275                    if (tarteaucitronExpireInDay) {
1276                        // Multiplication to tranform the number of days to milliseconds
1277                        timeExpire = tarteaucitronForceExpire * 86400000;
1278                    } else {
1279                        // Multiplication to tranform the number of hours to milliseconds
1280                        timeExpire = tarteaucitronForceExpire * 3600000;
1281                    }
1282                }
1283            }
1284
1285            var d = new Date(),
1286                time = d.getTime(),
1287                expireTime = time + timeExpire, // 365 days
1288                regex = new RegExp("!" + key + "=(wait|true|false)", "g"),
1289                cookie = tarteaucitron.cookie.read().replace(regex, ""),
1290                value = tarteaucitron.parameters.cookieName + '=' + cookie + '!' + key + '=' + status,
1291                domain = (tarteaucitron.parameters.cookieDomain !== undefined && tarteaucitron.parameters.cookieDomain !== '') ? '; domain=' + tarteaucitron.parameters.cookieDomain : '',
1292                secure = location.protocol === 'https:' ? '; Secure' : '';
1293
1294            d.setTime(expireTime);
1295            document.cookie = value + '; expires=' + d.toGMTString() + '; path=/' + domain + secure + '; samesite=lax';
1296        },
1297        "read": function () {
1298            "use strict";
1299            var nameEQ = tarteaucitron.parameters.cookieName + "=",
1300                ca = document.cookie.split(';'),
1301                i,
1302                c;
1303
1304            for (i = 0; i < ca.length; i += 1) {
1305                c = ca[i];
1306                while (c.charAt(0) === ' ') {
1307                    c = c.substring(1, c.length);
1308                }
1309                if (c.indexOf(nameEQ) === 0) {
1310                    return c.substring(nameEQ.length, c.length);
1311                }
1312            }
1313            return '';
1314        },
1315        "purge": function (arr) {
1316            "use strict";
1317            var i;
1318
1319            for (i = 0; i < arr.length; i += 1) {
1320                document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/;';
1321                document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname + ';';
1322                document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname.split('.').slice(-2).join('.') + ';';
1323            }
1324        },
1325        "checkCount": function (key) {
1326            "use strict";
1327            var arr = tarteaucitron.services[key].cookies,
1328                nb = arr.length,
1329                nbCurrent = 0,
1330                html = '',
1331                i,
1332                status = document.cookie.indexOf(key + '=true');
1333
1334            if (status >= 0 && nb === 0) {
1335                html += tarteaucitron.lang.useNoCookie;
1336            } else if (status >= 0) {
1337                for (i = 0; i < nb; i += 1) {
1338                    if (document.cookie.indexOf(arr[i] + '=') !== -1) {
1339                        nbCurrent += 1;
1340                        if (tarteaucitron.cookie.owner[arr[i]] === undefined) {
1341                            tarteaucitron.cookie.owner[arr[i]] = [];
1342                        }
1343                        if (tarteaucitron.cookie.crossIndexOf(tarteaucitron.cookie.owner[arr[i]], tarteaucitron.services[key].name) === false) {
1344                            tarteaucitron.cookie.owner[arr[i]].push(tarteaucitron.services[key].name);
1345                        }
1346                    }
1347                }
1348
1349                if (nbCurrent > 0) {
1350                    html += tarteaucitron.lang.useCookieCurrent + ' ' + nbCurrent + ' cookie';
1351                    if (nbCurrent > 1) {
1352                        html += 's';
1353                    }
1354                    html += '.';
1355                } else {
1356                    html += tarteaucitron.lang.useNoCookie;
1357                }
1358            } else if (nb === 0) {
1359                html = tarteaucitron.lang.noCookie;
1360            } else {
1361                html += tarteaucitron.lang.useCookie + ' ' + nb + ' cookie';
1362                if (nb > 1) {
1363                    html += 's';
1364                }
1365                html += '.';
1366            }
1367
1368            if (document.getElementById('tacCL' + key) !== null) {
1369                document.getElementById('tacCL' + key).innerHTML = html;
1370            }
1371        },
1372        "crossIndexOf": function (arr, match) {
1373            "use strict";
1374            var i;
1375            for (i = 0; i < arr.length; i += 1) {
1376                if (arr[i] === match) {
1377                    return true;
1378                }
1379            }
1380            return false;
1381        },
1382        "number": function () {
1383            "use strict";
1384            var cookies = document.cookie.split(';'),
1385                nb = (document.cookie !== '') ? cookies.length : 0,
1386                html = '',
1387                i,
1388                name,
1389                namea,
1390                nameb,
1391                c,
1392                d,
1393                s = (nb > 1) ? 's' : '',
1394                savedname,
1395                regex = /^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i,
1396                regexedDomain = (tarteaucitron.cdn.match(regex) !== null) ? tarteaucitron.cdn.match(regex)[1] : tarteaucitron.cdn,
1397                host = (tarteaucitron.domain !== undefined) ? tarteaucitron.domain : regexedDomain;
1398
1399            cookies = cookies.sort(function (a, b) {
1400                namea = a.split('=', 1).toString().replace(/ /g, '');
1401                nameb = b.split('=', 1).toString().replace(/ /g, '');
1402                c = (tarteaucitron.cookie.owner[namea] !== undefined) ? tarteaucitron.cookie.owner[namea] : '0';
1403                d = (tarteaucitron.cookie.owner[nameb] !== undefined) ? tarteaucitron.cookie.owner[nameb] : '0';
1404                if (c + a > d + b) { return 1; }
1405                if (c + a < d + b) { return -1; }
1406                return 0;
1407            });
1408
1409            if (document.cookie !== '') {
1410                for (i = 0; i < nb; i += 1) {
1411                    name = cookies[i].split('=', 1).toString().replace(/ /g, '');
1412                    if (tarteaucitron.cookie.owner[name] !== undefined && tarteaucitron.cookie.owner[name].join(' // ') !== savedname) {
1413                        savedname = tarteaucitron.cookie.owner[name].join(' // ');
1414                        html += '<div class="tarteaucitronHidden">';
1415                        html += '     <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="3">';
1416                        html += '        ' + tarteaucitron.cookie.owner[name].join(' // ');
1417                        html += '    </span>';
1418                        html += '</div><ul class="cookie-list">';
1419                    } else if (tarteaucitron.cookie.owner[name] === undefined && host !== savedname) {
1420                        savedname = host;
1421                        html += '<div class="tarteaucitronHidden">';
1422                        html += '     <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="3">';
1423                        html += '        ' + host;
1424                        html += '    </span>';
1425                        html += '</div><ul class="cookie-list">';
1426                    }
1427                    html += '<li class="tarteaucitronCookiesListMain">';
1428                    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>';
1429                    html += '    </div>';
1430                    html += '    <div class="tarteaucitronCookiesListRight">' + tarteaucitron.fixSelfXSS(cookies[i].split('=').slice(1).join('=')) + '</div>';
1431                    html += '</li>';
1432                }
1433                html += '</ul>';
1434            } else {
1435                html += '<div class="tarteaucitronCookiesListMain">';
1436                html += '    <div class="tarteaucitronCookiesListLeft"><strong>-</strong></div>';
1437                html += '    <div class="tarteaucitronCookiesListRight"></div>';
1438                html += '</div>';
1439            }
1440
1441            html += '<div class="tarteaucitronHidden spacer-20"></div>';
1442
1443            if (document.getElementById('tarteaucitronCookiesList') !== null) {
1444                document.getElementById('tarteaucitronCookiesList').innerHTML = html;
1445            }
1446
1447            if (document.getElementById('tarteaucitronCookiesNumber') !== null) {
1448                document.getElementById('tarteaucitronCookiesNumber').innerHTML = nb;
1449            }
1450
1451            if (document.getElementById('tarteaucitronCookiesNumberBis') !== null) {
1452                document.getElementById('tarteaucitronCookiesNumberBis').innerHTML = nb + ' cookie' + s;
1453            }
1454
1455            var purgeBtns = document.getElementsByClassName("purgeBtn");
1456            for (let i = 0; i < purgeBtns.length; i++) {
1457                tarteaucitron.addClickEventToElement(purgeBtns[i], function () {
1458                    tarteaucitron.cookie.purge([this.dataset.cookie]);
1459                    tarteaucitron.cookie.number();
1460                    tarteaucitron.userInterface.jsSizing('cookie');
1461                    return false;
1462                });
1463            }
1464
1465            for (i = 0; i < tarteaucitron.job.length; i += 1) {
1466                tarteaucitron.cookie.checkCount(tarteaucitron.job[i]);
1467            }
1468        }
1469    },
1470    "fixSelfXSS": function(html) {
1471        fixed = html.toString().replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
1472        return fixed;
1473    },
1474    "getLanguage": function () {
1475        "use strict";
1476
1477        var availableLanguages = 'bg,cn,cs,da,de,el,en,es,fi,fr,hu,it,ja,nl,oc,pl,pt,ro,ru,se,sk,tr,vi',
1478            defaultLanguage = 'en';
1479
1480        if (tarteaucitronForceLanguage !== '') {
1481            if (availableLanguages.indexOf(tarteaucitronForceLanguage) !== -1) {
1482                return tarteaucitronForceLanguage;
1483            }
1484        }
1485
1486        if (!navigator) { return 'en'; }
1487
1488        var lang = navigator.language || navigator.browserLanguage ||
1489                navigator.systemLanguage || navigator.userLang || null,
1490            userLanguage = lang ? lang.substr(0, 2) : null;
1491
1492        if (availableLanguages.indexOf(userLanguage) === -1) {
1493            return defaultLanguage;
1494        }
1495        return userLanguage;
1496    },
1497    "getLocale": function () {
1498        "use strict";
1499        if (!navigator) { return 'en_US'; }
1500
1501        var lang = navigator.language || navigator.browserLanguage ||
1502                navigator.systemLanguage || navigator.userLang || null,
1503            userLanguage = lang ? lang.substr(0, 2) : null;
1504
1505        if (userLanguage === 'fr') {
1506            return 'fr_FR';
1507        } else if (userLanguage === 'en') {
1508            return 'en_US';
1509        } else if (userLanguage === 'de') {
1510            return 'de_DE';
1511        } else if (userLanguage === 'es') {
1512            return 'es_ES';
1513        } else if (userLanguage === 'it') {
1514            return 'it_IT';
1515        } else if (userLanguage === 'pt') {
1516            return 'pt_PT';
1517        } else if (userLanguage === 'nl') {
1518            return 'nl_NL';
1519        } else if (userLanguage === 'el') {
1520            return 'el_EL';
1521        } else {
1522            return 'en_US';
1523        }
1524    },
1525    "addScript": function (url, id, callback, execute, attrName, attrVal, internal) {
1526        "use strict";
1527        var script,
1528            done = false;
1529
1530        if (execute === false) {
1531            if (typeof callback === 'function') {
1532                callback();
1533            }
1534        } else {
1535            script = document.createElement('script');
1536            script.type = 'text/javascript';
1537            script.id = (id !== undefined) ? id : '';
1538            script.async = true;
1539            script.src = url;
1540
1541            if (attrName !== undefined && attrVal !== undefined) {
1542                script.setAttribute(attrName, attrVal);
1543            }
1544
1545            if (typeof callback === 'function') {
1546                if ( !tarteaucitron.parameters.useExternalJs ) {
1547                    script.onreadystatechange = script.onload = function () {
1548                        var state = script.readyState;
1549                        if (!done && (!state || /loaded|complete/.test(state))) {
1550                            done = true;
1551                            callback();
1552                        }
1553                    };
1554                } else {
1555                    callback();
1556                }
1557            }
1558
1559            if ( !tarteaucitron.parameters.useExternalJs || !internal ) {
1560                document.getElementsByTagName('head')[0].appendChild(script);
1561            }
1562        }
1563    },
1564    "addInternalScript": function (url, id, callback, execute, attrName, attrVal) {
1565        tarteaucitron.addScript(url, id, callback, execute, attrName, attrVal, true);
1566    },
1567    "makeAsync": {
1568        "antiGhost": 0,
1569        "buffer": '',
1570        "init": function (url, id) {
1571            "use strict";
1572            var savedWrite = document.write,
1573                savedWriteln = document.writeln;
1574
1575            document.write = function (content) {
1576                tarteaucitron.makeAsync.buffer += content;
1577            };
1578            document.writeln = function (content) {
1579                tarteaucitron.makeAsync.buffer += content.concat("\n");
1580            };
1581
1582            setTimeout(function () {
1583                document.write = savedWrite;
1584                document.writeln = savedWriteln;
1585            }, 20000);
1586
1587            tarteaucitron.makeAsync.getAndParse(url, id);
1588        },
1589        "getAndParse": function (url, id) {
1590            "use strict";
1591            if (tarteaucitron.makeAsync.antiGhost > 9) {
1592                tarteaucitron.makeAsync.antiGhost = 0;
1593                return;
1594            }
1595            tarteaucitron.makeAsync.antiGhost += 1;
1596            tarteaucitron.addInternalScript(url, '', function () {
1597                if (document.getElementById(id) !== null) {
1598                    document.getElementById(id).innerHTML += "<span class='display-none'>&nbsp;</span>" + tarteaucitron.makeAsync.buffer;
1599                    tarteaucitron.makeAsync.buffer = '';
1600                    tarteaucitron.makeAsync.execJS(id);
1601                }
1602            });
1603        },
1604        "execJS": function (id) {
1605            /* not strict because third party scripts may have errors */
1606            var i,
1607                scripts,
1608                childId,
1609                type;
1610
1611            if (document.getElementById(id) === null) {
1612                return;
1613            }
1614
1615            scripts = document.getElementById(id).getElementsByTagName('script');
1616            for (i = 0; i < scripts.length; i += 1) {
1617                type = (scripts[i].getAttribute('type') !== null) ? scripts[i].getAttribute('type') : '';
1618                if (type === '') {
1619                    type = (scripts[i].getAttribute('language') !== null) ? scripts[i].getAttribute('language') : '';
1620                }
1621                if (scripts[i].getAttribute('src') !== null && scripts[i].getAttribute('src') !== '') {
1622                    childId = id + Math.floor(Math.random() * 99999999999);
1623                    document.getElementById(id).innerHTML += '<div id="' + childId + '"></div>';
1624                    tarteaucitron.makeAsync.getAndParse(scripts[i].getAttribute('src'), childId);
1625                } else if (type.indexOf('javascript') !== -1 || type === '') {
1626                    eval(scripts[i].innerHTML);
1627                }
1628            }
1629        }
1630    },
1631    "fallback": function (matchClass, content, noInner) {
1632        "use strict";
1633        var elems = document.getElementsByTagName('*'),
1634            i,
1635            index = 0;
1636
1637        for (i in elems) {
1638            if (elems[i] !== undefined) {
1639                for (index = 0; index < matchClass.length; index += 1) {
1640                    if ((' ' + elems[i].className + ' ')
1641                            .indexOf(' ' + matchClass[index] + ' ') > -1) {
1642                        if (typeof content === 'function') {
1643                            if (noInner === true) {
1644                                content(elems[i]);
1645                            } else {
1646                                elems[i].innerHTML = content(elems[i]);
1647                            }
1648                        } else {
1649                            elems[i].innerHTML = content;
1650                        }
1651                    }
1652                }
1653            }
1654        }
1655    },
1656    "engage": function (id) {
1657        "use strict";
1658        var html = '',
1659            r = Math.floor(Math.random() * 100000),
1660            engage = tarteaucitron.services[id].name + ' ' + tarteaucitron.lang.fallback;
1661
1662        if (tarteaucitron.lang['engage-' + id] !== undefined) {
1663            engage = tarteaucitron.lang['engage-' + id];
1664        }
1665
1666        html += '<div class="tac_activate">';
1667        html += '   <div class="tac_float">';
1668        html += '      ' + engage;
1669//        html += '      <button type="button" class="tarteaucitronAllow" id="Eng' + r + 'ed' + id + '" onclick="tarteaucitron.userInterface.respond(this, true);">';
1670        html += '      <button type="button" class="tarteaucitronAllow" id="Eng' + r + 'ed' + id + '">';
1671        html += '          &#10003; ' + tarteaucitron.lang.allow;
1672        html += '       </button>';
1673        html += '   </div>';
1674        html += '</div>';
1675
1676        return html;
1677    },
1678    "extend": function (a, b) {
1679        "use strict";
1680        var prop;
1681        for (prop in b) {
1682            if (b.hasOwnProperty(prop)) {
1683                a[prop] = b[prop];
1684            }
1685        }
1686    },
1687    "proTemp": '',
1688    "proTimer": function () {
1689        "use strict";
1690        setTimeout(tarteaucitron.proPing, 500);
1691    },
1692    "pro": function (list) {
1693        "use strict";
1694        tarteaucitron.proTemp += list;
1695        clearTimeout(tarteaucitron.proTimer);
1696        tarteaucitron.proTimer = setTimeout(tarteaucitron.proPing, 500);
1697    },
1698    "proPing": function () {
1699        "use strict";
1700        if (tarteaucitron.uuid !== '' && tarteaucitron.uuid !== undefined && tarteaucitron.proTemp !== '') {
1701            var div = document.getElementById('tarteaucitronPremium'),
1702                timestamp = new Date().getTime(),
1703                url = 'https://tarteaucitron.io/log/?';
1704
1705            if (div === null) {
1706                return;
1707            }
1708
1709            url += 'account=' + tarteaucitron.uuid + '&';
1710            url += 'domain=' + tarteaucitron.domain + '&';
1711            url += 'status=' + encodeURIComponent(tarteaucitron.proTemp) + '&';
1712            url += '_time=' + timestamp;
1713
1714            div.innerHTML = '<img src="' + url + '" class="display-none" />';
1715
1716            tarteaucitron.proTemp = '';
1717        }
1718
1719        tarteaucitron.cookie.number();
1720    },
1721    "AddOrUpdate" : function(source, custom){
1722        /**
1723         Utility function to Add or update the fields of obj1 with the ones in obj2
1724         */
1725        for(key in custom){
1726            if(custom[key] instanceof Object){
1727                source[key] = tarteaucitron.AddOrUpdate(source[key], custom[key]);
1728            }else{
1729                source[key] = custom[key];
1730            }
1731        }
1732        return source;
1733    },
1734    "getElemWidth": function(elem) {
1735        return elem.getAttribute('width') || elem.clientWidth;
1736    },
1737    "getElemHeight": function(elem) {
1738        return elem.getAttribute('height') || elem.clientHeight;
1739    },
1740    "addClickEventToId": function (elemId, func) {
1741        tarteaucitron.addClickEventToElement(document.getElementById(elemId), func);
1742    },
1743    "addClickEventToElement": function (e, func) {
1744        if (e) {
1745            if (e.addEventListener) {
1746                e.addEventListener("click", func);
1747            } else {
1748                e.attachEvent("onclick", func);
1749            }
1750        }
1751    }
1752};

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.