(function() { var l=void 0,m=!0,r=null,D=!1; (function(){function Aa(){function a(){if(!a.Cc)la=a.Cc=m,ma=D,c.a(F,function(a){a.pc()})}function b(){try{t.documentElement.doScroll("left")}catch(d){setTimeout(b,1);return}a()}if(t.addEventListener)"complete"===t.readyState?a():t.addEventListener("DOMContentLoaded",a,D);else if(t.attachEvent){t.attachEvent("onreadystatechange",a);var d=D;try{d=n.frameElement===r}catch(f){}t.documentElement.doScroll&&d&&b()}c.Sb(n,"load",a,m)}function Ba(){x.init=function(a,b,d){if(d)return x[d]||(x[d]=F[d]=S(a, b,d),x[d].ka()),x[d];d=x;if(F.mixpanel)d=F.mixpanel;else if(a)d=S(a,b,"mixpanel"),d.ka(),F.mixpanel=d;x=d;1===ca&&(n.mixpanel=x);Ca()}}function Ca(){c.a(F,function(a,b){"mixpanel"!==b&&(x[b]=a)});x._=c}function da(a){a=c.e(a)?a:c.g(a)?{}:{days:a};return c.extend({},Da,a)}function S(a,b,d){var f,h="mixpanel"===d?x:x[d];if(h&&0===ca)f=h;else{if(h&&!c.isArray(h)){o.error("You have already initialized "+d);return}f=new e}f.kb={};f.X(a,b,d);f.people=new j;f.people.X(f);if(!f.c("skip_first_touch_marketing")){var a= c.info.Y(r),g={},v=D;c.a(a,function(a,b){(g["initial_"+b]=a)&&(v=m)});v&&f.people.M(g)}J=J||f.c("debug");!c.g(h)&&c.isArray(h)&&(f.Aa.call(f.people,h.people),f.Aa(h));return f}function e(){}function P(){}function Ea(a){return a}function q(a){this.props={};this.zd=D;this.name=a.persistence_name?"mp_"+a.persistence_name:"mp_"+a.token+"_mixpanel";var b=a.persistence;if("cookie"!==b&&"localStorage"!==b)o.A("Unknown persistence type "+b+"; falling back to cookie"),b=a.persistence="cookie";this.i="localStorage"=== b&&c.localStorage.sa()?c.localStorage:c.cookie;this.load();this.jc(a);this.vd(a);this.save()}function j(){}function u(){}function C(a,b){this.J=b.J;this.ba=new G(a,{J:c.bind(this.h,this),i:b.i});this.B=b.B;this.Yc=b.Zc;this.la=b.la;this.hd=b.jd;this.D=this.B.batch_size;this.pa=this.B.batch_flush_interval_ms;this.va=!this.B.batch_autostart;this.Ja=0;this.G={}}function na(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 oa(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.N=a;this.i=b.i||window.localStorage;this.h=b.J||c.bind(pa.error,pa);this.Xa=new qa(a,{i:this.i});this.ua=b.ua||r;this.H=[]}function qa(a,b){b=b||{};this.N=a;this.i=b.i||window.localStorage;this.Qb=b.Qb||100;this.dc=b.dc||2E3}function T(){this.Nb="submit"}function M(){this.Nb="click"}function E(){}function ra(a){var b=Fa,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.fa=function(a){var b={};c.a(a,function(a,f){c.Wa(a)&&0=i;)h()}function d(){var a,b,d="",c;if('"'=== i)for(;h();){if('"'===i)return h(),d;if("\\"===i)if(h(),"u"===i){for(b=c=0;4>b;b+=1){a=parseInt(h(),16);if(!isFinite(a))break;c=16*c+a}d+=String.fromCharCode(c)}else if("string"===typeof k[i])d+=k[i];else break;else d+=i}g("Bad string")}function c(){var a;a="";"-"===i&&(a="-",h("-"));for(;"0"<=i&&"9">=i;)a+=i,h();if("."===i)for(a+=".";h()&&"0"<=i&&"9">=i;)a+=i;if("e"===i||"E"===i){a+=i;h();if("-"===i||"+"===i)a+=i,h();for(;"0"<=i&&"9">=i;)a+=i,h()}a=+a;if(isFinite(a))return a;g("Bad number")}function h(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.yd=e;a.text=p;throw a;}var e,i,k={'"':'"',"\\":"\\","/":"/",b:"\u0008",f:"\u000c",n:"\n",r:"\r",t:"\t"},p,s;s=function(){b();switch(i){case "{":var e;a:{var v,k={};if("{"===i){h("{");b();if("}"===i){h("}");e=k;break a}for(;i;){v=d();b();h(":");Object.hasOwnProperty.call(k,v)&&g('Duplicate key "'+v+'"');k[v]=s();b();if("}"===i){h("}");e=k;break a}h(",");b()}}g("Bad object")}return e;case "[":a:{e= [];if("["===i){h("[");b();if("]"===i){h("]");v=e;break a}for(;i;){e.push(s());b();if("]"===i){h("]");v=e;break a}h(",");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.xc=function(a){var b,d,f,h,g=0,e=0,i="",i=[];if(!a)return a;a=c.wd(a);do b=a.charCodeAt(g++),d=a.charCodeAt(g++),f=a.charCodeAt(g++),h=b<<16|d<<8|f,b=h>>18&63,d=h>>12&63,f=h>>6&63,h&=63,i[e++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b)+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h);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.ib=function(){function a(){function a(b,d){var c,f=0;for(c=0;cB?(Qa.error("Timeout waiting for mutex on "+s+"; clearing lock. ["+k+"]"),j.removeItem(o),j.removeItem(q),h()):setTimeout(function(){try{a()}catch(c){b&&b(c)}},w*(Math.random()+0.1))}!c&&"function"!==typeof b&&(c=b,b=r);var k=c|| (new Date).getTime()+"|"+Math.random(),p=(new Date).getTime(),s=this.N,w=this.Qb,B=this.dc,j=this.i,n=s+":X",q=s+":Y",o=s+":Z";try{if(U(j,m))h();else throw Error("localStorage support check failed");}catch(t){b&&b(t)}};var pa=ga("batch");G.prototype.Na=function(a,b,d){var f={id:ea(),flushAfter:(new Date).getTime()+2*b,payload:a};this.Xa.hb(c.bind(function(){var b;try{var c=this.da();c.push(f);(b=this.$a(c))&&this.H.push(f)}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.ua)};G.prototype.Dc=function(a){var b=this.H.slice(0,a);if(b.lengthg.flushAfter&&!f[g.id]&&(g.Qc=m,b.push(g),b.length>=a))break}}}return b};G.prototype.Sc=function(a,b){var d={};c.a(a,function(a){d[a]=m});this.H=oa(this.H,d);var f=c.bind(function(){var b;try{var c=this.da(),c=oa(c,d);if(b=this.$a(c))for(var c=this.da(),f=0;f e.length)this.ea();else{this.Ub=m;var i=c.bind(function(e){this.Ub=D;try{var g=D;if(a.hc)this.ba.ud(v);else if(c.e(e)&&"timeout"===e.error&&(new Date).getTime()-d>=b)this.h("Network timeout; retrying"),this.flush();else if(c.e(e)&&e.R&&(500<=e.R.status||429===e.R.status||"timeout"===e.error)){var i=2*this.pa,k=e.R.responseHeaders;if(k){var j=k["Retry-After"];j&&(i=1E3*parseInt(j,10)||i)}i=Math.min(6E5,i);this.h("Error; retry in "+i+" ms");this.Wb(i)}else if(c.e(e)&&e.R&&413===e.R.status)if(1=o.timeout?"timeout":"Bad HTTP status: "+o.status+" "+o.statusText,p.l(a),e&&(k?e({status:0,error:a,R:o}):e(0))};o.send(j)}catch(y){p.l(y),h=D}else j=t.createElement("script"),j.type="text/javascript", j.async=m,j.defer=m,j.src=a,u=t.getElementsByTagName("script")[0],u.parentNode.insertBefore(j,u);return h};e.prototype.Aa=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=[],h=[],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): h.push(a))},this);b(e,this);b(h,this);b(g,this)};e.prototype.rb=function(){return!!this.u.K};e.prototype.Cb=function(){var a="__mpq_"+this.c("token"),b=this.c("api_routes");return this.jb=this.jb||{K:{type:"events",F:"/"+b.track,ca:a+"_ev"},Za:{type:"people",F:"/"+b.engage,ca:a+"_pp"},Ra:{type:"groups",F:"/"+b.groups,ca:a+"_gr"}}};e.prototype.Jc=function(){if(!this.rb()){var a=c.bind(function(a){return new C(a.ca,{B:this.config,Zc:c.bind(function(b,c,e){this.k(this.c("api_host")+a.F,this.lb(b),c, this.nb(e,b))},this),la:c.bind(function(b){return this.pb("before_send_"+a.type,b)},this),J:this.c("error_reporter"),jd:c.bind(this.bb,this)})},this),b=this.Cb();this.u={K:a(b.K),Za:a(b.Za),Ra:a(b.Ra)}}this.c("batch_autostart")&&this.ab()};e.prototype.ab=function(){this.nc=m;if(this.rb())this.T=m,c.a(this.u,function(a){a.start()})};e.prototype.bb=function(){this.T=D;c.a(this.u,function(a){a.stop();a.clear()})};e.prototype.push=function(a){this.Aa([a])};e.prototype.disable=function(a){"undefined"=== typeof a?this.U.Ac=m:this.xa=this.xa.concat(a)};e.prototype.lb=function(a){a=c.ha(a);"base64"===this.c("api_payload_format")&&(a=c.xc(a));return{data:a}};e.prototype.Fa=function(a,b){var d=c.truncate(a.data,255),e=a.F,h=a.Ha,g=a.gd,j=a.$c||{},b=b||P,i=m,k=c.bind(function(){j.bc||(d=this.pb("before_send_"+a.type,d));return d?(o.log("MIXPANEL REQUEST:"),o.log(d),this.k(e,this.lb(d),j,this.nb(b,d))):r},this);this.T&&!g?h.Na(d,function(a){a?b(1,d):k()}):i=k();return i&&d};e.prototype.o=K(function(a,b, d,e){!e&&"function"===typeof d&&(e=d,d=r);var d=d||{},h=d.transport;if(h)d.fb=h;h=d.send_immediately;"function"!==typeof e&&(e=P);if(c.g(a))this.l("No event name provided to mixpanel.track");else if(this.mb(a))e(0);else{b=c.extend({},b);b.token=this.c("token");var g=this.persistence.Tc(a);c.g(g)||(b.$duration=parseFloat((((new Date).getTime()-g)/1E3).toFixed(3)));this.qb();g=this.c("track_marketing")?c.info.Nc():{};if(this.I){var j=this.I.replayId;j&&(b.$mp_replay_id=j)}b=c.extend({},c.info.aa({mp_loader:this.c("mp_loader")}), g,this.persistence.aa(),this.P,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.Fa({type:"events",data:{event:a,properties:b},F:this.c("api_host")+"/"+this.c("api_routes").track,Ha:this.u.K,gd:h,$c:d},e)}});e.prototype.ed=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.uc=K(function(a,b,c){var e=this.s(a),h={};e===l?(h[a]=[b],this.m(h)): -1===e.indexOf(b)&&(e.push(b),h[a]=e,this.m(h));return this.people.ga(a,b,c)});e.prototype.Uc=K(function(a,b,c){var e=this.s(a);if(e!==l){var h=e.indexOf(b);-1(x.__SV||0)?o.A("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))}),Ba(),x.init(),c.a(F,function(a){a.ka()}),Aa())})()})(); })();