Advertisement
Guest User

Statvoo Analytics Unminified Tracking Code

a guest
Aug 19th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* statvoo.com - v1.7.0 */ ! function(t) {
  2.     function e(t, e) {
  3.         this.scriptObj = !1, this.src = t, this.async = e, this.hook = !1
  4.     }
  5.  
  6.     function o() {
  7.         this.start_time = new Date, this.last_activity = new Date, this.ltid = 0, this.sid = 0, this.record = new Array, this.cursorX = 0, this.cursorY = 0, this.scrollX = 0, this.scrollY = 0, this.hasTyped = !1, this.hasClicked = !1
  8.     }
  9.  
  10.     function a() {}
  11.  
  12.     function i() {}
  13.  
  14.     function n() {}
  15.  
  16.     function s() {}
  17.     e.prototype.clear = function() {
  18.         this.scriptObj.parentNode.removeChild(this.scriptObj)
  19.     }, e.prototype.load = function(t) {
  20.         this.scriptObj = document.createElement("script"), this.scriptObj.src = this.src, this.scriptObj.async = this.async, this.hook = document.getElementsByTagName("script")[0], this.hook.parentNode.insertBefore(this.scriptObj, this.hook);
  21.         var e = this;
  22.         this.hook && ("undefined" != typeof this.scriptObj.onreadystatechange ? this.scriptObj.onreadystatechange = function() {
  23.             ("complete" == this.readyState || "loaded" == this.readyState) && (void 0 != t && t(), e.clear())
  24.         } : this.scriptObj.onload = function() {
  25.             setTimeout(function() {}, 400), void 0 != t && t(), e.clear()
  26.         })
  27.     }, o.prototype.checkCursor = function() {
  28.         var e = t.statvoo.tracker,
  29.             o = document.documentElement,
  30.             a = document.body;
  31.         e.scrollX = o && o.scrollLeft || a && a.scrollLeft || 0, e.scrollY = o && o.scrollTop || a && a.scrollTop || 0;
  32.         var i = e.hasTyped ? 1 : 0,
  33.             n = e.hasClicked ? 1 : 0;
  34.         e.hasTyped = !1, e.hasClicked = !1, e.record.push(e.cursorX + "|" + e.cursorY + "|" + e.scrollX + "|" + e.scrollY + "|" + i + "|" + n + "|" + screen.width)
  35.     }, o.prototype.randomstring = function() {
  36.         for (var t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", e = "", o = 0; 12 > o; o++) {
  37.             var a = Math.floor(Math.random() * t.length);
  38.             e += t.substring(a, a + 1)
  39.         }
  40.         return e
  41.     }, o.prototype.trackPath = function(e, o) {
  42.         t.statvoo.helper;
  43.         return "https://analytics-api.statvoo.com/v3/wst/" + e + "/" + o
  44.     }, o.prototype.pinger = function() {
  45.         var o = t.statvoo.tracker;
  46.         t.statvoo.debug && console.log("ping:" + o.ltid);
  47.         var a = new Date,
  48.             i = a.getTime(),
  49.             n = o.last_activity.getTime(),
  50.             s = new Date,
  51.             r = s - o.start_time;
  52.         o.start_time = new Date;
  53.         var c = o.record,
  54.             d = "?_=" + this.randomstring() + "&s=" + this.site + "&ltid=" + o.ltid + "&g=" + this.guid + "&t=" + this.title + "&ts=" + encodeURIComponent(r) + "&record=" + encodeURIComponent(c);
  55.         o.record = new Array, 3e5 > i - n ? o.source = o.trackPath("ping", d) : this.source = o.trackPath("ping", d + "&idle=1"), t.statvoo.script = new e(this.source, "async"), t.statvoo.script.load()
  56.     }, o.prototype.postHTML = function() {
  57.         if (document.getElementsByTagName("html").length) {
  58.             var t = document.createElement("iframe"),
  59.                 e = (0 | 9e6 * Math.random()).toString(36);
  60.             document.body.appendChild(t), t.style.display = "none", t.contentWindow.name = e;
  61.             var o = document.createElement("form");
  62.             o.target = e, o.action = "https://analytics-api.statvoo.com/v3/wst/html/", o.method = "POST";
  63.             var a = document.createElement("input");
  64.             a.type = "hidden", a.name = "s", a.value = this.site, o.appendChild(a);
  65.             var a = document.createElement("input");
  66.             a.type = "hidden", a.name = "ltid", a.value = this.ltid, o.appendChild(a);
  67.             var a = document.createElement("input");
  68.             a.type = "hidden", a.name = "g", a.value = this.guid, o.appendChild(a);
  69.             var a = document.createElement("input");
  70.             a.type = "hidden", a.name = "html", a.value = document.getElementsByTagName("html")[0].innerHTML, o.appendChild(a), document.body.appendChild(o), o.submit(), t.onload = function() {
  71.                 t.parentNode.removeChild(t)
  72.             }
  73.         }
  74.     }, o.prototype.moved = function(e) {
  75.         var o = t.statvoo.tracker;
  76.         o.last_activity = new Date, e = e || window.event, o.cursorX = e.pageX || e.clientX, o.cursorY = e.pageY || e.clientY
  77.     }, o.prototype.typed = function(t) {
  78.         var e = v.tracker;
  79.         e.moved(t), e.hasTyped = !0
  80.     }, o.prototype.clicked = function(o) {
  81.         t.statvoo.debug && console.log("clicked");
  82.         var a = t.statvoo.tracker;
  83.         a.moved(o), a.hasClicked = !0, o = o || window.event;
  84.         var i = o.target || o.srcElement,
  85.             n = i.href;
  86.         return void 0 == n || n.startsWith("javascript") ? !0 : n.startsWith(location.protocol + "//" + location.hostname) ? void 0 : (a.source = a.trackPath("click", "?_=" + a.randomstring() + "&s=" + a.site + "&r=" + a.referrer + "&l=" + a.language + "&p=" + a.platform + "&d=" + a.screenres + "&g=" + a.guid + "&t=" + a.title + "&lk=" + encodeURIComponent(n)), t.statvoo.script = new e(a.source, "async"), t.statvoo.script.load(), a.sleep(400), !0)
  87.     }, o.prototype.sleep = function(t) {
  88.         for (t += (new Date).getTime(); new Date < t;);
  89.     }, o.prototype.kill = function() {
  90.         var e = t.statvoo.tracker;
  91.         clearInterval(e.intPing), clearInterval(e.intCursor), clearInterval(e.intHref)
  92.     }, o.prototype.initialize = function() {
  93.         t.statvoo.debug && console.log("initialized");
  94.         var o = t.statvoo.tracker;
  95.         clearInterval(o.intPing), o.intPing = 0, clearInterval(o.intCursor), o.intCursor = 0, clearInterval(o.intHref), o.intHref = 0, o.location = location.href, o.site = encodeURIComponent(location.hostname), o.referrer = encodeURIComponent(document.referrer), o.language = encodeURIComponent(navigator.browserLanguage || navigator.language || ""), o.platform = encodeURIComponent(navigator.platform), o.screenres = encodeURIComponent(screen.width + "x" + screen.height), o.title = encodeURIComponent(document.title), document.cookie.indexOf("statvoo_tracker") >= 0 ? o.guid = t.statvoo.cookie.view() : (o.today = new Date, o.expire = new Date, o.nDays = 5e4, o.expire.setTime(o.today.getTime() + 864e5 * o.nDays), o.guid = t.statvoo.cookie.save(), document.cookie = "statvoo_tracker=" + escape(o.guid) + ";path=/;domain=" + location.hostname + ";expires=" + o.expire.toGMTString()), o.source = o.trackPath("track", "?_=" + o.randomstring() + "&s=" + o.site + "&r=" + o.referrer + "&l=" + o.language + "&p=" + o.platform + "&d=" + o.screenres + "&g=" + o.guid + "&t=" + o.title), t.statvoo.script = new e(o.source, "async"), t.statvoo.script.load(), o.intPing = setInterval(function() {
  96.             o.pinger()
  97.         }, 15e3), "undefined" != typeof document.attachEvent ? (document.attachEvent("onmousedown", o.clicked), document.attachEvent("onmousemove", o.moved), document.attachEvent("onkeydown", o.typed)) : (document.addEventListener("mousedown", o.clicked, !1), document.addEventListener("mousemove", o.moved, !1), document.addEventListener("keydown", o.typed, !1)), o.intCursor = setInterval(function() {
  98.             o.checkCursor()
  99.         }, 1e3), o.intHref = setInterval(function() {
  100.             o.location != location.href && o.initialize()
  101.         }, 100)
  102.     }, o.prototype.monitorXHR = function() {
  103.         ! function() {
  104.             var t = window.XMLHttpRequest.prototype.send;
  105.             window.XMLHttpRequest.prototype.send = function() {
  106.                 var e = {};
  107.                 e.arguments = arguments, e.ms = 0;
  108.                 var o = this,
  109.                     a = window.setInterval(function() {
  110.                         return 4 != o.readyState ? void e.ms++ : (e.responseText = o.responseText, e.responseURL = o.responseURL, e.status = o.status, e.pointer = o, clearInterval(a), void console.log(e))
  111.                     }, 1);
  112.                 return t.apply(this, [].slice.call(arguments))
  113.             }
  114.         }()
  115.     };
  116.     var r = function(o, a) {
  117.             var i = t.statvoo.tracker;
  118.             i.source = i.trackPath("event", "?_=" + i.randomstring() + "&s=" + i.site + "&ltid=" + i.ltid + "&g=" + i.guid + "&v_key=" + encodeURIComponent(o) + "&v_value=" + encodeURIComponent(a) + "&r=" + i.referrer + "&l=" + i.language + "&p=" + i.platform + "&d=" + i.screenres + "&t=" + i.title), t.statvoo.script = new e(i.source, "async"), t.statvoo.script.load()
  119.         },
  120.         c = function(o, a) {
  121.             var i = t.statvoo.tracker;
  122.             void 0 == o && (o = ""), void 0 == a && (a = ""), i.source = i.trackPath("tag", "?_=" + i.randomstring() + "&s=" + i.site + "&ltid=" + i.ltid + "&g=" + i.guid + "&t_key=" + encodeURIComponent(o) + "&t_value=" + encodeURIComponent(a) + "&r=" + i.referrer + "&l=" + i.language + "&p=" + i.platform + "&d=" + i.screenres + "&t=" + i.title), t.statvoo.script = new e(i.source, "async"), t.statvoo.script.load()
  123.         },
  124.         d = function(o, a) {
  125.             var i = t.statvoo.tracker;
  126.             void 0 == o && (o = ""), void 0 == a && (a = ""), i.source = i.trackPath("goal", "?_=" + i.randomstring() + "&s=" + i.site + "&ltid=" + i.ltid + "&g=" + i.guid + "&g_key=" + encodeURIComponent(o) + "&g_value=" + encodeURIComponent(a) + "&r=" + i.referrer + "&l=" + i.language + "&p=" + i.platform + "&d=" + i.screenres + "&t=" + i.title), t.statvoo.script = new e(i.source, "async"), t.statvoo.script.load()
  127.         },
  128.         l = function(o, a) {
  129.             var i = t.statvoo.tracker,
  130.                 n = t.statvoo.helper;
  131.             i.source = i.trackPath("identify", "?_=" + i.randomstring() + "&s=" + i.site + "&g=" + i.guid + "&i_obj=" + encodeURIComponent(n.serialize(o))), t.statvoo.script = new e(i.source, "async"), t.statvoo.script.load(a)
  132.         },
  133.         m = function(o) {
  134.             var a = t.statvoo.tracker,
  135.                 i = t.statvoo.helper;
  136.             a.source = a.trackPath("error", "?_=" + a.randomstring() + "&s=" + a.site + "&ltid=" + a.ltid + "&g=" + a.guid + "&e_obj=" + encodeURIComponent(i.serialize(o))), t.statvoo.script = new e(a.source, "async"), t.statvoo.script.load()
  137.         };
  138.     a.prototype.view = function() {
  139.         var t = new RegExp("statvoo_tracker=([^;]+)"),
  140.             e = t.exec(document.cookie);
  141.         return null != e ? unescape(e[1]) : null
  142.     }, a.prototype.save = function() {
  143.         var t = function() {
  144.             return Math.floor(65536 * Math.random()).toString(16)
  145.         };
  146.         return t() + t() + "-" + t() + "-" + t() + "-" + t() + "-" + t() + t() + t()
  147.     }, i.prototype.acline = function(o, a, i, n) {
  148.         var s = t.statvoo.tracker;
  149.         if (1 == a) {
  150.             if (s.source = s.trackPath("chat", "?_=" + s.randomstring() + "&s=" + s.site + "&r=" + s.referrer + "&l=" + s.language + "&p=" + s.platform + "&d=" + s.screenres + "&g=" + s.guid + "&t=" + s.title + "&cad=" + a + "&ses=" + o), t.statvoo.script = new e(s.source, "async"), t.statvoo.script.load(), document.getElementById("statvoo_tracker_diag_chat_wnd").parentNode.removeChild(document.getElementById("statvoo_tracker_diag_chat_wnd")), document.getElementById("statvoo_chat_widget")) {
  151.                 var r = document.getElementById("statvoo_chat_widget");
  152.                 r.parentElement.removeChild(r)
  153.             }
  154.             var c = document.getElementsByName("statvoo_styles")[0];
  155.             "undefined" != typeof c && null != c || (c = document.createElement("link"), c.setAttribute("rel", "stylesheet"), c.setAttribute("type", "text/css"), c.setAttribute("id", "statvoo_styles"), c.setAttribute("name", "statvoo_styles"), c.setAttribute("href", "https://static.statvoo.com/css/chat.css"), document.head.appendChild(c)), t.statvoo.chatWidget.initialiseWidgetExistingSession(o, i, n)
  156.         } else s.source = s.trackPath("chat", "?_=" + s.randomstring() + "&s=" + s.site + "&r=" + s.referrer + "&l=" + s.language + "&p=" + s.platform + "&d=" + s.screenres + "&g=" + s.guid + "&t=" + s.title + "&cad=" + a + "&ses=" + o), t.statvoo.script = new e(s.source, "async"), t.statvoo.script.load(), document.getElementById("statvoo_tracker_diag_chat_wnd").parentNode.removeChild(document.getElementById("statvoo_tracker_diag_chat_wnd"))
  157.     }, n.prototype.closeChat = function() {
  158.         document.getElementById("statvoo_chat_widget") && document.getElementById("statvoo_chat_widget").parentNode.removeChild("statvoo_chat_widget")
  159.     }, n.prototype.initialiseWidget = function() {
  160.         var t = this,
  161.             e = document.getElementsByName("statvoo_chat_widget")[0];
  162.         "undefined" != typeof element && null != e || (1 == t.adminOnline ? (e = document.createElement("div"), e.setAttribute("id", "statvoo_chat_widget"), e.setAttribute("name", "statvoo_chat_widget"), e.innerHTML = "<div id='statvoo_chat_widget_header' name='statvoo_chat_widget_header' onclick='window.statvoo.chatWidget.minmax()'><span id='statvoo_chat_widget_titletext'>We're online, let's chat</span><span id='statvoo_chat_widget_minmax' name='statvoo_chat_widget_minmax'></span></div>", e.innerHTML += "<div id='statvoo_chat_widget_inner' name='statvoo_chat_widget_inner'><div style='margin-bottom:5px'><label for='statvoo_chatwidget__yourname' style='display:block'>Your name:</label><input id='statvoo_chatwidget__yourname' name='statvoo_chatwidget__yourname' type='text' style='width:275px' /></div><div style='margin-bottom:5px'><label for='statvoo_chatwidget__youremail' style='display:block'>Your email:</label><input id='statvoo_chatwidget__youremail' name='statvoo_chatwidget__youremail' type='text' style='width:275px' /></div><div style='margin-bottom:5px'><label for='statvoo_chatwidget__subject' title='Required' style='display:block'>Subject: <span style='color:red'>*</span></label><input id='statvoo_chatwidget__subject' name='statvoo_chatwidget__subject' type='text' style='width:275px' /></div><div><input type='submit' value='Start Chat!' onclick='window.statvoo.chatWidget.startChat();' /></div><div style='position:absolute;bottom:5px;right:5px;'><a style='color:#017c34' href='https://statvoo.com' target='_blank'>statvoo.com</a></div></div>", document.body.appendChild(e), this.iHeight = document.getElementById("statvoo_chat_widget").clientHeight + 75, this.widgetEl = document.getElementsByName("statvoo_chat_widget")[0], this.widgetEl.style.height = this.iHeight + "px", this.minimise()) : (e = document.createElement("div"), e.setAttribute("id", "statvoo_chat_widget"), e.setAttribute("name", "statvoo_chat_widget"), e.innerHTML = "<div id='statvoo_chat_widget_header' name='statvoo_chat_widget_header' onclick='window.statvoo.chatWidget.minmax()'><span id='statvoo_chat_widget_titletext'>Leave a message..</span><span id='statvoo_chat_widget_minmax' name='statvoo_chat_widget_minmax'></span></div>", e.innerHTML += "<div id='statvoo_chat_widget_inner' name='statvoo_chat_widget_inner'><div style='margin-bottom:5px'><label for='statvoo_chatwidget__yourname' title='Required' style='display:block'>Your name: <span style='color:red'>*</span></label><input id='statvoo_chatwidget__yourname' name='statvoo_chatwidget__yourname' type='text' style='width:275px' /></div><div style='margin-bottom:5px'><label for='statvoo_chatwidget__youremail' title='Required' style='display:block'>Your email: <span style='color:red'>*</span></label><input id='statvoo_chatwidget__youremail' name='statvoo_chatwidget__youremail' type='text' style='width:275px' /></div><div style='margin-bottom:5px'><label for='statvoo_chatwidget__subject' title='Required' style='display:block'>Subject: <span style='color:red'>*</span></label><input id='statvoo_chatwidget__subject' name='statvoo_chatwidget__subject' type='text' style='width:275px' /></div><div style='margin-bottom:5px'><label for='statvoo_chatwidget__message' title='Required' style='display:block'>Message: <span style='color:red'>*</span></label><textarea id='statvoo_chatwidget__message' name='statvoo_chatwidget__message' style='width:275px;min-height:50px;'></textarea></div><div><input type='submit' value='Send Message!' onclick='window.statvoo.chatWidget.startChat();' /></div><div style='position:absolute;bottom:5px;right:5px;'><a style='color:#017c34' href='https://statvoo.com' target='_blank'>statvoo.com</a></div></div>", document.body.appendChild(e), this.iHeight = document.getElementById("statvoo_chat_widget").clientHeight + 50, this.widgetEl = document.getElementsByName("statvoo_chat_widget")[0], this.widgetEl.style.height = this.iHeight + "px", this.minimise()))
  163.     }, n.prototype.initialiseWidgetExistingSession = function(t, e, o) {
  164.         var a = document.getElementsByName("statvoo_chat_widget")[0];
  165.         a = document.createElement("div"), a.setAttribute("id", "statvoo_chat_widget"), a.setAttribute("name", "statvoo_chat_widget"), a.innerHTML = "<div id='statvoo_chat_widget_header' name='statvoo_chat_widget_header' onclick='window.statvoo.chatWidget.minmax()'><span id='statvoo_chat_widget_titletext'>Connected to Live chat..</span><span id='statvoo_chat_widget_minmax' name='statvoo_chat_widget_minmax'></span></div>", a.innerHTML += "<div id='statvoo_chat_widget_inner' name='statvoo_chat_widget_inner'><div id='statvoo_chatwidget__actions'><a href='javascript:;' onclick='window.statvoo.chatWidget.terminate(" + t + ", " + e + ", " + o + ")'>End chat</a></div><div id='statvoo_chatwidget__message'></div><div><input placeholder='Type message here..' type='text' value='' id='txtStatvooLiveChatNewMessage' onkeyup='window.statvoo.chatWidget.sendChatMessage(event, " + t + ", " + e + ", " + o + ");' /></div><div style='position:absolute;bottom:5px;right:5px;'><a style='color:#017c34' href='https://statvoo.com' target='_blank'>statvoo.com</a></div></div>", document.body.appendChild(a), this.iHeight = document.getElementById("statvoo_chat_widget").clientHeight + 75, this.widgetEl = document.getElementsByName("statvoo_chat_widget")[0], this.widgetEl.style.height = this.iHeight + "px", this.maximise(), window.statvoo.chatWidget.getAllChats(t, e, o), window.statvoo.chatWidget.refresher = setInterval(function() {
  166.             window.statvoo.chatWidget.getAllChats(t, e, o)
  167.         }, 5e3)
  168.     }, n.prototype.terminate = function(o, a, i) {
  169.         if (confirm("Are you sure?")) {
  170.             var n = t.statvoo.tracker,
  171.                 s = t.statvoo.helper,
  172.                 r = {
  173.                     session_id: o,
  174.                     userid: a,
  175.                     siteid: i
  176.                 };
  177.             n.source = n.trackPath("chat", "?_=" + n.randomstring() + "&s=" + n.site + "&ltid=" + n.ltid + "&g=" + n.guid + "&lc=end&_obj=" + encodeURIComponent(s.serialize(r))), t.statvoo.script = new e(n.source, "async"), t.statvoo.script.load(), clearInterval(window.statvoo.chatWidget.refresher), window.statvoo.chatWidget.refresher = 0, document.getElementById("statvoo_chat_widget").parentNode.removeChild(document.getElementById("statvoo_chat_widget"))
  178.         }
  179.     }, n.prototype.sendChatMessage = function(o, a, i, n) {
  180.         var s = t.statvoo.tracker,
  181.             r = t.statvoo.helper;
  182.         if (o = o || window.event, 13 == o.keyCode) {
  183.             var c = document.getElementById("txtStatvooLiveChatNewMessage").value,
  184.                 d = encodeURIComponent(c),
  185.                 l = {
  186.                     session_id: a,
  187.                     userid: i,
  188.                     siteid: n,
  189.                     message: d
  190.                 };
  191.             s.source = s.trackPath("chat", "?_=" + s.randomstring() + "&s=" + s.site + "&ltid=" + s.ltid + "&g=" + s.guid + "&lc=send&_obj=" + encodeURIComponent(r.serialize(l))), t.statvoo.script = new e(s.source, "async"), t.statvoo.script.load(), document.getElementById("txtStatvooLiveChatNewMessage").value = "";
  192.             var m = document.getElementById("statvoo_chatwidget__message");
  193.             m.innerHTML += "<div class='_statvoo-lc-messageItem'><div><span class='_statvoo-lc-messageItemWHO'>user</span><span class='_statvoo-lc-messageItemTIMESTAMP'>now</span></div><span class='_statvoo-lc-messageItemMESSAGE'>" + c + "</span></div>"
  194.         }
  195.     }, n.prototype.loadGetAllChats = function(t) {
  196.         for (var e = document.getElementById("statvoo_chatwidget__message"), o = "", a = 0; a < t.length; a++) o += "<div class='_statvoo-lc-messageItem'><div><span class='_statvoo-lc-messageItemWHO'>" + t[a].who + "</span><span class='_statvoo-lc-messageItemTIMESTAMP'>" + t[a].timestamp + "</span></div><span class='_statvoo-lc-messageItemMESSAGE'>" + t[a].message + "</span></div>";
  197.         e.innerHTML = o
  198.     }, n.prototype.getAllChats = function(o, a, i) {
  199.         var n = t.statvoo.tracker,
  200.             s = t.statvoo.helper,
  201.             r = {
  202.                 session_id: o,
  203.                 userid: a,
  204.                 siteid: i
  205.             };
  206.         n.source = n.trackPath("chat", "?_=" + n.randomstring() + "&s=" + n.site + "&ltid=" + n.ltid + "&g=" + n.guid + "&lc=get&_obj=" + encodeURIComponent(s.serialize(r))), t.statvoo.script = new e(n.source, "async"), t.statvoo.script.load()
  207.     }, n.prototype.minmax = function() {
  208.         "0px" == this.widgetEl.style.bottom ? this.minimise() : this.maximise()
  209.     }, n.prototype.minimise = function() {
  210.         this.widgetEl.style.bottom = "-" + (this.iHeight - 32) + "px", this.widgetEl.style.height = "" + this.iHeight + "px", document.getElementsByName("statvoo_chat_widget_minmax")[0].innerHTML = "^"
  211.     }, n.prototype.maximise = function() {
  212.         this.widgetEl.style.bottom = "0px", this.widgetEl.style.height = "auto", document.getElementsByName("statvoo_chat_widget_minmax")[0].innerHTML = "-"
  213.     }, n.prototype.startChat = function() {
  214.         var o = this,
  215.             a = t.statvoo.tracker,
  216.             i = t.statvoo.helper,
  217.             n = document.getElementsByName("statvoo_styles")[0];
  218.         if ("undefined" != typeof n && null != n || (n = document.createElement("link"), n.setAttribute("rel", "stylesheet"), n.setAttribute("type", "text/css"), n.setAttribute("id", "statvoo_styles"), n.setAttribute("name", "statvoo_styles"), n.setAttribute("href", "https://static.statvoo.com/css/chat.css"), document.head.appendChild(n)), o.adminOnline) {
  219.             var s = document.getElementsByName("statvoo_chatwidget__yourname")[0].value,
  220.                 r = document.getElementsByName("statvoo_chatwidget__youremail")[0].value,
  221.                 c = document.getElementsByName("statvoo_chatwidget__subject")[0].value;
  222.             if ("" == c) return document.getElementsByName("statvoo_chatwidget__subject")[0].style.border = "1px solid red", void document.getElementsByName("statvoo_chatwidget__subject")[0].focus();
  223.             var d = window.statvoo.tracker.guid,
  224.                 l = window.statvoo.tracker.sid;
  225.             if (v && v.tracker && v.identify({
  226.                     name: s,
  227.                     email: r
  228.                 }), document.getElementById("statvoo_chat_widget")) {
  229.                 var m = document.getElementById("statvoo_chat_widget");
  230.                 m.parentElement.removeChild(m)
  231.             }
  232.             var u = {
  233.                 name: s,
  234.                 email: r,
  235.                 subject: c,
  236.                 siteid: l,
  237.                 userid: d
  238.             };
  239.             a.source = a.trackPath("chat", "?_=" + a.randomstring() + "&s=" + a.site + "&ltid=" + a.ltid + "&g=" + a.guid + "&lc=userstart&_obj=" + encodeURIComponent(i.serialize(u))), t.statvoo.script = new e(a.source, "async"), t.statvoo.script.load()
  240.         } else {
  241.             var s = document.getElementsByName("statvoo_chatwidget__yourname")[0].value,
  242.                 r = document.getElementsByName("statvoo_chatwidget__youremail")[0].value,
  243.                 c = document.getElementsByName("statvoo_chatwidget__subject")[0].value,
  244.                 p = document.getElementsByName("statvoo_chatwidget__message")[0].value;
  245.             if ("" == s || "" == r || "" == c || "" == p) return void alert("Please fill in all the fields");
  246.             var d = window.statvoo.tracker.guid,
  247.                 l = window.statvoo.tracker.sid;
  248.             v && v.tracker && v.identify({
  249.                 name: s,
  250.                 email: r
  251.             });
  252.             var u = {
  253.                 name: s,
  254.                 email: r,
  255.                 subject: c,
  256.                 message: p,
  257.                 siteid: l,
  258.                 userid: d
  259.             };
  260.             a.source = a.trackPath("chat", "?_=" + a.randomstring() + "&s=" + a.site + "&ltid=" + a.ltid + "&g=" + a.guid + "&lc=usermessage&_obj=" + encodeURIComponent(i.serialize(u))), t.statvoo.script = new e(a.source, "async"), t.statvoo.script.load()
  261.         }
  262.     }, n.prototype.messageSent = function(t) {
  263.         if (alert(t), document.getElementById("statvoo_chat_widget")) {
  264.             var e = document.getElementById("statvoo_chat_widget");
  265.             e.parentElement.removeChild(e)
  266.         }
  267.     }, "function" != typeof String.prototype.startsWith && (String.prototype.startsWith = function(t) {
  268.         return 0 == this.indexOf(t)
  269.     }), s.prototype.strUgly = function(t) {
  270.         for (var e, o = "", a = 0, i = t.length; i > a; a += 1) e = t.charCodeAt(a), o += e.toString(16) + " ";
  271.         return o = o.replace(/ /g, ""), o.split("").reverse().join("")
  272.     }, s.prototype.strUnUgly = function(t) {
  273.         t = t.split("").reverse().join("").replace(/(.{2})/g, "$1 ");
  274.         for (var e, o = t.split(" "), a = "", i = 0, n = o.length; n > i; i += 1) e = String.fromCharCode(parseInt(o[i], 16)), a += e;
  275.         return a
  276.     }, s.prototype.postRequest = function(t, e) {
  277.         var o = this,
  278.             a = o.createXMLHTTPObject();
  279.         a && (a.open("POST", t, !0), a.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), a.onreadystatechange = function() {
  280.             4 == a.readyState && 200 != a.status && 304 != a.status
  281.         }, 4 != a.readyState && a.send(e))
  282.     }, s.prototype.createCORSRequest = function(t, e) {
  283.         var o = new XMLHttpRequest;
  284.         return "withCredentials" in o ? o.open(t, e, !0) : "undefined" != typeof XDomainRequest ? (o = new XDomainRequest, o.open(t, e)) : o = null, o
  285.     }, s.prototype.createXMLHTTPObject = function() {
  286.         for (var t = [function() {
  287.                 return new XMLHttpRequest
  288.             }, function() {
  289.                 return new ActiveXObject("Msxml2.XMLHTTP")
  290.             }, function() {
  291.                 return new ActiveXObject("Msxml3.XMLHTTP")
  292.             }, function() {
  293.                 return new ActiveXObject("Microsoft.XMLHTTP")
  294.             }], e = !1, o = 0; o < t.length; o++) {
  295.             try {
  296.                 e = t[o]()
  297.             } catch (a) {
  298.                 continue
  299.             }
  300.             break
  301.         }
  302.         return e
  303.     }, s.prototype.serialize = function(t) {
  304.         var e, o, a, i = "",
  305.             n = "",
  306.             s = 0,
  307.             r = function(t) {
  308.                 var e = 0,
  309.                     o = 0,
  310.                     a = t.length,
  311.                     i = "";
  312.                 for (o = 0; a > o; o++) i = t.charCodeAt(o), e += 128 > i ? 1 : 2048 > i ? 2 : 3;
  313.                 return e
  314.             },
  315.             c = function(t) {
  316.                 var e, o, a, i, n = typeof t;
  317.                 if ("object" === n && !t) return "null";
  318.                 if ("object" === n) {
  319.                     if (!t.constructor) return "object";
  320.                     a = t.constructor.toString(), e = a.match(/(\w+)\(/), e && (a = e[1].toLowerCase()), i = ["boolean", "number", "string", "array"];
  321.                     for (o in i)
  322.                         if (a == i[o]) {
  323.                             n = i[o];
  324.                             break
  325.                         }
  326.                 }
  327.                 return n
  328.             },
  329.             d = c(t);
  330.         switch (d) {
  331.             case "function":
  332.                 e = "";
  333.                 break;
  334.             case "boolean":
  335.                 e = "b:" + (t ? "1" : "0");
  336.                 break;
  337.             case "number":
  338.                 e = (Math.round(t) == t ? "i" : "d") + ":" + t;
  339.                 break;
  340.             case "string":
  341.                 e = "s:" + r(t) + ':"' + t + '"';
  342.                 break;
  343.             case "array":
  344.             case "object":
  345.                 e = "a";
  346.                 for (o in t)
  347.                     if (t.hasOwnProperty(o)) {
  348.                         if (i = c(t[o]), "function" === i) continue;
  349.                         a = o.match(/^[0-9]+$/) ? parseInt(o, 10) : o, n += this.serialize(a) + this.serialize(t[o]), s++
  350.                     }
  351.                 e += ":" + s + ":{" + n + "}";
  352.                 break;
  353.             case "undefined":
  354.             default:
  355.                 e = "N"
  356.         }
  357.         return "object" !== d && "array" !== d && (e += ";"), e
  358.     };
  359.     var v = {};
  360.     v.cookie = new a, v.script = !1, v.tracker = new o, v.chat = new i, v.chatWidget = new n, v.helper = new s, v.event = r, v.goal = d, v.tag = c, v.identify = l, v.errors = m, v.debug = !1, t.statvoo = v, t.onerror = function(e, o, a, i, n) {
  361.         t.statvoo.errors({
  362.             m: e,
  363.             f: o,
  364.             l: a,
  365.             c: i,
  366.             s: n && n.stack ? n.stack : "",
  367.             e: n
  368.         })
  369.     }, t.statvoo.tracker.initialize()
  370. }(window);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement