diff --git a/CHANGELOG.md b/CHANGELOG.md index 700437e7..40ea57c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +**2.9.4** (22 Jul 2016) +- Cookie setting fix: return cookie setting function to its previous functionality of using days instead of seconds + **2.9.3** (19 Jul 2016) - Autotrack: small tweaks diff --git a/build/mixpanel.amd.js b/build/mixpanel.amd.js index 6094ba1e..aeed82b7 100644 --- a/build/mixpanel.amd.js +++ b/build/mixpanel.amd.js @@ -2,7 +2,7 @@ define(function () { 'use strict'; var Config = { DEBUG: false, - LIB_VERSION: '2.9.3' + LIB_VERSION: '2.9.4' }; // since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file @@ -951,7 +951,7 @@ define(function () { 'use strict'; return cookie; }, - set: function(name, value, seconds, cross_subdomain, is_secure) { + set_seconds: function(name, value, seconds, cross_subdomain, is_secure) { var cdomain = '', expires = '', secure = ''; @@ -976,6 +976,29 @@ define(function () { 'use strict'; document$1.cookie = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure; }, + set: function(name, value, days, cross_subdomain, is_secure) { + var cdomain = '', expires = '', secure = ''; + + if (cross_subdomain) { + var matches = document$1.location.hostname.match(/[a-z0-9][a-z0-9\-]+\.[a-z\.]{2,6}$/i), + domain = matches ? matches[0] : ''; + + cdomain = ((domain) ? '; domain=.' + domain : ''); + } + + if (days) { + var date = new Date(); + date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); + expires = '; expires=' + date.toGMTString(); + } + + if (is_secure) { + secure = '; secure'; + } + + document$1.cookie = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure; + }, + remove: function(name, cross_subdomain) { _.cookie.set(name, '', -1, cross_subdomain); } @@ -1863,7 +1886,7 @@ define(function () { 'use strict'; if (!isNaN(secondsToDisable) && secondsToDisable > 0) { var disableUntil = _.timestamp() + (secondsToDisable * 1000); console.log('disabling CE for ' + secondsToDisable + ' seconds (from ' + _.timestamp() + ' until ' + disableUntil + ')'); - _.cookie.set(DISABLE_COOKIE, true, secondsToDisable, true); + _.cookie.set_seconds(DISABLE_COOKIE, true, secondsToDisable, true); } }, diff --git a/build/mixpanel.cjs.js b/build/mixpanel.cjs.js index a4d12802..3d05c06f 100644 --- a/build/mixpanel.cjs.js +++ b/build/mixpanel.cjs.js @@ -2,7 +2,7 @@ var Config = { DEBUG: false, - LIB_VERSION: '2.9.3' + LIB_VERSION: '2.9.4' }; // since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file @@ -951,7 +951,7 @@ _.cookie = { return cookie; }, - set: function(name, value, seconds, cross_subdomain, is_secure) { + set_seconds: function(name, value, seconds, cross_subdomain, is_secure) { var cdomain = '', expires = '', secure = ''; @@ -976,6 +976,29 @@ _.cookie = { document$1.cookie = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure; }, + set: function(name, value, days, cross_subdomain, is_secure) { + var cdomain = '', expires = '', secure = ''; + + if (cross_subdomain) { + var matches = document$1.location.hostname.match(/[a-z0-9][a-z0-9\-]+\.[a-z\.]{2,6}$/i), + domain = matches ? matches[0] : ''; + + cdomain = ((domain) ? '; domain=.' + domain : ''); + } + + if (days) { + var date = new Date(); + date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); + expires = '; expires=' + date.toGMTString(); + } + + if (is_secure) { + secure = '; secure'; + } + + document$1.cookie = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure; + }, + remove: function(name, cross_subdomain) { _.cookie.set(name, '', -1, cross_subdomain); } @@ -1863,7 +1886,7 @@ var ce = { if (!isNaN(secondsToDisable) && secondsToDisable > 0) { var disableUntil = _.timestamp() + (secondsToDisable * 1000); console.log('disabling CE for ' + secondsToDisable + ' seconds (from ' + _.timestamp() + ' until ' + disableUntil + ')'); - _.cookie.set(DISABLE_COOKIE, true, secondsToDisable, true); + _.cookie.set_seconds(DISABLE_COOKIE, true, secondsToDisable, true); } }, diff --git a/build/mixpanel.globals.js b/build/mixpanel.globals.js index da10cf40..c55ed2d7 100644 --- a/build/mixpanel.globals.js +++ b/build/mixpanel.globals.js @@ -3,7 +3,7 @@ var Config = { DEBUG: false, - LIB_VERSION: '2.9.3' + LIB_VERSION: '2.9.4' }; // since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file @@ -952,7 +952,7 @@ return cookie; }, - set: function(name, value, seconds, cross_subdomain, is_secure) { + set_seconds: function(name, value, seconds, cross_subdomain, is_secure) { var cdomain = '', expires = '', secure = ''; @@ -977,6 +977,29 @@ document$1.cookie = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure; }, + set: function(name, value, days, cross_subdomain, is_secure) { + var cdomain = '', expires = '', secure = ''; + + if (cross_subdomain) { + var matches = document$1.location.hostname.match(/[a-z0-9][a-z0-9\-]+\.[a-z\.]{2,6}$/i), + domain = matches ? matches[0] : ''; + + cdomain = ((domain) ? '; domain=.' + domain : ''); + } + + if (days) { + var date = new Date(); + date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); + expires = '; expires=' + date.toGMTString(); + } + + if (is_secure) { + secure = '; secure'; + } + + document$1.cookie = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure; + }, + remove: function(name, cross_subdomain) { _.cookie.set(name, '', -1, cross_subdomain); } @@ -1864,7 +1887,7 @@ if (!isNaN(secondsToDisable) && secondsToDisable > 0) { var disableUntil = _.timestamp() + (secondsToDisable * 1000); console.log('disabling CE for ' + secondsToDisable + ' seconds (from ' + _.timestamp() + ' until ' + disableUntil + ')'); - _.cookie.set(DISABLE_COOKIE, true, secondsToDisable, true); + _.cookie.set_seconds(DISABLE_COOKIE, true, secondsToDisable, true); } }, diff --git a/build/mixpanel.umd.js b/build/mixpanel.umd.js index 1dd775ab..02142991 100644 --- a/build/mixpanel.umd.js +++ b/build/mixpanel.umd.js @@ -6,7 +6,7 @@ var Config = { DEBUG: false, - LIB_VERSION: '2.9.3' + LIB_VERSION: '2.9.4' }; // since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file @@ -955,7 +955,7 @@ return cookie; }, - set: function(name, value, seconds, cross_subdomain, is_secure) { + set_seconds: function(name, value, seconds, cross_subdomain, is_secure) { var cdomain = '', expires = '', secure = ''; @@ -980,6 +980,29 @@ document$1.cookie = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure; }, + set: function(name, value, days, cross_subdomain, is_secure) { + var cdomain = '', expires = '', secure = ''; + + if (cross_subdomain) { + var matches = document$1.location.hostname.match(/[a-z0-9][a-z0-9\-]+\.[a-z\.]{2,6}$/i), + domain = matches ? matches[0] : ''; + + cdomain = ((domain) ? '; domain=.' + domain : ''); + } + + if (days) { + var date = new Date(); + date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); + expires = '; expires=' + date.toGMTString(); + } + + if (is_secure) { + secure = '; secure'; + } + + document$1.cookie = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure; + }, + remove: function(name, cross_subdomain) { _.cookie.set(name, '', -1, cross_subdomain); } @@ -1867,7 +1890,7 @@ if (!isNaN(secondsToDisable) && secondsToDisable > 0) { var disableUntil = _.timestamp() + (secondsToDisable * 1000); console.log('disabling CE for ' + secondsToDisable + ' seconds (from ' + _.timestamp() + ' until ' + disableUntil + ')'); - _.cookie.set(DISABLE_COOKIE, true, secondsToDisable, true); + _.cookie.set_seconds(DISABLE_COOKIE, true, secondsToDisable, true); } }, diff --git a/examples/commonjs-browserify/bundle.js b/examples/commonjs-browserify/bundle.js index 511029da..cc6d63e1 100644 --- a/examples/commonjs-browserify/bundle.js +++ b/examples/commonjs-browserify/bundle.js @@ -3,7 +3,7 @@ var Config = { DEBUG: false, - LIB_VERSION: '2.9.3' + LIB_VERSION: '2.9.4' }; // since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file @@ -952,7 +952,7 @@ _.cookie = { return cookie; }, - set: function(name, value, seconds, cross_subdomain, is_secure) { + set_seconds: function(name, value, seconds, cross_subdomain, is_secure) { var cdomain = '', expires = '', secure = ''; @@ -977,6 +977,29 @@ _.cookie = { document$1.cookie = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure; }, + set: function(name, value, days, cross_subdomain, is_secure) { + var cdomain = '', expires = '', secure = ''; + + if (cross_subdomain) { + var matches = document$1.location.hostname.match(/[a-z0-9][a-z0-9\-]+\.[a-z\.]{2,6}$/i), + domain = matches ? matches[0] : ''; + + cdomain = ((domain) ? '; domain=.' + domain : ''); + } + + if (days) { + var date = new Date(); + date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); + expires = '; expires=' + date.toGMTString(); + } + + if (is_secure) { + secure = '; secure'; + } + + document$1.cookie = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure; + }, + remove: function(name, cross_subdomain) { _.cookie.set(name, '', -1, cross_subdomain); } @@ -1864,7 +1887,7 @@ var ce = { if (!isNaN(secondsToDisable) && secondsToDisable > 0) { var disableUntil = _.timestamp() + (secondsToDisable * 1000); console.log('disabling CE for ' + secondsToDisable + ' seconds (from ' + _.timestamp() + ' until ' + disableUntil + ')'); - _.cookie.set(DISABLE_COOKIE, true, secondsToDisable, true); + _.cookie.set_seconds(DISABLE_COOKIE, true, secondsToDisable, true); } }, diff --git a/examples/es2015-babelify/bundle.js b/examples/es2015-babelify/bundle.js index 3bcfab4a..eca12cbf 100644 --- a/examples/es2015-babelify/bundle.js +++ b/examples/es2015-babelify/bundle.js @@ -390,7 +390,7 @@ var ce = { if (!isNaN(secondsToDisable) && secondsToDisable > 0) { var disableUntil = _utils._.timestamp() + secondsToDisable * 1000; console.log('disabling CE for ' + secondsToDisable + ' seconds (from ' + _utils._.timestamp() + ' until ' + disableUntil + ')'); - _utils._.cookie.set(DISABLE_COOKIE, true, secondsToDisable, true); + _utils._.cookie.set_seconds(DISABLE_COOKIE, true, secondsToDisable, true); } }, @@ -638,7 +638,7 @@ Object.defineProperty(exports, '__esModule', { }); var Config = { DEBUG: false, - LIB_VERSION: '2.9.3' + LIB_VERSION: '2.9.4' }; exports['default'] = Config; @@ -5032,7 +5032,7 @@ _.cookie = { return cookie; }, - set: function set(name, value, seconds, cross_subdomain, is_secure) { + set_seconds: function set_seconds(name, value, seconds, cross_subdomain, is_secure) { var cdomain = '', expires = '', secure = ''; @@ -5057,6 +5057,31 @@ _.cookie = { document.cookie = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure; }, + set: function set(name, value, days, cross_subdomain, is_secure) { + var cdomain = '', + expires = '', + secure = ''; + + if (cross_subdomain) { + var matches = document.location.hostname.match(/[a-z0-9][a-z0-9\-]+\.[a-z\.]{2,6}$/i), + domain = matches ? matches[0] : ''; + + cdomain = domain ? '; domain=.' + domain : ''; + } + + if (days) { + var date = new Date(); + date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000); + expires = '; expires=' + date.toGMTString(); + } + + if (is_secure) { + secure = '; secure'; + } + + document.cookie = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure; + }, + remove: function remove(name, cross_subdomain) { _.cookie.set(name, '', -1, cross_subdomain); } diff --git a/examples/umd-webpack/bundle.js b/examples/umd-webpack/bundle.js index 45704e35..451daf9f 100644 --- a/examples/umd-webpack/bundle.js +++ b/examples/umd-webpack/bundle.js @@ -69,7 +69,7 @@ var Config = { DEBUG: false, - LIB_VERSION: '2.9.3' + LIB_VERSION: '2.9.4' }; // since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file @@ -1018,7 +1018,7 @@ return cookie; }, - set: function(name, value, seconds, cross_subdomain, is_secure) { + set_seconds: function(name, value, seconds, cross_subdomain, is_secure) { var cdomain = '', expires = '', secure = ''; @@ -1043,6 +1043,29 @@ document$1.cookie = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure; }, + set: function(name, value, days, cross_subdomain, is_secure) { + var cdomain = '', expires = '', secure = ''; + + if (cross_subdomain) { + var matches = document$1.location.hostname.match(/[a-z0-9][a-z0-9\-]+\.[a-z\.]{2,6}$/i), + domain = matches ? matches[0] : ''; + + cdomain = ((domain) ? '; domain=.' + domain : ''); + } + + if (days) { + var date = new Date(); + date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); + expires = '; expires=' + date.toGMTString(); + } + + if (is_secure) { + secure = '; secure'; + } + + document$1.cookie = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure; + }, + remove: function(name, cross_subdomain) { _.cookie.set(name, '', -1, cross_subdomain); } @@ -1930,7 +1953,7 @@ if (!isNaN(secondsToDisable) && secondsToDisable > 0) { var disableUntil = _.timestamp() + (secondsToDisable * 1000); console.log('disabling CE for ' + secondsToDisable + ' seconds (from ' + _.timestamp() + ' until ' + disableUntil + ')'); - _.cookie.set(DISABLE_COOKIE, true, secondsToDisable, true); + _.cookie.set_seconds(DISABLE_COOKIE, true, secondsToDisable, true); } }, diff --git a/mixpanel.min.js b/mixpanel.min.js index c01b4f5d..7d0ad00a 100644 --- a/mixpanel.min.js +++ b/mixpanel.min.js @@ -4,116 +4,117 @@ var m=void 0,o=!0,r=null,y=!1;function C(){return function(){}} 1);return}a()}if(document.addEventListener)"complete"===document.readyState?a():document.addEventListener("DOMContentLoaded",a,y);else if(document.attachEvent){document.attachEvent("onreadystatechange",a);var d=y;try{d=window.frameElement===r}catch(e){}document.documentElement.doScroll&&d&&b()}c.o(window,"load",a,o)}function Y(){s.init=function(a,b,d){if(d)return s[d]||(s[d]=z[d]=I(a,b,d),s[d].ra()),s[d];d=s;if(z.mixpanel)d=z.mixpanel;else if(a)d=I(a,b,"mixpanel"),d.ra(),z.mixpanel=d;s=d;1===M&&(window.mixpanel= s);Z()}}function Z(){c.a(z,function(a,b){"mixpanel"!==b&&(s[b]=a)});s._=c}function I(a,b,d){var e,f="mixpanel"===d?s:s[d];if(f&&0===M)e=f;else{if(f&&!c.isArray(f)){k.error("You have already initialized "+d);return}e=new i}e.La(a,b,d);e.people=new p;e.people.La(e);A=A||e.c("debug");e.__autotrack_enabled=e.c("autotrack");if(e.c("autotrack")){D.Yc(e.c("token"),100,100)?D.cd()?D.U(e):(e.__autotrack_enabled=y,k.log("Disabling Automatic Event Collection because this browser is not supported")):(e.__autotrack_enabled= y,k.log("Not in active bucket: disabling Automatic Event Collection."));try{W(e)}catch(h){k.error(h)}}!c.d(f)&&c.isArray(f)&&(e.Ja.call(e.people,f.people),e.Ja(f));return e}function p(){}function i(){}function n(a){this.props={};this.Db=y;this.name=a.persistence_name?"mp_"+a.persistence_name:"mp_"+a.token+"_mixpanel";var b=a.persistence;if("cookie"!==b&&"localStorage"!==b)k.ca("Unknown persistence type "+b+"; falling back to cookie"),b=a.persistence="cookie";if(b="localStorage"===b){b=o;try{c.localStorage.set("__mplssupport__", -"xyz"),"xyz"!==c.localStorage.get("__mplssupport__")&&(b=y),c.localStorage.remove("__mplssupport__")}catch(d){b=y}b||k.error("localStorage unsupported; falling back to cookie store")}this.w=b?c.localStorage:c.cookie;this.load();this.bc(a);this.Ed(a);this.save()}function J(){this.Sb="submit"}function E(){this.Sb="click"}function x(){}function $(a){var b=a.tagName.toLowerCase();if("html"===b||"head"===b)return r;var d=m,b=m,c=a,f=[];do{f.push(c);if("none"!==c.style["pointer-events"]){if(d){var h=window.getComputedStyle(c), -l=window.getComputedStyle(d),h=h.cursor;if(("default"===h||"auto"===h)&&h!==l.cursor){b=d;break}}d=c.attributes;for(l=0;l/g,">").replace(/"/g,""").replace(/'/g,"'"));return a};c.extend=function(a){c.a(F.call(arguments,1),function(b){for(var d in b)b[d]!==m&&(a[d]=b[d])});return a};c.isArray=v||function(a){return"[object Array]"===H.call(a)};c.Za=function(a){try{return/^\s*\bfunction\b/.test(a)}catch(b){return y}}; -c.bd=function(a){return!(!a||!K.call(a,"callee"))};c.ja=function(a){return!a?[]:a.ja?a.ja():c.isArray(a)||c.bd(a)?F.call(a):c.Gd(a)};c.Gd=function(a){var b=[];if(a===r)return b;c.a(a,function(a){b[b.length]=a});return b};c.Od=function(a){return a};c.Kb=function(a,b){var d=y;if(a===r)return d;if(V&&a.indexOf===V)return-1!=a.indexOf(b);c.a(a,function(a){if(d||(d=a===b))return P});return d};c.g=function(a,b){return-1!==a.indexOf(b)};c.Mb=function(a,b){a.prototype=new b;a.yd=b.prototype};c.j=function(a){return a=== +0,f=a.length;c/g,">").replace(/"/g,""").replace(/'/g,"'"));return a};c.extend=function(a){c.a(F.call(arguments,1),function(b){for(var d in b)b[d]!==m&&(a[d]=b[d])});return a};c.isArray=w||function(a){return"[object Array]"===H.call(a)};c.Za=function(a){try{return/^\s*\bfunction\b/.test(a)}catch(b){return y}}; +c.bd=function(a){return!(!a||!K.call(a,"callee"))};c.ja=function(a){return!a?[]:a.ja?a.ja():c.isArray(a)||c.bd(a)?F.call(a):c.Hd(a)};c.Hd=function(a){var b=[];if(a===r)return b;c.a(a,function(a){b[b.length]=a});return b};c.Pd=function(a){return a};c.Kb=function(a,b){var d=y;if(a===r)return d;if(V&&a.indexOf===V)return-1!=a.indexOf(b);c.a(a,function(a){if(d||(d=a===b))return P});return d};c.g=function(a,b){return-1!==a.indexOf(b)};c.Mb=function(a,b){a.prototype=new b;a.zd=b.prototype};c.j=function(a){return a=== Object(a)&&!c.isArray(a)};c.V=function(a){if(c.j(a)){for(var b in a)if(K.call(a,b))return y;return o}return y};c.d=function(a){return a===m};c.$a=function(a){return"[object String]"==H.call(a)};c.dd=function(a){return"[object Date]"==H.call(a)};c.fd=function(a){return"[object Number]"==H.call(a)};c.ed=function(a){return!!(a&&1===a.nodeType)};c.Hb=function(a){c.a(a,function(b,d){c.dd(b)?a[d]=c.Zc(b):c.j(b)&&(a[d]=c.Hb(b))});return a};c.timestamp=function(){Date.now=Date.now||function(){return+new Date}; return Date.now()};c.Zc=function(a){function b(a){return 10>a?"0"+a:a}return a.getUTCFullYear()+"-"+b(a.getUTCMonth()+1)+"-"+b(a.getUTCDate())+"T"+b(a.getUTCHours())+":"+b(a.getUTCMinutes())+":"+b(a.getUTCSeconds())};c.l=function(a){return function(){try{return a.apply(this,arguments)}catch(b){k.ca("Implementation error. Please contact support@mixpanel.com.")}}};c.od=function(a){for(var b=["identify","_check_and_handle_notifications","_show_notification"],d=0;d=j;)f()}function d(){var a,b,d="",c;if('"'===j)for(;f();){if('"'===j)return f(),d;if("\\"===j)if(f(),"u"===j){for(b=c=0;4>b;b+=1){a=parseInt(f(),16);if(!isFinite(a))break;c=16*c+a}d+=String.fromCharCode(c)}else if("string"===typeof g[j])d+=g[j];else break;else d+=j}h("Bad string")}function c(){var a;a="";"-"===j&&(a="-",f("-"));for(;"0"<=j&&"9">=j;)a+=j,f();if("."===j)for(a+= -".";f()&&"0"<=j&&"9">=j;)a+=j;if("e"===j||"E"===j){a+=j;f();if("-"===j||"+"===j)a+=j,f();for(;"0"<=j&&"9">=j;)a+=j,f()}a=+a;if(isFinite(a))return a;h("Bad number")}function f(a){a&&a!==j&&h("Expected '"+a+"' instead of '"+j+"'");j=i.charAt(l);l+=1;return j}function h(a){throw{name:"SyntaxError",message:a,Md:l,text:i};}var l,j,g={'"':'"',"\\":"\\","/":"/",b:"\u0008",f:"\u000c",n:"\n",r:"\r",t:"\t"},i,q;q=function(){b();switch(j){case "{":var l;a:{var g,i={};if("{"===j){f("{");b();if("}"===j){f("}"); +".";f()&&"0"<=j&&"9">=j;)a+=j;if("e"===j||"E"===j){a+=j;f();if("-"===j||"+"===j)a+=j,f();for(;"0"<=j&&"9">=j;)a+=j,f()}a=+a;if(isFinite(a))return a;h("Bad number")}function f(a){a&&a!==j&&h("Expected '"+a+"' instead of '"+j+"'");j=i.charAt(l);l+=1;return j}function h(a){throw{name:"SyntaxError",message:a,Nd:l,text:i};}var l,j,g={'"':'"',"\\":"\\","/":"/",b:"\u0008",f:"\u000c",n:"\n",r:"\r",t:"\t"},i,q;q=function(){b();switch(j){case "{":var l;a:{var g,i={};if("{"===j){f("{");b();if("}"===j){f("}"); l=i;break a}for(;j;){g=d();b();f(":");Object.hasOwnProperty.call(i,g)&&h('Duplicate key "'+g+'"');i[g]=q();b();if("}"===j){f("}");l=i;break a}f(",");b()}}h("Bad object")}return l;case "[":a:{l=[];if("["===j){f("[");b();if("]"===j){f("]");g=l;break a}for(;j;){l.push(q());b();if("]"===j){f("]");g=l;break a}f(",");b()}}h("Bad array")}return g;case '"':return d();case "-":return c();default:return"0"<=j&&"9">=j?c():a()}};return function(a){i=a;l=0;j=" ";a=q();b();j&&h("Syntax error");return a}}();c.zb= -function(a){var b,d,e,f,h=0,l=0,j="",j=[];if(!a)return a;a=c.Fd(a);do b=a.charCodeAt(h++),d=a.charCodeAt(h++),e=a.charCodeAt(h++),f=b<<16|d<<8|e,b=f>>18&63,d=f>>12&63,e=f>>6&63,f&=63,j[l++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f); -while(hl?c++:j=127l?String.fromCharCode(l>>6|192,l&63|128):String.fromCharCode(l>>12|224,l>>6&63|128,l&63|128);j!==r&&(c>d&&(b+=a.substring(d,c)),b+=j,d=c=h+1)}c>d&&(b+=a.substring(d,a.length));return b};c.ib=function(){function a(){function a(b, +function(a){var b,d,e,f,h=0,l=0,j="",j=[];if(!a)return a;a=c.Gd(a);do b=a.charCodeAt(h++),d=a.charCodeAt(h++),e=a.charCodeAt(h++),f=b<<16|d<<8|e,b=f>>18&63,d=f>>12&63,e=f>>6&63,f&=63,j[l++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f); +while(hl?c++:j=127l?String.fromCharCode(l>>6|192,l&63|128):String.fromCharCode(l>>12|224,l>>6&63|128,l&63|128);j!==r&&(c>d&&(b+=a.substring(d,c)),b+=j,d=c=h+1)}c>d&&(b+=a.substring(d,a.length));return b};c.ib=function(){function a(){function a(b, c){var d,f=0;for(d=0;db&&delete a[d];c.V(a)&&delete this.props.__cmpns}});n.prototype.Dd=function(){if(!this.Db)this.G(c.info.Oc()),this.Db=o};n.prototype.cc=function(a){this.ia(c.info.rd(a))};n.prototype.gb=function(a){this.G({$initial_referrer:a||"$direct",$initial_referring_domain:c.info.Tb(a)||"$direct"},"")};n.prototype.ad=function(){return c.ya({$initial_referrer:this.props.$initial_referrer, -$initial_referring_domain:this.props.$initial_referring_domain})};n.prototype.bc=function(a){this.Fb=this.Ua=a.cookie_expiration;this.td(a.disable_persistence);this.sd(a.cross_subdomain_cookie);this.vd(a.secure_cookie)};n.prototype.td=function(a){(this.disabled=a)&&this.remove()};n.prototype.sd=function(a){if(a!==this.Ra)this.Ra=a,this.remove(),this.save()};n.prototype.$c=function(){return this.Ra};n.prototype.vd=function(a){if(a!==this.Ub)this.Ub=a?o:y,this.remove(),this.save()};n.prototype.B=function(a, -b){var d=this.Ka(a),e=b[a],f=this.Z("$set"),h=this.Z("$set_once"),g=this.Z("$add"),j=this.Z("$union"),i=this.Z("$append",[]);"__mps"===d?(c.extend(f,e),this.S("$add",e),this.S("$union",e)):"__mpso"===d?c.a(e,function(a,b){b in h||(h[b]=a)}):"__mpa"===d?c.a(e,function(a,b){b in f?f[b]+=a:(b in g||(g[b]=0),g[b]+=a)},this):"__mpu"===d?c.a(e,function(a,b){c.isArray(a)&&(b in j||(j[b]=[]),j[b]=j[b].concat(a))}):"__mpap"===d&&i.push(e);k.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):");k.log(b); -this.save()};n.prototype.S=function(a,b){var d=this.R(a);c.d(d)||(c.a(b,function(a,b){delete d[b]},this),this.save())};n.prototype.Ka=function(a){if("$set"===a)return"__mps";if("$set_once"===a)return"__mpso";if("$add"===a)return"__mpa";if("$append"===a)return"__mpap";if("$union"===a)return"__mpu";k.error("Invalid queue:",a)};n.prototype.R=function(a){return this.props[this.Ka(a)]};n.prototype.Z=function(a,b){var d=this.Ka(a),b=c.d(b)?{}:b;return this.props[d]||(this.props[d]=b)};n.prototype.ud=function(a){var b= -this.props.__timers||{};b[a]=(new Date).getTime();this.props.__timers=b;this.save()};n.prototype.nd=function(a){var b=(this.props.__timers||{})[a];c.d(b)||(delete this.props.__timers[a],this.save());return b};var g;i.prototype.U=function(a,b,d){if(c.d(d))k.error("You must name your new library: init(token, config, name)");else if("mixpanel"===d)k.error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");else return a=I(a,b,d),s[d]=a,a.ra(),a};i.prototype.La= -function(a,b,d){this.__loaded=o;this.config={};this.Vb(c.extend({},Q,b,{name:d,token:a,callback_fn:("mixpanel"===d?d:"mixpanel."+d)+"._jsc"}));this._jsc=C();this.Ha=[];this.Ia=[];this.Ga=[];this.P={disable_all_events:y,identify_called:y};this.persistence=this.cookie=new n(this.config);this.G({distinct_id:c.ib()},"")};i.prototype.ra=function(){this.c("loaded")(this);this.c("track_pageview")&&this.$b()};i.prototype.nc=function(){c.a(this.Ha,function(a){this.Na.apply(this,a)},this);c.a(this.Ia,function(a){this.p.apply(this, -a)},this);delete this.Ha;delete this.Ia};i.prototype.Na=function(a,b){if(this.c("img"))return k.error("You can't use DOM tracking functions with img = true."),y;if(!R)return this.Ha.push([a,b]),y;var c=(new a).U(this);return c.J.apply(c,b)};i.prototype.sa=function(a,b){if(c.d(a))return r;if(L)return function(c){a(c,b)};var d=this._jsc,e=""+Math.floor(1E8*Math.random()),f=this.c("callback_fn")+"["+e+"]";d[e]=function(c){delete d[e];a(c,b)};return f};i.prototype.p=function(a,b,d){if(S)this.Ia.push(arguments); -else{var e=this.c("verbose");b.verbose&&(e=o);this.c("test")&&(b.test=1);e&&(b.verbose=1);this.c("img")&&(b.img=1);if(!L)if(d)b.callback=d;else if(e||this.c("test"))b.callback="(function(){})";b.ip=this.c("ip")?1:0;b._=(new Date).getTime().toString();a+="?"+c.hc(b);if("img"in b){var f=document.createElement("img");f.src=a;document.body.appendChild(f)}else if(L)try{var h=new XMLHttpRequest;h.open("GET",a,o);h.withCredentials=o;h.onreadystatechange=function(){if(4===h.readyState)if(-1!==a.indexOf("api.mixpanel.com/track")&& -D.Pc(h),200===h.status)d&&(e?d(c.ma(h.responseText)):d(Number(h.responseText)));else{var b="Bad HTTP status: "+h.status+" "+h.statusText;k.error(b);d&&(e?d({status:0,error:b}):d(0))}};h.send(r)}catch(g){k.error(g)}else{f=document.createElement("script");f.type="text/javascript";f.async=o;f.defer=o;f.src=a;var j=document.getElementsByTagName("script")[0];j.parentNode.insertBefore(f,j)}}};i.prototype.Ja=function(a){function b(a,b){c.a(a,function(a){this[a[0]].apply(this,a.slice(1))},b)}var d,e=[],f= -[],h=[];c.a(a,function(a){a&&(d=a[0],"function"===typeof a?a.call(this):c.isArray(a)&&"alias"===d?e.push(a):c.isArray(a)&&-1!==d.indexOf("track")&&"function"===typeof this[d]?h.push(a):f.push(a))},this);b(e,this);b(f,this);b(h,this)};i.prototype.push=function(a){this.Ja([a])};i.prototype.disable=function(a){"undefined"===typeof a?this.P.Tc=o:this.Ga=this.Ga.concat(a)};i.prototype.J=function(a,b,d){"function"!==typeof d&&(d=C());if(c.d(a))k.error("No event name provided to mixpanel.track");else if(this.nb(a))d(0); -else{b=b||{};b.token=this.c("token");var e=this.persistence.nd(a);c.d(e)||(b.$duration=parseFloat((((new Date).getTime()-e)/1E3).toFixed(3)));this.persistence.cc(document.referrer);this.c("store_google")&&this.persistence.Dd();this.c("save_referrer")&&this.persistence.gb(document.referrer);b=c.extend({},c.info.ha(),this.persistence.ha(),b);try{if(this.c("autotrack")&&"mp_page_view"!==a&&"$create_alias"!==a)b=c.extend({},b,this.F),this.F={$__c:0},c.cookie.set("mp_"+this.c("name")+"__c",0,1,o)}catch(f){k.error(f)}e= -this.c("property_blacklist");c.isArray(e)?c.a(e,function(a){delete b[a]}):k.error("Invalid value for property_blacklist config: "+e);a=c.truncate({event:a,properties:b},255);e=c.na(a);e=c.zb(e);k.log("MIXPANEL REQUEST:");k.log(a);this.p(this.c("api_host")+"/track/",{data:e},this.sa(d,a));return a}};i.prototype.$b=function(a){if(c.d(a))a=document.location.href;this.J("mp_page_view",c.info.ld(a))};i.prototype.Cd=function(){return this.Na.call(this,E,arguments)};i.prototype.Bd=function(){return this.Na.call(this, -J,arguments)};i.prototype.zd=function(a){c.d(a)?k.error("No event name provided to mixpanel.time_event"):this.nb(a)||this.persistence.ud(a)};i.prototype.ia=function(a,b){this.persistence.ia(a,b)};i.prototype.G=function(a,b,c){this.persistence.G(a,b,c)};i.prototype.Ba=function(a){this.persistence.Ba(a)};i.prototype.Ma=function(a,b){var c={};c[a]=b;this.ia(c)};i.prototype.Wa=function(a,b,c,e,f,h){a!==this.T()&&a!==this.wa("__alias")&&(this.Ba("__alias"),this.Ma("distinct_id",a));this.jb(this.T());this.P.Xa= -o;this.people.rc(b,c,e,f,h)};i.prototype.reset=function(){this.persistence.clear();this.P.Xa=y;this.G({distinct_id:c.ib()},"")};i.prototype.T=function(){return this.wa("distinct_id")};i.prototype.Lc=function(a,b){if(a===this.wa("$people_distinct_id"))return k.ca("Attempting to create alias for existing People user - aborting."),-2;var d=this;c.d(b)&&(b=this.T());if(a!==b)return this.Ma("__alias",a),this.J("$create_alias",{alias:a,distinct_id:b},function(){d.Wa(a)});k.error("alias matches current distinct_id - skipping api call."); -this.Wa(a);return-1};i.prototype.hd=function(a){this.Ma("mp_name_tag",a)};i.prototype.Vb=function(a){if(c.j(a))c.extend(this.config,a),this.c("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.c("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.bc(this.config),A=A||this.c("debug")};i.prototype.c=function(a){return this.config[a]};i.prototype.wa=function(a){return this.persistence.props[a]};i.prototype.toString= -function(){var a=this.c("name");"mixpanel"!==a&&(a="mixpanel."+a);return a};i.prototype.nb=function(a){return c.Nb(t)||this.P.Tc||c.Kb(this.Ga,a)};i.prototype.jb=function(a){if(a&&!this.P.Xa&&!this.c("disable_notifications")){k.log("MIXPANEL NOTIFICATION CHECK");var b=this;this.p(this.c("decide_host")+"/decide/",{verbose:o,version:"1",lib:"web",token:this.c("token"),distinct_id:a},this.sa(function(a){a.notifications&&0");this.Rc= -c.u(a.cta)||"Close";this.da=c.u(a.cta_url)||r;this.Ya=c.u(a.image_url)||r;this.fa=c.u(a.type)||"takeover";this.style=c.u(a.style)||"light";this.L=c.u(a.thumb_image_url)||r;this.title=c.u(a.title)||"";this.Ca=c.u(a.video_url)||r;this.ka=g.jc;this.X=g.ic;this.ua=o;if(!this.da)this.da="#dismiss",this.ua=y;this.v="mini"===this.fa;if(!this.v)this.fa="takeover";this.jd=!this.v?g.Y:g.Da;this.wb();this.xa=this.wc();this.zc()};g=i.kc;g.M=200;g.z="mixpanel-notification";g.la=0.6;g.I=25;g.oa=200;g.Y=388;g.Da= -420;g.A=85;g.Ea=5;g.K=60;g.Fa=Math.round(g.K/2);g.jc=595;g.ic=334;g.prototype.show=function(){var a=this;this.wb();this.q?(this.yc(),this.xc(),this.Dc(this.mc)):setTimeout(function(){a.show()},300)};g.prototype.Sa=c.l(function(){this.Ob||this.ub({invisible:o});var a=this.wd?this.i("video"):this.Q();if(this.dc)this.Fc("bg","visible"),this.N(a,"exiting"),setTimeout(this.vb,g.M);else{var b,c,e;this.v?(b="right",c=20,e=-100):(b="top",c=g.I,e=g.oa+g.I);this.pa([{s:this.i("bg"),m:"opacity",start:g.la,k:0}, -{s:a,m:"opacity",start:1,k:0},{s:a,m:b,start:c,k:e}],g.M,this.vb)}});g.prototype.N=c.l(function(a,b){b=g.z+"-"+b;"string"===typeof a&&(a=this.i(a));a.className?~(" "+a.className+" ").indexOf(" "+b+" ")||(a.className+=" "+b):a.className=b});g.prototype.Fc=c.l(function(a,b){b=g.z+"-"+b;"string"===typeof a&&(a=this.i(a));if(a.className)a.className=(" "+a.className+" ").replace(" "+b+" ","").replace(/^[\s\xA0]+/,"").replace(/[\s\xA0]+$/,"")});g.prototype.pa=c.l(function(a,b,c,e){var f=this,h=y,g,j;g= -1*new Date;var i,e=e||g;i=g-e;for(g=0;g=j.start?1:-1;j.H=j.start+(j.k-j.start)*i/b;if("opacity"!==j.m)j.H=Math.round(j.H);if(0=j.k||0>k&&j.H<=j.k)j.H=j.k}}if(h){for(g=0;g'):this.Jb="",this.L?(a.push(this.L),this.Yb='
'):this.Yb="");return a};g.prototype.xc=function(){var a="",b="",c="";this.ga=document.createElement("div");this.ga.id=g.z+"-wrapper";if(this.v)a='
'+ -this.body+'
';else{var a=this.ua||this.W?"":'
',e=this.W?'
':"";this.O("ie",7)&&(e=a="");a='
'+this.Yb+'
'+this.Jb+'
'+this.title+'
'+this.body+'
'+ -a+''+this.Rc+""+e+"
"}this.fc?(b="//www.youtube.com/embed/"+this.fc+"?wmode=transparent&showinfo=0&modestbranding=0&rel=0&autoplay=1&loop=0&vq=hd1080",this.gc&&(b+="&enablejsapi=1&html5=1&controls=0",c='
')): -this.ec&&(b="//player.vimeo.com/video/"+this.ec+"?autoplay=1&title=0&byline=0&portrait=0");if(this.W)this.Hd='',c='
'+c+"
";b=c+a;this.Va&&(b=(this.v?a:"")+'
'+(this.v?c:b)+"
"); -this.ga.innerHTML=('
'+b+"
").replace(/class=\"/g,'class="'+g.z+"-").replace(/id=\"/g,'id="'+g.z+"-")};g.prototype.yc=function(){this.h="dark"===this.style?{Qa:"#1d1f25",aa:"#282b32",ta:"#3a4147",Ab:"#4a5157",Mc:"#32353c",Eb:"0.4",ab:"#2a3137",Aa:"#fff",fb:"#9498a3",Xb:"#464851",za:"#ddd"}:{Qa:"#fff",aa:"#e7eaee",ta:"#eceff3",Ab:"#f5f5f5",Mc:"#e4ecf2",Eb:"1.0",ab:"#fafafa", -Aa:"#5c6578",fb:"#8b949b",Xb:"#ced9e6",za:"#7c8598"};var a="0px 0px 35px 0px rgba(45, 49, 56, 0.7)",b=a,d=a,e=g.K+2*g.Ea,f=g.M/1E3+"s";this.v&&(a="none");var h={};h["@media only screen and (max-width: "+(g.Da+20-1)+"px)"]={"#overlay":{display:"none"}};a={".flipped":{transform:"rotateY(180deg)"},"#overlay":{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",overflow:"auto","text-align":"center","z-index":"10000","font-family":'"Helvetica", "Arial", sans-serif',"-webkit-font-smoothing":"antialiased", -"-moz-osx-font-smoothing":"grayscale"},"#overlay.mini":{height:"0",overflow:"visible"},"#overlay a":{width:"initial",padding:"0","text-decoration":"none","text-transform":"none",color:"inherit"},"#bgwrapper":{position:"relative",width:"100%",height:"100%"},"#bg":{position:"fixed",top:"0",left:"0",width:"100%",height:"100%","min-width":4*this.Vc+"px","min-height":4*this.Uc+"px","background-color":"black",opacity:"0.0","-ms-filter":"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)",filter:"alpha(opacity=60)", -transition:"opacity "+f},"#bg.visible":{opacity:g.la},".mini #bg":{width:"0",height:"0","min-width":"0"},"#flipcontainer":{perspective:"1000px",position:"absolute",width:"100%"},"#flipper":{position:"relative","transform-style":"preserve-3d",transition:"0.3s"},"#takeover":{position:"absolute",left:"50%",width:g.Y+"px","margin-left":Math.round(-g.Y/2)+"px","backface-visibility":"hidden",transform:"rotateY(0deg)",opacity:"0.0",top:g.oa+"px",transition:"opacity "+f+", top "+f},"#takeover.visible":{opacity:"1.0", -top:g.I+"px"},"#takeover.exiting":{opacity:"0.0",top:g.oa+"px"},"#thumbspacer":{height:g.Fa+"px"},"#thumbborder-wrapper":{position:"absolute",top:-g.Ea+"px",left:g.Y/2-g.Fa-g.Ea+"px",width:e+"px",height:e/2+"px",overflow:"hidden"},"#thumbborder":{position:"absolute",width:e+"px",height:e+"px","border-radius":e+"px","background-color":this.h.aa,opacity:"0.5"},"#thumbnail":{position:"absolute",top:"0px",left:g.Y/2-g.Fa+"px",width:g.K+"px",height:g.K+"px",overflow:"hidden","z-index":"100","border-radius":g.K+ -"px"},"#mini":{position:"absolute",right:"20px",top:g.I+"px",width:this.jd+"px",height:2*g.A+"px","margin-top":20-g.A+"px","backface-visibility":"hidden",opacity:"0.0",transform:"rotateX(90deg)",transition:"opacity 0.3s, transform 0.3s, right 0.3s"},"#mini.visible":{opacity:"1.0",transform:"rotateX(0deg)"},"#mini.exiting":{opacity:"0.0",right:"-150px"},"#mainbox":{"border-radius":"4px","box-shadow":a,"text-align":"center","background-color":this.h.Qa,"font-size":"14px",color:this.h.fb},"#mini #mainbox":{height:g.A+ -"px","margin-top":g.A+"px","border-radius":"3px",transition:"background-color "+f},"#mini-border":{height:g.A+6+"px",width:g.Da+6+"px",position:"absolute",top:"-3px",left:"-3px","margin-top":g.A+"px","border-radius":"6px",opacity:"0.25","background-color":"#fff","z-index":"-1","box-shadow":d},"#mini-icon":{position:"relative",display:"inline-block",width:"75px",height:g.A+"px","border-radius":"3px 0 0 3px","background-color":this.h.aa,background:"linear-gradient(135deg, "+this.h.Ab+" 0%, "+this.h.aa+ -" 100%)",transition:"background-color "+f},"#mini:hover #mini-icon":{"background-color":this.h.ab},"#mini:hover #mainbox":{"background-color":this.h.ab},"#mini-icon-img":{position:"absolute","background-image":"url("+this.L+")",width:"48px",height:"48px",top:"20px",left:"12px"},"#content":{padding:"30px 20px 0px 20px"},"#mini-content":{"text-align":"left",height:g.A+"px",cursor:"pointer"},"#img":{width:"328px","margin-top":"30px","border-radius":"5px"},"#title":{"max-height":"600px",overflow:"hidden", -"word-wrap":"break-word",padding:"25px 0px 20px 0px","font-size":"19px","font-weight":"bold",color:this.h.Aa},"#body":{"max-height":"600px","margin-bottom":"25px",overflow:"hidden","word-wrap":"break-word","line-height":"21px","font-size":"15px","font-weight":"normal","text-align":"left"},"#mini #body":{display:"inline-block","max-width":"250px",margin:"0 0 0 30px",height:g.A+"px","font-size":"16px","letter-spacing":"0.8px",color:this.h.Aa},"#mini #body-text":{display:"table",height:g.A+"px"},"#mini #body-text div":{display:"table-cell", -"vertical-align":"middle"},"#tagline":{"margin-bottom":"15px","font-size":"10px","font-weight":"600","letter-spacing":"0.8px",color:"#ccd7e0","text-align":"left"},"#tagline a":{color:this.h.Xb,transition:"color "+f},"#tagline a:hover":{color:this.h.za},"#cancel":{position:"absolute",right:"0",width:"8px",height:"8px",padding:"10px","border-radius":"20px",margin:"12px 12px 0 0","box-sizing":"content-box",cursor:"pointer",transition:"background-color "+f},"#mini #cancel":{margin:"7px 7px 0 0"},"#cancel-icon":{width:"8px", -height:"8px",overflow:"hidden","background-image":"url(//cdn.mxpnl.com/site_media/images/icons/notifications/cancel-x.png)",opacity:this.h.Eb},"#cancel:hover":{"background-color":this.h.ta},"#button":{display:"block",height:"60px","line-height":"60px","text-align":"center","background-color":this.h.aa,"border-radius":"0 0 4px 4px",overflow:"hidden",cursor:"pointer",transition:"background-color "+f},"#button-close":{display:"inline-block",width:"9px",height:"60px","margin-right":"8px","vertical-align":"top", -"background-image":"url(//cdn.mxpnl.com/site_media/images/icons/notifications/close-x-"+this.style+".png)","background-repeat":"no-repeat","background-position":"0px 25px"},"#button-play":{display:"inline-block",width:"30px",height:"60px","margin-left":"15px","background-image":"url(//cdn.mxpnl.com/site_media/images/icons/notifications/play-"+this.style+"-small.png)","background-repeat":"no-repeat","background-position":"0px 15px"},"a#button-link":{display:"inline-block","vertical-align":"top","text-align":"center", -"font-size":"17px","font-weight":"bold",overflow:"hidden","word-wrap":"break-word",color:this.h.Aa,transition:"color "+f},"#button:hover":{"background-color":this.h.ta,color:this.h.za},"#button:hover a":{color:this.h.za},"#video-noflip":{position:"relative",top:2*-this.X+"px"},"#video-flip":{"backface-visibility":"hidden",transform:"rotateY(180deg)"},"#video":{position:"absolute",width:this.ka-1+"px",height:this.X+"px",top:g.I+"px","margin-top":"100px",left:"50%","margin-left":Math.round(-this.ka/ -2)+"px",overflow:"hidden","border-radius":"5px","box-shadow":b,transform:"translateZ(1px)",transition:"opacity "+f+", top "+f},"#video.exiting":{opacity:"0.0",top:this.X+"px"},"#video-holder":{position:"absolute",width:this.ka-1+"px",height:this.X+"px",overflow:"hidden","border-radius":"5px"},"#video-frame":{"margin-left":"-1px",width:this.ka+"px"},"#video-controls":{opacity:"0",transition:"opacity 0.5s"},"#video:hover #video-controls":{opacity:"1.0"},"#video .video-progress-el":{position:"absolute", -bottom:"0",height:"25px","border-radius":"0 0 0 5px"},"#video-progress":{width:"90%"},"#video-progress-total":{width:"100%","background-color":this.h.Qa,opacity:"0.7"},"#video-elapsed":{width:"0","background-color":"#6cb6f5",opacity:"0.9"},"#video #video-time":{width:"10%",right:"0","font-size":"11px","line-height":"25px",color:this.h.fb,"background-color":"#666","border-radius":"0 0 5px 0"}};this.O("ie",8)&&c.extend(a,{"* html #overlay":{position:"absolute"},"* html #bg":{position:"absolute"},"html, body":{height:"100%"}}); -this.O("ie",7)&&c.extend(a,{"#mini #body":{display:"inline",zoom:"1",border:"1px solid "+this.h.ta},"#mini #body-text":{padding:"20px"},"#mini #mini-icon":{display:"none"}});var b="backface-visibility,border-radius,box-shadow,opacity,perspective,transform,transform-style,transition".split(","),d=["khtml","moz","ms","o","webkit"],i;for(i in a)for(e=0;e(s.__SV||0)?k.ca("Version mismatch; please ensure you're using the latest version of the Mixpanel code snippet."):(c.a(s._i,function(a){a&&c.isArray(a)&&(z[a[a.length-1]]=I.apply(this,a))}),Y(),s.init(),c.a(z,function(a){a.ra()}),X())})()})(); +v.cookie.split(";"),c=0;cb&&delete a[d];c.V(a)&&delete this.props.__cmpns}});n.prototype.Ed= +function(){if(!this.Db)this.G(c.info.Oc()),this.Db=o};n.prototype.cc=function(a){this.ia(c.info.rd(a))};n.prototype.gb=function(a){this.G({$initial_referrer:a||"$direct",$initial_referring_domain:c.info.Tb(a)||"$direct"},"")};n.prototype.ad=function(){return c.ya({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})};n.prototype.bc=function(a){this.Fb=this.Ua=a.cookie_expiration;this.td(a.disable_persistence);this.sd(a.cross_subdomain_cookie); +this.wd(a.secure_cookie)};n.prototype.td=function(a){(this.disabled=a)&&this.remove()};n.prototype.sd=function(a){if(a!==this.Ra)this.Ra=a,this.remove(),this.save()};n.prototype.$c=function(){return this.Ra};n.prototype.wd=function(a){if(a!==this.Ub)this.Ub=a?o:y,this.remove(),this.save()};n.prototype.B=function(a,b){var d=this.Ka(a),e=b[a],f=this.Z("$set"),h=this.Z("$set_once"),g=this.Z("$add"),j=this.Z("$union"),i=this.Z("$append",[]);"__mps"===d?(c.extend(f,e),this.S("$add",e),this.S("$union", +e)):"__mpso"===d?c.a(e,function(a,b){b in h||(h[b]=a)}):"__mpa"===d?c.a(e,function(a,b){b in f?f[b]+=a:(b in g||(g[b]=0),g[b]+=a)},this):"__mpu"===d?c.a(e,function(a,b){c.isArray(a)&&(b in j||(j[b]=[]),j[b]=j[b].concat(a))}):"__mpap"===d&&i.push(e);k.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):");k.log(b);this.save()};n.prototype.S=function(a,b){var d=this.R(a);c.d(d)||(c.a(b,function(a,b){delete d[b]},this),this.save())};n.prototype.Ka=function(a){if("$set"===a)return"__mps";if("$set_once"=== +a)return"__mpso";if("$add"===a)return"__mpa";if("$append"===a)return"__mpap";if("$union"===a)return"__mpu";k.error("Invalid queue:",a)};n.prototype.R=function(a){return this.props[this.Ka(a)]};n.prototype.Z=function(a,b){var d=this.Ka(a),b=c.d(b)?{}:b;return this.props[d]||(this.props[d]=b)};n.prototype.ud=function(a){var b=this.props.__timers||{};b[a]=(new Date).getTime();this.props.__timers=b;this.save()};n.prototype.nd=function(a){var b=(this.props.__timers||{})[a];c.d(b)||(delete this.props.__timers[a], +this.save());return b};var g;i.prototype.U=function(a,b,d){if(c.d(d))k.error("You must name your new library: init(token, config, name)");else if("mixpanel"===d)k.error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");else return a=I(a,b,d),s[d]=a,a.ra(),a};i.prototype.La=function(a,b,d){this.__loaded=o;this.config={};this.Vb(c.extend({},Q,b,{name:d,token:a,callback_fn:("mixpanel"===d?d:"mixpanel."+d)+"._jsc"}));this._jsc=C();this.Ha=[];this.Ia=[];this.Ga= +[];this.P={disable_all_events:y,identify_called:y};this.persistence=this.cookie=new n(this.config);this.G({distinct_id:c.ib()},"")};i.prototype.ra=function(){this.c("loaded")(this);this.c("track_pageview")&&this.$b()};i.prototype.nc=function(){c.a(this.Ha,function(a){this.Na.apply(this,a)},this);c.a(this.Ia,function(a){this.p.apply(this,a)},this);delete this.Ha;delete this.Ia};i.prototype.Na=function(a,b){if(this.c("img"))return k.error("You can't use DOM tracking functions with img = true."),y;if(!R)return this.Ha.push([a, +b]),y;var c=(new a).U(this);return c.J.apply(c,b)};i.prototype.sa=function(a,b){if(c.d(a))return r;if(L)return function(c){a(c,b)};var d=this._jsc,e=""+Math.floor(1E8*Math.random()),f=this.c("callback_fn")+"["+e+"]";d[e]=function(c){delete d[e];a(c,b)};return f};i.prototype.p=function(a,b,d){if(S)this.Ia.push(arguments);else{var e=this.c("verbose");b.verbose&&(e=o);this.c("test")&&(b.test=1);e&&(b.verbose=1);this.c("img")&&(b.img=1);if(!L)if(d)b.callback=d;else if(e||this.c("test"))b.callback="(function(){})"; +b.ip=this.c("ip")?1:0;b._=(new Date).getTime().toString();a+="?"+c.hc(b);if("img"in b){var f=document.createElement("img");f.src=a;document.body.appendChild(f)}else if(L)try{var h=new XMLHttpRequest;h.open("GET",a,o);h.withCredentials=o;h.onreadystatechange=function(){if(4===h.readyState)if(-1!==a.indexOf("api.mixpanel.com/track")&&D.Pc(h),200===h.status)d&&(e?d(c.ma(h.responseText)):d(Number(h.responseText)));else{var b="Bad HTTP status: "+h.status+" "+h.statusText;k.error(b);d&&(e?d({status:0,error:b}): +d(0))}};h.send(r)}catch(g){k.error(g)}else{f=document.createElement("script");f.type="text/javascript";f.async=o;f.defer=o;f.src=a;var j=document.getElementsByTagName("script")[0];j.parentNode.insertBefore(f,j)}}};i.prototype.Ja=function(a){function b(a,b){c.a(a,function(a){this[a[0]].apply(this,a.slice(1))},b)}var d,e=[],f=[],h=[];c.a(a,function(a){a&&(d=a[0],"function"===typeof a?a.call(this):c.isArray(a)&&"alias"===d?e.push(a):c.isArray(a)&&-1!==d.indexOf("track")&&"function"===typeof this[d]? +h.push(a):f.push(a))},this);b(e,this);b(f,this);b(h,this)};i.prototype.push=function(a){this.Ja([a])};i.prototype.disable=function(a){"undefined"===typeof a?this.P.Tc=o:this.Ga=this.Ga.concat(a)};i.prototype.J=function(a,b,d){"function"!==typeof d&&(d=C());if(c.d(a))k.error("No event name provided to mixpanel.track");else if(this.nb(a))d(0);else{b=b||{};b.token=this.c("token");var e=this.persistence.nd(a);c.d(e)||(b.$duration=parseFloat((((new Date).getTime()-e)/1E3).toFixed(3)));this.persistence.cc(document.referrer); +this.c("store_google")&&this.persistence.Ed();this.c("save_referrer")&&this.persistence.gb(document.referrer);b=c.extend({},c.info.ha(),this.persistence.ha(),b);try{if(this.c("autotrack")&&"mp_page_view"!==a&&"$create_alias"!==a)b=c.extend({},b,this.F),this.F={$__c:0},c.cookie.set("mp_"+this.c("name")+"__c",0,1,o)}catch(f){k.error(f)}e=this.c("property_blacklist");c.isArray(e)?c.a(e,function(a){delete b[a]}):k.error("Invalid value for property_blacklist config: "+e);a=c.truncate({event:a,properties:b}, +255);e=c.na(a);e=c.zb(e);k.log("MIXPANEL REQUEST:");k.log(a);this.p(this.c("api_host")+"/track/",{data:e},this.sa(d,a));return a}};i.prototype.$b=function(a){if(c.d(a))a=document.location.href;this.J("mp_page_view",c.info.ld(a))};i.prototype.Dd=function(){return this.Na.call(this,E,arguments)};i.prototype.Cd=function(){return this.Na.call(this,J,arguments)};i.prototype.Ad=function(a){c.d(a)?k.error("No event name provided to mixpanel.time_event"):this.nb(a)||this.persistence.ud(a)};i.prototype.ia= +function(a,b){this.persistence.ia(a,b)};i.prototype.G=function(a,b,c){this.persistence.G(a,b,c)};i.prototype.Ba=function(a){this.persistence.Ba(a)};i.prototype.Ma=function(a,b){var c={};c[a]=b;this.ia(c)};i.prototype.Wa=function(a,b,c,e,f,h){a!==this.T()&&a!==this.wa("__alias")&&(this.Ba("__alias"),this.Ma("distinct_id",a));this.jb(this.T());this.P.Xa=o;this.people.rc(b,c,e,f,h)};i.prototype.reset=function(){this.persistence.clear();this.P.Xa=y;this.G({distinct_id:c.ib()},"")};i.prototype.T=function(){return this.wa("distinct_id")}; +i.prototype.Lc=function(a,b){if(a===this.wa("$people_distinct_id"))return k.ca("Attempting to create alias for existing People user - aborting."),-2;var d=this;c.d(b)&&(b=this.T());if(a!==b)return this.Ma("__alias",a),this.J("$create_alias",{alias:a,distinct_id:b},function(){d.Wa(a)});k.error("alias matches current distinct_id - skipping api call.");this.Wa(a);return-1};i.prototype.hd=function(a){this.Ma("mp_name_tag",a)};i.prototype.Vb=function(a){if(c.j(a))c.extend(this.config,a),this.c("persistence_name")|| +(this.config.persistence_name=this.config.cookie_name),this.c("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.bc(this.config),A=A||this.c("debug")};i.prototype.c=function(a){return this.config[a]};i.prototype.wa=function(a){return this.persistence.props[a]};i.prototype.toString=function(){var a=this.c("name");"mixpanel"!==a&&(a="mixpanel."+a);return a};i.prototype.nb=function(a){return c.Nb(t)||this.P.Tc||c.Kb(this.Ga,a)};i.prototype.jb= +function(a){if(a&&!this.P.Xa&&!this.c("disable_notifications")){k.log("MIXPANEL NOTIFICATION CHECK");var b=this;this.p(this.c("decide_host")+"/decide/",{verbose:o,version:"1",lib:"web",token:this.c("token"),distinct_id:a},this.sa(function(a){a.notifications&&0");this.Rc=c.u(a.cta)||"Close";this.da=c.u(a.cta_url)||r;this.Ya=c.u(a.image_url)||r;this.fa=c.u(a.type)||"takeover";this.style=c.u(a.style)||"light";this.L=c.u(a.thumb_image_url)||r;this.title=c.u(a.title)||"";this.Ca=c.u(a.video_url)||r;this.ka=g.jc; +this.X=g.ic;this.ua=o;if(!this.da)this.da="#dismiss",this.ua=y;this.v="mini"===this.fa;if(!this.v)this.fa="takeover";this.jd=!this.v?g.Y:g.Da;this.wb();this.xa=this.wc();this.zc()};g=i.kc;g.M=200;g.z="mixpanel-notification";g.la=0.6;g.I=25;g.oa=200;g.Y=388;g.Da=420;g.A=85;g.Ea=5;g.K=60;g.Fa=Math.round(g.K/2);g.jc=595;g.ic=334;g.prototype.show=function(){var a=this;this.wb();this.q?(this.yc(),this.xc(),this.Dc(this.mc)):setTimeout(function(){a.show()},300)};g.prototype.Sa=c.l(function(){this.Ob||this.ub({invisible:o}); +var a=this.xd?this.i("video"):this.Q();if(this.dc)this.Fc("bg","visible"),this.N(a,"exiting"),setTimeout(this.vb,g.M);else{var b,c,e;this.v?(b="right",c=20,e=-100):(b="top",c=g.I,e=g.oa+g.I);this.pa([{s:this.i("bg"),m:"opacity",start:g.la,k:0},{s:a,m:"opacity",start:1,k:0},{s:a,m:b,start:c,k:e}],g.M,this.vb)}});g.prototype.N=c.l(function(a,b){b=g.z+"-"+b;"string"===typeof a&&(a=this.i(a));a.className?~(" "+a.className+" ").indexOf(" "+b+" ")||(a.className+=" "+b):a.className=b});g.prototype.Fc=c.l(function(a, +b){b=g.z+"-"+b;"string"===typeof a&&(a=this.i(a));if(a.className)a.className=(" "+a.className+" ").replace(" "+b+" ","").replace(/^[\s\xA0]+/,"").replace(/[\s\xA0]+$/,"")});g.prototype.pa=c.l(function(a,b,c,e){var f=this,h=y,g,j;g=1*new Date;var i,e=e||g;i=g-e;for(g=0;g=j.start?1:-1;j.H=j.start+(j.k-j.start)*i/b;if("opacity"!==j.m)j.H=Math.round(j.H);if(0=j.k||0>k&&j.H<=j.k)j.H=j.k}}if(h){for(g=0;g'):this.Jb="",this.L?(a.push(this.L),this.Yb='
'):this.Yb= +"");return a};g.prototype.xc=function(){var a="",b="",c="";this.ga=document.createElement("div");this.ga.id=g.z+"-wrapper";if(this.v)a='
'+this.body+'
';else{var a=this.ua||this.W?"":'
',e=this.W?'
': +"";this.O("ie",7)&&(e=a="");a='
'+this.Yb+'
'+this.Jb+'
'+this.title+'
'+this.body+'
'+a+''+this.Rc+""+e+"
"}this.fc?(b="//www.youtube.com/embed/"+this.fc+"?wmode=transparent&showinfo=0&modestbranding=0&rel=0&autoplay=1&loop=0&vq=hd1080", +this.gc&&(b+="&enablejsapi=1&html5=1&controls=0",c='
')):this.ec&&(b="//player.vimeo.com/video/"+this.ec+"?autoplay=1&title=0&byline=0&portrait=0");if(this.W)this.Id='',c='
'+c+"
";b=c+a;this.Va&&(b=(this.v?a:"")+'
'+(this.v?c:b)+"
");this.ga.innerHTML=('
'+b+"
").replace(/class=\"/g,'class="'+ +g.z+"-").replace(/id=\"/g,'id="'+g.z+"-")};g.prototype.yc=function(){this.h="dark"===this.style?{Qa:"#1d1f25",aa:"#282b32",ta:"#3a4147",Ab:"#4a5157",Mc:"#32353c",Eb:"0.4",ab:"#2a3137",Aa:"#fff",fb:"#9498a3",Xb:"#464851",za:"#ddd"}:{Qa:"#fff",aa:"#e7eaee",ta:"#eceff3",Ab:"#f5f5f5",Mc:"#e4ecf2",Eb:"1.0",ab:"#fafafa",Aa:"#5c6578",fb:"#8b949b",Xb:"#ced9e6",za:"#7c8598"};var a="0px 0px 35px 0px rgba(45, 49, 56, 0.7)",b=a,d=a,e=g.K+2*g.Ea,f=g.M/1E3+"s";this.v&&(a="none");var h={};h["@media only screen and (max-width: "+ +(g.Da+20-1)+"px)"]={"#overlay":{display:"none"}};a={".flipped":{transform:"rotateY(180deg)"},"#overlay":{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",overflow:"auto","text-align":"center","z-index":"10000","font-family":'"Helvetica", "Arial", sans-serif',"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"},"#overlay.mini":{height:"0",overflow:"visible"},"#overlay a":{width:"initial",padding:"0","text-decoration":"none","text-transform":"none",color:"inherit"}, +"#bgwrapper":{position:"relative",width:"100%",height:"100%"},"#bg":{position:"fixed",top:"0",left:"0",width:"100%",height:"100%","min-width":4*this.Vc+"px","min-height":4*this.Uc+"px","background-color":"black",opacity:"0.0","-ms-filter":"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)",filter:"alpha(opacity=60)",transition:"opacity "+f},"#bg.visible":{opacity:g.la},".mini #bg":{width:"0",height:"0","min-width":"0"},"#flipcontainer":{perspective:"1000px",position:"absolute",width:"100%"},"#flipper":{position:"relative", +"transform-style":"preserve-3d",transition:"0.3s"},"#takeover":{position:"absolute",left:"50%",width:g.Y+"px","margin-left":Math.round(-g.Y/2)+"px","backface-visibility":"hidden",transform:"rotateY(0deg)",opacity:"0.0",top:g.oa+"px",transition:"opacity "+f+", top "+f},"#takeover.visible":{opacity:"1.0",top:g.I+"px"},"#takeover.exiting":{opacity:"0.0",top:g.oa+"px"},"#thumbspacer":{height:g.Fa+"px"},"#thumbborder-wrapper":{position:"absolute",top:-g.Ea+"px",left:g.Y/2-g.Fa-g.Ea+"px",width:e+"px",height:e/ +2+"px",overflow:"hidden"},"#thumbborder":{position:"absolute",width:e+"px",height:e+"px","border-radius":e+"px","background-color":this.h.aa,opacity:"0.5"},"#thumbnail":{position:"absolute",top:"0px",left:g.Y/2-g.Fa+"px",width:g.K+"px",height:g.K+"px",overflow:"hidden","z-index":"100","border-radius":g.K+"px"},"#mini":{position:"absolute",right:"20px",top:g.I+"px",width:this.jd+"px",height:2*g.A+"px","margin-top":20-g.A+"px","backface-visibility":"hidden",opacity:"0.0",transform:"rotateX(90deg)", +transition:"opacity 0.3s, transform 0.3s, right 0.3s"},"#mini.visible":{opacity:"1.0",transform:"rotateX(0deg)"},"#mini.exiting":{opacity:"0.0",right:"-150px"},"#mainbox":{"border-radius":"4px","box-shadow":a,"text-align":"center","background-color":this.h.Qa,"font-size":"14px",color:this.h.fb},"#mini #mainbox":{height:g.A+"px","margin-top":g.A+"px","border-radius":"3px",transition:"background-color "+f},"#mini-border":{height:g.A+6+"px",width:g.Da+6+"px",position:"absolute",top:"-3px",left:"-3px", +"margin-top":g.A+"px","border-radius":"6px",opacity:"0.25","background-color":"#fff","z-index":"-1","box-shadow":d},"#mini-icon":{position:"relative",display:"inline-block",width:"75px",height:g.A+"px","border-radius":"3px 0 0 3px","background-color":this.h.aa,background:"linear-gradient(135deg, "+this.h.Ab+" 0%, "+this.h.aa+" 100%)",transition:"background-color "+f},"#mini:hover #mini-icon":{"background-color":this.h.ab},"#mini:hover #mainbox":{"background-color":this.h.ab},"#mini-icon-img":{position:"absolute", +"background-image":"url("+this.L+")",width:"48px",height:"48px",top:"20px",left:"12px"},"#content":{padding:"30px 20px 0px 20px"},"#mini-content":{"text-align":"left",height:g.A+"px",cursor:"pointer"},"#img":{width:"328px","margin-top":"30px","border-radius":"5px"},"#title":{"max-height":"600px",overflow:"hidden","word-wrap":"break-word",padding:"25px 0px 20px 0px","font-size":"19px","font-weight":"bold",color:this.h.Aa},"#body":{"max-height":"600px","margin-bottom":"25px",overflow:"hidden","word-wrap":"break-word", +"line-height":"21px","font-size":"15px","font-weight":"normal","text-align":"left"},"#mini #body":{display:"inline-block","max-width":"250px",margin:"0 0 0 30px",height:g.A+"px","font-size":"16px","letter-spacing":"0.8px",color:this.h.Aa},"#mini #body-text":{display:"table",height:g.A+"px"},"#mini #body-text div":{display:"table-cell","vertical-align":"middle"},"#tagline":{"margin-bottom":"15px","font-size":"10px","font-weight":"600","letter-spacing":"0.8px",color:"#ccd7e0","text-align":"left"},"#tagline a":{color:this.h.Xb, +transition:"color "+f},"#tagline a:hover":{color:this.h.za},"#cancel":{position:"absolute",right:"0",width:"8px",height:"8px",padding:"10px","border-radius":"20px",margin:"12px 12px 0 0","box-sizing":"content-box",cursor:"pointer",transition:"background-color "+f},"#mini #cancel":{margin:"7px 7px 0 0"},"#cancel-icon":{width:"8px",height:"8px",overflow:"hidden","background-image":"url(//cdn.mxpnl.com/site_media/images/icons/notifications/cancel-x.png)",opacity:this.h.Eb},"#cancel:hover":{"background-color":this.h.ta}, +"#button":{display:"block",height:"60px","line-height":"60px","text-align":"center","background-color":this.h.aa,"border-radius":"0 0 4px 4px",overflow:"hidden",cursor:"pointer",transition:"background-color "+f},"#button-close":{display:"inline-block",width:"9px",height:"60px","margin-right":"8px","vertical-align":"top","background-image":"url(//cdn.mxpnl.com/site_media/images/icons/notifications/close-x-"+this.style+".png)","background-repeat":"no-repeat","background-position":"0px 25px"},"#button-play":{display:"inline-block", +width:"30px",height:"60px","margin-left":"15px","background-image":"url(//cdn.mxpnl.com/site_media/images/icons/notifications/play-"+this.style+"-small.png)","background-repeat":"no-repeat","background-position":"0px 15px"},"a#button-link":{display:"inline-block","vertical-align":"top","text-align":"center","font-size":"17px","font-weight":"bold",overflow:"hidden","word-wrap":"break-word",color:this.h.Aa,transition:"color "+f},"#button:hover":{"background-color":this.h.ta,color:this.h.za},"#button:hover a":{color:this.h.za}, +"#video-noflip":{position:"relative",top:2*-this.X+"px"},"#video-flip":{"backface-visibility":"hidden",transform:"rotateY(180deg)"},"#video":{position:"absolute",width:this.ka-1+"px",height:this.X+"px",top:g.I+"px","margin-top":"100px",left:"50%","margin-left":Math.round(-this.ka/2)+"px",overflow:"hidden","border-radius":"5px","box-shadow":b,transform:"translateZ(1px)",transition:"opacity "+f+", top "+f},"#video.exiting":{opacity:"0.0",top:this.X+"px"},"#video-holder":{position:"absolute",width:this.ka- +1+"px",height:this.X+"px",overflow:"hidden","border-radius":"5px"},"#video-frame":{"margin-left":"-1px",width:this.ka+"px"},"#video-controls":{opacity:"0",transition:"opacity 0.5s"},"#video:hover #video-controls":{opacity:"1.0"},"#video .video-progress-el":{position:"absolute",bottom:"0",height:"25px","border-radius":"0 0 0 5px"},"#video-progress":{width:"90%"},"#video-progress-total":{width:"100%","background-color":this.h.Qa,opacity:"0.7"},"#video-elapsed":{width:"0","background-color":"#6cb6f5", +opacity:"0.9"},"#video #video-time":{width:"10%",right:"0","font-size":"11px","line-height":"25px",color:this.h.fb,"background-color":"#666","border-radius":"0 0 5px 0"}};this.O("ie",8)&&c.extend(a,{"* html #overlay":{position:"absolute"},"* html #bg":{position:"absolute"},"html, body":{height:"100%"}});this.O("ie",7)&&c.extend(a,{"#mini #body":{display:"inline",zoom:"1",border:"1px solid "+this.h.ta},"#mini #body-text":{padding:"20px"},"#mini #mini-icon":{display:"none"}});var b="backface-visibility,border-radius,box-shadow,opacity,perspective,transform,transform-style,transition".split(","), +d=["khtml","moz","ms","o","webkit"],i;for(i in a)for(e=0;e(s.__SV||0)?k.ca("Version mismatch; please ensure you're using the latest version of the Mixpanel code snippet."): +(c.a(s._i,function(a){a&&c.isArray(a)&&(z[a[a.length-1]]=I.apply(this,a))}),Y(),s.init(),c.a(z,function(a){a.ra()}),X())})()})(); })(); diff --git a/package.json b/package.json index 4bd271de..dbd11f9f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mixpanel-browser", - "version": "2.9.3", + "version": "2.9.4", "description": "The official Mixpanel JavaScript browser client library", "main": "build/mixpanel.cjs.js", "directories": { diff --git a/src/ce.js b/src/ce.js index 3c8a8b90..d6d9f27d 100644 --- a/src/ce.js +++ b/src/ce.js @@ -244,7 +244,7 @@ var ce = { if (!isNaN(secondsToDisable) && secondsToDisable > 0) { var disableUntil = _.timestamp() + (secondsToDisable * 1000); console.log('disabling CE for ' + secondsToDisable + ' seconds (from ' + _.timestamp() + ' until ' + disableUntil + ')'); - _.cookie.set(DISABLE_COOKIE, true, secondsToDisable, true); + _.cookie.set_seconds(DISABLE_COOKIE, true, secondsToDisable, true); } }, diff --git a/src/config.js b/src/config.js index 799f4943..73c9878c 100644 --- a/src/config.js +++ b/src/config.js @@ -1,6 +1,6 @@ var Config = { DEBUG: false, - LIB_VERSION: '2.9.3' + LIB_VERSION: '2.9.4' }; export default Config; diff --git a/src/utils.js b/src/utils.js index ef085563..35988e5e 100644 --- a/src/utils.js +++ b/src/utils.js @@ -949,7 +949,7 @@ _.cookie = { return cookie; }, - set: function(name, value, seconds, cross_subdomain, is_secure) { + set_seconds: function(name, value, seconds, cross_subdomain, is_secure) { var cdomain = '', expires = '', secure = ''; @@ -974,6 +974,29 @@ _.cookie = { document.cookie = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure; }, + set: function(name, value, days, cross_subdomain, is_secure) { + var cdomain = '', expires = '', secure = ''; + + if (cross_subdomain) { + var matches = document.location.hostname.match(/[a-z0-9][a-z0-9\-]+\.[a-z\.]{2,6}$/i), + domain = matches ? matches[0] : ''; + + cdomain = ((domain) ? '; domain=.' + domain : ''); + } + + if (days) { + var date = new Date(); + date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); + expires = '; expires=' + date.toGMTString(); + } + + if (is_secure) { + secure = '; secure'; + } + + document.cookie = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure; + }, + remove: function(name, cross_subdomain) { _.cookie.set(name, '', -1, cross_subdomain); } diff --git a/tests/unit/testCE.js b/tests/unit/testCE.js index 4d8ad650..b796ccd6 100644 --- a/tests/unit/testCE.js +++ b/tests/unit/testCE.js @@ -844,7 +844,7 @@ describe('Collect Everything system', function() { it('should not track when the cookie is set', function() { const cookie = {}; - _.cookie.set = sinon.spy((cookieKey, val, expireySeconds, cross_subdomain) => { + _.cookie.set_seconds = sinon.spy((cookieKey, val, expireySeconds, cross_subdomain) => { cookie[cookieKey] = val; setTimeout(() => delete cookie[cookieKey], expireySeconds * 1000); }); @@ -854,7 +854,7 @@ describe('Collect Everything system', function() { ce._addDomEventHandlers({}); ce.checkForBackoff({getResponseHeader: () => 1}); - expect(_.cookie.set.calledWith(DISABLE_COOKIE, true, 1, true)).to.equal(true); + expect(_.cookie.set_seconds.calledWith(DISABLE_COOKIE, true, 1, true)).to.equal(true); // test immediatelya after expect(_.cookie.parse(DISABLE_COOKIE)).to.equal(true);