thatpatguy

LB - Triggermail

Jul 20th, 2016
478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function() {
  2.     var a = !1,
  3.         b = /var xyz/.test(function() {}) ? /\b_super\b/ : /[\D|\d]*/;
  4.     this.__tmClass = function() {};
  5.     window.__tmClass = this.__tmClass;
  6.     __tmClass.extend = function(c) {
  7.         function e() {
  8.             !a && this.init && this.init.apply(this, arguments)
  9.         }
  10.         var f = this.prototype;
  11.         a = !0;
  12.         var h = new this;
  13.         a = !1;
  14.         for (var n in c) h[n] = "function" == typeof c[n] && "function" == typeof f[n] && b.test(c[n]) ? function(a, c) {
  15.             return function() {
  16.                 var b = this._super;
  17.                 this._super = f[a];
  18.                 var e = c.apply(this, arguments);
  19.                 this._super = b;
  20.                 return e
  21.             }
  22.         }(n, c[n]) : c[n];
  23.         e.prototype =
  24.             h;
  25.         e.prototype.constructor = e;
  26.         e.extend = arguments.callee;
  27.         return window.__tmClass = e
  28.     }
  29. })();
  30. window.triggermail = {};
  31. window.console ? "undefined" == typeof window.console.debug && (console.debug = function() {}) : console = {
  32.     debug: function() {},
  33.     error: function() {},
  34.     log: function() {}
  35. };
  36. window.TM_API_HOST = "triggeredmail.appspot.com/api";
  37. window.triggermail.lytics = [];
  38. triggermail.lytics.__SV = 1.2;
  39. (function(a) {
  40.     function b() {
  41.         b.done || (I = b.done = !0, C = !1, d.each(A, function(g) {
  42.             g._dom_loaded()
  43.         }))
  44.     }
  45.     var c = Array.prototype,
  46.         e = Object.prototype,
  47.         f = c.slice,
  48.         h = e.toString,
  49.         n = e.hasOwnProperty,
  50.         q = window.console,
  51.         x = window.navigator,
  52.         l = window.document,
  53.         m = x.userAgent,
  54.         H = ["__mps", "__mpa", "__mpap", "$people_distinct_id", "__alias"],
  55.         u = !1;
  56.     try {
  57.         u = window.XMLHttpRequest && "withCredentials" in new XMLHttpRequest
  58.     } catch (z) {}
  59.     var v = "https:" == l.location.protocol ? "https://" : "http://",
  60.         e = a && a.__SV || 0,
  61.         y = u,
  62.         C = !y && -1 == m.indexOf("MSIE"),
  63.         d = {}, B = !1,
  64.         K = {
  65.             api_host: v + TM_API_HOST,
  66.             cross_subdomain_cookie: !0,
  67.             cookie_name: "",
  68.             loaded: function() {},
  69.             store_google: !1,
  70.             save_referrer: !0,
  71.             test: !1,
  72.             verbose: !1,
  73.             img: !1,
  74.             track_pageview: !0,
  75.             debug: !1,
  76.             live_demo: !1,
  77.             track_links_timeout: 300,
  78.             cookie_expiration: 365,
  79.             upgrade: !1,
  80.             disable_cookie: !1,
  81.             ip: !0
  82.         }, I = !1;
  83.     (function() {
  84.         var g = c.forEach,
  85.             a = c.indexOf,
  86.             r = Array.isArray,
  87.             b = {}, e = d.each = function(a, w, r) {
  88.                 if (null != a)
  89.                     if (g && a.forEach === g) a.forEach(w, r);
  90.                     else if (a.length === +a.length)
  91.                     for (var d = 0, c = a.length; d < c && !(d in a && w.call(r, a[d], d, a) === b); d++);
  92.                 else
  93.                     for (d in a)
  94.                         if (n.call(a, d) && w.call(r, a[d], d, a) === b) break
  95.             };
  96.         d.extend = function(g) {
  97.             e(f.call(arguments, 1), function(a) {
  98.                 for (var w in a) void 0 !== a[w] && (g[w] = a[w])
  99.             });
  100.             return g
  101.         };
  102.         d.isArray = r || function(g) {
  103.             return "[object Array]" === h.call(g)
  104.         };
  105.         d.isFunction = function(g) {
  106.             try {
  107.                 return /^\s*\bfunction\b/.test(g)
  108.             } catch (a) {
  109.                 return !1
  110.             }
  111.         };
  112.         d.isArguments = function(g) {
  113.             return !(!g || !n.call(g, "callee"))
  114.         };
  115.         d.toArray = function(g) {
  116.             return !g ? [] : g.toArray ? g.toArray() : d.isArray(g) || d.isArguments(g) ? f.call(g) : d.values(g)
  117.         };
  118.         d.values = function(g) {
  119.             var a = [];
  120.             if (null == g) return a;
  121.             e(g, function(g) {
  122.                 a[a.length] = g
  123.             });
  124.             return a
  125.         };
  126.         d.identity = function(g) {
  127.             return g
  128.         };
  129.         d.include = function(g, r) {
  130.             var d = !1;
  131.             if (null == g) return d;
  132.             if (a && g.indexOf === a) return -1 != g.indexOf(r);
  133.             e(g, function(g) {
  134.                 if (d || (d = g === r)) return b
  135.             });
  136.             return d
  137.         };
  138.         d.includes = function(g, a) {
  139.             return -1 !== g.indexOf(a)
  140.         }
  141.     })();
  142.     d.inherit = function(g, a) {
  143.         g.prototype = new a;
  144.         g.prototype.constructor = g;
  145.         g.superclass = a.prototype;
  146.         return g
  147.     };
  148.     d.isObject = function(g) {
  149.         return g === Object(g) && !d.isArray(g)
  150.     };
  151.     d.isEmptyObject = function(g) {
  152.         if (d.isObject(g)) {
  153.             for (var a in g)
  154.                 if (n.call(g,
  155.                     a)) return !1;
  156.             return !0
  157.         }
  158.         return !1
  159.     };
  160.     d.isUndefined = function(g) {
  161.         return void 0 === g
  162.     };
  163.     d.isString = function(g) {
  164.         return "[object String]" == h.call(g)
  165.     };
  166.     d.isDate = function(g) {
  167.         return "[object Date]" == h.call(g)
  168.     };
  169.     d.isNumber = function(g) {
  170.         return "[object Number]" == h.call(g)
  171.     };
  172.     d.encodeDates = function(g) {
  173.         d.each(g, function(a, r) {
  174.             d.isDate(a) ? g[r] = d.formatDate(a) : d.isObject(a) && (g[r] = d.encodeDates(a))
  175.         });
  176.         return g
  177.     };
  178.     d.formatDate = function(g) {
  179.         function a(g) {
  180.             return 10 > g ? "0" + g : g
  181.         }
  182.         return g.getUTCFullYear() + "-" + a(g.getUTCMonth() + 1) + "-" + a(g.getUTCDate()) +
  183.             "T" + a(g.getUTCHours()) + ":" + a(g.getUTCMinutes()) + ":" + a(g.getUTCSeconds())
  184.     };
  185.     d.strip_empty_properties = function(g) {
  186.         var a = {};
  187.         d.each(g, function(g, c) {
  188.             d.isString(g) && 0 < g.length && (a[c] = g)
  189.         });
  190.         return a
  191.     };
  192.     d.truncate = function(g, a) {
  193.         var r;
  194.         "string" === typeof g ? r = g.slice(0, a) : d.isArray(g) ? (r = [], d.each(g, function(g) {
  195.             r.push(d.truncate(g, a))
  196.         })) : d.isObject(g) ? (r = {}, d.each(g, function(g, c) {
  197.             r[c] = d.truncate(g, a)
  198.         })) : r = g;
  199.         return r
  200.     };
  201.     d.JSONEncode = function() {
  202.         return function(g) {
  203.             var a = function(g) {
  204.                 var a = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  205.                     w = {
  206.                         "\b": "\\b",
  207.                         "\t": "\\t",
  208.                         "\n": "\\n",
  209.                         "\f": "\\f",
  210.                         "\r": "\\r",
  211.                         '"': '\\"',
  212.                         "\\": "\\\\"
  213.                     };
  214.                 a.lastIndex = 0;
  215.                 return a.test(g) ? '"' + g.replace(a, function(g) {
  216.                     var a = w[g];
  217.                     return "string" === typeof a ? a : "\\u" + ("0000" + g.charCodeAt(0).toString(16)).slice(-4)
  218.                 }) + '"' : '"' + g + '"'
  219.             }, r = function(g, d) {
  220.                     var c = "",
  221.                         b = 0,
  222.                         e = b = "",
  223.                         e = 0,
  224.                         f = c,
  225.                         l = [],
  226.                         k = d[g];
  227.                     switch (typeof k) {
  228.                         case "string":
  229.                             return a(k);
  230.                         case "number":
  231.                             return isFinite(k) ? String(k) : "null";
  232.                         case "boolean":
  233.                         case "null":
  234.                             return String(k);
  235.                         case "object":
  236.                             if (!k) return "null";
  237.                             c += "    ";
  238.                             l = [];
  239.                             if ("[object Array]" ===
  240.                                 h.apply(k)) {
  241.                                 e = k.length;
  242.                                 for (b = 0; b < e; b += 1) l[b] = r(b, k) || "null";
  243.                                 return e = 0 === l.length ? "[]" : c ? "[\n" + c + l.join(",\n" + c) + "\n" + f + "]" : "[" + l.join(",") + "]"
  244.                             }
  245.                             for (b in k) n.call(k, b) && (e = r(b, k)) && l.push(a(b) + (c ? ": " : ":") + e);
  246.                             return e = 0 === l.length ? "{}" : c ? "{" + l.join(",") + "" + f + "}" : "{" + l.join(",") + "}"
  247.                     }
  248.                 };
  249.             return r("", {
  250.                 "": g
  251.             })
  252.         }
  253.     }();
  254.     d.JSONDecode = function() {
  255.         var g, a, r = {
  256.                 '"': '"',
  257.                 "\\": "\\",
  258.                 "/": "/",
  259.                 b: "\b",
  260.                 f: "\f",
  261.                 n: "\n",
  262.                 r: "\r",
  263.                 t: "\t"
  264.             }, d, c = function(a) {
  265.                 throw {
  266.                     name: "SyntaxError",
  267.                     message: a,
  268.                     at: g,
  269.                     text: d
  270.                 };
  271.             }, b = function(b) {
  272.                 b && b !== a && c("Expected '" +
  273.                     b + "' instead of '" + a + "'");
  274.                 a = d.charAt(g);
  275.                 g += 1;
  276.                 return a
  277.             }, e = function() {
  278.                 var g;
  279.                 g = "";
  280.                 "-" === a && (g = "-", b("-"));
  281.                 for (;
  282.                     "0" <= a && "9" >= a;) g += a, b();
  283.                 if ("." === a)
  284.                     for (g += "."; b() && "0" <= a && "9" >= a;) g += a;
  285.                 if ("e" === a || "E" === a) {
  286.                     g += a;
  287.                     b();
  288.                     if ("-" === a || "+" === a) g += a, b();
  289.                     for (;
  290.                         "0" <= a && "9" >= a;) g += a, b()
  291.                 }
  292.                 g = +g;
  293.                 if (isFinite(g)) return g;
  294.                 c("Bad number")
  295.             }, f = function() {
  296.                 var g, d, e = "",
  297.                     E;
  298.                 if ('"' === a)
  299.                     for (; b();) {
  300.                         if ('"' === a) return b(), e;
  301.                         if ("\\" === a)
  302.                             if (b(), "u" === a) {
  303.                                 for (d = E = 0; 4 > d; d += 1) {
  304.                                     g = parseInt(b(), 16);
  305.                                     if (!isFinite(g)) break;
  306.                                     E = 16 * E + g
  307.                                 }
  308.                                 e += String.fromCharCode(E)
  309.                             } else if ("string" ===
  310.                             typeof r[a]) e += r[a];
  311.                         else break;
  312.                         else e += a
  313.                     }
  314.                 c("Bad string")
  315.             }, l = function() {
  316.                 for (; a && " " >= a;) b()
  317.             }, k = function() {
  318.                 switch (a) {
  319.                     case "t":
  320.                         return b("t"), b("r"), b("u"), b("e"), !0;
  321.                     case "f":
  322.                         return b("f"), b("a"), b("l"), b("s"), b("e"), !1;
  323.                     case "n":
  324.                         return b("n"), b("u"), b("l"), b("l"), null
  325.                 }
  326.                 c("Unexpected '" + a + "'")
  327.             }, h;
  328.         h = function() {
  329.             l();
  330.             switch (a) {
  331.                 case "{":
  332.                     var g;
  333.                     a: {
  334.                         var d = {};
  335.                         if ("{" === a) {
  336.                             b("{");
  337.                             l();
  338.                             if ("}" === a) {
  339.                                 b("}");
  340.                                 g = d;
  341.                                 break a
  342.                             }
  343.                             for (; a;) {
  344.                                 g = f();
  345.                                 l();
  346.                                 b(":");
  347.                                 Object.hasOwnProperty.call(d, g) && c('Duplicate key "' + g + '"');
  348.                                 d[g] = h();
  349.                                 l();
  350.                                 if ("}" ===
  351.                                     a) {
  352.                                     b("}");
  353.                                     g = d;
  354.                                     break a
  355.                                 }
  356.                                 b(",");
  357.                                 l()
  358.                             }
  359.                         }
  360.                         c("Bad object");
  361.                         g = void 0
  362.                     }
  363.                     return g;
  364.                 case "[":
  365.                     a: {
  366.                         g = [];
  367.                         if ("[" === a) {
  368.                             b("[");
  369.                             l();
  370.                             if ("]" === a) {
  371.                                 b("]");
  372.                                 break a
  373.                             }
  374.                             for (; a;) {
  375.                                 g.push(h());
  376.                                 l();
  377.                                 if ("]" === a) {
  378.                                     b("]");
  379.                                     break a
  380.                                 }
  381.                                 b(",");
  382.                                 l()
  383.                             }
  384.                         }
  385.                         c("Bad array");
  386.                         g = void 0
  387.                     }
  388.                     return g;
  389.                 case '"':
  390.                     return f();
  391.                 case "-":
  392.                     return e();
  393.                 default:
  394.                     return "0" <= a && "9" >= a ? e() : k()
  395.             }
  396.         };
  397.         return function(b) {
  398.             d = b;
  399.             g = 0;
  400.             a = " ";
  401.             b = h();
  402.             l();
  403.             a && c("Syntax error");
  404.             return b
  405.         }
  406.     }();
  407.     d.base64Encode = function(g) {
  408.         var a, b, c, e, f = 0,
  409.             l = 0,
  410.             h = "",
  411.             h = [];
  412.         if (!g) return g;
  413.         g = d.utf8Encode(g);
  414.         do a = g.charCodeAt(f++),
  415.         b = g.charCodeAt(f++), c = g.charCodeAt(f++), e = a << 16 | b << 8 | c, a = e >> 18 & 63, b = e >> 12 & 63, c = e >> 6 & 63, e &= 63, h[l++] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(a) + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b) + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(c) + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e);
  416.         while (f < g.length);
  417.         h = h.join("");
  418.         switch (g.length % 3) {
  419.             case 1:
  420.                 h = h.slice(0, -2) + "==";
  421.                 break;
  422.             case 2:
  423.                 h =
  424.                     h.slice(0, -1) + "="
  425.         }
  426.         return h
  427.     };
  428.     d.utf8Encode = function(g) {
  429.         g = (g + "").replace(/\r\n/g, "\n").replace(/\r/g, "\n");
  430.         var a = "",
  431.             b, d, c = 0,
  432.             e;
  433.         b = d = 0;
  434.         c = g.length;
  435.         for (e = 0; e < c; e++) {
  436.             var f = g.charCodeAt(e),
  437.                 l = null;
  438.             128 > f ? d++ : l = 127 < f && 2048 > f ? String.fromCharCode(f >> 6 | 192, f & 63 | 128) : String.fromCharCode(f >> 12 | 224, f >> 6 & 63 | 128, f & 63 | 128);
  439.             null !== l && (d > b && (a += g.substring(b, d)), a += l, b = d = e + 1)
  440.         }
  441.         d > b && (a += g.substring(b, g.length));
  442.         return a
  443.     };
  444.     d.UUID = function() {
  445.         var a = function() {
  446.             for (var a = 1 * new Date, g = 0; a == 1 * new Date;) g++;
  447.             return a.toString(16) + g.toString(16)
  448.         },
  449.             b = function(a) {
  450.                 function g(a, b) {
  451.                     var c, r = 0;
  452.                     for (c = 0; c < b.length; c++) r |= d[c] << 8 * c;
  453.                     return a ^ r
  454.                 }
  455.                 var b, d = [],
  456.                     c = 0;
  457.                 for (a = 0; a < m.length; a++) b = m.charCodeAt(a), d.unshift(b & 255), 4 <= d.length && (c = g(c, d), d = []);
  458.                 0 < d.length && (c = g(c, d));
  459.                 return c.toString(16)
  460.             };
  461.         return function() {
  462.             var d = (screen.height * screen.width).toString(16);
  463.             return a() + "-" + Math.random().toString(16).replace(".", "") + "-" + b() + "-" + d + "-" + a()
  464.         }
  465.     }();
  466.     d.isBlockedUA = function() {
  467.         return /(google web preview|baiduspider|yandexbot)/i.test(m) ? !0 : !1
  468.     };
  469.     d.HTTPBuildQuery = function(a,
  470.         b) {
  471.         var c, e, f = [];
  472.         "undefined" === typeof b && (b = "&");
  473.         d.each(a, function(a, g) {
  474.             c = encodeURIComponent(a.toString());
  475.             e = encodeURIComponent(g);
  476.             f[f.length] = e + "=" + c
  477.         });
  478.         return f.join(b)
  479.     };
  480.     d.getQueryParam = function(a, b) {
  481.         b = b.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
  482.         var d = RegExp("[\\?&]" + b + "=([^&#]*)").exec(a);
  483.         return null === d || d && "string" !== typeof d[1] && d[1].length ? "" : decodeURIComponent(d[1]).replace(/\+/g, " ")
  484.     };
  485.     d.cookie = {
  486.         get: function(a) {
  487.             a += "=";
  488.             for (var b = l.cookie.split(";"), d = 0; d < b.length; d++) {
  489.                 for (var c = b[d];
  490.                     " " == c.charAt(0);) c =
  491.                     c.substring(1, c.length);
  492.                 if (0 == c.indexOf(a)) return decodeURIComponent(c.substring(a.length, c.length))
  493.             }
  494.             return null
  495.         },
  496.         parse: function(a) {
  497.             var b;
  498.             try {
  499.                 b = d.JSONDecode(d.cookie.get(a)) || {}
  500.             } catch (c) {}
  501.             return b
  502.         },
  503.         set: function(a, b, d, c) {
  504.             var e = "",
  505.                 f = "";
  506.             c && (e = (e = (e = l.location.hostname.match(/[a-z0-9][a-z0-9\-]+\.[a-z\.]{2,6}$/i)) ? e[0] : "") ? "; domain=." + e : "");
  507.             d && (f = new Date, f.setTime(f.getTime() + 864E5 * d), f = "; expires=" + f.toGMTString());
  508.             l.cookie = a + "=" + encodeURIComponent(b) + f + "; path=/" + e
  509.         },
  510.         remove: function(a, b) {
  511.             d.cookie.set(a,
  512.                 "", -1, b)
  513.         }
  514.     };
  515.     d.register_event = function() {
  516.         function a(g, c, e) {
  517.             return function(a) {
  518.                 if (a = a || b(window.event)) {
  519.                     var f = !0,
  520.                         l;
  521.                     d.isFunction(e) && (l = e(a));
  522.                     a = c.call(g, a);
  523.                     if (!1 === l || !1 === a) f = !1;
  524.                     return f
  525.                 }
  526.             }
  527.         }
  528.  
  529.         function b(a) {
  530.             a && (a.preventDefault = b.preventDefault, a.stopPropagation = b.stopPropagation);
  531.             return a
  532.         }
  533.         b.preventDefault = function() {
  534.             this.returnValue = !1
  535.         };
  536.         b.stopPropagation = function() {
  537.             this.cancelBubble = !0
  538.         };
  539.         return function(b, d, c, e) {
  540.             b ? b.addEventListener && !e ? b.addEventListener(d, c, !1) : (d = "on" + d, b[d] = a(b, c, b[d])) : t.error("No valid element provided to register_event")
  541.         }
  542.     }();
  543.     d.dom_query = function() {
  544.         function a(g, d) {
  545.             return 0 <= (" " + g.className + " ").replace(b, " ").indexOf(" " + d + " ")
  546.         }
  547.         var b = /[\t\r\n]/g;
  548.         return function(b) {
  549.             if (!l.getElementsByTagName) return [];
  550.             b = b.split(" ");
  551.             for (var c, e = Array(l), w = 0; w < b.length; w++)
  552.                 if (c = b[w].replace(/^\s+/, "").replace(/\s+$/, ""), -1 < c.indexOf("#")) {
  553.                     c = c.split("#");
  554.                     var f = c[0],
  555.                         e = l.getElementById(c[1]);
  556.                     if (!e || f && e.nodeName.toLowerCase() != f) return [];
  557.                     e = Array(e)
  558.                 } else if (-1 < c.indexOf(".")) {
  559.                 c = c.split(".");
  560.                 var f = c[0],
  561.                     h = c[1];
  562.                 f || (f = "*");
  563.                 c = [];
  564.                 for (var k = 0, m = 0; m <
  565.                     e.length; m++) {
  566.                     var n;
  567.                     n = "*" == f ? e[m].all ? e[m].all : e[m].getElementsByTagName("*") : e[m].getElementsByTagName(f);
  568.                     for (var q = 0; q < n.length; q++) c[k++] = n[q]
  569.                 }
  570.                 e = [];
  571.                 for (k = f = 0; k < c.length; k++) c[k].className && (d.isString(c[k].className) && a(c[k], h)) && (e[f++] = c[k])
  572.             } else if (c.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)) {
  573.                 var f = RegExp.$1,
  574.                     u = RegExp.$2,
  575.                     h = RegExp.$3,
  576.                     p = RegExp.$4;
  577.                 f || (f = "*");
  578.                 c = [];
  579.                 for (m = k = 0; m < e.length; m++) {
  580.                     n = "*" == f ? e[m].all ? e[m].all : e[m].getElementsByTagName("*") : e[m].getElementsByTagName(f);
  581.                     for (q =
  582.                         0; q < n.length; q++) c[k++] = n[q]
  583.                 }
  584.                 e = [];
  585.                 f = 0;
  586.                 switch (h) {
  587.                     case "=":
  588.                         h = function(a) {
  589.                             return a.getAttribute(u) == p
  590.                         };
  591.                         break;
  592.                     case "~":
  593.                         h = function(a) {
  594.                             return a.getAttribute(u).match(RegExp("\\b" + p + "\\b"))
  595.                         };
  596.                         break;
  597.                     case "|":
  598.                         h = function(a) {
  599.                             return a.getAttribute(u).match(RegExp("^" + p + "-?"))
  600.                         };
  601.                         break;
  602.                     case "^":
  603.                         h = function(a) {
  604.                             return 0 == a.getAttribute(u).indexOf(p)
  605.                         };
  606.                         break;
  607.                     case "$":
  608.                         h = function(a) {
  609.                             return a.getAttribute(u).lastIndexOf(p) == a.getAttribute(u).length - p.length
  610.                         };
  611.                         break;
  612.                     case "*":
  613.                         h = function(a) {
  614.                             return -1 < a.getAttribute(u).indexOf(p)
  615.                         };
  616.                         break;
  617.                     default:
  618.                         h = function(a) {
  619.                             return a.getAttribute(u)
  620.                         }
  621.                 }
  622.                 e = [];
  623.                 for (k = f = 0; k < c.length; k++) h(c[k]) && (e[f++] = c[k])
  624.             } else {
  625.                 f = c;
  626.                 c = [];
  627.                 for (m = k = 0; m < e.length; m++) {
  628.                     n = e[m].getElementsByTagName(f);
  629.                     for (q = 0; q < n.length; q++) c[k++] = n[q]
  630.                 }
  631.                 e = c
  632.             }
  633.             return e
  634.         }
  635.     }();
  636.     d.info = {
  637.         campaignParams: function() {
  638.             var a = "",
  639.                 b = {};
  640.             d.each(["utm_source", "utm_medium", "utm_campaign", "utm_content", "utm_term"], function(c) {
  641.                 a = d.getQueryParam(l.URL, c);
  642.                 a.length && (b[c] = a)
  643.             });
  644.             return b
  645.         },
  646.         searchEngine: function(a) {
  647.             return 0 === a.search("https?://(.*)google.([^/?]*)") ? "google" :
  648.                 0 === a.search("https?://(.*)bing.com") ? "bing" : 0 === a.search("https?://(.*)yahoo.com") ? "yahoo" : 0 === a.search("https?://(.*)duckduckgo.com") ? "duckduckgo" : null
  649.         },
  650.         searchInfo: function(a) {
  651.             var b = d.info.searchEngine(a),
  652.                 c = {};
  653.             null !== b && (c.g_search_engine = b, a = d.getQueryParam(a, "yahoo" != b ? "q" : "p"), a.length && (c.mp_keyword = a));
  654.             return c
  655.         },
  656.         browser: function() {
  657.             var a = x.vendor || "";
  658.             return window.opera ? d.includes(m, "Mini") ? "Opera Mini" : "Opera" : /(BlackBerry|PlayBook|BB10)/i.test(m) ? "BlackBerry" : d.includes(m, "Chrome") ? "Chrome" :
  659.                 d.includes(a, "Apple") ? d.includes(m, "Mobile") ? "Mobile Safari" : "Safari" : d.includes(m, "Android") ? "Android Mobile" : d.includes(m, "Konqueror") ? "Konqueror" : d.includes(m, "Firefox") ? "Firefox" : d.includes(m, "MSIE") ? "Internet Explorer" : d.includes(m, "Gecko") ? "Mozilla" : ""
  660.         },
  661.         os: function() {
  662.             return /Windows/i.test(m) ? /Phone/.test(m) ? "Windows Mobile" : "Windows" : /(iPhone|iPad|iPod)/.test(m) ? "iOS" : /Android/.test(m) ? "Android" : /(BlackBerry|PlayBook|BB10)/i.test(m) ? "BlackBerry" : /Mac/i.test(m) ? "Mac OS X" : /Linux/.test(m) ? "Linux" :
  663.                 ""
  664.         },
  665.         device: function() {
  666.             return /iPhone/.test(m) ? "iPhone" : /iPad/.test(m) ? "iPad" : /iPod/.test(m) ? "iPod Touch" : /(BlackBerry|PlayBook|BB10)/i.test(m) ? "BlackBerry" : /Windows Phone/i.test(m) ? "Windows Phone" : /Android/.test(m) ? "Android" : ""
  667.         },
  668.         referringDomain: function(a) {
  669.             a = a.split("/");
  670.             return 3 <= a.length ? a[2] : ""
  671.         },
  672.         properties: function() {
  673.             return d.strip_empty_properties({
  674.                 os: d.info.os(),
  675.                 browser: d.info.browser(),
  676.                 device: d.info.device(),
  677.                 mp_lib: "web"
  678.             })
  679.         },
  680.         people_properties: function() {
  681.             return d.strip_empty_properties({
  682.                 $os: d.info.os(),
  683.                 $browser: d.info.browser()
  684.             })
  685.         },
  686.         pageviewInfo: function(a) {
  687.             return d.strip_empty_properties({
  688.                 mp_page: a,
  689.                 mp_referrer: l.referrer,
  690.                 mp_browser: d.info.browser(),
  691.                 mp_platform: d.info.os()
  692.             })
  693.         }
  694.     };
  695.     var t = {
  696.         log: function() {
  697.             if (B && !d.isUndefined(q) && q) try {
  698.                 q.log.apply(q, arguments)
  699.             } catch (a) {
  700.                 d.each(arguments, function(a) {
  701.                     q.log(a)
  702.                 })
  703.             }
  704.         },
  705.         error: function() {
  706.             if (B && !d.isUndefined(q) && q) {
  707.                 var a = ["Mixpanel error:"].concat(d.toArray(arguments));
  708.                 try {
  709.                     q.error.apply(q, a)
  710.                 } catch (b) {
  711.                     d.each(a, function(a) {
  712.                         q.error(a)
  713.                     })
  714.                 }
  715.             }
  716.         },
  717.         critical: function() {
  718.             if (!d.isUndefined(q) &&
  719.                 q) {
  720.                 var a = ["Mixpanel error:"].concat(d.toArray(arguments));
  721.                 try {
  722.                     q.error.apply(q, a)
  723.                 } catch (b) {
  724.                     d.each(a, function(a) {
  725.                         q.error(a)
  726.                     })
  727.                 }
  728.             }
  729.         }
  730.     }, u = function() {};
  731.     u.prototype.create_properties = function() {};
  732.     u.prototype.event_handler = function() {};
  733.     u.prototype.after_track_handler = function() {};
  734.     u.prototype.init = function(a) {
  735.         this.mp = a;
  736.         return this
  737.     };
  738.     u.prototype.track = function(a, b, c, e) {
  739.         var f = this,
  740.             l = d.dom_query(a);
  741.         if (0 == l.length) t.error("The DOM query (" + a + ") returned 0 elements");
  742.         else return d.each(l, function(a) {
  743.             d.register_event(a,
  744.                 this.override_event, function(a) {
  745.                     var g = {}, d = f.create_properties(c, this),
  746.                         l = f.mp.get_config("track_links_timeout");
  747.                     f.event_handler(a, this, g);
  748.                     window.setTimeout(f.track_callback(e, d, g, !0), l);
  749.                     f.mp.track(b, d, f.track_callback(e, d, g))
  750.                 })
  751.         }, this), !0
  752.     };
  753.     u.prototype.track_callback = function(a, b, c, d) {
  754.         d = d || !1;
  755.         var e = this;
  756.         return function() {
  757.             c.callback_fired || (c.callback_fired = !0, a && !1 === a(d, b) || e.after_track_handler(b, c, d))
  758.         }
  759.     };
  760.     u.prototype.create_properties = function(a, b) {
  761.         return "function" === typeof a ? a(b) : d.extend({}, a)
  762.     };
  763.     var D = function() {
  764.         this.override_event = "click"
  765.     };
  766.     d.inherit(D, u);
  767.     D.prototype.create_properties = function(a, b) {
  768.         var c = D.superclass.create_properties.apply(this, arguments);
  769.         b.href && (c.url = b.href);
  770.         return c
  771.     };
  772.     D.prototype.event_handler = function(a, b, c) {
  773.         c.new_tab = 2 === a.which || a.metaKey || "_blank" === b.target;
  774.         c.href = b.href;
  775.         c.new_tab || a.preventDefault()
  776.     };
  777.     D.prototype.after_track_handler = function(a, b, c) {
  778.         b.new_tab || setTimeout(function() {
  779.             window.location = b.href
  780.         }, 0)
  781.     };
  782.     var F = function() {
  783.         this.override_event = "submit"
  784.     };
  785.     d.inherit(F,
  786.         u);
  787.     F.prototype.event_handler = function(a, b, c) {
  788.         c.element = b;
  789.         a.preventDefault()
  790.     };
  791.     F.prototype.after_track_handler = function(a, b, c) {
  792.         setTimeout(function() {
  793.             b.element.submit()
  794.         }, 0)
  795.     };
  796.     var p = function(a) {
  797.         this.props = {};
  798.         this.campaign_params_saved = !1;
  799.         this.name = a.cookie_name ? "mp_" + a.cookie_name : "mp_" + a.token + "_mixpanel";
  800.         this.load();
  801.         this.update_config(a);
  802.         this.upgrade(a);
  803.         this.save()
  804.     };
  805.     p.prototype.properties = function() {
  806.         var a = {};
  807.         d.each(this.props, function(b, c) {
  808.             d.include(H, c) || (a[c] = b)
  809.         });
  810.         return a
  811.     };
  812.     p.prototype.load = function() {
  813.         if (!this.disabled) {
  814.             var a =
  815.                 d.cookie.parse(this.name);
  816.             a && (this.props = d.extend({}, a))
  817.         }
  818.     };
  819.     p.prototype.upgrade = function(a) {
  820.         var b = a.upgrade,
  821.             c;
  822.         b && (c = "mp_super_properties", "string" === typeof b && (c = b), b = d.cookie.parse(c), d.cookie.remove(c), d.cookie.remove(c, !0), b && (this.props = d.extend(this.props, b.all, b.events)));
  823.         if (!a.cookie_name && "mixpanel" !== a.name && (c = "mp_" + a.token + "_" + a.name, b = d.cookie.parse(c))) d.cookie.remove(c), d.cookie.remove(c, !0), this.register_once(b)
  824.     };
  825.     p.prototype.save = function() {
  826.         this.disabled || d.cookie.set(this.name, d.JSONEncode(this.props),
  827.             this.expire_days, this.cross_subdomain)
  828.     };
  829.     p.prototype.remove = function() {
  830.         d.cookie.remove(this.name, !1);
  831.         d.cookie.remove(this.name, !0)
  832.     };
  833.     p.prototype.clear = function() {
  834.         this.remove();
  835.         this.props = {}
  836.     };
  837.     p.prototype.register_once = function(a, b, c) {
  838.         return d.isObject(a) ? ("undefined" === typeof b && (b = "None"), this.expire_days = "undefined" === typeof c ? this.default_expiry : c, d.each(a, function(a, g) {
  839.             if (!this.props[g] || this.props[g] === b) this.props[g] = a
  840.         }, this), this.save(), !0) : !1
  841.     };
  842.     p.prototype.register = function(a, b) {
  843.         return d.isObject(a) ?
  844.             (this.expire_days = "undefined" === typeof b ? this.default_expiry : b, d.extend(this.props, a), this.save(), !0) : !1
  845.     };
  846.     p.prototype.unregister = function(a) {
  847.         a in this.props && (delete this.props[a], this.save())
  848.     };
  849.     p.prototype.update_campaign_params = function() {
  850.         this.campaign_params_saved || (this.register_once(d.info.campaignParams()), this.campaign_params_saved = !0)
  851.     };
  852.     p.prototype.update_search_keyword = function(a) {
  853.         this.register(d.info.searchInfo(a))
  854.     };
  855.     p.prototype.update_referrer_info = function(a) {
  856.         this.register_once({
  857.             $initial_referrer: a ||
  858.                 "$direct",
  859.             $initial_referring_domain: d.info.referringDomain(a) || "$direct"
  860.         }, "")
  861.     };
  862.     p.prototype.get_referrer_info = function() {
  863.         return d.strip_empty_properties({
  864.             $initial_referrer: this.props.$initial_referrer,
  865.             $initial_referring_domain: this.props.$initial_referring_domain
  866.         })
  867.     };
  868.     p.prototype.safe_merge = function(a) {
  869.         d.each(this.props, function(b, c) {
  870.             c in a || (a[c] = b)
  871.         });
  872.         return a
  873.     };
  874.     p.prototype.update_config = function(a) {
  875.         this.default_expiry = this.expire_days = a.cookie_expiration;
  876.         this.set_disabled(a.disable_cookie);
  877.         this.set_cross_subdomain(a.cross_subdomain_cookie)
  878.     };
  879.     p.prototype.set_disabled = function(a) {
  880.         (this.disabled = a) && this.remove()
  881.     };
  882.     p.prototype.set_cross_subdomain = function(a) {
  883.         a !== this.cross_subdomain && (this.cross_subdomain = a, this.remove(), this.save())
  884.     };
  885.     p.prototype.get_cross_subdomain = function() {
  886.         return this.cross_subdomain
  887.     };
  888.     p.prototype._add_to_people_queue = function(a, b) {
  889.         var c = this._get_queue_key(a),
  890.             e = b[a],
  891.             f = this._get_or_create_queue("$set"),
  892.             l = this._get_or_create_queue("$add"),
  893.             h = this._get_or_create_queue("$append", []);
  894.         "__mps" === c ? (d.extend(f, e), this._pop_from_people_queue("$add",
  895.             e)) : "__mpa" === c ? d.each(e, function(a, b) {
  896.             b in f ? f[b] += a : (b in l || (l[b] = 0), l[b] += a)
  897.         }, this) : "__mpap" === c && h.push(e);
  898.         t.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):");
  899.         t.log(b);
  900.         this.save()
  901.     };
  902.     p.prototype._pop_from_people_queue = function(a, b) {
  903.         var c = this._get_queue(a);
  904.         d.isUndefined(c) || (d.each(b, function(a, b) {
  905.             delete c[b]
  906.         }, this), this.save())
  907.     };
  908.     p.prototype._get_queue_key = function(a) {
  909.         if ("$set" === a) return "__mps";
  910.         if ("$add" === a) return "__mpa";
  911.         if ("$append" === a) return "__mpap";
  912.         t.error("Invalid queue:", a)
  913.     };
  914.     p.prototype._get_queue =
  915.         function(a) {
  916.             return this.props[this._get_queue_key(a)]
  917.     };
  918.     p.prototype._get_or_create_queue = function(a, b) {
  919.         var c = this._get_queue_key(a);
  920.         b = d.isUndefined(b) ? {} : b;
  921.         return this.props[c] || (this.props[c] = b)
  922.     };
  923.     var G = function(b, c, e) {
  924.         var f, l = "triggermail.lytics" === e ? a : a[e];
  925.         if (l && !d.isArray(l)) t.error("You have already initialized " + e);
  926.         else return f = new k, f._init(b, c, e), f.people = new s, f.people._init(f), B = B || f.get_config("debug"), d.isUndefined(l) || (f._execute_array.call(f.people, l.people), f._execute_array(l)), f
  927.     }, k =
  928.             function() {};
  929.     k.prototype.init = function(b, c, d) {
  930.         if ("undefined" === typeof d) t.error("You must name your new library: init(token, config, name)");
  931.         else if ("triggermail.lytics" === d) t.error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");
  932.         else return b = G(b, c, d), a[d] = b, b._loaded(), b
  933.     };
  934.     k.prototype._init = function(a, b, c) {
  935.         this.__loaded = !0;
  936.         this.config = {};
  937.         this.set_config(d.extend({}, K, b, {
  938.             name: c,
  939.             token: a,
  940.             callback_fn: ("triggermail.lytics" === c ? c : "triggermail.lytics." + c) +
  941.                 "._jsc"
  942.         }));
  943.         this._jsc = function() {};
  944.         this.__dom_loaded_queue = [];
  945.         this.__request_queue = [];
  946.         this.__disabled_events = [];
  947.         this._flags = {
  948.             disable_all_events: !1,
  949.             identify_called: !1
  950.         };
  951.         this.cookie = new p(this.config);
  952.         this.register_once({
  953.             distinct_id: d.UUID()
  954.         }, "")
  955.     };
  956.     k.prototype._loaded = function() {
  957.         this.get_config("loaded")(this);
  958.         this.get_config("track_pageview") && this.track_pageview()
  959.     };
  960.     k.prototype._dom_loaded = function() {
  961.         d.each(this.__dom_loaded_queue, function(a) {
  962.             this._track_dom.apply(this, a)
  963.         }, this);
  964.         d.each(this.__request_queue,
  965.             function(a) {
  966.                 this._send_request.apply(this, a)
  967.             }, this);
  968.         delete this.__dom_loaded_queue;
  969.         delete this.__request_queue
  970.     };
  971.     k.prototype._track_dom = function(a, b) {
  972.         if (this.get_config("img")) return t.error("You can't use DOM tracking functions with img = true."), !1;
  973.         if (!I) return this.__dom_loaded_queue.push([a, b]), !1;
  974.         var c = (new a).init(this);
  975.         return c.track.apply(c, b)
  976.     };
  977.     k.prototype._prepare_callback = function(a, b) {
  978.         if (d.isUndefined(a)) return null;
  979.         if (y) return function(c) {
  980.             a(c, b)
  981.         };
  982.         var c = this._jsc,
  983.             e = "" + Math.floor(1E8 * Math.random()),
  984.             f = this.get_config("callback_fn") + '["' + e + '"]';
  985.         c[e] = function(d) {
  986.             delete c[e];
  987.             a(d, b)
  988.         };
  989.         return f
  990.     };
  991.     k.prototype._send_request = function(a, b, c) {
  992.         if (C) this.__request_queue.push(arguments);
  993.         else {
  994.             var e = this.get_config("verbose");
  995.             this.get_config("test") && (b.test = 1);
  996.             e && (b.verbose = 1);
  997.             this.get_config("img") && (b.img = 1);
  998.             c && !y && (b.callback = c);
  999.             b.ip = this.get_config("ip") ? 1 : 0;
  1000.             b._ = (new Date).getTime().toString();
  1001.             if ("img" in b) {
  1002.                 var f = l.createElement("img");
  1003.                 f.src = a;
  1004.                 l.body.appendChild(f)
  1005.             } else if (y) {
  1006.                 var h = new XMLHttpRequest;
  1007.                 h.open("POST",
  1008.                     a, !0);
  1009.                 h.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  1010.                 h.withCredentials = !0;
  1011.                 h.onreadystatechange = function(a) {
  1012.                     4 === h.readyState && (200 === h.status ? c && (e ? c(d.JSONDecode(h.responseText)) : c(Number(h.responseText))) : (a = "Bad HTTP status: " + h.status + " " + h.statusText, t.error(a), c && (e ? c({
  1013.                         status: 0,
  1014.                         error: a
  1015.                     }) : c(0))))
  1016.                 };
  1017.                 h.send(d.HTTPBuildQuery(b))
  1018.             } else {
  1019.                 a += "?" + d.HTTPBuildQuery(b);
  1020.                 f = l.createElement("script");
  1021.                 f.type = "text/javascript";
  1022.                 f.async = !0;
  1023.                 f.defer = !0;
  1024.                 f.src = a;
  1025.                 var k = l.getElementsByTagName("script")[0];
  1026.                 k.parentNode.insertBefore(f, k)
  1027.             }
  1028.         }
  1029.     };
  1030.     k.prototype._execute_array = function(a) {
  1031.         var b, c = [],
  1032.             e = [],
  1033.             f = [];
  1034.         d.each(a, function(a) {
  1035.             a && (b = a[0], "function" === typeof a ? a.call(this) : d.isArray(a) && "alias" === b ? c.push(a) : d.isArray(a) && -1 != b.indexOf("track") && "function" === typeof this[b] ? f.push(a) : e.push(a))
  1036.         }, this);
  1037.         a = function(a, b) {
  1038.             d.each(a, function(a) {
  1039.                 this[a[0]].apply(this, a.slice(1))
  1040.             }, b)
  1041.         };
  1042.         a(c, this);
  1043.         a(e, this);
  1044.         a(f, this)
  1045.     };
  1046.     k.prototype.push = function(a) {
  1047.         this._execute_array([a])
  1048.     };
  1049.     k.prototype.disable = function(a) {
  1050.         "undefined" === typeof a ?
  1051.             this._flags.disable_all_events = !0 : this.__disabled_events = this.__disabled_events.concat(a)
  1052.     };
  1053.     k.prototype.track = function(a, b, c) {
  1054.         if ("undefined" === typeof a) t.error("No event name provided to mixpanel.track");
  1055.         else {
  1056.             b = b || {};
  1057.             b.token = b.token || this.get_config("token");
  1058.             this.cookie.update_search_keyword(l.referrer);
  1059.             this.get_config("store_google") && this.cookie.update_campaign_params();
  1060.             this.get_config("save_referrer") && this.cookie.update_referrer_info(l.referrer);
  1061.             b = d.extend({}, d.info.properties(), this.cookie.properties(),
  1062.                 b);
  1063.             delete b.ch;
  1064.             b = {
  1065.                 event: a,
  1066.                 properties: b
  1067.             };
  1068.             B && (b.validate = 1);
  1069.             b = d.truncate(b, 1023);
  1070.             var e = d.JSONEncode(b),
  1071.                 e = d.base64Encode(e);
  1072.             t.log("MIXPANEL REQUEST:");
  1073.             t.log(b);
  1074.             payload = {
  1075.                 data: e
  1076.             }; - 1 != this.get_distinct_id().indexOf("live_demo") ? (payload.live_demo = !0, this._send_request(this.get_config("api_host") + "/templates/demo_track/" + a, payload, this._prepare_callback(c, b))) : this._send_request(this.get_config("api_host") + "/track/" + a, payload, this._prepare_callback(c, b));
  1077.             return b
  1078.         }
  1079.     };
  1080.     k.prototype.track_pageview = function(a) {
  1081.         "undefined" ===
  1082.             typeof a && (a = l.location.href);
  1083.         this.track("mp_page_view", d.info.pageviewInfo(a))
  1084.     };
  1085.     k.prototype.track_links = function() {
  1086.         return this._track_dom.call(this, D, arguments)
  1087.     };
  1088.     k.prototype.track_forms = function() {
  1089.         return this._track_dom.call(this, F, arguments)
  1090.     };
  1091.     k.prototype.register = function(a, b) {
  1092.         this.cookie.register(a, b)
  1093.     };
  1094.     k.prototype.register_once = function(a, b, c) {
  1095.         this.cookie.register_once(a, b, c)
  1096.     };
  1097.     k.prototype.unregister = function(a) {
  1098.         this.cookie.unregister(a)
  1099.     };
  1100.     k.prototype._register_single = function(a, b) {
  1101.         var c = {};
  1102.         c[a] =
  1103.             b;
  1104.         this.register(c)
  1105.     };
  1106.     k.prototype.identify = function(a, b, c, d) {
  1107.         a != this.get_distinct_id() && a != this.get_property("__alias") && (this.unregister("__alias"), this._register_single("distinct_id", a));
  1108.         this._flags.identify_called = !0;
  1109.         this.people._flush(b, c, d)
  1110.     };
  1111.     k.prototype.get_distinct_id = function() {
  1112.         return this.get_property("distinct_id")
  1113.     };
  1114.     k.prototype.alias = function(a, b) {
  1115.         if (a === this.get_property("$people_distinct_id")) return t.critical("Attempting to create alias for existing People user - aborting."), -2;
  1116.         var c = this;
  1117.         d.isUndefined(b) && (b = this.get_distinct_id());
  1118.         if (a !== b) return this._register_single("__alias", a), this.track("$create_alias", {
  1119.             alias: a,
  1120.             distinct_id: b
  1121.         }, function(b) {
  1122.             c.identify(a)
  1123.         });
  1124.         t.error("alias matches current distinct_id - skipping api call.");
  1125.         this.identify(a);
  1126.         return -1
  1127.     };
  1128.     k.prototype.name_tag = function(a) {
  1129.         this._register_single("mp_name_tag", a)
  1130.     };
  1131.     k.prototype.set_config = function(a) {
  1132.         d.isObject(a) && (d.extend(this.config, a), this.cookie && this.cookie.update_config(this.config), B = B || this.get_config("debug"))
  1133.     };
  1134.     k.prototype.get_config =
  1135.         function(a) {
  1136.             return this.config[a]
  1137.     };
  1138.     k.prototype.get_property = function(a) {
  1139.         return this.cookie.props[a]
  1140.     };
  1141.     k.prototype.toString = function() {
  1142.         var a = this.get_config("name");
  1143.         "triggermail.lytics" !== a && (a = "triggermail.lytics." + a);
  1144.         return a
  1145.     };
  1146.     var s = function() {};
  1147.     s.prototype._init = function(a) {
  1148.         this._mixpanel = a
  1149.     };
  1150.     s.prototype.set = function(a, b, c) {
  1151.         var e = {}, f = {};
  1152.         d.isObject(a) ? (d.each(a, function(a, b) {
  1153.             "$distinct_id" == b || "$token" == b || (f[b] = a)
  1154.         }), c = b) : f[a] = b;
  1155.         this._get_config("save_referrer") && this._mixpanel.cookie.update_referrer_info(l.referrer);
  1156.         f = d.extend({}, d.info.people_properties(), this._mixpanel.cookie.get_referrer_info(), f);
  1157.         e.$set = f;
  1158.         return this._send_request(e, c)
  1159.     };
  1160.     s.prototype.increment = function(a, b, c) {
  1161.         var e = {}, f = {};
  1162.         d.isObject(a) ? (d.each(a, function(a, b) {
  1163.             "$distinct_id" == b || "$token" == b || (isNaN(parseFloat(a)) ? t.error("Invalid increment value passed to mixpanel.people.increment - must be a number") : f[b] = a)
  1164.         }), c = b) : (d.isUndefined(b) && (b = 1), f[a] = b);
  1165.         e.$add = f;
  1166.         return this._send_request(e, c)
  1167.     };
  1168.     s.prototype.append = function(a, b, c) {
  1169.         var e = {}, f = {};
  1170.         d.isObject(a) ?
  1171.             (d.each(a, function(a, b) {
  1172.             "$distinct_id" == b || "$token" == b || (f[b] = a)
  1173.         }), c = b) : f[a] = b;
  1174.         e.$append = f;
  1175.         return this._send_request(e, c)
  1176.     };
  1177.     s.prototype.track_charge = function(a, b, c) {
  1178.         if (!d.isNumber(a) && (a = parseFloat(a), isNaN(a))) {
  1179.             t.error("Invalid value passed to mixpanel.people.track_charge - must be a number");
  1180.             return
  1181.         }
  1182.         return this.append("$transactions", d.extend({
  1183.             $amount: a
  1184.         }, b), c)
  1185.     };
  1186.     s.prototype.clear_charges = function(a) {
  1187.         return this.set("$transactions", [], a)
  1188.     };
  1189.     s.prototype.delete_user = function() {
  1190.         if (this._identify_called()) {
  1191.             var a = {
  1192.                 $delete: this._mixpanel.get_distinct_id()
  1193.             };
  1194.             return this._send_request(a)
  1195.         }
  1196.         t.error("mixpanel.people.delete_user() requires you to call identify() first")
  1197.     };
  1198.     s.prototype.toString = function() {
  1199.         return this._mixpanel.toString() + ".people"
  1200.     };
  1201.     s.prototype._send_request = function(a, b) {
  1202.         a.$token = this._get_config("token");
  1203.         a.$distinct_id = this._mixpanel.get_distinct_id();
  1204.         var c = d.encodeDates(a),
  1205.             e = d.truncate(c, 255),
  1206.             c = d.JSONEncode(c),
  1207.             c = d.base64Encode(c);
  1208.         if (!this._identify_called()) return this._enqueue(a), d.isUndefined(b) ||
  1209.             (this._get_config("verbose") ? b({
  1210.             status: -1,
  1211.             error: null
  1212.         }) : b(-1)), e;
  1213.         t.log("MIXPANEL PEOPLE REQUEST:");
  1214.         t.log(e);
  1215.         this._mixpanel._send_request(this._get_config("api_host") + "/engage/", {
  1216.             data: c
  1217.         }, this._mixpanel._prepare_callback(b, e));
  1218.         return e
  1219.     };
  1220.     s.prototype._get_config = function(a) {
  1221.         return this._mixpanel.get_config(a)
  1222.     };
  1223.     s.prototype._identify_called = function() {
  1224.         return !0 === this._mixpanel._flags.identify_called
  1225.     };
  1226.     s.prototype._enqueue = function(a) {
  1227.         "$set" in a ? this._mixpanel.cookie._add_to_people_queue("$set", a) : "$add" in
  1228.             a ? this._mixpanel.cookie._add_to_people_queue("$add", a) : "$append" in a ? this._mixpanel.cookie._add_to_people_queue("$append", a) : t.error("Invalid call to _enqueue():", a)
  1229.     };
  1230.     s.prototype._flush = function(a, b, c) {
  1231.         var e = this,
  1232.             f = d.extend({}, this._mixpanel.cookie._get_queue("$set")),
  1233.             l = d.extend({}, this._mixpanel.cookie._get_queue("$add")),
  1234.             h = this._mixpanel.cookie._get_queue("$append");
  1235.         !d.isUndefined(f) && (d.isObject(f) && !d.isEmptyObject(f)) && (e._mixpanel.cookie._pop_from_people_queue("$set", f), this.set(f, function(b,
  1236.             c) {
  1237.             0 == b && e._mixpanel.cookie._add_to_people_queue("$set", f);
  1238.             d.isUndefined(a) || a(b, c)
  1239.         }));
  1240.         !d.isUndefined(l) && (d.isObject(l) && !d.isEmptyObject(l)) && (e._mixpanel.cookie._pop_from_people_queue("$add", l), this.increment(l, function(a, c) {
  1241.             0 == a && e._mixpanel.cookie._add_to_people_queue("$add", l);
  1242.             d.isUndefined(b) || b(a, c)
  1243.         }));
  1244.         if (!d.isUndefined(h) && d.isArray(h) && h.length)
  1245.             for (var k = h.length - 1; 0 <= k; k--) {
  1246.                 var m = h.pop();
  1247.                 e.append(m, function(a, b) {
  1248.                     0 == a && e._mixpanel.cookie._add_to_people_queue("$append", m);
  1249.                     d.isUndefined(c) ||
  1250.                         c(a, b)
  1251.                 })
  1252.             }
  1253.     };
  1254.     d.toArray = d.toArray;
  1255.     d.isObject = d.isObject;
  1256.     d.JSONEncode = d.JSONEncode;
  1257.     d.JSONDecode = d.JSONDecode;
  1258.     d.isEmptyObject = d.isEmptyObject;
  1259.     k.prototype.init = k.prototype.init;
  1260.     k.prototype.disable = k.prototype.disable;
  1261.     k.prototype.track = k.prototype.track;
  1262.     k.prototype.track_links = k.prototype.track_links;
  1263.     k.prototype.track_forms = k.prototype.track_forms;
  1264.     k.prototype.track_pageview = k.prototype.track_pageview;
  1265.     k.prototype.register = k.prototype.register;
  1266.     k.prototype.register_once = k.prototype.register_once;
  1267.     k.prototype.unregister =
  1268.         k.prototype.unregister;
  1269.     k.prototype.identify = k.prototype.identify;
  1270.     k.prototype.alias = k.prototype.alias;
  1271.     k.prototype.name_tag = k.prototype.name_tag;
  1272.     k.prototype.set_config = k.prototype.set_config;
  1273.     k.prototype.get_config = k.prototype.get_config;
  1274.     k.prototype.get_property = k.prototype.get_property;
  1275.     k.prototype.get_distinct_id = k.prototype.get_distinct_id;
  1276.     k.prototype.toString = k.prototype.toString;
  1277.     p.prototype.properties = p.prototype.properties;
  1278.     p.prototype.update_search_keyword = p.prototype.update_search_keyword;
  1279.     p.prototype.update_referrer_info =
  1280.         p.prototype.update_referrer_info;
  1281.     p.prototype.get_cross_subdomain = p.prototype.get_cross_subdomain;
  1282.     p.prototype.clear = p.prototype.clear;
  1283.     s.prototype.set = s.prototype.set;
  1284.     s.prototype.increment = s.prototype.increment;
  1285.     s.prototype.append = s.prototype.append;
  1286.     s.prototype.track_charge = s.prototype.track_charge;
  1287.     s.prototype.clear_charges = s.prototype.clear_charges;
  1288.     s.prototype.delete_user = s.prototype.delete_user;
  1289.     s.prototype.toString = s.prototype.toString;
  1290.     if (d.isUndefined(a)) t.critical("'mixpanel' object not initialized. Ensure you are using the latest version of the Mixpanel JS Library along with the snippet we provide.");
  1291.     else if (a.__loaded || a.config && a.cookie) t.error("Mixpanel library has already been downloaded at least once.");
  1292.     else if (1.1 > e) t.critical("Version mismatch; please ensure you're using the latest version of the Mixpanel code snippet.");
  1293.     else {
  1294.         var A = {};
  1295.         d.each(a._i, function(a) {
  1296.             var b;
  1297.             a && d.isArray(a) && (b = a[a.length - 1], a = G.apply(this, a), A[b] = a)
  1298.         });
  1299.         var L = function() {
  1300.             d.each(A, function(b, c) {
  1301.                 "triggermail.lytics" !== c && (a[c] = b)
  1302.             });
  1303.             a._ = d
  1304.         };
  1305.         a.init = function(b, c, d) {
  1306.             d ? a[d] || (a[d] = A[d] = G(b, c, d), a[d]._loaded()) : (d = a, A["triggermail.lytics"] ?
  1307.                 d = A["triggermail.lytics"] : b && (d = G(b, c, "triggermail.lytics")), window["triggermail.lytics"] = a = d, L())
  1308.         };
  1309.         a.init();
  1310.         d.each(A, function(a) {
  1311.             a._loaded()
  1312.         });
  1313.         if (l.addEventListener) "complete" == l.readyState ? b() : l.addEventListener("DOMContentLoaded", b, !1);
  1314.         else if (l.attachEvent) {
  1315.             l.attachEvent("onreadystatechange", b);
  1316.             e = !1;
  1317.             try {
  1318.                 e = null == window.frameElement
  1319.             } catch (M) {}
  1320.             if (l.documentElement.doScroll && e) {
  1321.                 var J = function() {
  1322.                     try {
  1323.                         l.documentElement.doScroll("left")
  1324.                     } catch (a) {
  1325.                         setTimeout(J, 1);
  1326.                         return
  1327.                     }
  1328.                     b()
  1329.                 };
  1330.                 J()
  1331.             }
  1332.         }
  1333.         d.register_event(window,
  1334.             "load", b, !0)
  1335.     }
  1336. })(window.triggermail.lytics);
  1337. var prettyPrint = function() {
  1338.     var a = {
  1339.         el: function(b, e) {
  1340.             var f = document.createElement(b),
  1341.                 h;
  1342.             if ((e = a.merge({}, e)) && e.style) a.applyCSS(f, e.style), delete e.style;
  1343.             for (h in e) e.hasOwnProperty(h) && (f[h] = e[h]);
  1344.             return f
  1345.         },
  1346.         applyCSS: function(a, b) {
  1347.             for (var f in b)
  1348.                 if (b.hasOwnProperty(f)) try {
  1349.                     a.style[f] = b[f]
  1350.                 } catch (h) {}
  1351.         },
  1352.         txt: function(a) {
  1353.             return document.createTextNode(a)
  1354.         },
  1355.         row: function(b, e, f) {
  1356.             f = f || "td";
  1357.             var h = a.count(b, null) + 1,
  1358.                 n = a.el("tr"),
  1359.                 q, x = {
  1360.                     style: a.getStyles(f, e),
  1361.                     colSpan: h,
  1362.                     onmouseover: function() {
  1363.                         a.forEach(this.parentNode.childNodes, function(b) {
  1364.                             "td" ===
  1365.                                 b.nodeName.toLowerCase() && a.applyCSS(b, a.getStyles("td_hover", e))
  1366.                         })
  1367.                     },
  1368.                     onmouseout: function() {
  1369.                         a.forEach(this.parentNode.childNodes, function(b) {
  1370.                             "td" === b.nodeName.toLowerCase() && a.applyCSS(b, a.getStyles("td", e))
  1371.                         })
  1372.                     }
  1373.                 };
  1374.             a.forEach(b, function(b) {
  1375.                 null !== b && (q = a.el(f, x), b.nodeType ? q.appendChild(b) : q.innerHTML = a.shorten(b.toString()), n.appendChild(q))
  1376.             });
  1377.             return n
  1378.         },
  1379.         hRow: function(b, e) {
  1380.             return a.row(b, e, "th")
  1381.         },
  1382.         table: function(b, e) {
  1383.             b = b || [];
  1384.             var f = {
  1385.                 style: a.getStyles("thead", e)
  1386.             }, h = {
  1387.                     style: a.getStyles("tbody", e)
  1388.                 }, n = {
  1389.                     style: a.getStyles("table",
  1390.                         e)
  1391.                 }, n = a.el("table", n),
  1392.                 f = a.el("thead", f),
  1393.                 h = a.el("tbody", h);
  1394.             b.length && (n.appendChild(f), f.appendChild(a.hRow(b, e)));
  1395.             n.appendChild(h);
  1396.             return {
  1397.                 node: n,
  1398.                 tbody: h,
  1399.                 thead: f,
  1400.                 appendChild: function(a) {
  1401.                     this.tbody.appendChild(a)
  1402.                 },
  1403.                 addRow: function(b, c, f) {
  1404.                     this.appendChild(a.row.call(a, b, c || e, f));
  1405.                     return this
  1406.                 }
  1407.             }
  1408.         },
  1409.         shorten: function(a) {
  1410.             a = a.replace(/^\s\s*|\s\s*$|\n/g, "");
  1411.             return 40 < a.length ? a.substring(0, 39) + "..." : a
  1412.         },
  1413.         htmlentities: function(a) {
  1414.             return a.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;")
  1415.         },
  1416.         merge: function(b,
  1417.             e) {
  1418.             "object" !== typeof b && (b = {});
  1419.             for (var f in e)
  1420.                 if (e.hasOwnProperty(f)) {
  1421.                     var h = e[f];
  1422.                     b[f] = "object" === typeof h ? a.merge(b[f], h) : h
  1423.                 }
  1424.             f = 2;
  1425.             for (h = arguments.length; f < h; f++) a.merge(b, arguments[f]);
  1426.             return b
  1427.         },
  1428.         count: function(a, b) {
  1429.             for (var f = 0, h = 0, n = a.length; h < n; h++) a[h] === b && f++;
  1430.             return f
  1431.         },
  1432.         thead: function(a) {
  1433.             return a.getElementsByTagName("thead")[0]
  1434.         },
  1435.         forEach: function(a, b, f) {
  1436.             f || (f = b);
  1437.             b = a.length;
  1438.             for (var h = -1; ++h < b && !1 !== f(a[h], h, a););
  1439.             return !0
  1440.         },
  1441.         type: function(a) {
  1442.             try {
  1443.                 if (null === a) return "null";
  1444.                 if (void 0 === a) return "undefined";
  1445.                 var b = Object.prototype.toString.call(a).match(/\s(.+?)\]/)[1].toLowerCase();
  1446.                 return a.nodeType ? 1 === a.nodeType ? "domelement" : "domnode" : /^(string|number|array|regexp|function|date|boolean)$/.test(b) ? b : "object" === typeof a ? a.jquery && "string" === typeof a.jquery ? "jquery" : "object" : a === window || a === document ? "object" : "default"
  1447.             } catch (f) {
  1448.                 return "default"
  1449.             }
  1450.         },
  1451.         within: function(a) {
  1452.             return {
  1453.                 is: function(b) {
  1454.                     for (var f in a)
  1455.                         if (a[f] === b) return f;
  1456.                     return ""
  1457.                 }
  1458.             }
  1459.         },
  1460.         common: {
  1461.             circRef: function(c, e, f) {
  1462.                 return a.expander("[POINTS BACK TO <strong>" +
  1463.                     e + "</strong>]", "Click to show this item anyway", function() {
  1464.                         this.parentNode.appendChild(b(c, {
  1465.                             maxDepth: 1
  1466.                         }))
  1467.                     })
  1468.             },
  1469.             depthReached: function(c, e) {
  1470.                 return a.expander("[DEPTH REACHED]", "Click to show this item anyway", function() {
  1471.                     try {
  1472.                         this.parentNode.appendChild(b(c, {
  1473.                             maxDepth: 1
  1474.                         }))
  1475.                     } catch (e) {
  1476.                         this.parentNode.appendChild(a.table(["ERROR OCCURED DURING OBJECT RETRIEVAL"], "error").addRow([e.message]).node)
  1477.                     }
  1478.                 })
  1479.             }
  1480.         },
  1481.         getStyles: function(c, e) {
  1482.             e = b.settings.styles[e] || {};
  1483.             return a.merge({}, b.settings.styles["default"][c], e[c])
  1484.         },
  1485.         expander: function(b, e, f) {
  1486.             return a.el("a", {
  1487.                 innerHTML: a.shorten(b) + ' <b style="visibility:hidden;">[+]</b>',
  1488.                 title: e,
  1489.                 onmouseover: function() {
  1490.                     this.getElementsByTagName("b")[0].style.visibility = "visible"
  1491.                 },
  1492.                 onmouseout: function() {
  1493.                     this.getElementsByTagName("b")[0].style.visibility = "hidden"
  1494.                 },
  1495.                 onclick: function() {
  1496.                     this.style.display = "none";
  1497.                     f.call(this);
  1498.                     return !1
  1499.                 },
  1500.                 style: {
  1501.                     cursor: "pointer"
  1502.                 }
  1503.             })
  1504.         },
  1505.         stringify: function(b) {
  1506.             var e = a.type(b),
  1507.                 f, h = !0;
  1508.             if ("array" === e) return f = "[", a.forEach(b, function(b, c) {
  1509.                 f += (0 === c ? "" : ", ") + a.stringify(b)
  1510.             }),
  1511.             f + "]";
  1512.             if ("object" === typeof b) {
  1513.                 f = "{";
  1514.                 for (var n in b) b.hasOwnProperty(n) && (f += (h ? "" : ", ") + n + ":" + a.stringify(b[n]), h = !1);
  1515.                 return f + "}"
  1516.             }
  1517.             return "regexp" === e ? "/" + b.source + "/" : "string" === e ? '"' + b.replace(/"/g, '\\"') + '"' : b.toString()
  1518.         },
  1519.         headerGradient: function() {
  1520.             var a = document.createElement("canvas");
  1521.             if (!a.getContext) return "";
  1522.             var b = a.getContext("2d");
  1523.             a.height = 30;
  1524.             a.width = 1;
  1525.             var f = b.createLinearGradient(0, 0, 0, 30);
  1526.             f.addColorStop(0, "rgba(0,0,0,0)");
  1527.             f.addColorStop(1, "rgba(0,0,0,0.25)");
  1528.             b.fillStyle = f;
  1529.             b.fillRect(0, 0,
  1530.                 1, 30);
  1531.             return "url(" + (a.toDataURL && a.toDataURL() || "") + ")"
  1532.         }()
  1533.     }, b = function(c, e) {
  1534.             e = e || {};
  1535.             var f = a.merge({}, b.config, e),
  1536.                 h = a.el("div"),
  1537.                 n = {}, q = !1;
  1538.             b.settings = f;
  1539.             var x = {
  1540.                 string: function(b) {
  1541.                     return a.txt('"' + a.shorten(b.replace(/"/g, '\\"')) + '"')
  1542.                 },
  1543.                 number: function(b) {
  1544.                     return a.txt(b)
  1545.                 },
  1546.                 regexp: function(b) {
  1547.                     var c = a.table(["RegExp", null], "regexp"),
  1548.                         e = a.table(),
  1549.                         h = a.expander("/" + b.source + "/", "Click to show more", function() {
  1550.                             this.parentNode.appendChild(c.node)
  1551.                         });
  1552.                     e.addRow(["g", b.global]).addRow(["i", b.ignoreCase]).addRow(["m",
  1553.                         b.multiline
  1554.                     ]);
  1555.                     c.addRow(["source", "/" + b.source + "/"]).addRow(["flags", e.node]).addRow(["lastIndex", b.lastIndex]);
  1556.                     return f.expanded ? c.node : h
  1557.                 },
  1558.                 domelement: function(b, c) {
  1559.                     var e = a.table(["DOMElement", null], "domelement"),
  1560.                         h = b.nodeName || "";
  1561.                     e.addRow(["tag", "&lt;" + h.toLowerCase() + "&gt;"]);
  1562.                     a.forEach(["id", "className", "innerHTML", "src", "href"], function(c) {
  1563.                         b[c] && e.addRow([c, a.htmlentities(b[c])])
  1564.                     });
  1565.                     return f.expanded ? e.node : a.expander("DOMElement (" + h.toLowerCase() + ")", "Click to show more", function() {
  1566.                         this.parentNode.appendChild(e.node)
  1567.                     })
  1568.                 },
  1569.                 domnode: function(b) {
  1570.                     var c = a.table(["DOMNode", null], "domelement"),
  1571.                         e = a.htmlentities((b.data || "UNDEFINED").replace(/\n/g, "\\n"));
  1572.                     c.addRow(["nodeType", b.nodeType + " (" + b.nodeName + ")"]).addRow(["data", e]);
  1573.                     return f.expanded ? c.node : a.expander("DOMNode", "Click to show more", function() {
  1574.                         this.parentNode.appendChild(c.node)
  1575.                     })
  1576.                 },
  1577.                 jquery: function(a, b, c) {
  1578.                     return x.array(a, b, c, !0)
  1579.                 },
  1580.                 object: function(b, c, e) {
  1581.                     var h = a.within(n).is(b);
  1582.                     if (h) return a.common.circRef(b, h, f);
  1583.                     n[e || "TOP"] = b;
  1584.                     if (c === f.maxDepth) return a.common.depthReached(b,
  1585.                         f);
  1586.                     var z = a.table(["Object", null], "object");
  1587.                     e = !0;
  1588.                     for (var v in b)
  1589.                         if (!b.hasOwnProperty || b.hasOwnProperty(v)) {
  1590.                             var h = b[v],
  1591.                                 y = a.type(h);
  1592.                             e = !1;
  1593.                             try {
  1594.                                 z.addRow([v, x[y](h, c + 1, v)], y)
  1595.                             } catch (C) {
  1596.                                 window.console && window.console.log && console.log(C.message)
  1597.                             }
  1598.                         }
  1599.                     e ? z.addRow(["<small>[empty]</small>"]) : z.thead.appendChild(a.hRow(["key", "value"], "colHeader"));
  1600.                     b = f.expanded || q ? z.node : a.expander(a.stringify(b), "Click to show more", function() {
  1601.                         this.parentNode.appendChild(z.node)
  1602.                     });
  1603.                     q = !0;
  1604.                     return b
  1605.                 },
  1606.                 array: function(b, c, e, h) {
  1607.                     var q = a.within(n).is(b);
  1608.                     if (q) return a.common.circRef(b, q);
  1609.                     n[e || "TOP"] = b;
  1610.                     if (c === f.maxDepth) return a.common.depthReached(b);
  1611.                     e = h ? "jQuery" : "Array";
  1612.                     var v = a.table([e + "(" + b.length + ")", null], h ? "jquery" : e.toLowerCase()),
  1613.                         y = !0,
  1614.                         C = 0;
  1615.                     h && v.addRow(["selector", b.selector]);
  1616.                     a.forEach(b, function(d, e) {
  1617.                         if (0 <= f.maxArray && ++C > f.maxArray) return v.addRow([e + ".." + (b.length - 1), x[a.type(d)]("...", c + 1, e)]), !1;
  1618.                         y = !1;
  1619.                         v.addRow([e, x[a.type(d)](d, c + 1, e)])
  1620.                     });
  1621.                     h || (y ? v.addRow(["<small>[empty]</small>"]) : v.thead.appendChild(a.hRow(["index", "value"], "colHeader")));
  1622.                     return f.expanded ? v.node : a.expander(a.stringify(b), "Click to show more", function() {
  1623.                         this.parentNode.appendChild(v.node)
  1624.                     })
  1625.                 },
  1626.                 "function": function(b, c, e) {
  1627.                     if (c = a.within(n).is(b)) return a.common.circRef(b, c);
  1628.                     n[e || "TOP"] = b;
  1629.                     var h = a.table(["Function", null], "function");
  1630.                     a.table(["Arguments"]);
  1631.                     e = b.toString().match(/\((.+?)\)/);
  1632.                     b = b.toString().match(/\(.*?\)\s+?\{?([\S\s]+)/)[1].replace(/\}?$/, "");
  1633.                     h.addRow(["arguments", e ? e[1].replace(/[^\w_,\s]/g, "") : "<small>[none/native]</small>"]).addRow(["body", b]);
  1634.                     return f.expanded ?
  1635.                         h.node : a.expander("function(){...}", "Click to see more about this function.", function() {
  1636.                             this.parentNode.appendChild(h.node)
  1637.                         })
  1638.                 },
  1639.                 date: function(b) {
  1640.                     var c = a.table(["Date", null], "date"),
  1641.                         e = b.toString().split(/\s/);
  1642.                     c.addRow(["Time", e[4]]).addRow(["Date", e.slice(0, 4).join("-")]);
  1643.                     return f.expanded ? c.node : a.expander("Date (timestamp): " + +b, "Click to see a little more info about this date", function() {
  1644.                         this.parentNode.appendChild(c.node)
  1645.                     })
  1646.                 },
  1647.                 "boolean": function(b) {
  1648.                     return a.txt(b.toString().toUpperCase())
  1649.                 },
  1650.                 undefined: function() {
  1651.                     return a.txt("UNDEFINED")
  1652.                 },
  1653.                 "null": function() {
  1654.                     return a.txt("NULL")
  1655.                 },
  1656.                 "default": function() {
  1657.                     return a.txt("prettyPrint: TypeNotFound Error")
  1658.                 }
  1659.             };
  1660.             h.appendChild(x[f.forceObject ? "object" : a.type(c)](c, 0));
  1661.             return h
  1662.         };
  1663.     b.config = {
  1664.         expanded: !0,
  1665.         forceObject: !1,
  1666.         maxDepth: 3,
  1667.         maxArray: -1,
  1668.         styles: {
  1669.             array: {
  1670.                 th: {
  1671.                     backgroundColor: "#6DBD2A",
  1672.                     color: "white"
  1673.                 }
  1674.             },
  1675.             "function": {
  1676.                 th: {
  1677.                     backgroundColor: "#D82525"
  1678.                 }
  1679.             },
  1680.             regexp: {
  1681.                 th: {
  1682.                     backgroundColor: "#E2F3FB",
  1683.                     color: "#000"
  1684.                 }
  1685.             },
  1686.             object: {
  1687.                 th: {
  1688.                     backgroundColor: "#1F96CF"
  1689.                 }
  1690.             },
  1691.             jquery: {
  1692.                 th: {
  1693.                     backgroundColor: "#FBF315"
  1694.                 }
  1695.             },
  1696.             error: {
  1697.                 th: {
  1698.                     backgroundColor: "red",
  1699.                     color: "yellow"
  1700.                 }
  1701.             },
  1702.             domelement: {
  1703.                 th: {
  1704.                     backgroundColor: "#F3801E"
  1705.                 }
  1706.             },
  1707.             date: {
  1708.                 th: {
  1709.                     backgroundColor: "#A725D8"
  1710.                 }
  1711.             },
  1712.             colHeader: {
  1713.                 th: {
  1714.                     backgroundColor: "#EEE",
  1715.                     color: "#000",
  1716.                     textTransform: "uppercase"
  1717.                 }
  1718.             },
  1719.             "default": {
  1720.                 table: {
  1721.                     borderCollapse: "collapse",
  1722.                     width: "100%"
  1723.                 },
  1724.                 td: {
  1725.                     padding: "5px",
  1726.                     fontSize: "12px",
  1727.                     backgroundColor: "#FFF",
  1728.                     color: "#222",
  1729.                     border: "1px solid #000",
  1730.                     verticalAlign: "top",
  1731.                     fontFamily: '"Consolas","Lucida Console",Courier,mono',
  1732.                     whiteSpace: "nowrap"
  1733.                 },
  1734.                 td_hover: {},
  1735.                 th: {
  1736.                     padding: "5px",
  1737.                     fontSize: "12px",
  1738.                     backgroundColor: "#222",
  1739.                     color: "#EEE",
  1740.                     textAlign: "left",
  1741.                     border: "1px solid #000",
  1742.                     verticalAlign: "top",
  1743.                     fontFamily: '"Consolas","Lucida Console",Courier,mono',
  1744.                     backgroundImage: a.headerGradient,
  1745.                     backgroundRepeat: "repeat-x"
  1746.                 }
  1747.             }
  1748.         }
  1749.     };
  1750.     return b
  1751. }();
  1752. jQuery.extend(triggermail, function() {
  1753.     var a = function(a, c) {
  1754.         var e = a.obem;
  1755.         "undefined" != typeof e && "" != e && "undefined" == typeof triggermail.lytics.get_property("obem") && (triggermail.lytics.register({
  1756.             OBFUSCATED_EMAIL_PROPERTY: e
  1757.         }, 365), triggermail.track("identify", {
  1758.             customer: a
  1759.         }));
  1760.         e = a.email;
  1761.         if (!(void 0 == e || "" == e)) {
  1762.             if (!0 !== c && (e = triggermail.core.sanitizer.sanitize("email", e), !e)) return;
  1763.             var f = triggermail.lytics.get_property("email");
  1764.             if (!(triggermail.util.isValidEmail(f) && f != e)) return e != triggermail.lytics.get_property("email") &&
  1765.                 (triggermail.lytics.register({
  1766.                 email: e
  1767.             }, 365), triggermail.track("identify", {
  1768.                 customer: a
  1769.             })), a
  1770.         }
  1771.     };
  1772.     return {
  1773.         track: function(a, c) {
  1774.             var e = jQuery.extend({}, c);
  1775.             jQuery.extend(c, triggermail.lytics.cookie.props);
  1776.             try {
  1777.                 c.url = window.location.href, -1 < c.url.indexOf("s.thebrighttag") && delete c.url
  1778.             } catch (f) {}
  1779.             "unsubscribe" == a && e.email && (c.email = e.email);
  1780.             "page_view" != a && ("true" == triggermail.util.cookie.get("tm_debug") ? triggermail.lytics.track(a, c, this.track_callback(a, c)) : triggermail.lytics.track(a, c));
  1781.             triggermail.lytics.get_distinct_id() &&
  1782.                 (c.distinct_id = triggermail.lytics.get_distinct_id());
  1783.             try {
  1784.                 !0 === triggermail.integ.debug && console.debug(a, c)
  1785.             } catch (h) {}
  1786.         },
  1787.         report_to_insanetiego: function(a, c) {
  1788.             if ("true" === triggermail.util.cookie.get("tm_debug")) {
  1789.                 0 === $("#insanetiego").length && triggermail.insanetiego.inject_div();
  1790.                 var e = prettyPrint(c, {
  1791.                     styles: {
  1792.                         array: {
  1793.                             th: {
  1794.                                 display: "none"
  1795.                             }
  1796.                         },
  1797.                         object: {
  1798.                             th: {
  1799.                                 display: "none"
  1800.                             }
  1801.                         },
  1802.                         "default": {
  1803.                             th: {
  1804.                                 display: "none"
  1805.                             }
  1806.                         }
  1807.                     }
  1808.                 });
  1809.                 $("#insanetiego").append("<p><b>Event: " + a + "</b></p>");
  1810.                 $("#insanetiego").append(e);
  1811.                 $.each(c.products, function(a,
  1812.                     b) {
  1813.                     var c, e;
  1814.                     b.image && $("<img/>").attr("src", b.image).load(function() {
  1815.                         c = this.width;
  1816.                         e = this.height;
  1817.                         $("#insanetiego").append("<p><b>Image size: width-" + c + " height-" + e + "<b></p>");
  1818.                         $("#insanetiego").append('<img src="' + b.image + '" height="100" width="100" />')
  1819.                     });
  1820.                     b.alternative_image && (c = this.width, e = this.height, $("<img/>").attr("src", b.alternative_image).load(function() {
  1821.                         c = this.width;
  1822.                         e = this.height;
  1823.                         $("#insanetiego").append("<p><b>Alternative Image size: width-" + c + " height-" + e + "<b></p>");
  1824.                         $("#insanetiego").append('<img src="' +
  1825.                             b.alternative_image + '" height="100" width="100"/>')
  1826.                     }))
  1827.                 })
  1828.             }
  1829.         },
  1830.         validate: function(a) {
  1831.             "true" === triggermail.util.cookie.get("tm_debug") && (a ? $("#insanetiego").append('<p><b style="color:#64E813;">Event is ok</b></p>') : $("#insanetiego").append('<p><b style="color:#E60508;">The Event Seems Broken</b></p>'))
  1832.         },
  1833.         track_callback: function(a, c) {
  1834.             return function(e) {
  1835.                 triggermail.report_to_insanetiego(a, c);
  1836.                 triggermail.validate(e)
  1837.             }
  1838.         },
  1839.         add_to_cart: function(a) {
  1840.             return this.track("add_to_cart", {
  1841.                 products: [a]
  1842.             })
  1843.         },
  1844.         remove_from_cart: function(a) {
  1845.             return this.track("remove_from_cart", {
  1846.                 products: [a]
  1847.             })
  1848.         },
  1849.         wishlist: function(a) {
  1850.             return this.track("wishlist", {
  1851.                 products: [a]
  1852.             })
  1853.         },
  1854.         view_cart: function(a) {
  1855.             return this.track("viewed_cart", a)
  1856.         },
  1857.         stop: function(a) {
  1858.             return this.track("stop", a)
  1859.         },
  1860.         page: function(a) {
  1861.             return this.track("page_view", a)
  1862.         },
  1863.         purchase: function(a) {
  1864.             return this.track("purchase", a)
  1865.         },
  1866.         checkout_start: function(a) {
  1867.             return this.track("checkout_start", a)
  1868.         },
  1869.         view: function(a, c) {
  1870.             triggermail.integ.salt_products && (a.salt = Math.random().toString(36).replace(".", ""));
  1871.             var e = jQuery.extend(c || {}, {
  1872.                 products: [a]
  1873.             });
  1874.             return this.track("viewed_product", e)
  1875.         },
  1876.         view_content: function(a, c) {
  1877.             triggermail.integ.salt_products && (a.salt = Math.random().toString(36).replace(".", ""));
  1878.             var e = jQuery.extend(c || {}, {
  1879.                 contents: [a]
  1880.             });
  1881.             return this.track("viewed_content", e)
  1882.         },
  1883.         search: function(a) {
  1884.             return this.track("search", a)
  1885.         },
  1886.         identify: function(b, c) {
  1887.             return a(b, c)
  1888.         },
  1889.         subscribe: function(b) {
  1890.             b.source = "newsletter";
  1891.             return a(b)
  1892.         },
  1893.         unsubscribe: function(a) {
  1894.             return this.track("unsubscribe", a)
  1895.         },
  1896.         patch: function(a) {
  1897.             return this.track("patch", a)
  1898.         },
  1899.         merge: function(a) {
  1900.             return this.track("merge",
  1901.                 a)
  1902.         },
  1903.         eton_show: function(a) {
  1904.             return this.track("eton_show", a)
  1905.         },
  1906.         init: function(a) {},
  1907.         exception: function(a) {
  1908.             var c = {};
  1909.             jQuery.extend(c, triggermail.lytics._.info.properties());
  1910.             try {
  1911.                 c.url = window.location.href, -1 < c.url.indexOf("s.thebrighttag") && delete c.url, c.message = a.message
  1912.             } catch (e) {}
  1913.             c.error = a;
  1914.             this.track("exception", c)
  1915.         },
  1916.         EMAIL_ADDRESS_PROPERTY: "email_address",
  1917.         PAGE_VIEW: "page_view",
  1918.         MAX_PROPERTY_LENGTH: 1024
  1919.     }
  1920. }());
  1921. triggermail.util = function() {
  1922.     return {
  1923.         price: function(a) {
  1924.             return isNaN(parseFloat(a)) ? parseFloat(a.replace(/[^0-9\.]/g, "")) : parseFloat(a)
  1925.         },
  1926.         unique: function(a) {
  1927.             for (var b = {}, c = 0; c < a.length; c++) b[a[c]] = !0;
  1928.             return jQuery.map(b, function(a, b) {
  1929.                 return b
  1930.             })
  1931.         },
  1932.         slugify: function(a) {
  1933.             return a.toLowerCase().replace(/[^\w ]+/g, "").replace(/ +/g, "-")
  1934.         },
  1935.         serializeForm: function(a) {
  1936.             var b = {};
  1937.             a = a.serializeArray();
  1938.             $.each(a, function() {
  1939.                 void 0 !== b[this.name] ? (b[this.name].push || (b[this.name] = [b[this.name]]), b[this.name].push(this.value ||
  1940.                     "")) : b[this.name] = this.value || ""
  1941.             });
  1942.             return b
  1943.         },
  1944.         getUrlParam: function(a) {
  1945.             a = a.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
  1946.             a = RegExp("[\\?&]" + a + "=([^&#]*)").exec(window.location.search);
  1947.             return null == a ? "" : decodeURIComponent(a[1].replace(/\+/g, " "))
  1948.         },
  1949.         isMobile: function() {
  1950.             var a = !1,
  1951.                 b = "iphone;ipad;android;blackberry;nokia;opera mini;windows mobile;windows phone;iemobile".split(";"),
  1952.                 c;
  1953.             for (c in b) 0 < navigator.userAgent.toLowerCase().indexOf(b[c].toLowerCase()) && (a = !0);
  1954.             return a
  1955.         },
  1956.         getParamFromQueryString: function(a,
  1957.             b) {
  1958.             return decodeURI((RegExp(b + "=(.+?)(&|$)").exec(a) || [, null])[1])
  1959.         },
  1960.         trimString: function(a, b) {
  1961.             return jQuery.trim(a).substring(0, b)
  1962.         },
  1963.         isAnonymousUser: function() {
  1964.             var a = triggermail.lytics.get_property(triggermail.core.EMAIL_ADDRESS_PROPERTY);
  1965.             return !this.isValidEmail(a)
  1966.         },
  1967.         emRegex: /\S+@\S+\.\S+/,
  1968.         isValidEmail: function(a) {
  1969.             return triggermail.util.emRegex.test(a)
  1970.         },
  1971.         findEmail: function(a, b) {
  1972.             try {
  1973.                 return "undefined" == typeof b && (b = triggermail.util.emRegex), b.exec(a).pop()
  1974.             } catch (c) {}
  1975.         },
  1976.         hashCode: function(a) {
  1977.             var b = 0,
  1978.                 c, e;
  1979.             if (0 == a.length) return b;
  1980.             for (c = 0; c < a.length; c++) e = a.charCodeAt(c), b = (b << 5) - b + e, b &= b;
  1981.             return b
  1982.         },
  1983.         productHash: function(a) {
  1984.             a = this.sanitizeProductName(a[TriggerMail.PRODUCT_NAME_PROPERTY]);
  1985.             return this.hashCode(a)
  1986.         },
  1987.         _getbyte64: function(a, b) {
  1988.             _ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  1989.             var c = _ALPHA.indexOf(a.charAt(b));
  1990.             if (-1 === c) throw "Cannot decode base64";
  1991.             return c
  1992.         },
  1993.         b64decode: function(a) {
  1994.             var b = 0,
  1995.                 c, e, f = a.length,
  1996.                 h = [];
  1997.             a = String(a);
  1998.             if (0 === f) return a;
  1999.             if (0 !== f % 4) throw "Cannot decode base64";
  2000.             "=" === a.charAt(f - 1) && (b = 1, "=" === a.charAt(f - 2) && (b = 2), f -= 4);
  2001.             for (c = 0; c < f; c += 4) e = this._getbyte64(a, c) << 18 | this._getbyte64(a, c + 1) << 12 | this._getbyte64(a, c + 2) << 6 | this._getbyte64(a, c + 3), h.push(String.fromCharCode(e >> 16, e >> 8 & 255, e & 255));
  2002.             switch (b) {
  2003.                 case 1:
  2004.                     e = this._getbyte64(a, c) << 18 | this._getbyte64(a, c + 1) << 12 | this._getbyte64(a, c + 2) << 6;
  2005.                     h.push(String.fromCharCode(e >> 16, e >> 8 & 255));
  2006.                     break;
  2007.                 case 2:
  2008.                     e = this._getbyte64(a, c) << 18 | this._getbyte64(a, c + 1) << 12, h.push(String.fromCharCode(e >> 16))
  2009.             }
  2010.             return h.join("")
  2011.         },
  2012.         wrapEvent: function(a) {
  2013.             var b =
  2014.                 Array.prototype.slice.call(arguments, 1);
  2015.             return function() {
  2016.                 try {
  2017.                     return a.apply(this, b.concat(Array.prototype.slice.call(arguments, 0)))
  2018.                 } catch (c) {}
  2019.             }
  2020.         },
  2021.         removeURLParam: function(a, b) {
  2022.             return triggermail.util.updateURLParams(a, b, !1)
  2023.         },
  2024.         keepURLParam: function(a, b) {
  2025.             return triggermail.util.updateURLParams(a, b, !0)
  2026.         },
  2027.         updateURLParams: function(a, b, c) {
  2028.             var e = a.split("?")[0],
  2029.                 f = [],
  2030.                 f = -1 !== a.indexOf("?") ? a.split("?")[1] : "";
  2031.             if ("" !== f) {
  2032.                 for (var f = f.split("&"), h = f.length - 1; 0 <= h; h -= 1) a = f[h].split("=")[0], c ? jQuery.isArray(b) ? -1 ==
  2033.                     b.indexOf(a) && f.splice(h, 1) : a != b && f.splice(h, 1) : jQuery.isArray(b) ? -1 < b.indexOf(a) && f.splice(h, 1) : a == b && f.splice(h, 1);
  2034.                 e += 0 < f.length ? "?" + f.join("&") : ""
  2035.             }
  2036.             return e
  2037.         },
  2038.         getArrayElementFromQueryString: function(a, b) {
  2039.             var c = [];
  2040.             a || (a = location.href);
  2041.             b = b.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
  2042.             for (var e = RegExp(b + "=([^&#]+)", "ig");;) {
  2043.                 var f = e.exec(a);
  2044.                 if (f && f[1]) c.push(f[1]);
  2045.                 else break
  2046.             }
  2047.             return c.length ? 1 == c.length ? c[0] : c : null
  2048.         }
  2049.     }
  2050. }();
  2051. triggermail.util.cookie = triggermail.lytics._.cookie;
  2052. triggermail.util.encode = triggermail.lytics._.JSONEncode;
  2053. triggermail.util.decode = triggermail.lytics._.JSONDecode;
  2054. triggermail.demo = function() {
  2055.     var a = triggermail.lytics.get_distinct_id(); - 1 == a.indexOf("live_demo") && (triggermail.lytics._register_single("distinct_id", "live_demo_" + a), a = triggermail.lytics.get_distinct_id());
  2056.     triggermail.lytics.cookie.update_config({
  2057.         live_demo: !0,
  2058.         cookie_expiration: 1
  2059.     });
  2060.     window.open("http://www.bluecore.com/api/templates/live_demo/" + triggermail.Partner.keys.lytics.p + "/" + a)
  2061. };
  2062. triggermail.util.walk = function(a, b) {
  2063.     b(a);
  2064.     for (a = a.firstChild; a;) walk(a, b), a = a.nextSibling
  2065. };
  2066. triggermail.util.walkUntil = function(a, b, c) {
  2067.     ret = b(a);
  2068.     if (!0 === c(ret)) return ret;
  2069.     for (a = a.firstChild; a;) walk(a, b), a = a.nextSibling
  2070. };
  2071. triggermail.insanetiego = function() {
  2072.     return {
  2073.         inject_div: function() {
  2074.             $("body").append('<div id="insanetiego" style="position:fixed;bottom:0;width:100%;background:#D8E7ED;height:300px;overflow:scroll;z-index:2000;border-top-style:solid;border-top-width:5px;"></div>')
  2075.         },
  2076.         remove_div: function() {
  2077.             $("#insanetiego").remove()
  2078.         },
  2079.         debug: function() {
  2080.             triggermail.util.cookie.set("tm_debug", !0);
  2081.             triggermail.integ.debug = !0;
  2082.             this.inject_div()
  2083.         },
  2084.         undebug: function() {
  2085.             triggermail.util.cookie.set("tm_debug", !1);
  2086.             triggermail.integ.debug = !1
  2087.         }
  2088.     }
  2089. }();
  2090. triggermail.core = {};
  2091. triggermail.core.sanitizer = function() {
  2092.     return {
  2093.         sanitize: function(a, b) {
  2094.             if ("email" == a) {
  2095.                 var c;
  2096.                 c = /\S+@\S+\.\S+/.test(b) ? b : null;
  2097.                 return c
  2098.             }
  2099.             return b ? b : ""
  2100.         }
  2101.     }
  2102. }();
  2103. triggermail.integ = function() {
  2104.     return {
  2105.         init: function() {
  2106.             "undefined" != typeof triggermail.Partner.init ? triggermail.Partner.init() : triggermail.integ.partnerInit();
  2107.             try {
  2108.                 triggermail.integ.checkLoop()
  2109.             } catch (a) {}
  2110.         },
  2111.         partnerInit: function(a) {
  2112.             var b = triggermail.Partner;
  2113.             if (!("undefined" == typeof a && (jQuery(".translated-rtl, .translated-rtl").length || jQuery('meta[http-equiv="X-Translated-By"]').length))) {
  2114.                 try {
  2115.                     b.trackProductView()
  2116.                 } catch (c) {
  2117.                     triggermail.exception(c)
  2118.                 }
  2119.                 try {
  2120.                     triggermail.Partner.trackAddToCart()
  2121.                 } catch (e) {
  2122.                     triggermail.exception(e)
  2123.                 }
  2124.                 try {
  2125.                     triggermail.Partner.trackCheckout()
  2126.                 } catch (f) {
  2127.                     triggermail.exception(f)
  2128.                 }
  2129.                 try {
  2130.                     triggermail.Partner.watchEmail()
  2131.                 } catch (h) {
  2132.                     triggermail.exception(h)
  2133.                 }
  2134.                 if (triggermail.Partner.hasOwnProperty("trackRemoveFromCart")) try {
  2135.                     triggermail.Partner.trackRemoveFromCart()
  2136.                 } catch (n) {
  2137.                     triggermail.exception(n)
  2138.                 }
  2139.                 if (triggermail.Partner.hasOwnProperty("trackCheckoutStart")) try {
  2140.                     triggermail.Partner.trackCheckoutStart()
  2141.                 } catch (q) {
  2142.                     triggermail.exception(q)
  2143.                 }
  2144.                 if (triggermail.Partner.hasOwnProperty("trackUnsubscribe")) try {
  2145.                     triggermail.Partner.trackUnsubscribe()
  2146.                 } catch (x) {
  2147.                     triggermail.exception(x)
  2148.                 }
  2149.                 if (triggermail.Partner.hasOwnProperty("trackSubscribe")) try {
  2150.                     triggermail.Partner.trackSubscribe()
  2151.                 } catch (l) {
  2152.                     triggermail.exception(l)
  2153.                 }
  2154.                 if (triggermail.Partner.hasOwnProperty("trackSearch")) try {
  2155.                     triggermail.Partner.trackSearch()
  2156.                 } catch (m) {
  2157.                     triggermail.exception(m)
  2158.                 }
  2159.                 if (triggermail.Partner.hasOwnProperty("trackWishlist")) try {
  2160.                     triggermail.Partner.trackWishlist()
  2161.                 } catch (H) {
  2162.                     triggermail.exception(H)
  2163.                 }
  2164.                 if (triggermail.Partner.hasOwnProperty("trackContentView")) try {
  2165.                     triggermail.Partner.trackContentView()
  2166.                 } catch (u) {
  2167.                     triggermail.exception(u)
  2168.                 }
  2169.                 if (triggermail.Partner.hasOwnProperty("trackStop")) try {
  2170.                     triggermail.Partner.trackStop()
  2171.                 } catch (z) {
  2172.                     triggermail.exception(z)
  2173.                 }
  2174.             }
  2175.         },
  2176.         checkLoop: function() {
  2177.             var a = triggermail.util.getUrlParam("tme");
  2178.             0 < a.length ? triggermail.identify({
  2179.                 email: a,
  2180.                 source: "tme email append"
  2181.             }, !0) : (a = triggermail.util.getUrlParam("obem"), "undefined" != typeof a && "" != a && triggermail.identify({
  2182.                 obem: a,
  2183.                 source: "obem email append"
  2184.             }), (a = decodeURIComponent(location.search).match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi) || decodeURIComponent(location.hash).match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi)) && triggermail.util.isValidEmail(a[0]) ? triggermail.identify({
  2185.                 email: a[0],
  2186.                 source: "esp email append"
  2187.             }) : "undefined" != typeof jQuery("#bluecore_purchase_pixel") && 0 < jQuery("#bluecore_purchase_pixel").length && (a = jQuery("#bluecore_purchase_pixel")[0].src, a = triggermail.util.getParamFromQueryString(a, "email"), triggermail.identify({
  2188.                 email: a,
  2189.                 source: "bluecore purchase pixel"
  2190.             })))
  2191.         }
  2192.     }
  2193. }();
  2194. triggermail.integ.ProductFetcher = __tmClass.extend({
  2195.     name: function() {
  2196.         return this._name
  2197.     },
  2198.     readOg: function(a) {
  2199.         return jQuery('meta[property="' + a + '"]').attr("content")
  2200.     },
  2201.     category: function() {
  2202.         return this._category
  2203.     },
  2204.     color: function() {
  2205.         return this._color
  2206.     },
  2207.     size: function() {
  2208.         return this._size
  2209.     },
  2210.     price: function() {
  2211.         return this._price
  2212.     },
  2213.     brand: function() {
  2214.         return this._brand
  2215.     },
  2216.     id: function() {
  2217.         return this._id
  2218.     },
  2219.     image: function() {
  2220.         return this._image
  2221.     },
  2222.     url: function() {
  2223.         return this._url
  2224.     },
  2225.     out_of_stock: function() {
  2226.         return !1
  2227.     },
  2228.     tags: function() {
  2229.         return this._tags
  2230.     },
  2231.     to_dict: function() {
  2232.         try {
  2233.             var a = {
  2234.                 name: triggermail.core.sanitizer.sanitize("name", this.name()),
  2235.                 category: triggermail.core.sanitizer.sanitize("category", this.category()),
  2236.                 size: triggermail.core.sanitizer.sanitize("size", this.size()),
  2237.                 price: triggermail.core.sanitizer.sanitize("price", this.price()),
  2238.                 brand: triggermail.core.sanitizer.sanitize("brand", this.brand()),
  2239.                 id: triggermail.core.sanitizer.sanitize("id", this.id()),
  2240.                 image: triggermail.core.sanitizer.sanitize("image", this.image()),
  2241.                 url: triggermail.core.sanitizer.sanitize("url",
  2242.                     this.url()),
  2243.                 out_of_stock: this.out_of_stock(),
  2244.                 tags: this.tags(),
  2245.                 color: triggermail.core.sanitizer.sanitize("color", this.color())
  2246.             }, b;
  2247.             for (b in a)("" === a[b] || !1 == a[b]) && "out_of_stock" != b && delete a[b];
  2248.             jQuery.extend(a, this.extra_props());
  2249.             return a
  2250.         } catch (c) {
  2251.             triggermail.exception({
  2252.                 location: "product_fetcher",
  2253.                 error: c
  2254.             })
  2255.         }
  2256.     },
  2257.     extra_props: function() {
  2258.         return {}
  2259.     },
  2260.     fetch: function() {
  2261.         return this.to_dict()
  2262.     }
  2263. });
  2264. triggermail.integ.ContentFetcher = __tmClass.extend({
  2265.     name: function() {
  2266.         return this._name
  2267.     },
  2268.     id: function() {
  2269.         return this._id
  2270.     },
  2271.     image: function() {
  2272.         return this._image
  2273.     },
  2274.     url: function() {
  2275.         return this._url
  2276.     },
  2277.     title: function() {
  2278.         return this._title
  2279.     },
  2280.     to_dict: function() {
  2281.         try {
  2282.             var a = {
  2283.                 id: triggermail.core.sanitizer.sanitize("id", this.id()),
  2284.                 image: triggermail.core.sanitizer.sanitize("image", this.image()),
  2285.                 name: triggermail.core.sanitizer.sanitize("name", this.name()),
  2286.                 title: triggermail.core.sanitizer.sanitize("title", this.title()),
  2287.                 url: triggermail.core.sanitizer.sanitize("url",
  2288.                     this.url())
  2289.             }, b;
  2290.             for (b in a)("" === a[b] || !1 == a[b]) && delete a[b];
  2291.             jQuery.extend(a, this.extra_props());
  2292.             return a
  2293.         } catch (c) {
  2294.             triggermail.exception({
  2295.                 location: "content_fetcher",
  2296.                 error: c
  2297.             })
  2298.         }
  2299.     },
  2300.     extra_props: function() {
  2301.         return {}
  2302.     },
  2303.     fetch: function() {
  2304.         return this.to_dict()
  2305.     }
  2306. });
  2307. triggermail.integ.initServices = function() {
  2308.     triggermail.lytics.init(triggermail.integ.keys.lytics);
  2309.     triggermail.lytics = window["triggermail.lytics"];
  2310.     triggermail.lytics.set_config({
  2311.         save_referrer: !1,
  2312.         store_google: !1,
  2313.         debug: triggermail.integ.debug
  2314.     })
  2315. };
  2316. triggermail.integ.loadJQuery = function() {
  2317.     var a = document.createElement("script");
  2318.     a.type = "text/javascript";
  2319.     a.src = ("https:" === document.location.protocol ? "https://" : "http://") + "ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js";
  2320.     var b = document.getElementsByTagName("script")[0];
  2321.     b.parentNode.insertBefore(a, b)
  2322. };
  2323. triggermail.fetcher = triggermail.integ.ProductFetcher.extend({
  2324.     name: function() {
  2325.         return app.page.title
  2326.     },
  2327.     category: function() {},
  2328.     id: function() {
  2329.         return triggermail_master_product_id
  2330.     },
  2331.     url: function() {
  2332.         return window.location.href.split("?")[0]
  2333.     },
  2334.     brand: function() {},
  2335.     image: function() {
  2336.         return $('meta[property="og:image"]').attr("content") || jQuery("div.product-primary-image img").first().attr("src")
  2337.     },
  2338.     price: function() {
  2339.         return 0 < $("div.product-main-pricing .product-standard-price").length ? triggermail.util.price($("div.product-main-pricing .product-standard-price").text()) :
  2340.             0 < $("div.product-main-pricing .price-sales").length ? triggermail.util.price($("div.product-main-pricing .price-sales").text()) : triggermail.util.price($("div.product-main-pricing .product-price").text().split("-")[0])
  2341.     },
  2342.     out_of_stock: function() {
  2343.         var a = $(".swatches.size li").length,
  2344.             b = $(".swatches.size li.unselectable").length;
  2345.         return 2 > a - b ? !0 : !1
  2346.     },
  2347.     extra_props: function() {
  2348.         var a = {};
  2349.         $(".breadcrumb li>a").each(function(b, c) {
  2350.             0 != b && (a["breadcrumb_" + b.toString()] = $(c).text())
  2351.         });
  2352.         0 < $("div.product-main-pricing .product-price .product-standard-price-strike").length ?
  2353.             (a.original_price = triggermail.util.price($("div.product-main-pricing .product-price .product-standard-price-strike").text()), a.on_sale = !0) : 0 < $("div.product-main-pricing .product-standard-price").length ? (a.original_price = triggermail.util.price($("div.product-main-pricing .product-standard-price").text()), a.on_sale = !1) : a.on_sale = !0;
  2354.         return a
  2355.     }
  2356. });
  2357. triggermail.LuckyContentFetcher = triggermail.integ.ContentFetcher.extend({
  2358.     id: function() {
  2359.         return "promo"
  2360.     },
  2361.     name: function() {
  2362.         return "promo"
  2363.     },
  2364.     image: function() {
  2365.         return "http://www.triggermail.io/images/blue_logo.png"
  2366.     },
  2367.     url: function() {
  2368.         return "http://www.luckybrand.com"
  2369.     },
  2370.     title: function() {
  2371.         try {
  2372.             return $(".top-bar").find("li").first().text()
  2373.         } catch (a) {}
  2374.     },
  2375.     extra_props: function() {
  2376.         try {
  2377.             var a = {};
  2378.             a.note = $(".header-promos").find(".info a").text();
  2379.             a.disclaimer_url = $(".header-promos").find(".info a").attr("href").split("?")[0];
  2380.             return a
  2381.         } catch (b) {}
  2382.     }
  2383. });
  2384. triggermail.CheckoutProduct = triggermail.integ.ProductFetcher.extend({
  2385.     init: function(a) {
  2386.         this._id = a
  2387.     }
  2388. });
  2389. triggermail.Partner = function() {
  2390.     return {
  2391.         init: function() {
  2392.             jQuery(document).ready(function() {
  2393.                 triggermail.integ.partnerInit()
  2394.             })
  2395.         },
  2396.         trackProductView: function() {
  2397.             if ("undefined" != typeof app.page.type && "product" == app.page.type && 0 < $("div.product-col-2.product-detail").length) {
  2398.                 var a = new triggermail.fetcher;
  2399.                 "undefined" == typeof a.image() ? setTimeout(function() {
  2400.                     triggermail.Partner.trackProductView()
  2401.                 }, 5E3) : "" !== a.id() && null !== a.id() && ("" != a.image() ? triggermail.view(a.to_dict()) : triggermail.view({
  2402.                     id: a.id()
  2403.                 }, {
  2404.                     partial: !0
  2405.                 }));
  2406.                 $(document).ajaxComplete(function(a, c, e) {
  2407.                     triggermail.util.wrapEvent(function() {
  2408.                         if (-1 < e.url.indexOf("size=")) {
  2409.                             var a = triggermail_master_product_id,
  2410.                                 b = triggermail.util.price($("div.product-main-pricing .product-price .product-standard-price-strike").text());
  2411.                             "undefined" != typeof b && (0 < b && "null" != b) && triggermail.patch({
  2412.                                 products: [{
  2413.                                     id: a,
  2414.                                     original_price: b
  2415.                                 }]
  2416.                             })
  2417.                         }
  2418.                     })()
  2419.                 })
  2420.             }
  2421.         },
  2422.         trackAddToCart: function() {
  2423.             "https://www.luckybrand.com/on/demandware.store/Sites-LuckyBrand-Site/en_US/Wishlist-Show" != window.location.href && $(document).ajaxComplete(function(a,
  2424.                 c, e) {
  2425.                 if ("/on/demandware.store/Sites-LuckyBrand-Site/en_US/Cart-AddProduct?format=ajax" == e.url) try {
  2426.                     var f = new triggermail.fetcher;
  2427.                     f.id() && triggermail.add_to_cart({
  2428.                         id: f.id()
  2429.                     })
  2430.                 } catch (h) {
  2431.                     a = e.data.match(/[0-9A-Z]+/), 0 < a.length && triggermail.add_to_cart({
  2432.                         id: a[0]
  2433.                     })
  2434.                 }
  2435.             });
  2436.             if ("/cart" == window.location.pathname) {
  2437.                 var a = [];
  2438.                 $("table#cart-table tbody tr div.style span.value").each(function(b, c) {
  2439.                     a.push($(c).text())
  2440.                 });
  2441.                 0 < a.length && triggermail.view_cart({
  2442.                     products: a
  2443.                 })
  2444.             }
  2445.         },
  2446.         trackRemoveFromCart: function() {},
  2447.         trackCheckoutStart: function() {
  2448.             "/cart" ==
  2449.                 window.location.pathname && "null" != triggermail.util.getParamFromQueryString(window.location.href, "dwcont") && triggermail.checkout_start({})
  2450.         },
  2451.         trackCheckout: function() {
  2452.             if ("undefined" != typeof triggermail_order_json) {
  2453.                 for (var a = triggermail_order_json.total, b = [], c = __skuString.split("|"), e = 1; e < c.length; e += 4) b.push({
  2454.                     id: c[e]
  2455.                 });
  2456.                 order = {
  2457.                     total: a,
  2458.                     products: b,
  2459.                     email: triggermail_order_json.email,
  2460.                     order_id: orderID
  2461.                 };
  2462.                 triggermail.purchase(order)
  2463.             }
  2464.         },
  2465.         trackSearch: function() {
  2466.             $(document).ajaxComplete(function(a, c, e) {
  2467.                 triggermail.util.wrapEvent(function() {
  2468.                     if (-1 <
  2469.                         e.url.indexOf("/search")) {
  2470.                         var a = triggermail.util.getParamFromQueryString(e.url, "q");
  2471.                         "" != a && "null" != a && triggermail.search({
  2472.                             search_term: a
  2473.                         })
  2474.                     }
  2475.                 }, e)()
  2476.             });
  2477.             if ("search" == app.page.type) {
  2478.                 var a = [];
  2479.                 $(".breadcrumbpath a").each(function(b, c) {
  2480.                     a.push($(c).attr("title"))
  2481.                 });
  2482.                 triggermail.search({
  2483.                     search_term: a.join(" ")
  2484.                 })
  2485.             }
  2486.         },
  2487.         trackContentView: function() {
  2488.             if (1 == Math.floor(100 * Math.random()) && "http://www.luckybrand.com/" == window.location.href) {
  2489.                 var a = new triggermail.LuckyContentFetcher;
  2490.                 triggermail.view_content(a.to_dict())
  2491.             }
  2492.         },
  2493.         trackUnsubscribe: function() {
  2494.             if (-1 < window.location.href.indexOf("pages.email-luckybrand.com") && $("#unsubscribe").is(":checked")) {
  2495.                 var a = $("#email").val();
  2496.                 if (triggermail.util.isValidEmail(a)) return triggermail.unsubscribe({
  2497.                     email: a
  2498.                 })
  2499.             }
  2500.         },
  2501.         trackSubscribe: function() {
  2502.             $(document).ajaxComplete(function(a, b, c) {
  2503.                 triggermail.util.wrapEvent(function() {
  2504.                     if (-1 < c.url.indexOf("Account-EmailSignup")) {
  2505.                         var a = decodeURIComponent(triggermail.util.getParamFromQueryString(c.data, "email"));
  2506.                         triggermail.util.isValidEmail(a) && triggermail.identify({
  2507.                             email: a,
  2508.                             source: "email signup"
  2509.                         })
  2510.                     }
  2511.                 }, c)()
  2512.             })
  2513.         },
  2514.         watchEmail: function() {
  2515.             if ("undefined" == typeof _loggedIn) var a = $(".menu-utility-user li:first-child").text().trim().split("\n")[1].trim();
  2516.             window.triggermail_email_address && triggermail.identify({
  2517.                 email: triggermail_email_address,
  2518.                 first_name: a
  2519.             });
  2520.             a = "";
  2521.             try {
  2522.                 a = decodeURIComponent(triggermail.util.getParamFromQueryString(window.location.hash, "ea"))
  2523.             } catch (b) {}
  2524.             triggermail.util.isValidEmail(a) && triggermail.identify({
  2525.                 email: a
  2526.             })
  2527.         },
  2528.         env: function() {
  2529.             return -1 < document.location.hostname.toLowerCase().indexOf("www.luckybrand.com") ?
  2530.                 "p" : "d"
  2531.         },
  2532.         keys: {
  2533.             Keen: {
  2534.                 d: {
  2535.                     id: "",
  2536.                     key: ""
  2537.                 },
  2538.                 p: {
  2539.                     id: "52f11badd97b854cf2000000",
  2540.                     key: "d738abf54d6e54c13e034a61158ddb7505567520c38ad18590ca53ebc2f0fc66994d3e846cca186e179143d1624370ce5ce0fc77f5f320ad173839776db6a758546eefac5e4a2627269ba61a6ae110e8d2cc3806b117dfab7f3623cb89c7c4487391ad6b60df889e446de08baeec584a"
  2541.                 }
  2542.             },
  2543.             lytics: {
  2544.                 d: "dev",
  2545.                 p: "lucky_jeans"
  2546.             }
  2547.         }
  2548.     }
  2549. }();
  2550. triggermail.initialize = function() {
  2551.     triggermail.integ.keys = {};
  2552.     var a = triggermail.Partner.env();
  2553.     triggermail.integ.keys.lytics = triggermail.Partner.keys.lytics[a];
  2554.     triggermail.integ.debug = !1;
  2555.     triggermail.integ.initServices();
  2556.     triggermail.init();
  2557.     a = triggermail.util.getUrlParam("__distinct_id_override__");
  2558.     "" != a && (triggermail.lytics.cookie.props.distinct_id = a, triggermail.lytics.cookie.save());
  2559.     a = triggermail.util.getUrlParam("eton_distinct_id");
  2560.     "" != a && (triggermail.lytics.cookie.props.distinct_id = a, triggermail.lytics.cookie.save());
  2561.     var a = triggermail.util.getUrlParam("mc_eid"),
  2562.         b = triggermail.lytics.cookie.props.distinct_id;
  2563.     a && b !== a && (a = "mceid_" + a, b !== a && (triggermail.merge({
  2564.         merge: {
  2565.             source: b,
  2566.             destination: a
  2567.         },
  2568.         customer: {
  2569.             distinct_id: a
  2570.         }
  2571.     }), triggermail.lytics.cookie.props.distinct_id = a, triggermail.lytics.cookie.save(), triggermail.lytics.register({
  2572.         mc_eid: a
  2573.     })));
  2574.     triggermail.integ.init();
  2575.     a = triggermail.util.getUrlParam("__auto_demo__");
  2576.     "" != a && (triggermail.demo(), triggermail.identify({
  2577.         email: a
  2578.     }));
  2579.     try {
  2580.         triggermail.eton.init()
  2581.     } catch (c) {}
  2582. };
  2583.  
  2584. function __checkJquery() {
  2585.     triggermail.__tm_initialized || (window.jQuery ? (triggermail.initialize(), triggermail.__tm_initialized = !0) : window.setTimeout(__checkJquery, 100))
  2586. }
  2587. __checkJquery();
Advertisement
Add Comment
Please, Sign In to add comment