(function() { var l=void 0,m=!0,r=null,D=!1; (function(){function Ba(){function a(){if(!a.Hc)la=a.Hc=m,ma=D,c.a(F,function(a){a.uc()})}function b(){try{u.documentElement.doScroll("left")}catch(d){setTimeout(b,1);return}a()}if(u.addEventListener)"complete"===u.readyState?a():u.addEventListener("DOMContentLoaded",a,D);else if(u.attachEvent){u.attachEvent("onreadystatechange",a);var d=D;try{d=n.frameElement===r}catch(h){}u.documentElement.doScroll&&d&&b()}c.Xb(n,"load",a,m)}function Ca(){x.init=function(a,b,d){if(d)return x[d]||(x[d]=F[d]=S(a, b,d),x[d].la()),x[d];d=x;if(F.mixpanel)d=F.mixpanel;else if(a)d=S(a,b,"mixpanel"),d.la(),F.mixpanel=d;x=d;1===ca&&(n.mixpanel=x);Da()}}function Da(){c.a(F,function(a,b){"mixpanel"!==b&&(x[b]=a)});x._=c}function da(a){a=c.g(a)?a:c.e(a)?{}:{days:a};return c.extend({},Ea,a)}function S(a,b,d){var h,f="mixpanel"===d?x:x[d];if(f&&0===ca)h=f;else{if(f&&!c.isArray(f)){o.error("You have already initialized "+d);return}h=new e}h.mb={};h.Y(a,b,d);h.people=new k;h.people.Y(h);if(!h.c("skip_first_touch_marketing")){var a= c.info.Z(r),g={},v=D;c.a(a,function(a,b){(g["initial_"+b]=a)&&(v=m)});v&&h.people.O(g)}J=J||h.c("debug");!c.e(f)&&c.isArray(f)&&(h.Ba.call(h.people,f.people),h.Ba(f));return h}function e(){}function P(){}function Fa(a){return a}function na(a){throw Error(a+" not available in this build.");}function q(a){this.props={};this.Fd=D;this.name=a.persistence_name?"mp_"+a.persistence_name:"mp_"+a.token+"_mixpanel";var b=a.persistence;if("cookie"!==b&&"localStorage"!==b)o.B("Unknown persistence type "+b+"; falling back to cookie"), b=a.persistence="cookie";this.j="localStorage"===b&&c.localStorage.ua()?c.localStorage:c.cookie;this.load();this.pc(a);this.Bd();this.save()}function k(){}function t(){}function C(a,b){this.L=b.L;this.ca=new G(a,{L:c.bind(this.h,this),j:b.j,v:b.v});this.C=b.C;this.dd=b.ed;this.ma=b.ma;this.od=b.pd;this.G=this.C.batch_size;this.qa=this.C.batch_flush_interval_ms;this.fa=!this.C.batch_autostart;this.Ka=0;this.J={};this.Fb=b.Fb||D}function oa(a,b){var d=[];c.a(a,function(a){var c=a.id;if(c in b){if(c= b[c],c!==r)a.payload=c,d.push(a)}else d.push(a)});return d}function pa(a,b){var d=[];c.a(a,function(a){a.id&&!b[a.id]&&d.push(a)});return d}function G(a,b){b=b||{};this.P=a;if(this.v=b.v)this.j=b.j||window.localStorage,this.Ya=new qa(a,{j:this.j});this.h=b.L||c.bind(ra.error,ra);this.wa=b.wa||r;this.D=[]}function qa(a,b){b=b||{};this.P=a;this.j=b.j||window.localStorage;this.Vb=b.Vb||100;this.jc=b.jc||2E3}function T(){this.Sb="submit"}function M(){this.Sb="click"}function E(){}function Ga(){var a= n.navigator.onLine;return c.e(a)||a}function sa(a){var b=Ha,d=a.split("."),d=d[d.length-1];if(4a?"0"+a:a}return a.getUTCFullYear()+"-"+b(a.getUTCMonth()+1)+"-"+b(a.getUTCDate())+ "T"+b(a.getUTCHours())+":"+b(a.getUTCMinutes())+":"+b(a.getUTCSeconds())};c.ga=function(a){var b={};c.a(a,function(a,h){c.Xa(a)&&0=i;)f()}function d(){var a,b,d="",c;if('"'===i)for(;f();){if('"'===i)return f(),d;if("\\"===i)if(f(),"u"===i){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 j[i])d+=j[i];else break;else d+=i}g("Bad string")}function c(){var a;a="";"-"===i&&(a="-",f("-"));for(;"0"<=i&&"9">=i;)a+=i,f();if("."===i)for(a+= ".";f()&&"0"<=i&&"9">=i;)a+=i;if("e"===i||"E"===i){a+=i;f();if("-"===i||"+"===i)a+=i,f();for(;"0"<=i&&"9">=i;)a+=i,f()}a=+a;if(isFinite(a))return a;g("Bad number")}function f(a){a&&a!==i&&g("Expected '"+a+"' instead of '"+i+"'");i=p.charAt(e);e+=1;return i}function g(a){a=new SyntaxError(a);a.Ed=e;a.text=p;throw a;}var e,i,j={'"':'"',"\\":"\\","/":"/",b:"\u0008",f:"\u000c",n:"\n",r:"\r",t:"\t"},p,s;s=function(){b();switch(i){case "{":var e;a:{var v,j={};if("{"===i){f("{");b();if("}"===i){f("}");e= j;break a}for(;i;){v=d();b();f(":");Object.hasOwnProperty.call(j,v)&&g('Duplicate key "'+v+'"');j[v]=s();b();if("}"===i){f("}");e=j;break a}f(",");b()}}g("Bad object")}return e;case "[":a:{e=[];if("["===i){f("[");b();if("]"===i){f("]");v=e;break a}for(;i;){e.push(s());b();if("]"===i){f("]");v=e;break a}f(",");b()}}g("Bad array")}return v;case '"':return d();case "-":return c();default:return"0"<=i&&"9">=i?c():a()}};return function(a){p=a;e=0;i=" ";a=s();b();i&&g("Syntax error");return a}}();c.Cc= function(a){var b,d,h,f,g=0,e=0,i="",i=[];if(!a)return a;a=c.Cd(a);do b=a.charCodeAt(g++),d=a.charCodeAt(g++),h=a.charCodeAt(g++),f=b<<16|d<<8|h,b=f>>18&63,d=f>>12&63,h=f>>6&63,f&=63,i[e++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f); while(ge?c++:i=127e?String.fromCharCode(e>>6|192,e&63|128):String.fromCharCode(e>>12|224,e>>6&63|128,e&63|128);i!==r&&(c>d&&(b+=a.substring(d,c)),b+=i,d=c=g+1)}c>d&&(b+=a.substring(d,a.length));return b};c.kb=function(){function a(){function a(b, c){var d,h=0;for(d=0;dB?(Sa.error("Timeout waiting for mutex on "+s+"; clearing lock. ["+j+"]"),k.removeItem(o),k.removeItem(q),f()):setTimeout(function(){try{a()}catch(c){b&&b(c)}},w*(Math.random()+0.1))}!c&&"function"!==typeof b&&(c=b,b=r);var j=c|| (new Date).getTime()+"|"+Math.random(),p=(new Date).getTime(),s=this.P,w=this.Vb,B=this.jc,k=this.j,n=s+":X",q=s+":Y",o=s+":Z";try{if(U(k,m))f();else throw Error("localStorage support check failed");}catch(u){b&&b(u)}};var ra=ga("batch");G.prototype.Oa=function(a,b,d){var h={id:ea(),flushAfter:(new Date).getTime()+2*b,payload:a};this.v?this.Ya.ib(c.bind(function(){var b;try{var c=this.ea();c.push(h);(b=this.ab(c))&&this.D.push(h)}catch(e){this.h("Error enqueueing item",a),b=D}d&&d(b)},this),c.bind(function(a){this.h("Error acquiring storage lock", a);d&&d(D)},this),this.wa):(this.D.push(h),d&&d(m))};G.prototype.Ic=function(a){var b=this.D.slice(0,a);if(this.v&&b.lengthg.flushAfter&&!h[g.id]&&(g.Wc=m,b.push(g),b.length>=a))break}}}return b};G.prototype.Yc=function(a,b){var d={};c.a(a,function(a){d[a]=m});this.D=pa(this.D,d);if(this.v){var h=c.bind(function(){var b;try{var c=this.ea(),c=pa(c,d);if(b=this.ab(c))for(var c= this.ea(),h=0;hv.length)this.N();else{this.Zb=m;var j=c.bind(function(j){this.Zb=D;try{var k=D;if(a.nc)this.ca.Ad(i);else if(c.g(j)&&"timeout"===j.error&&(new Date).getTime()-d>=b)this.h("Network timeout; retrying"),this.flush();else if(c.g(j)&&(500<=j.sa||429===j.sa||0>=j.sa&&!Ga()||"timeout"===j.error)){var v=2*this.qa;j.ac&&(v=1E3*parseInt(j.ac,10)||v);v=Math.min(6E5,v);this.h("Error; retry in "+ v+" ms");this.bc(v)}else if(c.g(j)&&413===j.sa)if(1=o.timeout?"timeout":"Bad HTTP status: "+o.status+" "+o.statusText,p.l(a),e&&(j?e({status:0,sa:o.status,error:a,ac:(o.responseHeaders||{})["Retry-After"]}):e(0))};o.send(k)}catch(y){p.l(y),f=D}else k=u.createElement("script"),k.type="text/javascript",k.async=m,k.defer=m,k.src=a,t=u.getElementsByTagName("script")[0],t.parentNode.insertBefore(k,t);return f};e.prototype.Ba=function(a){function b(a, b){c.a(a,function(a){if(c.isArray(a[0])){var d=b;c.a(a,function(a){d=d[a[0]].apply(d,a.slice(1))})}else this[a[0]].apply(this,a.slice(1))},b)}var d,e=[],f=[],g=[];c.a(a,function(a){a&&(d=a[0],c.isArray(d)?g.push(a):"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]?g.push(a):f.push(a))},this);b(e,this);b(f,this);b(g,this)};e.prototype.ub=function(){return!!this.u.M};e.prototype.Gb=function(){var a="__mpq_"+this.c("token"), b=this.c("api_routes");return this.lb=this.lb||{M:{type:"events",H:"/"+b.track,da:a+"_ev"},$a:{type:"people",H:"/"+b.engage,da:a+"_pp"},Sa:{type:"groups",H:"/"+b.groups,da:a+"_gr"}}};e.prototype.Pc=function(){if(!this.ub()){var a=c.bind(function(a){return new C(a.da,{C:this.config,L:this.c("error_reporter"),ed:c.bind(function(b,c,e){this.k(this.c("api_host")+a.H,this.nb(b),c,this.qb(e,b))},this),ma:c.bind(function(b){return this.sb("before_send_"+a.type,b)},this),pd:c.bind(this.cb,this),v:m})},this), b=this.Gb();this.u={M:a(b.M),$a:a(b.$a),Sa:a(b.Sa)}}this.c("batch_autostart")&&this.bb()};e.prototype.bb=function(){this.sc=m;if(this.ub())this.U=m,c.a(this.u,function(a){a.start()})};e.prototype.cb=function(){this.U=D;c.a(this.u,function(a){a.stop();a.clear()})};e.prototype.push=function(a){this.Ba([a])};e.prototype.disable=function(a){"undefined"===typeof a?this.V.Fc=m:this.ya=this.ya.concat(a)};e.prototype.nb=function(a){a=c.ia(a);"base64"===this.c("api_payload_format")&&(a=c.Cc(a));return{data:a}}; e.prototype.Ga=function(a,b){var d=c.truncate(a.data,255),e=a.H,f=a.Ia,g=a.nd,k=a.fd||{},b=b||P,i=m,j=c.bind(function(){k.hc||(d=this.sb("before_send_"+a.type,d));return d?(o.log("MIXPANEL REQUEST:"),o.log(d),this.k(e,this.nb(d),k,this.qb(b,d))):r},this);this.U&&!g?f.Oa(d,function(a){a?b(1,d):j()}):i=j();return i&&d};e.prototype.o=K(function(a,b,d,e){!e&&"function"===typeof d&&(e=d,d=r);var d=d||{},f=d.transport;if(f)d.gb=f;f=d.send_immediately;"function"!==typeof e&&(e=P);if(c.e(a))this.l("No event name provided to mixpanel.track"); else if(this.ob(a))e(0);else{b=c.extend({},b);b.token=this.c("token");var g=this.persistence.Zc(a);c.e(g)||(b.$duration=parseFloat((((new Date).getTime()-g)/1E3).toFixed(3)));this.tb();g=this.c("track_marketing")?c.info.Tc():{};b=c.extend({},c.info.ba({mp_loader:this.c("mp_loader")}),g,this.persistence.ba(),this.R,this.Hb(),b);g=this.c("property_blacklist");c.isArray(g)?c.a(g,function(a){delete b[a]}):this.l("Invalid value for property_blacklist config: "+g);return this.Ga({type:"events",data:{event:a, properties:b},H:this.c("api_host")+"/"+this.c("api_routes").track,Ia:this.u.M,nd:f,fd:d},e)}});e.prototype.ld=K(function(a,b,d){c.isArray(b)||(b=[b]);var e={};e[a]=b;this.m(e);return this.people.set(a,b,d)});e.prototype.zc=K(function(a,b,c){var e=this.s(a),f={};e===l?(f[a]=[b],this.m(f)):-1===e.indexOf(b)&&(e.push(b),f[a]=e,this.m(f));return this.people.ha(a,b,c)});e.prototype.$c=K(function(a,b,c){var e=this.s(a);if(e!==l){var f=e.indexOf(b);-1(x.__SV||0)?o.B("Version mismatch; please ensure you're using the latest version of the Mixpanel code snippet."):(c.a(x._i,function(a){a&&c.isArray(a)&&(F[a[a.length-1]]=S.apply(this,a))}),Ca(),x.init(),c.a(F,function(a){a.la()}),Ba())})(function(a,b){var c= document.createElement("script");c.type="text/javascript";c.async=m;c.onload=b;c.src=a;document.head.appendChild(c)})})(); })();