PageSourceSearch

https://www.fullers.co.nz/Content/Scripts/CookieConsent/cookieconsent.js

js fullers.co.nz collected 2026-09-24 09:35:13 UTC 34,389 bytes, 594 lines download raw bytes

1! function (e) {
2    if (!e.hasInitialised) {
3        var t = {
4            escapeRegExp: function (e) {
5                return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&")
6            },
7            hasClass: function (e, t) {
8                var i = " ";
9                return 1 === e.nodeType && (i + e.className + i).replace(/[\n\t]/g, i).indexOf(i + t + i) >= 0
10            },
11            addClass: function (e, t) {
12                e.className += " " + t
13            },
14            removeClass: function (e, t) {
15                var i = new RegExp("\\b" + this.escapeRegExp(t) + "\\b");
16                e.className = e.className.replace(i, "")
17            },
18            interpolateString: function (e, t) {
19                var i = /{{([a-z][a-z0-9\-_]*)}}/gi;
20                return e.replace(i, function (e) {
21                    return t(arguments[1]) || ""
22                })
23            },
24            getCookie: function (e) {
25                var t = "; " + document.cookie,
26                    i = t.split("; " + e + "=");
27                return i.length < 2 ? void 0 : i.pop().split(";").shift()
28            },
29            setCookie: function (e, t, i, n, o, s) {
30                var r = new Date;
31                r.setDate(r.getDate() + (i || 365));
32                var a = [e + "=" + t, "expires=" + r.toUTCString(), "path=" + (o || "/")];
33                n && a.push("domain=" + n), s && a.push("secure"), document.cookie = a.join(";")
34            },
35            deepExtend: function (e, t) {
36                for (var i in t) t.hasOwnProperty(i) && (i in e && this.isPlainObject(e[i]) && this.isPlainObject(t[i]) ? this.deepExtend(e[i], t[i]) : e[i] = t[i]);
37                return e
38            },
39            throttle: function (e, t) {
40                var i = !1;
41                return function () {
42                    i || (e.apply(this, arguments), i = !0, setTimeout(function () {
43                        i = !1
44                    }, t))
45                }
46            },
47            hash: function (e) {
48                var t, i, n, o = 0;
49                if (0 === e.length) return o;
50                for (t = 0, n = e.length; t < n; ++t) i = e.charCodeAt(t), o = (o << 5) - o + i, o |= 0;
51                return o
52            },
53            normaliseHex: function (e) {
54                return "#" == e[0] && (e = e.substr(1)), 3 == e.length && (e = e[0] + e[0] + e[1] + e[1] + e[2] + e[2]), e
55            },
56            getContrast: function (e) {
57                e = this.normaliseHex(e);
58                var t = parseInt(e.substr(0, 2), 16),
59                    i = parseInt(e.substr(2, 2), 16),
60                    n = parseInt(e.substr(4, 2), 16),
61                    o = (299 * t + 587 * i + 114 * n) / 1e3;
62                return o >= 128 ? "#000" : "#fff"
63            },
64            getLuminance: function (e) {
65                var t = parseInt(this.normaliseHex(e), 16),
66                    i = 38,
67                    n = (t >> 16) + i,
68                    o = (t >> 8 & 255) + i,
69                    s = (255 & t) + i,
70                    r = (16777216 + 65536 * (n < 255 ? n < 1 ? 0 : n : 255) + 256 * (o < 255 ? o < 1 ? 0 : o : 255) + (s < 255 ? s < 1 ? 0 : s : 255)).toString(16).slice(1);
71                return "#" + r
72            },
73            isMobile: function () {
74                return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
75            },
76            isPlainObject: function (e) {
77                return "object" == typeof e && null !== e && e.constructor == Object
78            },
79            traverseDOMPath: function (e, i) {
80                return e && e.parentNode ? t.hasClass(e, i) ? e : this.traverseDOMPath(e.parentNode, i) : null
81            }
82        };
83        e.status = {
84            deny: "deny",
85            allow: "allow",
86            dismiss: "dismiss"
87        }, e.transitionEnd = function () {
88            var e = document.createElement("div"),
89                t = {
90                    t: "transitionend",
91                    OT: "oTransitionEnd",
92                    msT: "MSTransitionEnd",
93                    MozT: "transitionend",
94                    WebkitT: "webkitTransitionEnd"
95                };
96            for (var i in t)
97                if (t.hasOwnProperty(i) && "undefined" != typeof e.style[i + "ransition"]) return t[i];
98            return ""
99        }(), e.hasTransition = !!e.transitionEnd;
100        var i = Object.keys(e.status).map(t.escapeRegExp);
101        e.customStyles = {}, e.Popup = function () {
102            function n() {
103                this.initialise.apply(this, arguments)
104            }
105
106            function o(e) {
107                this.openingTimeout = null, t.removeClass(e, "cc-invisible")
108            }
109
110            function s(t) {
111                t.style.display = "none", t.removeEventListener(e.transitionEnd, this.afterTransition), this.afterTransition = null
112            }
113
114            function r() {
115                var t = this.options.onInitialise.bind(this);
116                if (!window.navigator.cookieEnabled) return t(e.status.deny), !0;
117                if (window.CookiesOK || window.navigator.CookiesOK) return t(e.status.allow), !0;
118                var i = Object.keys(e.status),
119                    n = this.getStatus(),
120                    o = i.indexOf(n) >= 0;
121                return o && t(n), o
122            }
123
124            function a() {
125                var e = this.options.position.split("-"),
126                    t = [];
127                return e.forEach(function (e) {
128                    t.push("cc-" + e)
129                }), t
130            }
131
132            function c() {
133                var e = this.options,
134                    i = "top" == e.position || "bottom" == e.position ? "banner" : "floating";
135                t.isMobile() && (i = "floating");
136                var n = ["cc-" + i, "cc-type-" + e.type, "cc-theme-" + e.theme];
137                e["static"] && n.push("cc-static"), n.push.apply(n, a.call(this));
138                p.call(this, this.options.palette);
139                return this.customStyleSelector && n.push(this.customStyleSelector), n
140            }
141
142            function l() {
143                var e = {},
144                    i = this.options;
145                i.showLink || (i.elements.link = "", i.elements.messagelink = i.elements.message), Object.keys(i.elements).forEach(function (n) {
146                    e[n] = t.interpolateString(i.elements[n], function (e) {
147                        var t = i.content[e];
148                        return e && "string" == typeof t && t.length ? t : ""
149                    })
150                });
151                var n = i.compliance[i.type];
152                n || (n = i.compliance.info), e.compliance = t.interpolateString(n, function (t) {
153                    return e[t]
154                });
155                var o = i.layouts[i.layout];
156                return o || (o = i.layouts.basic), t.interpolateString(o, function (t) {
157                    return e[t]
158                })
159            }
160
161            function u(i) {
162                var n = this.options,
163                    o = document.createElement("div"),
164                    s = n.container && 1 === n.container.nodeType ? n.container : document.body;
165                o.innerHTML = i;
166                var r = o.children[0];
167                return r.style.display = "none", t.hasClass(r, "cc-window") && e.hasTransition && t.addClass(r, "cc-invisible"), this.onButtonClick = h.bind(this), r.addEventListener("click", this.onButtonClick), n.autoAttach && (s.firstChild ? s.insertBefore(r, s.firstChild) : s.appendChild(r)), r
168            }
169
170            function h(n) {
171                var o = t.traverseDOMPath(n.target, "cc-btn") || n.target;
172                if (t.hasClass(o, "cc-btn")) {
173                    var s = o.className.match(new RegExp("\\bcc-(" + i.join("|") + ")\\b")),
174                        r = s && s[1] || !1;
175                    r && (this.setStatus(r), this.close(!0))
176                }
177                t.hasClass(o, "cc-close") && (this.setStatus(e.status.dismiss), this.close(!0)), t.hasClass(o, "cc-revoke") && this.revokeChoice()
178            }
179
180            function p(e) {
181                var i = t.hash(JSON.stringify(e)),
182                    n = "cc-color-override-" + i,
183                    o = t.isPlainObject(e);
184                return this.customStyleSelector = o ? n : null, o && d(i, e, "." + n), o
185            }
186
187            function d(i, n, o) {
188                if (e.customStyles[i]) return void ++e.customStyles[i].references;
189                var s = {},
190                    r = n.popup,
191                    a = n.button,
192                    c = n.highlight;
193                r && (r.text = r.text ? r.text : t.getContrast(r.background), r.link = r.link ? r.link : r.text, s[o + ".cc-window"] = ["color: #002E6D", "background-color: " + r.background], s[o + ".cc-revoke"] = ["color: " + r.text, "background-color: " + r.background], s[o + " .cc-link," + o + " .cc-link:active," + o + " .cc-link:visited"] = ["color: " + r.link], a && (a.text = a.text ? a.text : t.getContrast(a.background), a.border = a.border ? a.border : "transparent", s[o + " .cc-btn"] = ["color: " + a.text, "border-color: " + a.border, "background-color: white "], a.padding && s[o + " .cc-btn"].push("padding: " + a.padding), "transparent" != a.background && (s[o + " .cc-btn:hover, " + o + " .cc-btn:focus"] = ["background-color: " + (a.hover || v(a.background))]), c ? (c.text = c.text ? c.text : t.getContrast(c.background), c.border = c.border ? c.border : "transparent", s[o + " .cc-highlight .cc-btn:first-child"] = ["color: " + c.text, "border-color: " + c.border, "background-color: " + c.background]) : s[o + " .cc-highlight .cc-btn:first-child"] = ["color: " + r.text]));
194                var l = document.createElement("style");
195                document.head.appendChild(l), e.customStyles[i] = {
196                    references: 1,
197                    element: l.sheet
198                };
199                var u = -1;
200                for (var h in s) s.hasOwnProperty(h) && l.sheet.insertRule(h + "{" + s[h].join(";") + "}", ++u)
201            }
202
203            function v(e) {
204                return e = t.normaliseHex(e), "000000" == e ? "#222" : t.getLuminance(e)
205            }
206
207            function f(i) {
208                if (t.isPlainObject(i)) {
209                    var n = t.hash(JSON.stringify(i)),
210                        o = e.customStyles[n];
211                    if (o && !--o.references) {
212                        var s = o.element.ownerNode;
213                        s && s.parentNode && s.parentNode.removeChild(s), e.customStyles[n] = null
214                    }
215                }
216            }
217
218            function m(e, t) {
219                for (var i = 0, n = e.length; i < n; ++i) {
220                    var o = e[i];
221                    if (o instanceof RegExp && o.test(t) || "string" == typeof o && o.length && o === t) return !0
222                }
223                return !1
224            }
225
226            function b() {
227                var i = this.setStatus.bind(this),
228                    n = this.close.bind(this),
229                    o = this.options.dismissOnTimeout;
230                "number" == typeof o && o >
vendor: 4,320 bytes, lines 230-302
230= 0 && (this.dismissTimeout = window.setTimeout(function () {
231                    i(e.status.dismiss), n(!0)
232                }, Math.floor(o)));
233                var s = this.options.dismissOnScroll;
234                if ("number" == typeof s && s >= 0) {
235                    var r = function (t) {
236                        window.pageYOffset > Math.floor(s) && (i(e.status.dismiss), n(!0), window.removeEventListener("scroll", r), this.onWindowScroll = null)
237                    };
238                    this.options.enabled && (this.onWindowScroll = r, window.addEventListener("scroll", r))
239                }
240                var a = this.options.dismissOnWindowClick,
241                    c = this.options.ignoreClicksFrom;
242                if (a) {
243                    var l = function (o) {
244                        for (var s = !1, r = o.path.length, a = c.length, u = 0; u < r; u++)
245                            if (!s)
246                                for (var h = 0; h < a; h++) s || (s = t.hasClass(o.path[u], c[h]));
247                        s || (i(e.status.dismiss), n(!0), window.removeEventListener("click", l), this.onWindowClick = null)
248                    }.bind(this);
249                    this.options.enabled && (this.onWindowClick = l, window.addEventListener("click", l))
250                }
251            }
252
253            function g() {
254                if ("info" != this.options.type && (this.options.revokable = !0), t.isMobile() && (this.options.animateRevokable = !1), this.options.revokable) {
255                    var e = a.call(this);
256                    this.options.animateRevokable && e.push("cc-animate"), this.customStyleSelector && e.push(this.customStyleSelector);
257                    var i = this.options.revokeBtn.replace("{{classes}}", e.join(" ")).replace("{{policy}}", this.options.content.policy);
258                    this.revokeBtn = u.call(this, i);
259                    var n = this.revokeBtn;
260                    if (this.options.animateRevokable) {
261                        var o = t.throttle(function (e) {
262                            var i = !1,
263                                o = 20,
264                                s = window.innerHeight - 20;
265                            t.hasClass(n, "cc-top") && e.clientY < o && (i = !0), t.hasClass(n, "cc-bottom") && e.clientY > s && (i = !0), i ? t.hasClass(n, "cc-active") || t.addClass(n, "cc-active") : t.hasClass(n, "cc-active") && t.removeClass(n, "cc-active")
266                        }, 200);
267                        this.onMouseMove = o, window.addEventListener("mousemove", o)
268                    }
269                }
270            }
271            var y = {
272                enabled: !0,
273                container: null,
274                cookie: {
275                    name: "cookieconsent_status",
276                    path: "/",
277                    domain: "",
278                    expiryDays: 365,
279                    secure: !1
280                },
281                onPopupOpen: function () { },
282                onPopupClose: function () { },
283                onInitialise: function (e) { },
284                onStatusChange: function (e, t) { },
285                onRevokeChoice: function () { },
286                onNoCookieLaw: function (e, t) { },
287                content: {
288                    header: "Cookies used on the website!",
289                    message: "This website uses cookies to ensure you get the best experience on our website.",
290                    dismiss: "Got it!",
291                    allow: "Allow cookies",
292                    deny: "Decline",
293                    link: "Learn more",
294                    href: "https://cookiesandyou.com",
295                    close: "&#x274c;",
296                    target: "_blank",
297                    policy: "Cookie Policy"
298                },
299                elements: {
300                    header: '<span class="cc-header">{{header}}</span>&nbsp;',
301                    message: '<span id="cookieconsent:desc" class="cc-message">{{message}}</span>',
302                    messagelink: '<span id="cookieconsent:desc" class="cc-message">{{message}} <a aria-label="learn more about cookies" role=button tabindex="0" class="cc-link" href="{{href}}" rel="noopener noreferrer nofollow" target="{{target}}">{{link}}</a></span>',
303                    dismiss: '<a aria-label="dismiss cookie message" role=button tabindex="0" class="cc-btn cc-dismiss">{{dismiss}}</a>',
304                    allow: '<a aria-label="allow cookies" role=button tabindex="0"  class="cc-btn cc-allow">{{allow}}</a>',
305                    deny: '<a aria-label="deny cookies" role=button tabindex="0" class="cc-btn cc-deny">{{deny}}</a>',
306                    link: '<a aria-label="learn more about cookies" role=button tabindex="0" class="cc-link" href="{{href}}" rel="noopener noreferrer nofollow" target="{{target}}">{{link}}</a>',
307                    close: '<span aria-label="dismiss cookie message" role=button tabindex="0" class="cc-close">{{close}}</span>'
308                },
309                window: '<div role="dialog" aria-live="polite" aria-label="cookieconsent" aria-describedby="cookieconsent:desc" class="cc-window {{classes}}"><!--googleoff: all-->{{children}}<!--googleon: all--></div>',
310                revokeBtn: '<div class="cc-revoke {{classes}}">{{policy}}</div>',
311                compliance: {
312                    info: '<div class="cc-compliance">{{dismiss}}</div>',
313                    "opt-in": '<div class="cc-compliance cc-highlight">{{deny}}{{allow}}</div>',
314                    "opt-out": '<div class="cc-compliance cc-highlight">{{deny}}{{allow}}</div>'
315                },
316                type: "info",
317                layouts: {
318                    basic: "{{messagelink}}{{compliance}}",
319                    "basic-close": "{{messagelink}}{{compliance}}{{close}}",
320                    "basic-header": "{{header}}{{message}}{{link}}{{compliance}}"
321                },
322                layout: "basic",
323                position: "bottom",
324                theme: "block",
325                "static": !1,
326                palette: null,
327                revokable: !1,
328                animateRevokable: !0,
329                showLink: !0,
330                dismissOnScroll: !1,
331                dismissOnTimeout: !1,
332                dismissOnWindowClick: !1,
333                ignoreClicksFrom: ["cc-revoke", "cc-btn"],
334                autoOpen: !0,
335                autoAttach: !0,
336                whitelistPage: [],
337                blacklistPage: [],
338                overrideHTML: null
339            };
340            return n.prototype.initialise = function (e) {
341                this.options && this.destroy(), t.deepExtend(this.options = {}, y), t.isPlainObject(e) && t.deepExtend(this.options, e), r.call(this) && (this.options.enabled = !1), m(this.options.blacklistPage, location.pathname) && (this.options.enabled = !1), m(this.options.whitelistPage, location.pathname) && (this.options.enabled = !0);
342                var i = this.options.window.replace("{{classes}}
vendor: 7,287 bytes, lines 342-438
342", c.call(this).join(" ")).replace("{{children}}", l.call(this)),
343                    n = this.options.overrideHTML;
344                if ("string" == typeof n && n.length && (i = n), this.options["static"]) {
345                    var o = u.call(this, '<div class="cc-grower">' + i + "</div>");
346                    o.style.display = "", this.element = o.firstChild, this.element.style.display = "none", t.addClass(this.element, "cc-invisible")
347                } else this.element = u.call(this, i);
348                b.call(this), g.call(this), this.options.autoOpen && this.autoOpen()
349            }, n.prototype.destroy = function () {
350                this.onButtonClick && this.element && (this.element.removeEventListener("click", this.onButtonClick), this.onButtonClick = null), this.dismissTimeout && (clearTimeout(this.dismissTimeout), this.dismissTimeout = null), this.onWindowScroll && (window.removeEventListener("scroll", this.onWindowScroll), this.onWindowScroll = null), this.onWindowClick && (window.removeEventListener("click", this.onWindowClick), this.onWindowClick = null), this.onMouseMove && (window.removeEventListener("mousemove", this.onMouseMove), this.onMouseMove = null), this.element && this.element.parentNode && this.element.parentNode.removeChild(this.element), this.element = null, this.revokeBtn && this.revokeBtn.parentNode && this.revokeBtn.parentNode.removeChild(this.revokeBtn), this.revokeBtn = null, f(this.options.palette), this.options = null
351            }, n.prototype.open = function (t) {
352                if (this.element) return this.isOpen() || (e.hasTransition ? this.fadeIn() : this.element.style.display = "", this.options.revokable && this.toggleRevokeButton(), this.options.onPopupOpen.call(this)), this
353            }, n.prototype.close = function (t) {
354                if (this.element) return this.isOpen() && (e.hasTransition ? this.fadeOut() : this.element.style.display = "none", t && this.options.revokable && this.toggleRevokeButton(!0), this.options.onPopupClose.call(this)), this
355            }, n.prototype.fadeIn = function () {
356                var i = this.element;
357                if (e.hasTransition && i && (this.afterTransition && s.call(this, i), t.hasClass(i, "cc-invisible"))) {
358                    if (i.style.display = "", this.options["static"]) {
359                        var n = this.element.clientHeight;
360                        this.element.parentNode.style.maxHeight = n + "px"
361                    }
362                    var r = 20;
363                    this.openingTimeout = setTimeout(o.bind(this, i), r)
364                }
365            }, n.prototype.fadeOut = function () {
366                var i = this.element;
367                e.hasTransition && i && (this.openingTimeout && (clearTimeout(this.openingTimeout), o.bind(this, i)), t.hasClass(i, "cc-invisible") || (this.options["static"] && (this.element.parentNode.style.maxHeight = ""), this.afterTransition = s.bind(this, i), i.addEventListener(e.transitionEnd, this.afterTransition), t.addClass(i, "cc-invisible")))
368            }, n.prototype.isOpen = function () {
369                return this.element && "" == this.element.style.display && (!e.hasTransition || !t.hasClass(this.element, "cc-invisible"))
370            }, n.prototype.toggleRevokeButton = function (e) {
371                this.revokeBtn && (this.revokeBtn.style.display = e ? "" : "none")
372            }, n.prototype.revokeChoice = function (e) {
373                this.options.enabled = !0, this.clearStatus(), this.options.onRevokeChoice.call(this), e || this.autoOpen()
374            }, n.prototype.hasAnswered = function (t) {
375                return Object.keys(e.status).indexOf(this.getStatus()) >= 0
376            }, n.prototype.hasConsented = function (t) {
377                var i = this.getStatus();
378                return i == e.status.allow || i == e.status.dismiss
379            }, n.prototype.autoOpen = function (e) {
380                !this.hasAnswered() && this.options.enabled ? this.open() : this.hasAnswered() && this.options.revokable && this.toggleRevokeButton(!0)
381            }, n.prototype.setStatus = function (i) {
382                var n = this.options.cookie,
383                    o = t.getCookie(n.name),
384                    s = Object.keys(e.status).indexOf(o) >= 0;
385                Object.keys(e.status).indexOf(i) >= 0 ? (t.setCookie(n.name, i, n.expiryDays, n.domain, n.path, n.secure), this.options.onStatusChange.call(this, i, s)) : this.clearStatus()
386            }, n.prototype.getStatus = function () {
387                return t.getCookie(this.options.cookie.name)
388            }, n.prototype.clearStatus = function () {
389                var e = this.options.cookie;
390                t.setCookie(e.name, "", -1, e.domain, e.path)
391            }, n
392        }(), e.Location = function () {
393            function e(e) {
394                t.deepExtend(this.options = {}, s), t.isPlainObject(e) && t.deepExtend(this.options, e), this.currentServiceIndex = -1
395            }
396
397            function i(e, t, i) {
398                var n, o = document.createElement("script");
399                o.type = "text/" + (e.type || "javascript"), o.src = e.src || e, o.async = !1, o.onreadystatechange = o.onload = function () {
400                    var e = o.readyState;
401                    clearTimeout(n), t.done || e && !/loaded|complete/.test(e) || (t.done = !0, t(), o.onreadystatechange = o.onload = null)
402                }, document.body.appendChild(o), n = setTimeout(function () {
403                    t.done = !0, t(), o.onreadystatechange = o.onload = null
404                }, i)
405            }
406
407            function n(e, t, i, n, o) {
408                var s = new (window.XMLHttpRequest || window.ActiveXObject)("MSXML2.XMLHTTP.3.0");
409                if (s.open(n ? "POST" : "GET", e, 1), s.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), Array.isArray(o))
410                    for (var r = 0, a = o.length; r < a; ++r) {
411                        var c = o[r].split(":", 2);
412                        s.setRequestHeader(c[0].replace(/^\s+|\s+$/g, ""), c[1].replace(/^\s+|\s+$/g, ""))
413                    }
414                "function" == typeof t && (s.onreadystatechange = function () {
415                    s.readyState > 3 && t(s)
416                }), s.send(n)
417            }
418
419            function o(e) {
420                return new Error("Error [" + (e.code || "UNKNOWN") + "]: " + e.error)
421            }
422            var s = {
423                timeout: 5e3,
424                services: ["ipinfo"],
425                serviceDefinitions: {
426                    ipinfo: function () {
427                        return {
428                            url: "//ipinfo.io",
429                            headers: ["Accept: application/json"],
430                            callback: function (e, t) {
431                                try {
432                                    var i = JSON.parse(t);
433                                    return i.error ? o(i) : {
434                                        code: i.country
435                                    }
436                                } catch (n) {
437                                    return o({
438                                        error: "Invalid response 
438(" + n + ")"
439                                    })
440                                }
441                            }
442                        }
443                    },
444                    ipinfodb: function (e) {
445                        return {
446                            url: "//api.ipinfodb.com/v3/ip-country/?key={api_key}&format=json&callback={callback}",
447                            isScript: !0,
448                            callback: function (e, t) {
449                                try {
450                                    var i = JSON.parse(t);
451                                    return "ERROR" == i.statusCode ? o({
452                                        error: i.statusMessage
453                                    }) : {
454                                            code: i.countryCode
455                                        }
456                                } catch (n) {
457                                    return o({
458                                        error: "Invalid response (" + n + ")"
459                                    })
460                                }
461                            }
462                        }
463                    },
464                    maxmind: function () {
465                        return {
466                            url: "//js.maxmind.com/js/apis/geoip2/v2.1/geoip2.js",
467                            isScript: !0,
468                            callback: function (e) {
469                                return window.geoip2 ? void geoip2.country(function (t) {
470                                    try {
471                                        e({
472                                            code: t.country.iso_code
473                                        })
474                                    } catch (i) {
475                                        e(o(i))
476                                    }
477                                }, function (t) {
478                                    e(o(t))
479                                }) : void e(new Error("Unexpected response format. The downloaded script should have exported `geoip2` to the global scope"))
480                            }
481                        }
482                    }
483                }
484            };
485            return e.prototype.getNextService = function () {
486                var e;
487                do e = this.getServiceByIdx(++this.currentServiceIndex); while (this.currentServiceIndex < this.options.services.length && !e);
488                return e
489            }, e.prototype.getServiceByIdx = function (e) {
490                var i = this.options.services[e];
491                if ("function" == typeof i) {
492                    var n = i();
493                    return n.name && t.deepExtend(n, this.options.serviceDefinitions[n.name](n)), n
494                }
495                return "string" == typeof i ? this.options.serviceDefinitions[i]() : t.isPlainObject(i) ? this.options.serviceDefinitions[i.name](i) : null
496            }, e.prototype.locate = function (e, t) {
497                var i = this.getNextService();
498                return i ? (this.callbackComplete = e, this.callbackError = t, void this.runService(i, this.runNextServiceOnError.bind(this))) : void t(new Error("No services to run"))
499            }, e.prototype.setupUrl = function (e) {
500                var t = this.getCurrentServiceOpts();
501                return e.url.replace(/\{(.*?)\}/g, function (i, n) {
502                    if ("callback" === n) {
503                        var o = "callback" + Date.now();
504                        return window[o] = function (t) {
505                            e.__JSONP_DATA = JSON.stringify(t)
506                        }, o
507                    }
508                    if (n in t.interpolateUrl) return t.interpolateUrl[n]
509                })
510            }, e.prototype.runService = function (e, t) {
511                var o = this;
512                if (e && e.url && e.callback) {
513                    var s = e.isScript ? i : n,
514                        r = this.setupUrl(e);
515                    s(r, function (i) {
516                        var n = i ? i.responseText : "";
517                        e.__JSONP_DATA && (n = e.__JSONP_DATA, delete e.__JSONP_DATA), o.runServiceCallback.call(o, t, e, n)
518                    }, this.options.timeout, e.data, e.headers)
519                }
520            }, e.prototype.runServiceCallback = function (e, t, i) {
521                var n = this,
522                    o = function (t) {
523                        s || n.onServiceResult.call(n, e, t)
524                    },
525                    s = t.callback(o, i);
526                s && this.onServiceResult.call(this, e, s)
527            }, e.prototype.onServiceResult = function (e, t) {
528                t instanceof Error || t && t.error ? e.call(this, t, null) : e.call(this, null, t)
529            }, e.prototype.runNextServiceOnError = function (e, t) {
530                if (e) {
531                    this.logError(e);
532                    var i = this.getNextService();
533                    i ? this.runService(i, this.runNextServiceOnError.bind(this)) : this.completeService.call(this, this.callbackError, new Error("All services failed"))
534                } else this.completeService.call(this, this.callbackComplete, t)
535            }, e.prototype.getCurrentServiceOpts = function () {
536                var e = this.options.services[this.currentServiceIndex];
537                return "string" == typeof e ? {
538                    name: e
539                } : "function" == typeof e ? e() : t.isPlainObject(e) ? e : {}
540            }, e.prototype.completeService = function (e, t) {
541                this.currentServiceIndex = -1, e && e(t)
542            }, e.prototype.logError = function (e) {
543                var t = this.currentServiceIndex,
544                    i = this.getServiceByIdx(t);
545                console.warn("The service[" + t + "] (" + i.url + ") responded with the following error", e)
546            }, e
547        }(), e.Law = function () {
548            function e(e) {
549                this.initialise.apply(this, arguments)
550            }
551            var i = {
552                regionalLaw: !0,
553                hasLaw: ["AT", "BE", "BG", "HR", "CZ", "CY", "DK", "EE", "FI", "FR", "DE", "EL", "HU", "IE", "IT", "LV", "LT", "LU", "MT", "NL", "PL", "PT", "SK", "ES", "SE", "GB", "UK", "GR", "EU"],
554                revokable: ["HR", "CY", "DK", "EE", "FR", "DE", "LV", "LT", "NL", "PT", "ES"],
555                explicitAction: ["HR", "IT", "ES"]
556            };
557            return e.prototype.initialise = function (e) {
558                t.deepExtend(this.options = {}, i), t.isPlainObject(e) && t.deepExtend(this.options, e)
559            }, e.prototype.get = function (e) {
560                var t = this.options;
561                return {
562                    hasLaw: t.hasLaw.indexOf(e) >= 0,
563                    revokable: t.revokable.indexOf(e) >= 0,
564                    explicitAction: t.explicitAction.indexOf(e) >= 0
565                }
566            }, e.prototype.applyLaw = function (e, t) {
567                var i = this.get(t);
568                return i.hasLaw || (e.enabled = !1, "function" == typeof e.onNoCookieLaw && e.onNoCookieLaw(t, i)), this.options.regionalLaw && (i.revokable && (e.revokable = !0), i.explicitAction && (e.dismissOnScroll = !1, e.dismissOnTimeout = !1)), e
569            }, e
570        }(), e.initialise = function (i, n, o) {
571            var s = new e.Law(i.law);
572            n || (n = function () { }), o || (o = function () { });
573            var r = Object.keys(e.status),
574                a = t.getCookie("cookieconsent_status"),
575                c = r.indexOf(a) >= 0;
576            return c ? void n(new e.Popup(i)) : void e.getCountryCode(i, function (t) {
577                delete i.law, delete i.location, t.code && (i = s.applyLaw(i, t.code)), n(new e.Popup(i))
578            }, function (t) {
579                delete i.law, delete i.location, o(t, new e.Popup(i))
580            })
581        }, e.getCountryCode = function (t, i, n) {
582            if (t.law && t.law.countryCode) return void i({
583                code: t.law.countryCode
584            });
585            if (t.location) {
586                var o = new e.Location(t.location);
587                return void o.locate(function (e) {
588                    i(e || {})
589                }, n)
590            }
591            i({})
592        }, e.utils = t, e.hasInitialised = !0, window.cookieconsent = e
593    }
594}(window.cookieconsent || {});

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.