mixpanel-browser 2.68.0 → 2.69.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mixpanel-core.cjs.js +18 -3
- package/dist/mixpanel-recorder.js +186 -47
- package/dist/mixpanel-recorder.min.js +1 -1
- package/dist/mixpanel-recorder.min.js.map +1 -1
- package/dist/mixpanel-with-async-recorder.cjs.js +18 -3
- package/dist/mixpanel-with-recorder.js +194 -48
- package/dist/mixpanel-with-recorder.min.js +1 -1
- package/dist/mixpanel.amd.js +194 -48
- package/dist/mixpanel.cjs.js +194 -48
- package/dist/mixpanel.globals.js +18 -3
- package/dist/mixpanel.min.js +68 -68
- package/dist/mixpanel.module.js +194 -48
- package/dist/mixpanel.umd.js +194 -48
- package/dist/rrweb-compiled.js +190 -59
- package/package.json +19 -2
- package/rollup.config.mjs +2 -2
- package/src/config.js +1 -1
- package/src/index.d.ts +1 -0
- package/src/mixpanel-core.js +8 -1
- package/src/recorder/recorder.js +1 -1
- package/src/recorder/recording-registry.js +37 -2
- package/src/recorder/session-recording.js +2 -3
- package/src/request-queue.js +1 -1
- package/src/storage/indexed-db.js +4 -0
- package/src/storage/local-storage.js +4 -0
- package/src/storage/wrapper.js +1 -0
package/dist/mixpanel.min.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
(function(){function Db(){function a(){a.done||(Qa=a.done=!0,Ra=!1,d.h(R,function(e){e.rd()}))}function b(){try{B.documentElement.doScroll("left")}catch(e){setTimeout(b,1);return}a()}if(B.addEventListener)"complete"===B.readyState?a():B.addEventListener("DOMContentLoaded",a,!1);else if(B.attachEvent){B.attachEvent("onreadystatechange",a);var c=!1;try{c=null===r.frameElement}catch(e){}B.documentElement.doScroll&&c&&b()}d.Tc(r,"load",a,!0)}function Eb(){E.init=function(a,b,c){if(c)return E[c]||(E[c]=
|
|
2
|
-
R[c]=ma(a,b,c),E[c].Aa()),E[c];c=E;R.mixpanel?c=R.mixpanel:a&&(c=ma(a,b,"mixpanel"),c.Aa(),R.mixpanel=c);E=c;1===xa&&(r.mixpanel=E);Fb()}}function Fb(){d.h(R,function(a,b){"mixpanel"!==b&&(E[b]=a)});E._=d}function ya(a){a=d.j(a)?a:d.l(a)?{}:{days:a};return d.extend({},Gb,a)}function ma(a,b,c){var e="mixpanel"===c?E:E[c];if(e&&0===xa)var f=e;else{if(e&&!d.isArray(e)){
|
|
3
|
-
d.info.ma(null);var g={},k=!1;d.h(a,function(h,p){(g["initial_"+p]=h)&&(k=!0)});k&&f.people.ba(g)}S=S||f.g("debug");!d.l(e)&&d.isArray(e)&&(f.Ya.call(f.people,e.people),f.Ya(e));return f}function l(){}function Hb(a){return a}function Sa(a){throw Error(a+" not available in this build.");}function T(a){this.X=null;this.Xe=a}function y(a){this.props={};this.name=a.persistence_name?"mp_"+a.persistence_name:"mp_"+a.token+"_mixpanel";var b=a.persistence;"cookie"!==b&&"localStorage"!==b&&(
|
|
4
|
-
b+"; falling back to cookie"),b=a.persistence="cookie");"localStorage"===b&&d.localStorage.pa()?this.storage=d.localStorage:this.storage=d.cookie;this.load();this.ld(a);this.upgrade();this.save()}function x(){}function C(){}function M(a,b){this.Y=b.Y;this.ta=new O(a,{Y:d.bind(this.o,this),P:b.P,bd:b.bd,cd:b.cd,
|
|
5
|
-
b.vc||!1}function Ta(a,b){var c=[];d.h(a,function(e){var f=e.id;f in b?(f=b[f],null!==f&&(e.payload=f,c.push(e))):c.push(e)});return c}function Ua(a,b){var c=[];d.h(a,function(e){e.id&&!b[e.id]&&c.push(e)});return c}function O(a,b){b=b||{};this.ca=a;if(this.
|
|
6
|
-
function fa(a){this.storage=a||r.localStorage}function Va(a,b){b=b||{};this.ca=a;this.storage=b.storage||r.localStorage;this.Qc=b.Qc||100;this.Pb=b.Pb||2E3;this.Rc=b.Rc||D}function na(){this.Mc="submit"}function ba(){this.Mc="click"}function Q(){}function
|
|
2
|
+
R[c]=ma(a,b,c),E[c].Aa()),E[c];c=E;R.mixpanel?c=R.mixpanel:a&&(c=ma(a,b,"mixpanel"),c.Aa(),R.mixpanel=c);E=c;1===xa&&(r.mixpanel=E);Fb()}}function Fb(){d.h(R,function(a,b){"mixpanel"!==b&&(E[b]=a)});E._=d}function ya(a){a=d.j(a)?a:d.l(a)?{}:{days:a};return d.extend({},Gb,a)}function ma(a,b,c){var e="mixpanel"===c?E:E[c];if(e&&0===xa)var f=e;else{if(e&&!d.isArray(e)){z.error("You have already initialized "+c);return}f=new l}f.Xb={};f.la(a,b,c);f.people=new x;f.people.la(f);if(!f.g("skip_first_touch_marketing")){a=
|
|
3
|
+
d.info.ma(null);var g={},k=!1;d.h(a,function(h,p){(g["initial_"+p]=h)&&(k=!0)});k&&f.people.ba(g)}S=S||f.g("debug");!d.l(e)&&d.isArray(e)&&(f.Ya.call(f.people,e.people),f.Ya(e));return f}function l(){}function Hb(a){return a}function Sa(a){throw Error(a+" not available in this build.");}function T(a){this.X=null;this.Xe=a}function y(a){this.props={};this.name=a.persistence_name?"mp_"+a.persistence_name:"mp_"+a.token+"_mixpanel";var b=a.persistence;"cookie"!==b&&"localStorage"!==b&&(z.s("Unknown persistence type "+
|
|
4
|
+
b+"; falling back to cookie"),b=a.persistence="cookie");"localStorage"===b&&d.localStorage.pa()?this.storage=d.localStorage:this.storage=d.cookie;this.load();this.ld(a);this.upgrade();this.save()}function x(){}function C(){}function M(a,b){this.Y=b.Y;this.ta=new O(a,{Y:d.bind(this.o,this),P:b.P,bd:b.bd,cd:b.cd,C:b.C,ob:b.ob});this.O=b.O;this.He=b.Ie;this.Ca=b.Ca;this.Ve=b.We;this.S=this.O.batch_size;this.Ia=this.O.batch_flush_interval_ms;this.stopped=!this.O.batch_autostart;this.lb=0;this.V={};this.vc=
|
|
5
|
+
b.vc||!1}function Ta(a,b){var c=[];d.h(a,function(e){var f=e.id;f in b?(f=b[f],null!==f&&(e.payload=f,c.push(e))):c.push(e)});return c}function Ua(a,b){var c=[];d.h(a,function(e){e.id&&!b[e.id]&&c.push(e)});return c}function O(a,b){b=b||{};this.ca=a;if(this.C=b.C)this.P=b.P||new fa,this.lock=new Va(a,{storage:b.bd||r.localStorage,Pb:b.cd});this.o=b.Y||d.bind(Wa.error,Wa);this.Qa=b.Qa||null;this.K=[];this.Ab=!1;this.Pd=b.ob?Ib(d.bind(this.Zb,this),b.ob):d.bind(function(c){return this.Zb([c])},this)}
|
|
6
|
+
function fa(a){this.storage=a||r.localStorage}function Va(a,b){b=b||{};this.ca=a;this.storage=b.storage||r.localStorage;this.Qc=b.Qc||100;this.Pb=b.Pb||2E3;this.Rc=b.Rc||D}function na(){this.Mc="submit"}function ba(){this.Mc="click"}function Q(){}function A(a){this.tb=a.tb;this.Ja=a.Ud;this.Me=a.Le;this.wc=a.Wd;this.track=a.kf}function I(a){this.A=a}function ha(){}function Xa(a){var b=Jb,c=a.split(".");c=c[c.length-1];if(4<c.length||"com"===c||"org"===c)b=Kb;return(a=a.match(b))?a[0]:""}function za(a){var b=
|
|
7
7
|
Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return a?b.substring(0,a):b}function Ib(a,b){var c=null,e=[];return function(f){var g=this;e.push(f);c||(c=new D(function(k){setTimeout(function(){var h=a.apply(g,[e]);c=null;e=[];k(h)},b)}));return c}}function oa(a,b){return null===Aa||b?Aa=Ya(a||r.localStorage):Aa}function Ya(a){var b=!0;try{var c="__mplss_"+za(8);a.setItem(c,"xyz");"xyz"!==a.getItem(c)&&(b=!1);a.removeItem(c)}catch(e){b=!1}return b}function Za(a){a=
|
|
8
|
-
a.prototype;for(var b in a)"function"===typeof a[b]&&(a[b]=Ba(a[b]))}function Ba(a){return function(){try{return a.apply(this,arguments)}catch(b){
|
|
8
|
+
a.prototype;for(var b in a)"function"===typeof a[b]&&(a[b]=Ba(a[b]))}function Ba(a){return function(){try{return a.apply(this,arguments)}catch(b){z.s("Implementation error. Please turn on debug and contact support@mixpanel.com."),S&&z.s(b)}}}function ia(a){return{log:Ca(z.log,a),error:Ca(z.error,a),s:Ca(z.s,a)}}function Ca(a,b){return function(){arguments[0]="["+b+"] "+arguments[0];return a.apply(z,arguments)}}function pa(a,b){$a.add(a,b);Da||(Da=Lb($a.Od))}function ab(a){var b=typeof a;if(null!==
|
|
9
9
|
a&&("object"===b||"function"===b))var c=a.then;return"function"===typeof c?c:!1}function Ea(){for(var a=0;a<this.N.length;a++){var b=void 0,c=void 0,e=1===this.state?this.N[a].Ye:this.N[a].Qd,f=this.N[a];try{!1===e?f.reject(this.ra):(c=!0===e?this.ra:e.call(void 0,this.ra),c===f.promise?f.reject(TypeError("Promise-chain cycle")):(b=ab(c))?b.call(c,f.resolve,f.reject):f.resolve(c))}catch(g){f.reject(g)}}this.N.length=0}function bb(a){var b,c=this;if(!c.wa){c.wa=!0;c.Ha&&(c=c.Ha);try{(b=ab(a))?pa(function(){var e=
|
|
10
10
|
new cb(c);try{b.call(a,function(){bb.apply(e,arguments)},function(){ja.apply(e,arguments)})}catch(f){ja.call(e,f)}}):(c.ra=a,c.state=1,0<c.N.length&&pa(Ea,c))}catch(e){ja.call(new cb(c),e)}}}function ja(a){var b=this;b.wa||(b.wa=!0,b.Ha&&(b=b.Ha),b.ra=a,b.state=2,0<b.N.length&&pa(Ea,b))}function db(a,b,c,e){for(var f=0;f<b.length;f++)(function(g){a.resolve(b[g]).then(function(k){c(g,k)},e)})(f)}function cb(a){this.Ha=a;this.wa=!1}function Mb(a){this.promise=a;this.state=0;this.wa=!1;this.N=[];this.ra=
|
|
11
11
|
void 0}function U(a){if("function"!==typeof a)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var b=new Mb(this);this.then=function(c,e){var f={Ye:"function"===typeof c?c:!0,Qd:"function"===typeof e?e:!1};f.promise=new this.constructor(function(g,k){if("function"!==typeof g||"function"!==typeof k)throw TypeError("Not a function");f.resolve=g;f.reject=k});b.N.push(f);0!==b.state&&pa(Ea,b);return f.promise};this["catch"]=function(c){return this.then(void 0,
|
|
12
|
-
c)};try{a.call(void 0,function(c){bb.call(b,c)},function(c){ja.call(b,c)})}catch(c){ja.call(b,c)}}function eb(a,b,c){function e(f){
|
|
12
|
+
c)};try{a.call(void 0,function(c){bb.call(b,c)},function(c){ja.call(b,c)})}catch(c){ja.call(b,c)}}function eb(a,b,c){function e(f){z.error(b+" error: "+f)}return{pa:function(f){(f=c(a,f))||z.error(b+" unsupported");return f},error:e,get:function(f){try{return a.getItem(f)}catch(g){e(g)}return null},parse:function(f){try{return d.ga(a.getItem(f))||{}}catch(g){}return null},set:function(f,g){try{a.setItem(f,g)}catch(k){e(k)}},remove:function(f){try{a.removeItem(f)}catch(g){e(g)}}}}function Fa(a){var b=
|
|
13
13
|
{};a=fb(a).split(" ");for(var c=0;c<a.length;c++){var e=a[c];e&&(b[e]=!0)}return b}function fb(a){switch(typeof a.className){case "string":return a.className;case "object":return a.className.qf||a.getAttribute("class")||"";default:return""}}function Nb(a){if(a.previousElementSibling)return a.previousElementSibling;do a=a.previousSibling;while(a&&(!a||1!==a.nodeType));return a}function gb(a,b,c,e,f,g){var k={$classes:fb(a).split(" "),$tag_name:a.tagName.toLowerCase()},h=a.id;h&&(k.$id=h);Ga(a,b,f,
|
|
14
14
|
g)&&d.h(Ob.concat(e),function(p){if(a.hasAttribute(p)&&!c[p]){var q=a.getAttribute(p);qa(q)&&(k["$attr-"+p]=q)}});e=b=1;for(f=a;f=Nb(f);)b++,f.tagName===a.tagName&&e++;k.$nth_child=b;k.$nth_of_type=e;return k}function Pb(a,b){var c=b.Ad,e=b.Bd||[],f=b.Fd,g=b.Gd||[],k=b.Jd||!1,h=b.Id||[],p=b.Kd||!1,q={};d.h(b.Ed||[],function(v){q[v]=!0});var n=null,m="undefined"===typeof a.target?a.srcElement:a.target;m&&3===m.nodeType&&(m=m.parentNode);if(Qb(m,a)&&Ha(m,a,c,e)&&!Ia(m,a,f,g)){b=[m];for(var t=m;t.parentNode&&
|
|
15
15
|
!P(t,"body");)b.push(t.parentNode),t=t.parentNode;var w=[],u,G=!1;d.h(b,function(v){var N=Ga(v,a,c,e);q.href||"a"!==v.tagName.toLowerCase()||(u=v.getAttribute("href"),u=N&&qa(u)&&u);Ia(v,a,f,g)&&(G=!0);w.push(gb(v,a,q,h,c,e))},this);if(!G&&(b=B.documentElement,n={$event_type:a.type,$host:r.location.host,$pathname:r.location.pathname,$elements:w,$el_attr__href:u,$viewportHeight:Math.max(b.clientHeight,r.innerHeight||0),$viewportWidth:Math.max(b.clientWidth,r.innerWidth||0),$pageHeight:B.body.offsetHeight||
|
|
@@ -18,15 +18,15 @@ function hb(a,b,c,e){var f="";Ga(a,b,c,e)&&a.childNodes&&a.childNodes.length&&d.
|
|
|
18
18
|
function Ha(a,b,c,e){if(c)try{if(!c(a,b))return!1}catch(f){return J.s("Error while checking element in allowElementCallback",f),!1}if(!e.length)return!0;for(b=0;b<e.length;b++){c=e[b];try{if(a.matches(c))return!0}catch(f){J.s("Error while checking selector: "+c,f)}}return!1}function Ia(a,b,c,e){if(c)try{if(c(a,b))return!0}catch(f){return J.s("Error while checking element in blockElementCallback",f),!0}if(e&&e.length)for(b=0;b<e.length;b++){c=e[b];try{if(a.matches(c))return!0}catch(f){J.s("Error while checking selector: "+
|
|
19
19
|
c,f)}}a=Fa(a);for(b=0;b<Ja.length;b++)if(a[Ja[b]])return!0;return!1}function P(a,b){return a&&a.tagName&&a.tagName.toLowerCase()===b.toLowerCase()}function Qb(a,b){if(!a||P(a,"html")||!a||1!==a.nodeType)return!1;switch(a.tagName.toLowerCase()){case "form":return"submit"===b.type;case "input":return-1===["button","submit"].indexOf(a.getAttribute("type"))?"change"===b.type:"click"===b.type;case "select":case "textarea":return"change"===b.type;default:return"click"===b.type}}function Ga(a,b,c,e){if(!Ha(a,
|
|
20
20
|
b,c,e))return!1;for(c=a;c.parentNode&&!P(c,"body");c=c.parentNode)for(e=Fa(c),b=0;b<ib.length;b++)if(e[ib[b]])return!1;c=Fa(a);for(b=0;b<jb.length;b++)if(c[jb[b]])return!0;if(P(a,"input")||P(a,"select")||P(a,"textarea")||"true"===a.getAttribute("contenteditable"))return!1;b=a.type||"";if("string"===typeof b)switch(b.toLowerCase()){case "hidden":return!1;case "password":return!1}a=a.name||a.id||"";return"string"===typeof a&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,
|
|
21
|
-
""))?!1:!0}function qa(a){return null===a||d.l(a)||"string"===typeof a&&(a=d.trim(a),/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((a||"").replace(/[- ]/g,""))||/(^\d{3}-?\d{2}-?\d{4}$)/.test(a))?!1:!0}function kb(){this.W=[]}function Tb(a,b){lb(!0,a,b)}function Ub(a,b){lb(!1,a,b)}function Vb(a,b){return"1"===mb(a,b)}function nb(a,b){if(Wb(b))return
|
|
22
|
-
!0;(a="0"===mb(a,b))&&
|
|
23
|
-
a}function mb(a,b){return La(b).get(Ma(a,b))}function Wb(a){if(a&&a.Dc)return!1;a=a&&a.window||r;var b=a.navigator||{},c=!1;d.h([b.doNotTrack,b.msDoNotTrack,a.doNotTrack],function(e){d.includes([!0,1,"1","yes"],e)&&(c=!0)});return c}function lb(a,b,c){d.Cb(b)&&b.length?(c=c||{},La(c).set(Ma(b,c),a?1:0,d.le(c.pc)?c.pc:null,!!c.qc,!!c.Ge,!!c.Ld,c.oc),c.track&&a&&c.track(c.cf||"$opt_in",c.ef,{send_immediately:!0})):
|
|
24
|
-
!1;try{var e=b.call(this,"token"),f=b.call(this,"ignore_dnt"),g=b.call(this,"opt_out_tracking_persistence_type"),k=b.call(this,"opt_out_tracking_cookie_prefix"),h=b.call(this,"window");e&&(c=nb(e,{Dc:f,Pc:g,Oc:k,window:h}))}catch(p){
|
|
21
|
+
""))?!1:!0}function qa(a){return null===a||d.l(a)||"string"===typeof a&&(a=d.trim(a),/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((a||"").replace(/[- ]/g,""))||/(^\d{3}-?\d{2}-?\d{4}$)/.test(a))?!1:!0}function kb(){this.W=[]}function Tb(a,b){lb(!0,a,b)}function Ub(a,b){lb(!1,a,b)}function Vb(a,b){return"1"===mb(a,b)}function nb(a,b){if(Wb(b))return z.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),
|
|
22
|
+
!0;(a="0"===mb(a,b))&&z.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data.");return a}function Y(a){return Ka(a,function(b){return this.g(b)})}function V(a){return Ka(a,function(b){return this.I(b)})}function ca(a){return Ka(a,function(b){return this.I(b)})}function Xb(a,b){b=b||{};La(b).remove(Ma(a,b),!!b.qc,b.oc)}function La(a){a=a||{};return"localStorage"===a.Pc?d.localStorage:d.cookie}function Ma(a,b){b=b||{};return(b.Oc||"__mp_opt_in_out_")+
|
|
23
|
+
a}function mb(a,b){return La(b).get(Ma(a,b))}function Wb(a){if(a&&a.Dc)return!1;a=a&&a.window||r;var b=a.navigator||{},c=!1;d.h([b.doNotTrack,b.msDoNotTrack,a.doNotTrack],function(e){d.includes([!0,1,"1","yes"],e)&&(c=!0)});return c}function lb(a,b,c){d.Cb(b)&&b.length?(c=c||{},La(c).set(Ma(b,c),a?1:0,d.le(c.pc)?c.pc:null,!!c.qc,!!c.Ge,!!c.Ld,c.oc),c.track&&a&&c.track(c.cf||"$opt_in",c.ef,{send_immediately:!0})):z.error("gdpr."+(a?"optIn":"optOut")+" called with an invalid token")}function Ka(a,b){return function(){var c=
|
|
24
|
+
!1;try{var e=b.call(this,"token"),f=b.call(this,"ignore_dnt"),g=b.call(this,"opt_out_tracking_persistence_type"),k=b.call(this,"opt_out_tracking_cookie_prefix"),h=b.call(this,"window");e&&(c=nb(e,{Dc:f,Pc:g,Oc:k,window:h}))}catch(p){z.error("Unexpected error when checking tracking opt-out status: "+p)}if(!c)return a.apply(this,arguments);c=arguments[arguments.length-1];"function"===typeof c&&c(0)}}var S=!1;if("undefined"===typeof window){var ob={hostname:""};var r={crypto:{tf:function(){throw Error("unsupported");
|
|
25
25
|
}},navigator:{userAgent:"",onLine:!0},document:{createElement:function(){return{}},location:ob,referrer:""},screen:{width:0,height:0},location:ob,addEventListener:function(){},removeEventListener:function(){}}}else r=window;var pb=r.setImmediate,Da,qb=Object.prototype.toString,Lb="undefined"!==typeof pb?function(a){return pb(a)}:setTimeout;try{Object.defineProperty({},"x",{});var Z=function(a,b,c,e){return Object.defineProperty(a,b,{value:c,writable:!0,configurable:!1!==e})}}catch(a){Z=function(b,
|
|
26
26
|
c,e){b[c]=e;return b}}var $a=function(){function a(f,g){this.Sd=f;this.self=g;this.next=void 0}var b,c,e;return{add:function(f,g){e=new a(f,g);c?c.next=e:b=e;c=e;e=void 0},Od:function(){var f=b;for(b=c=Da=void 0;f;)f.Sd.call(f.self),f=f.next}}}();var rb=Z({},"constructor",U,!1);U.prototype=rb;Z(rb,"__NPO__",0,!1);Z(U,"resolve",function(a){return a&&"object"===typeof a&&1===a.__NPO__?a:new this(function(b,c){if("function"!==typeof b||"function"!==typeof c)throw TypeError("Not a function");b(a)})});
|
|
27
27
|
Z(U,"reject",function(a){return new this(function(b,c){if("function"!==typeof b||"function"!==typeof c)throw TypeError("Not a function");c(a)})});Z(U,"all",function(a){var b=this;return"[object Array]"!==qb.call(a)?b.reject(TypeError("Not an array")):0===a.length?b.resolve([]):new b(function(c,e){if("function"!==typeof c||"function"!==typeof e)throw TypeError("Not a function");var f=a.length,g=Array(f),k=0;db(b,a,function(h,p){g[h]=p;++k===f&&c(g)},e)})});Z(U,"race",function(a){var b=this;return"[object Array]"!==
|
|
28
28
|
qb.call(a)?b.reject(TypeError("Not an array")):new b(function(c,e){if("function"!==typeof c||"function"!==typeof e)throw TypeError("Not a function");db(b,a,function(f,g){c(g)},e)})});var D="undefined"!==typeof Promise&&-1!==Promise.toString().indexOf("[native code]")?Promise:U;var ra=Array.prototype,sb=Object.prototype,aa=ra.slice,ka=sb.toString,sa=sb.hasOwnProperty,F=r.console,W=r.navigator,B=r.document,ta=r.opera,tb=r.screen,H=W.userAgent,Na=Function.prototype.bind,ub=ra.forEach,vb=ra.indexOf,wb=
|
|
29
|
-
ra.map,Yb=Array.isArray,Oa={},d={trim:function(a){return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},
|
|
29
|
+
ra.map,Yb=Array.isArray,Oa={},d={trim:function(a){return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},z={log:function(){if(S&&!d.l(F)&&F)try{F.log.apply(F,arguments)}catch(a){d.h(arguments,function(b){F.log(b)})}},warn:function(){if(S&&!d.l(F)&&F){var a=["Mixpanel warning:"].concat(d.ea(arguments));try{F.warn.apply(F,a)}catch(b){d.h(a,function(c){F.warn(c)})}}},error:function(){if(S&&!d.l(F)&&F){var a=["Mixpanel error:"].concat(d.ea(arguments));try{F.error.apply(F,a)}catch(b){d.h(a,function(c){F.error(c)})}}},
|
|
30
30
|
s:function(){if(!d.l(F)&&F){var a=["Mixpanel error:"].concat(d.ea(arguments));try{F.error.apply(F,a)}catch(b){d.h(a,function(c){F.error(c)})}}}};d.bind=function(a,b){var c;if(Na&&a.bind===Na)return Na.apply(a,aa.call(arguments,1));if(!d.Bb(a))throw new TypeError;var e=aa.call(arguments,2);return c=function(){if(!(this instanceof c))return a.apply(b,e.concat(aa.call(arguments)));var f={};f.prototype=a.prototype;var g=new f;f.prototype=null;f=a.apply(g,e.concat(aa.call(arguments)));return Object(f)===
|
|
31
31
|
f?f:g}};d.h=function(a,b,c){if(null!==a&&void 0!==a)if(ub&&a.forEach===ub)a.forEach(b,c);else if(a.length===+a.length)for(var e=0,f=a.length;e<f&&!(e in a&&b.call(c,a[e],e,a)===Oa);e++);else for(e in a)if(sa.call(a,e)&&b.call(c,a[e],e,a)===Oa)break};d.extend=function(a){d.h(aa.call(arguments,1),function(b){for(var c in b)void 0!==b[c]&&(a[c]=b[c])});return a};d.isArray=Yb||function(a){return"[object Array]"===ka.call(a)};d.Bb=function(a){try{return/^\s*\bfunction\b/.test(a)}catch(b){return!1}};d.ie=
|
|
32
32
|
function(a){return!(!a||!sa.call(a,"callee"))};d.ea=function(a){return a?a.ea?a.ea():d.isArray(a)||d.ie(a)?aa.call(a):d.values(a):[]};d.map=function(a,b,c){if(wb&&a.map===wb)return a.map(b,c);var e=[];d.h(a,function(f){e.push(b.call(c,f))});return e};d.keys=function(a){var b=[];if(null===a)return b;d.h(a,function(c,e){b[b.length]=e});return b};d.values=function(a){var b=[];if(null===a)return b;d.h(a,function(c){b[b.length]=c});return b};d.zb=function(a,b){var c=!1;if(null===a)return c;if(vb&&a.indexOf===
|
|
@@ -41,11 +41,11 @@ t=void 0}return t;case "[":a:{t=[];if("["===h){f("[");b();if("]"===h){f("]");bre
|
|
|
41
41
|
g=h>>12&63;k=h>>6&63;h&=63;e[c++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(k)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h)}while(b<a.length);b=e.join("");switch(a.length%3){case 1:b=b.slice(0,-2)+"==";break;case 2:b=b.slice(0,-1)+"="}return b};d.nf=function(a){a=(a+"").replace(/\r\n/g,
|
|
42
42
|
"\n").replace(/\r/g,"\n");var b="",c,e;var f=c=0;var g=a.length;for(e=0;e<g;e++){var k=a.charCodeAt(e),h=null;128>k?c++:h=127<k&&2048>k?String.fromCharCode(k>>6|192,k&63|128):String.fromCharCode(k>>12|224,k>>6&63|128,k&63|128);null!==h&&(c>f&&(b+=a.substring(f,c)),b+=h,f=c=e+1)}c>f&&(b+=a.substring(f,a.length));return b};d.Ta=function(){try{return r.crypto.randomUUID()}catch(c){for(var a=Array(36),b=0;36>b;b++)a[b]=Math.floor(16*Math.random());a[14]=4;a[19]=a[19]&=-5;a[19]=a[19]|=8;a[8]=a[13]=a[18]=
|
|
43
43
|
a[23]="-";return d.map(a,function(e){return e.toString(16)}).join("")}};var xb="ahrefsbot;ahrefssiteaudit;amazonbot;baiduspider;bingbot;bingpreview;chrome-lighthouse;facebookexternal;petalbot;pinterest;screaming frog;yahoo! slurp;yandex;adsbot-google;apis-google;duplexweb-google;feedfetcher-google;google favicon;google web preview;google-read-aloud;googlebot;googleweblight;mediapartners-google;storebot-google".split(";");d.Gc=function(a){var b;a=a.toLowerCase();for(b=0;b<xb.length;b++)if(-1!==a.indexOf(xb[b]))return!0;
|
|
44
|
-
return!1};d.Ub=function(a){var b,c,e,f=[];d.l(b)&&(b="&");d.h(a,function(g,k){c=encodeURIComponent(g.toString());e=encodeURIComponent(k);f[f.length]=e+"="+c});return f.join(b)};d.vb=function(a,b){b=b.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");a=(new RegExp("[\\?&]"+b+"=([^&#]*)")).exec(a);if(null===a||a&&"string"!==typeof a[1]&&a[1].length)return"";a=a[1];try{a=decodeURIComponent(a)}catch(c){
|
|
44
|
+
return!1};d.Ub=function(a){var b,c,e,f=[];d.l(b)&&(b="&");d.h(a,function(g,k){c=encodeURIComponent(g.toString());e=encodeURIComponent(k);f[f.length]=e+"="+c});return f.join(b)};d.vb=function(a,b){b=b.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");a=(new RegExp("[\\?&]"+b+"=([^&#]*)")).exec(a);if(null===a||a&&"string"!==typeof a[1]&&a[1].length)return"";a=a[1];try{a=decodeURIComponent(a)}catch(c){z.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")};d.cookie={get:function(a){a+=
|
|
45
45
|
"=";for(var b=B.cookie.split(";"),c=0;c<b.length;c++){for(var e=b[c];" "==e.charAt(0);)e=e.substring(1,e.length);if(0===e.indexOf(a))return decodeURIComponent(e.substring(a.length,e.length))}return null},parse:function(a){try{var b=d.ga(d.cookie.get(a))||{}}catch(c){}return b},uf:function(a,b,c,e,f,g,k){var h="",p="",q="";k?h="; domain="+k:e&&(h=(h=Xa(B.location.hostname))?"; domain=."+h:"");c&&(p=new Date,p.setTime(p.getTime()+1E3*c),p="; expires="+p.toGMTString());g&&(f=!0,q="; SameSite=None");
|
|
46
46
|
f&&(q+="; secure");B.cookie=a+"="+encodeURIComponent(b)+p+"; path=/"+h+q},set:function(a,b,c,e,f,g,k){var h="",p="",q="";k?h="; domain="+k:e&&(h=(h=Xa(B.location.hostname))?"; domain=."+h:"");c&&(p=new Date,p.setTime(p.getTime()+864E5*c),p="; expires="+p.toGMTString());g&&(f=!0,q="; SameSite=None");f&&(q+="; secure");a=a+"="+encodeURIComponent(b)+p+"; path=/"+h+q;return B.cookie=a},remove:function(a,b,c){d.cookie.set(a,"",-1,b,!1,!1,c)}};var Aa=null,Pa=null;d.localStorage=eb(r.localStorage,"localStorage",
|
|
47
47
|
oa);d.sessionStorage=eb(r.sessionStorage,"sessionStorage",function(a,b){return null===Pa||b?Pa=Ya(a||r.sessionStorage):Pa});d.Tc=function(){function a(c,e,f){return function(g){if(g=g||b(r.event)){var k=!0,h;d.Bb(f)&&(h=f(g));g=e.call(c,g);if(!1===h||!1===g)k=!1;return k}}}function b(c){c&&(c.preventDefault=b.preventDefault,c.stopPropagation=b.stopPropagation);return c}b.preventDefault=function(){this.returnValue=!1};b.stopPropagation=function(){this.cancelBubble=!0};return function(c,e,f,g,k){c?
|
|
48
|
-
c.addEventListener&&!g?c.addEventListener(e,f,!!k):(e="on"+e,c[e]=a(c,f,c[e])):
|
|
48
|
+
c.addEventListener&&!g?c.addEventListener(e,f,!!k):(e="on"+e,c[e]=a(c,f,c[e])):z.error("No valid element provided to register_event")}}();var Zb=/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/;d.Nd=function(){function a(f){return f.all?f.all:f.getElementsByTagName("*")}function b(f,g){g=" "+g+" ";return 0<=(" "+f.className+" ").replace(e," ").indexOf(g)}function c(f){if(!B.getElementsByTagName)return[];f=f.split(" ");var g,k,h,p,q=[B];for(k=0;k<f.length;k++){var n=f[k].replace(/^\s+/,"").replace(/\s+$/,
|
|
49
49
|
"");if(-1<n.indexOf("#")){var m=n.split("#");n=m[0];q=B.getElementById(m[1]);if(!q||n&&q.nodeName.toLowerCase()!=n)return[];q=[q]}else if(-1<n.indexOf(".")){m=n.split(".");n=m[0];var t=m[1];n||(n="*");m=[];for(h=g=0;h<q.length;h++){var w="*"==n?a(q[h]):q[h].getElementsByTagName(n);for(p=0;p<w.length;p++)m[g++]=w[p]}q=[];for(h=n=0;h<m.length;h++)m[h].className&&d.Cb(m[h].className)&&b(m[h],t)&&(q[n++]=m[h])}else if(m=n.match(Zb)){n=m[1];var u=m[2];t=m[3];var G=m[4];n||(n="*");m=[];for(h=g=0;h<q.length;h++)for(w=
|
|
50
50
|
"*"==n?a(q[h]):q[h].getElementsByTagName(n),p=0;p<w.length;p++)m[g++]=w[p];q=[];n=0;switch(t){case "=":t=function(v){return v.getAttribute(u)==G};break;case "~":t=function(v){return v.getAttribute(u).match(new RegExp("\\b"+G+"\\b"))};break;case "|":t=function(v){return v.getAttribute(u).match(new RegExp("^"+G+"-?"))};break;case "^":t=function(v){return 0===v.getAttribute(u).indexOf(G)};break;case "$":t=function(v){return v.getAttribute(u).lastIndexOf(G)==v.getAttribute(u).length-G.length};break;case "*":t=
|
|
51
51
|
function(v){return-1<v.getAttribute(u).indexOf(G)};break;default:t=function(v){return v.getAttribute(u)}}q=[];for(h=n=0;h<m.length;h++)t(m[h])&&(q[n++]=m[h])}else{m=[];for(h=g=0;h<q.length;h++)for(w=q[h].getElementsByTagName(n),p=0;p<w.length;p++)m[g++]=w[p];q=m}}return q}var e=/[\t\r\n]/g;return function(f){return d.ke(f)?[f]:d.j(f)&&!d.l(f.length)?f:c.call(this,f)}}();var $b="utm_source utm_medium utm_campaign utm_content utm_term utm_id utm_source_platform utm_campaign_id utm_creative_format utm_marketing_tactic".split(" "),
|
|
@@ -55,7 +55,7 @@ ac="dclid fbclid gclid ko_click_id li_fat_id msclkid sccid ttclid twclid wbraid"
|
|
|
55
55
|
"Trident/")?"Internet Explorer":d.includes(a,"Gecko")?"Mozilla":""},kb:function(a,b,c){b={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,
|
|
56
56
|
BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/,"Whale Browser":/Whale\/(\d+(\.\d+)?)/}[d.info.Da(a,b,c)];return void 0===b?null:(a=a.match(b))?parseFloat(a[a.length-2]):null},Lc:function(){return/Windows/i.test(H)?/Phone/.test(H)||/WPDesktop/.test(H)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(H)?"iOS":/Android/.test(H)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(H)?
|
|
57
57
|
"BlackBerry":/Mac/i.test(H)?"Mac OS X":/Linux/.test(H)?"Linux":/CrOS/.test(H)?"Chrome OS":""},uc:function(a){return/Windows Phone/i.test(a)||/WPDesktop/.test(a)?"Windows Phone":/iPad/.test(a)?"iPad":/iPod/.test(a)?"iPod Touch":/iPhone/.test(a)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(a)?"BlackBerry":/Android/.test(a)?"Android":""},Sc:function(a){a=a.split("/");return 3<=a.length?a[2]:""},Ga:function(){return r.location.href},sa:function(a){"object"!==typeof a&&(a={});return d.extend(d.da({$os:d.info.Lc(),
|
|
58
|
-
$browser:d.info.Da(H,W.vendor,ta),$referrer:B.referrer,$referring_domain:d.info.Sc(B.referrer),$device:d.info.uc(H)}),{$current_url:d.info.Ga(),$browser_version:d.info.kb(H,W.vendor,ta),$screen_height:tb.height,$screen_width:tb.width,mp_lib:"web",$lib_version:"2.
|
|
58
|
+
$browser:d.info.Da(H,W.vendor,ta),$referrer:B.referrer,$referring_domain:d.info.Sc(B.referrer),$device:d.info.uc(H)}),{$current_url:d.info.Ga(),$browser_version:d.info.kb(H,W.vendor,ta),$screen_height:tb.height,$screen_width:tb.width,mp_lib:"web",$lib_version:"2.69.0",$insert_id:za(),time:d.timestamp()/1E3},d.da(a))},ze:function(){return d.extend(d.da({$os:d.info.Lc(),$browser:d.info.Da(H,W.vendor,ta)}),{$browser_version:d.info.kb(H,W.vendor,ta)})},ve:function(){return d.da({current_page_title:B.title,
|
|
59
59
|
current_domain:r.location.hostname,current_url_path:r.location.pathname,current_url_protocol:r.location.protocol,current_url_search:r.location.search})}};var Kb=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,Jb=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,da=null,ua=null;"undefined"!==typeof JSON&&(da=JSON.stringify,ua=JSON.parse);da=da||d.Vb;ua=ua||d.ga;d.info=d.info;d.info.browser=d.info.Da;d.info.browserVersion=d.info.kb;d.info.device=d.info.uc;d.info.properties=d.info.sa;d.isBlockedUA=d.Gc;d.isEmptyObject=d.Ma;d.isObject=
|
|
60
60
|
d.j;d.JSONDecode=d.ga;d.JSONEncode=d.Vb;d.toArray=d.ea;d.NPO=U;var Rb="clientX clientY offsetX offsetY pageX pageY screenX screenY x y".split(" "),jb=["mp-include"],Ja=["mp-no-track"],ib=Ja.concat(["mp-sensitive"]),Ob="aria-label aria-labelledby aria-describedby href name role title type".split(" "),J=ia("autocapture");kb.prototype.me=function(a,b,c){c=c||{};var e=c.threshold_px||30,f=c.timeout_ms||1E3;c=c.click_count||4;var g=Date.now(),k=this.W[this.W.length-1];if(k&&g-k.timestamp<f&&Math.sqrt(Math.pow(a-
|
|
61
61
|
k.x,2)+Math.pow(b-k.y,2))<e){if(this.W.push({x:a,y:b,timestamp:g}),this.W.length>=c)return this.W=[],!0}else this.W=[{x:a,y:b,timestamp:g}];return!1};var yb={allow_selectors:[],allow_url_regexes:[],block_attrs:[],block_element_callback:null,block_selectors:[],block_url_regexes:[],capture_extra_attrs:[],capture_text_content:!1,scroll_capture_all:!1,scroll_depth_percent_checkpoints:[25,50,75,100],click:!0,input:!0,pageview:"full-url",rage_click:!0,scroll:!0,submit:!0},va={$mp_autocapture:!0};I.prototype.B=
|
|
@@ -67,27 +67,27 @@ var a="",b=!1;this.na()||(b=this.A.Qb(va));b&&(a=d.info.Ga());this.re=r.addEvent
|
|
|
67
67
|
g,k){e.call(r.history,f,g,k);r.dispatchEvent(new Event("mp_locationchange"))});this.qe=r.addEventListener("mp_locationchange",Ba(function(){if(!this.na()){var f=d.info.Ga(),g=!1,k=f.split("#")[0].split("?")[0]!==a.split("#")[0].split("?")[0],h=this.Nc();"full-url"===h?g=f!==a:"url-with-path-and-query-string"===h?g=f.split("#")[0]!==a.split("#")[0]:"url-with-path"===h&&(g=k);g&&(this.A.Qb(va)&&(a=f),k&&(this.Na=0,J.log("Path change: re-initializing scroll depth checkpoints")))}}.bind(this)))}};I.prototype.ee=
|
|
68
68
|
function(){r.removeEventListener("click",this.Ic);if(this.$a()||this.A.g("record_heatmap_data"))J.log("Initializing rage click tracking"),this.ec||(this.ec=new kb),this.Ic=function(a){var b=this.$a();if(b||this.A.Eb())this.na()||this.ec.me(a.pageX,a.pageY,b)&&this.Ra(a,"$mp_rage_click")}.bind(this),r.addEventListener("click",this.Ic)};I.prototype.fe=function(){r.removeEventListener("scrollend",this.se);this.m("scroll")&&(J.log("Initializing scroll tracking"),this.Na=0,this.se=r.addEventListener("scrollend",
|
|
69
69
|
Ba(function(){if(this.m("scroll")&&!this.na()){var a=this.m("scroll_capture_all"),b=(this.m("scroll_depth_percent_checkpoints")||[]).slice().sort(function(h,p){return h-p}),c=r.scrollY,e=d.extend({$scroll_top:c},va);try{var f=B.body.scrollHeight,g=Math.round(c/(f-r.innerHeight)*100);e.$scroll_height=f;e.$scroll_percentage=g;if(g>this.Na)for(c=0;c<b.length;c++){var k=b[c];g>=k&&this.Na<k&&(this.Na=e.$scroll_checkpoint=k,a=!0)}}catch(h){J.s("Error while calculating scroll percentage",h)}a&&this.A.track("$mp_scroll",
|
|
70
|
-
e)}}.bind(this))))};I.prototype.ge=function(){r.removeEventListener("submit",this.te);this.m("submit")&&(J.log("Initializing submit tracking"),this.te=r.addEventListener("submit",function(a){this.m("submit")&&this.Ra(a,"$mp_submit")}.bind(this)))};Za(I);var bc=r.fetch,K=ia("flags"),zb={context:{}};
|
|
71
|
-
|
|
72
|
-
return!!this.flags};
|
|
73
|
-
e.flags;if(!e)throw Error("No flags in API response");var f=new Map;d.h(e,function(g,k){f.set(k,{key:g.variant_key,value:g.variant_value})});this.flags=f}.bind(this)).catch(function(e){this.Fb();K.error(e)}.bind(this))}.bind(this)).catch(function(c){this.Fb();K.error(c)}.bind(this))};
|
|
74
|
-
this.sb.then(function(){return this.wb(a,b)}.bind(this)).catch(function(c){K.error(c);return b}):new Promise(function(c){K.s("Feature Flags not initialized");c(b)})};
|
|
75
|
-
return this.xb(a,b)};
|
|
76
|
-
{"Experiment name":a,"Variant name":b.key,$experiment_type:"feature_flag","Variant fetch start time":(new Date(this.bc)).toISOString(),"Variant fetch complete time":(new Date(this.ac)).toISOString(),"Variant fetch latency (ms)":this.td}))};Za(
|
|
77
|
-
|
|
70
|
+
e)}}.bind(this))))};I.prototype.ge=function(){r.removeEventListener("submit",this.te);this.m("submit")&&(J.log("Initializing submit tracking"),this.te=r.addEventListener("submit",function(a){this.m("submit")&&this.Ra(a,"$mp_submit")}.bind(this)))};Za(I);var bc=r.fetch,K=ia("flags"),zb={context:{}};A.prototype.B=function(){bc&&"undefined"!==typeof Promise&&"undefined"!==typeof Map&&"undefined"!==typeof Set?(this.flags=null,this.rb(),this.gd=new Set):K.s("Feature Flags unavailable: missing minimum required APIs")};
|
|
71
|
+
A.prototype.ub=function(){var a=this.Ja("flags");return a?d.j(a)?d.extend({},zb,a):zb:{}};A.prototype.m=function(a){return this.ub()[a]};A.prototype.Db=function(){return!!this.Ja("flags")};A.prototype.lf=function(a,b){if(!this.Db())return K.s("Feature Flags not enabled, cannot update context"),Promise.resolve();var c=this.Ja("flags");d.j(c)||(c={});b=b&&b.replace?{}:this.m("context");c.context=d.extend({},b,a);this.Me("flags",c);return this.rb()};A.prototype.jc=function(){this.Db()||K.error("Feature Flags not enabled");
|
|
72
|
+
return!!this.flags};A.prototype.rb=function(){if(!this.Db())return Promise.resolve();var a=this.wc("distinct_id"),b=this.wc("$device_id");K.log("Fetching flags for distinct ID: "+a);a={context:d.extend({distinct_id:a,device_id:b},this.m("context"))};this.Za=Date.now();return this.sb=r.fetch(this.tb(),{method:"POST",headers:{Authorization:"Basic "+btoa(this.Ja("token")+":"),"Content-Type":"application/octet-stream"},body:JSON.stringify(a)}).then(function(c){this.Fb();return c.json().then(function(e){e=
|
|
73
|
+
e.flags;if(!e)throw Error("No flags in API response");var f=new Map;d.h(e,function(g,k){f.set(k,{key:g.variant_key,value:g.variant_value})});this.flags=f}.bind(this)).catch(function(e){this.Fb();K.error(e)}.bind(this))}.bind(this)).catch(function(c){this.Fb();K.error(c)}.bind(this))};A.prototype.Fb=function(){this.Za?(this.bc=this.Za,this.ac=Date.now(),this.td=this.ac-this.bc,this.Za=null):K.error("Fetch in progress started time not set, cannot mark fetch complete")};A.prototype.xc=function(a,b){return this.sb?
|
|
74
|
+
this.sb.then(function(){return this.wb(a,b)}.bind(this)).catch(function(c){K.error(c);return b}):new Promise(function(c){K.s("Feature Flags not initialized");c(b)})};A.prototype.wb=function(a,b){if(!this.jc())return K.log("Flags not loaded yet"),b;var c=this.flags.get(a);if(!c)return K.log('No flag found: "'+a+'"'),b;this.df(a,c);return c};A.prototype.xb=function(a,b){return this.xc(a,{value:b}).then(function(c){return c.value}).catch(function(c){K.error(c);return b})};A.prototype.Vd=function(a,b){K.s("mixpanel.flags.get_feature_data() is deprecated and will be removed in a future release. Use mixpanel.flags.get_variant_value() instead.");
|
|
75
|
+
return this.xb(a,b)};A.prototype.yc=function(a,b){return this.wb(a,{value:b}).value};A.prototype.isEnabled=function(a,b){return this.xb(a).then(function(){return this.Hc(a,b)}.bind(this)).catch(function(c){K.error(c);return b})};A.prototype.Hc=function(a,b){b=b||!1;var c=this.yc(a,b);!0!==c&&!1!==c&&(K.error('Feature flag "'+a+'" value: '+c+" is not a boolean; returning fallback value: "+b),c=b);return c};A.prototype.df=function(a,b){this.gd.has(a)||(this.gd.add(a),this.track("$experiment_started",
|
|
76
|
+
{"Experiment name":a,"Variant name":b.key,$experiment_type:"feature_flag","Variant fetch start time":(new Date(this.bc)).toISOString(),"Variant fetch complete time":(new Date(this.ac)).toISOString(),"Variant fetch latency (ms)":this.td}))};Za(A);A.prototype.are_flags_ready=A.prototype.jc;A.prototype.get_variant=A.prototype.xc;A.prototype.get_variant_sync=A.prototype.wb;A.prototype.get_variant_value=A.prototype.xb;A.prototype.get_variant_value_sync=A.prototype.yc;A.prototype.is_enabled=A.prototype.isEnabled;
|
|
77
|
+
A.prototype.is_enabled_sync=A.prototype.Hc;A.prototype.update_context=A.prototype.lf;A.prototype.get_feature_data=A.prototype.Vd;Q.prototype.Fa=function(){};Q.prototype.pb=function(){};Q.prototype.hb=function(){};Q.prototype.B=function(a){this.A=a;return this};Q.prototype.track=function(a,b,c,e){var f=this,g=d.Nd(a);if(0===g.length)z.error("The DOM query ("+a+") returned 0 elements");else return d.h(g,function(k){d.Tc(k,this.Mc,function(h){var p={},q=f.Fa(c,this),n=f.A.g("track_links_timeout");f.pb(h,
|
|
78
78
|
this,p);window.setTimeout(f.fd(e,q,p,!0),n);f.A.track(b,q,f.fd(e,q,p))})},this),!0};Q.prototype.fd=function(a,b,c,e){e=e||!1;var f=this;return function(){c.Hd||(c.Hd=!0,a&&!1===a(e,b)||f.hb(c))}};Q.prototype.Fa=function(a,b){return"function"===typeof a?a(b):d.extend({},a)};d.Fc(ba,Q);ba.prototype.Fa=function(a,b){var c=ba.Ze.Fa.apply(this,arguments);b.href&&(c.url=b.href);return c};ba.prototype.pb=function(a,b,c){c.Jc=2===a.which||a.metaKey||a.ctrlKey||"_blank"===b.target;c.href=b.href;c.Jc||a.preventDefault()};
|
|
79
79
|
ba.prototype.hb=function(a){a.Jc||setTimeout(function(){window.location=a.href},0)};d.Fc(na,Q);na.prototype.pb=function(a,b,c){c.element=b;a.preventDefault()};na.prototype.hb=function(a){setTimeout(function(){a.element.submit()},0)};var cc=ia("lock");Va.prototype.Tb=function(a,b){return new this.Rc(d.bind(function(c,e){function f(){function L(){u.removeItem(N);u.getItem(v)===q&&u.removeItem(v);u.getItem(G)===q&&u.removeItem(G)}u.setItem(N,"1");a().then(function(X){L();c(X)}).catch(function(X){L();
|
|
80
80
|
e(X)})}function g(){u.setItem(G,q);h(k,function(){u.getItem(G)===q?f():p(function(){u.getItem(v)!==q?g():h(function(){return!u.getItem(N)},f)})})}function k(){var L=u.getItem(v);if(L&&L!==q)return!1;u.setItem(v,q);if(u.getItem(v)===q)return!0;oa(u,!0)||e(Error("localStorage support dropped while acquiring lock"));return!1}function h(L,X){L()?X():p(function(){h(L,X)})}function p(L){(new Date).getTime()-n>w?(cc.error("Timeout waiting for mutex on "+m+"; clearing lock. ["+q+"]"),u.removeItem(N),u.removeItem(v),
|
|
81
81
|
g()):setTimeout(function(){try{L()}catch(X){e(X)}},t*(Math.random()+.1))}var q=b||(new Date).getTime()+"|"+Math.random(),n=(new Date).getTime(),m=this.ca,t=this.Qc,w=this.Pb,u=this.storage,G=m+":X",v=m+":Y",N=m+":Z";try{if(oa(u,!0))g();else throw Error("localStorage support check failed");}catch(L){e(L)}},this))};fa.prototype.B=function(){return D.resolve()};fa.prototype.setItem=function(a,b){return new D(d.bind(function(c,e){try{this.storage.setItem(a,da(b))}catch(f){e(f)}c()},this))};fa.prototype.getItem=
|
|
82
|
-
function(a){return new D(d.bind(function(b,c){try{var e=ua(this.storage.getItem(a))}catch(f){c(f)}b(e)},this))};fa.prototype.removeItem=function(a){return new D(d.bind(function(b,c){try{this.storage.removeItem(a)}catch(e){c(e)}b()},this))};var Wa=ia("batch");O.prototype.T=function(){return this.Ab?D.resolve():this.P.B().then(d.bind(function(){this.Ab=!0},this)).catch(d.bind(function(a){this.o("Error initializing queue persistence. Disabling persistence",a);this.Ab=!0;this.
|
|
83
|
-
function(a,b){a={id:za(),flushAfter:(new Date).getTime()+2*b,payload:a};if(this.
|
|
84
|
-
c);return!1},this))};O.prototype.Rd=function(a){var b=this.K.slice(0,a);return this.
|
|
82
|
+
function(a){return new D(d.bind(function(b,c){try{var e=ua(this.storage.getItem(a))}catch(f){c(f)}b(e)},this))};fa.prototype.removeItem=function(a){return new D(d.bind(function(b,c){try{this.storage.removeItem(a)}catch(e){c(e)}b()},this))};var Wa=ia("batch");O.prototype.T=function(){return this.Ab||!this.C?D.resolve():this.P.B().then(d.bind(function(){this.Ab=!0},this)).catch(d.bind(function(a){this.o("Error initializing queue persistence. Disabling persistence",a);this.Ab=!0;this.C=!1},this))};O.prototype.enqueue=
|
|
83
|
+
function(a,b){a={id:za(),flushAfter:(new Date).getTime()+2*b,payload:a};if(this.C)return this.Pd(a);this.K.push(a);return D.resolve(!0)};O.prototype.Zb=function(a){var b=d.bind(function(){return this.T().then(d.bind(function(){return this.va()},this)).then(d.bind(function(c){return this.Jb(c.concat(a))},this)).then(d.bind(function(c){c&&(this.K=this.K.concat(a));return c},this)).catch(d.bind(function(c){this.o("Error enqueueing items",c,a);return!1},this))},this);return this.lock.Tb(b,this.Qa).catch(d.bind(function(c){this.o("Error acquiring storage lock",
|
|
84
|
+
c);return!1},this))};O.prototype.Rd=function(a){var b=this.K.slice(0,a);return this.C&&b.length<a?this.T().then(d.bind(function(){return this.va()},this)).then(d.bind(function(c){if(c.length){var e={};d.h(b,function(k){e[k.id]=!0});for(var f=0;f<c.length;f++){var g=c[f];if((new Date).getTime()>g.flushAfter&&!e[g.id]&&(g.xe=!0,b.push(g),b.length>=a))break}}return b},this)):D.resolve(b)};O.prototype.Ae=function(a){var b={};d.h(a,function(e){b[e]=!0});this.K=Ua(this.K,b);if(this.C){var c=d.bind(function(){return this.T().then(d.bind(function(){return this.va()},
|
|
85
85
|
this)).then(d.bind(function(e){e=Ua(e,b);return this.Jb(e)},this)).then(d.bind(function(){return this.va()},this)).then(d.bind(function(e){for(var f=0;f<e.length;f++){var g=e[f];if(g.id&&b[g.id])throw Error("Item not removed from storage");}return!0},this)).catch(d.bind(function(e){this.o("Error removing items",e,a);return!1},this))},this);return this.lock.Tb(c,this.Qa).catch(d.bind(function(e){this.o("Error acquiring storage lock",e);return oa(this.lock.storage,!0)?!1:c().then(d.bind(function(f){return f?
|
|
86
|
-
f:this.P.removeItem(this.ca).then(function(){return f})},this)).catch(d.bind(function(f){this.o("Error clearing queue",f);return!1},this))},this))}return D.resolve(!0)};O.prototype.mf=function(a){this.K=Ta(this.K,a);return this.
|
|
86
|
+
f:this.P.removeItem(this.ca).then(function(){return f})},this)).catch(d.bind(function(f){this.o("Error clearing queue",f);return!1},this))},this))}return D.resolve(!0)};O.prototype.mf=function(a){this.K=Ta(this.K,a);return this.C?this.lock.Tb(d.bind(function(){return this.T().then(d.bind(function(){return this.va()},this)).then(d.bind(function(b){b=Ta(b,a);return this.Jb(b)},this)).catch(d.bind(function(b){this.o("Error updating items",a,b);return!1},this))},this),this.Qa).catch(d.bind(function(b){this.o("Error acquiring storage lock",
|
|
87
87
|
b);return!1},this)):D.resolve(!0)};O.prototype.va=function(){return this.T().then(d.bind(function(){return this.P.getItem(this.ca)},this)).then(d.bind(function(a){a&&!d.isArray(a)&&(this.o("Invalid storage entry:",a),a=null);return a||[]},this)).catch(d.bind(function(a){this.o("Error retrieving queue",a);return[]},this))};O.prototype.Jb=function(a){return this.T().then(d.bind(function(){return this.P.setItem(this.ca,a)},this)).then(function(){return!0}).catch(d.bind(function(b){this.o("Error saving queue",
|
|
88
|
-
b);return!1},this))};O.prototype.clear=function(){this.K=[];return this.
|
|
88
|
+
b);return!1},this))};O.prototype.clear=function(){this.K=[];return this.C?this.T().then(d.bind(function(){return this.P.removeItem(this.ca)},this)):D.resolve()};var la=ia("batch");M.prototype.enqueue=function(a){return this.ta.enqueue(a,this.Ia)};M.prototype.start=function(){this.stopped=!1;this.lb=0;return this.flush()};M.prototype.stop=function(){this.stopped=!0;this.Ob&&(clearTimeout(this.Ob),this.Ob=null)};M.prototype.clear=function(){return this.ta.clear()};M.prototype.Vc=function(){this.S=this.O.batch_size};
|
|
89
89
|
M.prototype.aa=function(){this.Xc(this.O.batch_flush_interval_ms)};M.prototype.Xc=function(a){this.Ia=a;this.stopped||(this.Ob=setTimeout(d.bind(function(){this.stopped||this.flush()},this),this.Ia))};M.prototype.Je=function(a,b){return new D(d.bind(function(c){this.He(a,b,c)},this))};M.prototype.flush=function(a){if(this.Ib)return la.log("Flush: Request already in progress"),D.resolve();this.Ib=!0;a=a||{};var b=this.O.batch_request_timeout_ms,c=(new Date).getTime(),e=this.S;return this.ta.Rd(e).then(d.bind(function(f){var g=
|
|
90
|
-
f.length===e,k=[],h={};d.h(f,function(m){var t=m.payload;this.Ca&&!m.xe&&(t=this.Ca(t));if(t){t.event&&t.properties&&(t.properties=d.extend({},t.properties,{mp_sent_by_lib_version:"2.
|
|
90
|
+
f.length===e,k=[],h={};d.h(f,function(m){var t=m.payload;this.Ca&&!m.xe&&(t=this.Ca(t));if(t){t.event&&t.properties&&(t.properties=d.extend({},t.properties,{mp_sent_by_lib_version:"2.69.0"}));var w=!0,u=m.id;u?5<(this.V[u]||0)&&(this.o("[dupe] item ID sent too many times, not sending",{item:m,S:f.length,bf:this.V[u]}),w=!1):this.o("[dupe] found item with no ID",{item:m});w&&k.push(t)}h[m.id]=t},this);if(1>k.length)return this.Ib=!1,this.aa(),D.resolve();var p=d.bind(function(){return this.ta.Ae(d.map(f,
|
|
91
91
|
function(m){return m.id})).then(d.bind(function(m){d.h(f,d.bind(function(t){var w=t.id;w?(this.V[w]=this.V[w]||0,this.V[w]++,5<this.V[w]&&this.o("[dupe] item ID sent too many times",{item:t,S:f.length,bf:this.V[w]})):this.o("[dupe] found item with no ID while removing",{item:t})},this));if(m)return this.lb=0,this.vc&&!g?(this.aa(),D.resolve()):this.flush();5<++this.lb?(this.o("Too many queue failures; disabling batching system."),this.Ve()):this.aa();return D.resolve()},this))},this),q=d.bind(function(m){this.Ib=
|
|
92
92
|
!1;try{if(a.jd)return this.ta.mf(h);if(d.j(m)&&"timeout"===m.error&&(new Date).getTime()-c>=b)return this.o("Network timeout; retrying"),this.flush();var t;if(t=d.j(m)){var w;if(!(w=500<=m.La||429===m.La)){var u;if(u=0>=m.La){var G=r.navigator.onLine;u=!(d.l(G)||G)}w=u}t=w||"timeout"===m.error}if(t){var v=2*this.Ia;m.Wc&&(v=1E3*parseInt(m.Wc,10)||v);v=Math.min(6E5,v);this.o("Error; retry in "+v+" ms");this.Xc(v);return D.resolve()}if(d.j(m)&&413===m.La){if(1<f.length)return this.S=Math.min(this.S,
|
|
93
93
|
Math.max(1,Math.floor(e/2)),f.length-1),this.o("413 response; reducing batch size to "+this.S),this.aa(),D.resolve();this.o("Single-event request too large; dropping",f);this.Vc()}return p()}catch(N){this.o("Error handling API response",N),this.aa()}},this),n={method:"POST",nd:!0,ae:!0,ed:b};a.jd&&(n.Rb="sendBeacon");la.log("MIXPANEL REQUEST:",k);return this.Je(k,n).then(q)},this)).catch(d.bind(function(f){this.o("Error flushing request queue",f);this.aa()},this))};M.prototype.o=function(a,b){la.error.apply(la.error,
|
|
@@ -96,10 +96,10 @@ g){this.M(g)||(e[g]=d.isArray(f)?f:[f])},this):e[a]=d.isArray(b)?b:[b];c.$union=
|
|
|
96
96
|
(c=b);return this.u(e,c)});C.prototype.ba=ca(function(a,b,c){var e=this.ad(a,b);d.j(a)&&(c=b);return this.u(e,c)});C.prototype.Sa=ca(function(a,b){a=this.kd(a);return this.u(a,b)});C.prototype.xa=ca(function(a,b,c){d.j(a)&&(c=b);a=this.hd(a,b);return this.u(a,c)});C.prototype["delete"]=ca(function(a){return this.u({$delete:""},a)});C.prototype.remove=ca(function(a,b,c){a=this.Uc(a,b);return this.u(a,c)});C.prototype.u=function(a,b){a.$group_key=this.cb;a.$group_id=this.bb;a.$token=this.I("token");
|
|
97
97
|
a=d.nb(a);return this.i.gb({type:"groups",data:a,endpoint:this.i.$("groups")+"/"+this.I("api_routes").groups,jb:this.i.H.groups},b)};C.prototype.M=function(a){return"$group_key"===a||"$group_id"===a};C.prototype.I=function(a){return this.i.g(a)};C.prototype.toString=function(){return this.i.toString()+".group."+this.cb+"."+this.bb};C.prototype.remove=C.prototype.remove;C.prototype.set=C.prototype.set;C.prototype.set_once=C.prototype.ba;C.prototype.union=C.prototype.xa;C.prototype.unset=C.prototype.Sa;
|
|
98
98
|
C.prototype.toString=C.prototype.toString;d.extend(x.prototype,Ab);x.prototype.la=function(a){this.i=a};x.prototype.set=V(function(a,b,c){var e=this.Zc(a,b);d.j(a)&&(c=b);this.I("save_referrer")&&this.i.persistence.Sb(document.referrer);e.$set=d.extend({},d.info.ze(),e.$set);return this.u(e,c)});x.prototype.ba=V(function(a,b,c){var e=this.ad(a,b);d.j(a)&&(c=b);return this.u(e,c)});x.prototype.Sa=V(function(a,b){a=this.kd(a);return this.u(a,b)});x.prototype.Ec=V(function(a,b,c){var e={},f={};d.j(a)?
|
|
99
|
-
(d.h(a,function(g,k){this.M(k)||(isNaN(parseFloat(g))?
|
|
100
|
-
x.prototype.lc=function(a){return this.set("$transactions",[],a)};x.prototype.tc=function(){if(this.eb()){var a={$delete:this.i.U()};return this.u(a)}
|
|
99
|
+
(d.h(a,function(g,k){this.M(k)||(isNaN(parseFloat(g))?z.error("Invalid increment value passed to mixpanel.people.increment - must be a number"):f[k]=g)},this),c=b):(d.l(b)&&(b=1),f[a]=b);e.$add=f;return this.u(e,c)});x.prototype.append=V(function(a,b,c){d.j(a)&&(c=b);a=this.Cd(a,b);return this.u(a,c)});x.prototype.remove=V(function(a,b,c){d.j(a)&&(c=b);a=this.Uc(a,b);return this.u(a,c)});x.prototype.xa=V(function(a,b,c){d.j(a)&&(c=b);a=this.hd(a,b);return this.u(a,c)});x.prototype.ff=V(function(){z.error("mixpanel.people.track_charge() is deprecated and no longer has any effect.")});
|
|
100
|
+
x.prototype.lc=function(a){return this.set("$transactions",[],a)};x.prototype.tc=function(){if(this.eb()){var a={$delete:this.i.U()};return this.u(a)}z.error("mixpanel.people.delete_user() requires you to call identify() first")};x.prototype.toString=function(){return this.i.toString()+".people"};x.prototype.u=function(a,b){a.$token=this.I("token");a.$distinct_id=this.i.U();var c=this.i.F("$device_id"),e=this.i.F("$user_id"),f=this.i.F("$had_persisted_distinct_id");c&&(a.$device_id=c);e&&(a.$user_id=
|
|
101
101
|
e);f&&(a.$had_persisted_distinct_id=f);c=d.nb(a);return this.eb()?this.i.gb({type:"people",data:c,endpoint:this.i.$("people")+"/"+this.I("api_routes").engage,jb:this.i.H.Hb},b):(this.sd(a),d.l(b)||(this.I("verbose")?b({status:-1,error:null}):b(-1)),d.truncate(c,255))};x.prototype.I=function(a){return this.i.g(a)};x.prototype.eb=function(){return!0===this.i.ia.Cc};x.prototype.sd=function(a){"$set"in a?this.i.persistence.G("$set",a):"$set_once"in a?this.i.persistence.G("$set_once",a):"$unset"in a?this.i.persistence.G("$unset",
|
|
102
|
-
a):"$add"in a?this.i.persistence.G("$add",a):"$append"in a?this.i.persistence.G("$append",a):"$remove"in a?this.i.persistence.G("$remove",a):"$union"in a?this.i.persistence.G("$union",a):
|
|
102
|
+
a):"$add"in a?this.i.persistence.G("$add",a):"$append"in a?this.i.persistence.G("$append",a):"$remove"in a?this.i.persistence.G("$remove",a):"$union"in a?this.i.persistence.G("$union",a):z.error("Invalid call to _enqueue():",a)};x.prototype.ja=function(a,b,c,e){var f=this,g=d.extend({},this.i.persistence.qa(a)),k=g;d.l(g)||!d.j(g)||d.Ma(g)||(f.i.persistence.J(a,g),f.i.persistence.save(),e&&(k=e(g)),b.call(f,k,function(h,p){0===h&&f.i.persistence.G(a,g);d.l(c)||c(h,p)}))};x.prototype.ud=function(a,
|
|
103
103
|
b,c,e,f,g,k){var h=this;this.ja("$set",this.set,a);this.ja("$set_once",this.ba,e);this.ja("$unset",this.Sa,g,function(n){return d.keys(n)});this.ja("$add",this.Ec,b);this.ja("$union",this.xa,f);a=this.i.persistence.qa("$append");if(!d.l(a)&&d.isArray(a)&&a.length)for(b=function(n,m){0===n&&h.i.persistence.G("$append",p);d.l(c)||c(n,m)},e=a.length-1;0<=e;e--){a=this.i.persistence.qa("$append");var p=a.pop();h.i.persistence.save();d.Ma(p)||h.append(p,b)}a=this.i.persistence.qa("$remove");if(!d.l(a)&&
|
|
104
104
|
d.isArray(a)&&a.length)for(b=function(n,m){0===n&&h.i.persistence.G("$remove",q);d.l(k)||k(n,m)},e=a.length-1;0<=e;e--){a=this.i.persistence.qa("$remove");var q=a.pop();h.i.persistence.save();d.Ma(q)||h.remove(q,b)}};x.prototype.M=function(a){return"$distinct_id"===a||"$token"===a||"$device_id"===a||"$user_id"===a||"$had_persisted_distinct_id"===a};x.prototype.set=x.prototype.set;x.prototype.set_once=x.prototype.ba;x.prototype.unset=x.prototype.Sa;x.prototype.increment=x.prototype.Ec;x.prototype.append=
|
|
105
105
|
x.prototype.append;x.prototype.remove=x.prototype.remove;x.prototype.union=x.prototype.xa;x.prototype.track_charge=x.prototype.ff;x.prototype.clear_charges=x.prototype.lc;x.prototype.delete_user=x.prototype.tc;x.prototype.toString=x.prototype.toString;var dc="__mps __mpso __mpus __mpa __mpap __mpr __mpu $people_distinct_id __alias __timers".split(" ");y.prototype.sa=function(){var a={};this.load();d.h(this.props,function(b,c){d.zb(dc,c)||(a[c]=b)});return a};y.prototype.load=function(){if(!this.disabled){var a=
|
|
@@ -108,8 +108,8 @@ return this.props[a]};y.prototype.remove=function(){this.storage.remove(this.nam
|
|
|
108
108
|
typeof b?this.sc:b,this.load(),d.extend(this.props,a),this.save(),!0):!1};y.prototype.unregister=function(a){this.load();a in this.props&&(delete this.props[a],this.save())};y.prototype.md=function(a){this.register(d.info.Fe(a))};y.prototype.Sb=function(a){this.L({$initial_referrer:a||"$direct",$initial_referring_domain:d.info.Sc(a)||"$direct"},"")};y.prototype.Zd=function(){return d.da({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})};
|
|
109
109
|
y.prototype.ld=function(a){this.sc=this.qb=a.cookie_expiration;this.$c(a.disable_persistence);this.Ne(a.cookie_domain);this.Oe(a.cross_site_cookie);this.Pe(a.cross_subdomain_cookie);this.Se(a.secure_cookie)};y.prototype.$c=function(a){(this.disabled=a)?this.remove():this.save()};y.prototype.Ne=function(a){a!==this.Ea&&(this.remove(),this.Ea=a,this.save())};y.prototype.Oe=function(a){a!==this.rc&&(this.rc=a,this.remove(),this.save())};y.prototype.Pe=function(a){a!==this.mb&&(this.mb=a,this.remove(),
|
|
110
110
|
this.save())};y.prototype.Xd=function(){return this.mb};y.prototype.Se=function(a){a!==this.Yc&&(this.Yc=a?!0:!1,this.remove(),this.save())};y.prototype.G=function(a,b){var c=this.za(a);a=b[a];var e=this.R("$set"),f=this.R("$set_once"),g=this.R("$unset"),k=this.R("$add"),h=this.R("$union"),p=this.R("$remove",[]),q=this.R("$append",[]);"__mps"===c?(d.extend(e,a),this.J("$add",a),this.J("$union",a),this.J("$unset",a)):"__mpso"===c?(d.h(a,function(n,m){m in f||(f[m]=n)}),this.J("$unset",a)):"__mpus"===
|
|
111
|
-
c?d.h(a,function(n){d.h([e,f,k,h],function(m){n in m&&delete m[n]});d.h(q,function(m){n in m&&delete m[n]});g[n]=!0}):"__mpa"===c?(d.h(a,function(n,m){m in e?e[m]+=n:(m in k||(k[m]=0),k[m]+=n)},this),this.J("$unset",a)):"__mpu"===c?(d.h(a,function(n,m){d.isArray(n)&&(m in h||(h[m]=[]),d.h(n,function(t){d.zb(h[m],t)||h[m].push(t)}))}),this.J("$unset",a)):"__mpr"===c?(p.push(a),this.J("$append",a)):"__mpap"===c&&(q.push(a),this.J("$unset",a));
|
|
112
|
-
|
|
111
|
+
c?d.h(a,function(n){d.h([e,f,k,h],function(m){n in m&&delete m[n]});d.h(q,function(m){n in m&&delete m[n]});g[n]=!0}):"__mpa"===c?(d.h(a,function(n,m){m in e?e[m]+=n:(m in k||(k[m]=0),k[m]+=n)},this),this.J("$unset",a)):"__mpu"===c?(d.h(a,function(n,m){d.isArray(n)&&(m in h||(h[m]=[]),d.h(n,function(t){d.zb(h[m],t)||h[m].push(t)}))}),this.J("$unset",a)):"__mpr"===c?(p.push(a),this.J("$append",a)):"__mpap"===c&&(q.push(a),this.J("$unset",a));z.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):");
|
|
112
|
+
z.log(b);this.save()};y.prototype.J=function(a,b){var c=this.props[this.za(a)];d.l(c)||d.h(b,function(e,f){"$append"===a||"$remove"===a?d.h(c,function(g){g[f]===e&&delete g[f]}):delete c[f]},this)};y.prototype.qa=function(a){return this.Oa(this.za(a))};y.prototype.za=function(a){if("$set"===a)return"__mps";if("$set_once"===a)return"__mpso";if("$unset"===a)return"__mpus";if("$add"===a)return"__mpa";if("$append"===a)return"__mpap";if("$remove"===a)return"__mpr";if("$union"===a)return"__mpu";z.error("Invalid queue:",
|
|
113
113
|
a)};y.prototype.R=function(a,b){a=this.za(a);b=d.l(b)?{}:b;return this.props[a]||(this.props[a]=b)};y.prototype.Qe=function(a){var b=(new Date).getTime(),c=this.Oa("__timers")||{};c[a]=b;this.props.__timers=c;this.save()};y.prototype.Be=function(a){var b=(this.Oa("__timers")||{})[a];d.l(b)||(delete this.props.__timers[a],this.save());return b};var ec=["mixpanelRecordingEvents","mixpanelRecordingRegistry"];T.prototype.cc=function(){return new D(function(a,b){var c=r.indexedDB.open("mixpanelBrowserDb",
|
|
114
114
|
1);c.onerror=function(){b(c.error)};c.onsuccess=function(){a(c.result)};c.onupgradeneeded=function(e){var f=e.target.result;ec.forEach(function(g){f.createObjectStore(g)})}})};T.prototype.B=function(){if(!r.indexedDB)return D.reject("indexedDB is not supported in this browser");this.X||(this.X=this.cc());return this.X.then(function(a){return a instanceof r.IDBDatabase?D.resolve():D.reject(a)})};T.prototype.Pa=function(a,b){function c(f){return new D(function(g,k){var h=f.transaction(e,a);h.oncomplete=
|
|
115
115
|
function(){g(h)};h.onabort=h.onerror=function(){k(h.error)};b(h.objectStore(e))})}var e=this.Xe;return this.X.then(c).catch(function(f){return f&&"InvalidStateError"===f.name?(this.X=this.cc(),this.X.then(c)):D.reject(f)}.bind(this))};T.prototype.setItem=function(a,b){return this.Pa("readwrite",function(c){c.put(b,a)})};T.prototype.getItem=function(a){var b;return this.Pa("readonly",function(c){b=c.get(a)}).then(function(){return b.result})};T.prototype.removeItem=function(a){return this.Pa("readwrite",
|
|
@@ -118,37 +118,37 @@ api_routes:Bb,api_extra_query_params:{},api_method:"POST",api_transport:"XHR",ap
|
|
|
118
118
|
debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5E3,batch_request_timeout_ms:9E4,batch_autostart:!0,hooks:{},record_block_class:/^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$/,
|
|
119
119
|
record_block_selector:"img, video, audio",record_canvas:!1,record_collect_fonts:!1,record_heatmap_data:!1,record_idle_timeout_ms:18E5,record_mask_text_class:/^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$/,record_mask_text_selector:"*",record_max_ms:864E5,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},Qa=!1;l.prototype.B=function(a,b,c){if(d.l(c))this.v("You must name your new library: init(token, config, name)");else if("mixpanel"===c)this.v("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");
|
|
120
120
|
else return a=ma(a,b,c),E[c]=a,a.Aa(),a};l.prototype.la=function(a,b,c){b=b||{};this.__loaded=!0;this.config={};var e={};"api_payload_format"in b||(b.api_host||Cb.api_host).match(/\.mixpanel\.com/)&&(e.api_payload_format="json");this.Kb(d.extend({},Cb,e,b,{name:c,token:a,callback_fn:("mixpanel"===c?c:"mixpanel."+c)+"._jsc"}));this._jsc=ha;this.Va=[];this.Wa=[];this.Ua=[];this.ia={disable_all_events:!1,identify_called:!1};this.H={};if(this.ha=this.g("batch_requests"))if(d.localStorage.pa(!0)&&ea){if(this.he(),
|
|
121
|
-
wa&&r.addEventListener){var f=d.bind(function(){this.H.Z.stopped||this.H.Z.flush({jd:!0})},this);r.addEventListener("pagehide",function(g){g.persisted&&f()});r.addEventListener("visibilitychange",function(){"hidden"===B.visibilityState&&f()})}}else this.ha=!1,
|
|
122
|
-
a=d.Ta();this.U()||this.L({distinct_id:"$device:"+a,$device_id:a},"");this.flags=new
|
|
123
|
-
d.sessionStorage.get(b)||d.sessionStorage.set(b,"$tab-"+d.Ta());d.sessionStorage.set(c,"1");this.$e=d.sessionStorage.get(b);r.addEventListener("beforeunload",function(){d.sessionStorage.remove(c)})}catch(e){this.v("Error initializing tab id",e)}else this.v("Session storage is not supported, cannot keep track of unique tab ID.")};l.prototype.Bc=function(){return this.$e||null};l.prototype.xd=function(){
|
|
124
|
-
0;e<c.length;e++){var f=c[e],g=Date.now();if(!f||g>f.maxExpires||g>f.idleExpires||c[e].tabId===b)return!0}return!1}).catch(d.bind(function(c){this.v("Error checking recording registry",c)},this))};l.prototype.Xa=Y(function(a){if(r.MutationObserver){var b=d.bind(function(e){var f=d.bind(function(){this.
|
|
125
|
-
a||c?b(!0):this.xd().then(function(e){e&&b(!1)})}else
|
|
126
|
-
function(){var a={},b=this.ab();b&&(a.$mp_replay_id=b);return a};l.prototype.$d=function(){var a=null,b=this.ab();b&&(a="https://mixpanel.com/projects/replay-redirect?"+d.Ub({replay_id:b,distinct_id:this.U(),token:this.g("token")}));return a};l.prototype.ab=function(){var a=null;this.
|
|
127
|
-
d.info.ma(null);d.h(a,function(b,c){this.unregister(c)}.bind(this))}};l.prototype.ic=function(){this.persistence.md(B.referrer);this.g("store_google")&&!this.g("stop_utm_persistence")&&this.register(d.info.ma());this.g("save_referrer")&&this.persistence.Sb(B.referrer)};l.prototype.rd=function(){d.h(this.Va,function(a){this.fb.apply(this,
|
|
128
|
-
|
|
129
|
-
(e=c,c=null);c=d.extend(g,c||{});ea||(c.method="GET");g="POST"===c.method;var h=wa&&g&&"sendbeacon"===c.Rb.toLowerCase(),p=c.nd;b.verbose&&(p=!0);this.g("test")&&(b.test=1);p&&(b.verbose=1);this.g("img")&&(b.img=1);if(!ea)if(e)b.callback=e;else if(p||this.g("test"))b.callback="(function(){})";
|
|
130
|
-
k.src=a,B.body.appendChild(k);else if(h){try{f=wa(a,k)}catch(w){q.v(w),f=!1}try{e&&e(f?1:0)}catch(w){q.v(w)}}else if(ea)try{var n=new XMLHttpRequest;n.open(c.method,a,!0);var m=this.g("xhr_headers");g&&(m["Content-Type"]="application/x-www-form-urlencoded");d.h(m,function(w,u){n.setRequestHeader(u,
|
|
131
|
-
c.ae)w=n.responseText;else return}e(w)}else e(Number(n.responseText))}else w=n.timeout&&!n.status&&(new Date).getTime()-t>=n.timeout?"timeout":"Bad HTTP status: "+n.status+" "+n.statusText,q.v(w),e&&(p?e({status:0,La:n.status,error:w,Wc:(n.responseHeaders||{})["Retry-After"]}):
|
|
132
|
-
h){d.h(k,function(p){if(d.isArray(p[0])){var q=h;d.h(p,function(n){q=q[n[0]].apply(q,n.slice(1))})}else this[p[0]].apply(this,p.slice(1))},h)}var c,e=[],f=[],g=[];d.h(a,function(k){k&&(c=k[0],d.isArray(c)?g.push(k):"function"===typeof k?k.call(this):d.isArray(k)&&
|
|
133
|
-
return this.Wb=this.Wb||{Z:{type:"events",Ba:"track",ua:a+"_ev"},Hb:{type:"people",Ba:"engage",ua:a+"_pp"},groups:{type:"groups",Ba:"groups",ua:a+"_gr"}}};l.prototype.he=function(){if(!this.kc()){var a=d.bind(function(c){return new M(c.ua,{O:this.config,
|
|
134
|
-
this.zc();this.H={Z:a(b.Z),Hb:a(b.Hb),groups:a(b.groups)}}this.g("batch_autostart")&&this.Lb()};l.prototype.Lb=function(){this.pd=!0;this.kc()&&(this.ha=!0,d.h(this.H,function(a){a.start()}))};l.prototype.Mb=function(){this.ha=!1;d.h(this.H,function(a){a.stop();
|
|
135
|
-
return{data:a}};l.prototype.gb=function(a,b){var c=d.truncate(a.data,255),e=a.endpoint,f=a.jb,g=a.Te,k=a.Ke||{};b=b||ha;var h=!0,p=d.bind(function(){k.dd||(c=this.hc("before_send_"+a.type,c));return c?(
|
|
136
|
-
typeof e&&(e=ha);if(d.l(a))this.v("No event name provided to mixpanel.track");else if(this.$b(a))e(0);else{b=d.extend({},b);b.token=this.g("token");var g=this.persistence.Be(a);d.l(g)||(b.$duration=parseFloat((((new Date).getTime()-g)/1E3).toFixed(3)));this.ic();
|
|
137
|
-
g);return this.gb({type:"events",data:{event:a,properties:b},endpoint:this.$("events")+"/"+this.g("api_routes").track,jb:this.H.Z,Te:f,Ke:c},e)}});l.prototype.Re=Y(function(a,b,c){d.isArray(b)||(b=[b]);var e={};e[a]=b;this.register(e);
|
|
138
|
-
e){var f=e.indexOf(b);-1<f&&(e.splice(f,1),this.register({sf:e}));0===e.length&&this.unregister(a)}return this.people.remove(a,b,c)});l.prototype.jf=Y(function(a,b,c,e){var f=d.extend({},b||{});d.h(c,function(g,k){null!==g&&void 0!==
|
|
139
|
-
b){"object"!==typeof a&&(a={});b=b||{};b=b.event_name||"$mp_web_page_view";var c=d.extend(d.info.ve(),d.info.ma(),d.info.nc());a=d.extend({},c,a);return this.track(b,a)});l.prototype.hf=function(){return this.fb.call(this,ba,arguments)};
|
|
140
|
-
|
|
141
|
-
typeof a&&0===a.indexOf("$device:"))return this.v("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:a})}this.
|
|
142
|
-
|
|
143
|
-
return-1};l.prototype.we=function(a){this.fc("mp_name_tag",a)};l.prototype.Kb=function(a){d.j(a)&&(d.extend(this.config,a),a.batch_size&&d.h(this.H,function(b){b.Vc()}),this.g("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.g("disable_persistence")||
|
|
144
|
-
function(a){return this.config[a]};l.prototype.hc=function(a){var b=(this.config.hooks[a]||Hb).apply(this,aa.call(arguments,1));"undefined"===typeof b&&(this.v(a+" hook did not return a value"),b=null);return b};l.prototype.
|
|
145
|
-
a)};l.prototype.vd=function(){"localStorage"===this.g("opt_out_tracking_persistence_type")&&d.localStorage.pa()&&(!this.Ka()&&this.Ka({persistence_type:"cookie"})&&this.Kc({enable_persistence:!1}),!this.oa()&&this.oa({persistence_type:"cookie"})&&this.Gb({clear_persistence:!1}),
|
|
146
|
-
l.prototype.ya=function(a){if(a&&a.clear_persistence)a=!0;else if(a&&a.enable_persistence)a=!1;else return;this.g("disable_persistence")||this.persistence.disabled===a||this.persistence.$c(a);a?(this.Mb(),this.Nb()):this.pd&&
|
|
147
|
-
cross_subdomain_cookie:this.g("cross_subdomain_cookie"),cookie_domain:this.g("cookie_domain"),secure_cookie:this.g("secure_cookie"),ignore_dnt:this.g("ignore_dnt")},b);d.localStorage.pa()||(b.persistence_type="cookie");
|
|
148
|
-
d.extend({enable_persistence:!0},a);this.ka(Tb,a);this.ya(a)};l.prototype.Gb=function(a){a=d.extend({clear_persistence:!0,delete_user:!0},a);a.delete_user&&this.people&&this.people.eb()&&(this.people.tc(),this.people.lc());
|
|
149
|
-
a instanceof Error||(a=Error(a)),this.g("error_reporter")(a,b)}catch(c){
|
|
150
|
-
l.prototype.
|
|
151
|
-
l.prototype.
|
|
152
|
-
l.prototype.
|
|
153
|
-
(function(a){Sa=a;xa=1;E=r.mixpanel;d.l(E)?
|
|
154
|
-
(d.h(E._i,function(b){b&&d.isArray(b)&&(R[b[b.length-1]]=ma.apply(this,b))}),Eb(),E.init(),d.h(R,function(b){b.Aa()}),Db())})(function(a,b){var c=document.createElement("script");c.type="text/javascript";c.async=!0;c.onload=b;c.src=a;document.head.appendChild(c)})})()
|
|
121
|
+
wa&&r.addEventListener){var f=d.bind(function(){this.H.Z.stopped||this.H.Z.flush({jd:!0})},this);r.addEventListener("pagehide",function(g){g.persisted&&f()});r.addEventListener("visibilitychange",function(){"hidden"===B.visibilityState&&f()})}}else this.ha=!1,z.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),d.h(this.zc(),function(g){z.log("Clearing batch queue "+g.ua);d.localStorage.remove(g.ua)});this.persistence=this.cookie=new y(this.config);this.fa={};this.vd();
|
|
122
|
+
a=d.Ta();this.U()||this.L({distinct_id:"$device:"+a,$device_id:a},"");this.flags=new A({tb:d.bind(function(){return this.$("flags")+"/"+this.g("api_routes").flags},this),Ud:d.bind(this.g,this),Le:d.bind(this.Kb,this),Wd:d.bind(this.F,this),kf:d.bind(this.track,this)});this.flags.B();this.flags=this.flags;this.ib=new I(this);this.ib.B();this.wd();this.Xa()};l.prototype.wd=function(){if(this.g("disable_persistence"))z.log("Tab ID initialization skipped due to disable_persistence config");else if(d.sessionStorage.pa())try{var a=
|
|
123
|
+
this.g("name")+"_"+this.g("token"),b="mp_tab_id_"+a,c="mp_gen_new_tab_id_"+a;!d.sessionStorage.get(c)&&d.sessionStorage.get(b)||d.sessionStorage.set(b,"$tab-"+d.Ta());d.sessionStorage.set(c,"1");this.$e=d.sessionStorage.get(b);r.addEventListener("beforeunload",function(){d.sessionStorage.remove(c)})}catch(e){this.v("Error initializing tab id",e)}else this.v("Session storage is not supported, cannot keep track of unique tab ID.")};l.prototype.Bc=function(){return this.$e||null};l.prototype.xd=function(){if(this.g("disable_persistence"))return z.log("Load recorder check skipped due to disable_persistence config"),
|
|
124
|
+
Promise.resolve(!1);var a=new T("mixpanelRecordingRegistry"),b=this.Bc();return a.B().then(function(){return a.getAll()}).then(function(c){for(var e=0;e<c.length;e++){var f=c[e],g=Date.now();if(!f||g>f.maxExpires||g>f.idleExpires||c[e].tabId===b)return!0}return!1}).catch(d.bind(function(c){this.v("Error checking recording registry",c)},this))};l.prototype.Xa=Y(function(a){if(r.MutationObserver){var b=d.bind(function(e){var f=d.bind(function(){this.D=this.D||new r.__mp_recorder(this);this.D.resumeRecording(e)},
|
|
125
|
+
this);d.l(r.__mp_recorder)?Sa(this.g("recorder_src"),f):f()},this),c=0<this.g("record_sessions_percent")&&100*Math.random()<=this.g("record_sessions_percent");a||c?b(!0):this.xd().then(function(e){e&&b(!1)})}else z.s("Browser does not support MutationObserver; skipping session recording")});l.prototype.Ue=function(){this.Xa(!0)};l.prototype.Nb=function(){return this.D?this.D.stopRecording():Promise.resolve()};l.prototype.ye=function(){return this.D?this.D.pauseRecording():Promise.resolve()};l.prototype.De=
|
|
126
|
+
function(){return this.D?this.D.resumeRecording():Promise.resolve()};l.prototype.Eb=function(){return this.ab()&&this.g("record_heatmap_data")};l.prototype.Ac=function(){var a={},b=this.ab();b&&(a.$mp_replay_id=b);return a};l.prototype.$d=function(){var a=null,b=this.ab();b&&(a="https://mixpanel.com/projects/replay-redirect?"+d.Ub({replay_id:b,distinct_id:this.U(),token:this.g("token")}));return a};l.prototype.ab=function(){var a=null;this.D&&(a=this.D.replayId);return a||null};l.prototype.od=function(){return this.D};
|
|
127
|
+
l.prototype.Aa=function(){this.g("loaded")(this);this.ic();this.people.ba(this.persistence.Zd());if(this.g("store_google")&&this.g("stop_utm_persistence")){var a=d.info.ma(null);d.h(a,function(b,c){this.unregister(c)}.bind(this))}};l.prototype.ic=function(){this.persistence.md(B.referrer);this.g("store_google")&&!this.g("stop_utm_persistence")&&this.register(d.info.ma());this.g("save_referrer")&&this.persistence.Sb(B.referrer)};l.prototype.rd=function(){d.h(this.Va,function(a){this.fb.apply(this,
|
|
128
|
+
a)},this);this.oa()||d.h(this.Wa,function(a){this.u.apply(this,a)},this);delete this.Va;delete this.Wa};l.prototype.fb=function(a,b){if(this.g("img"))return this.v("You can't use DOM tracking functions with img = true."),!1;if(!Qa)return this.Va.push([a,b]),!1;a=(new a).B(this);return a.track.apply(a,b)};l.prototype.dc=function(a,b){if(d.l(a))return null;if(ea)return function(g){a(g,b)};var c=this._jsc,e=""+Math.floor(1E8*Math.random()),f=this.g("callback_fn")+"["+e+"]";c[e]=function(g){delete c[e];
|
|
129
|
+
a(g,b)};return f};l.prototype.u=function(a,b,c,e){var f=!0;if(Ra)return this.Wa.push(arguments),f;var g={method:this.g("api_method"),Rb:this.g("api_transport"),nd:this.g("verbose")},k=null;e||!d.Bb(c)&&"string"!==typeof c||(e=c,c=null);c=d.extend(g,c||{});ea||(c.method="GET");g="POST"===c.method;var h=wa&&g&&"sendbeacon"===c.Rb.toLowerCase(),p=c.nd;b.verbose&&(p=!0);this.g("test")&&(b.test=1);p&&(b.verbose=1);this.g("img")&&(b.img=1);if(!ea)if(e)b.callback=e;else if(p||this.g("test"))b.callback="(function(){})";
|
|
130
|
+
b.ip=this.g("ip")?1:0;b._=(new Date).getTime().toString();g&&(k="data="+encodeURIComponent(b.data),delete b.data);d.extend(b,this.g("api_extra_query_params"));a+="?"+d.Ub(b);var q=this;if("img"in b)k=B.createElement("img"),k.src=a,B.body.appendChild(k);else if(h){try{f=wa(a,k)}catch(w){q.v(w),f=!1}try{e&&e(f?1:0)}catch(w){q.v(w)}}else if(ea)try{var n=new XMLHttpRequest;n.open(c.method,a,!0);var m=this.g("xhr_headers");g&&(m["Content-Type"]="application/x-www-form-urlencoded");d.h(m,function(w,u){n.setRequestHeader(u,
|
|
131
|
+
w)});if(c.ed&&"undefined"!==typeof n.timeout){n.timeout=c.ed;var t=(new Date).getTime()}n.withCredentials=!0;n.onreadystatechange=function(){if(4===n.readyState)if(200===n.status){if(e)if(p){try{var w=d.ga(n.responseText)}catch(u){if(q.v(u),c.ae)w=n.responseText;else return}e(w)}else e(Number(n.responseText))}else w=n.timeout&&!n.status&&(new Date).getTime()-t>=n.timeout?"timeout":"Bad HTTP status: "+n.status+" "+n.statusText,q.v(w),e&&(p?e({status:0,La:n.status,error:w,Wc:(n.responseHeaders||{})["Retry-After"]}):
|
|
132
|
+
e(0))};n.send(k)}catch(w){q.v(w),f=!1}else k=B.createElement("script"),k.type="text/javascript",k.async=!0,k.defer=!0,k.src=a,m=B.getElementsByTagName("script")[0],m.parentNode.insertBefore(k,m);return f};l.prototype.Ya=function(a){function b(k,h){d.h(k,function(p){if(d.isArray(p[0])){var q=h;d.h(p,function(n){q=q[n[0]].apply(q,n.slice(1))})}else this[p[0]].apply(this,p.slice(1))},h)}var c,e=[],f=[],g=[];d.h(a,function(k){k&&(c=k[0],d.isArray(c)?g.push(k):"function"===typeof k?k.call(this):d.isArray(k)&&
|
|
133
|
+
"alias"===c?e.push(k):d.isArray(k)&&-1!==c.indexOf("track")&&"function"===typeof this[c]?g.push(k):f.push(k))},this);b(e,this);b(f,this);b(g,this)};l.prototype.kc=function(){return!!this.H.Z};l.prototype.zc=function(){var a="__mpq_"+this.g("token");return this.Wb=this.Wb||{Z:{type:"events",Ba:"track",ua:a+"_ev"},Hb:{type:"people",Ba:"engage",ua:a+"_pp"},groups:{type:"groups",Ba:"groups",ua:a+"_gr"}}};l.prototype.he=function(){if(!this.kc()){var a=d.bind(function(c){return new M(c.ua,{O:this.config,
|
|
134
|
+
Y:this.g("error_reporter"),Ie:d.bind(function(e,f,g){this.u(this.$(c.Ba)+"/"+this.g("api_routes")[c.Ba],this.Yb(e),f,this.dc(g,e))},this),Ca:d.bind(function(e){return this.hc("before_send_"+c.type,e)},this),We:d.bind(this.Mb,this),C:!0})},this),b=this.zc();this.H={Z:a(b.Z),Hb:a(b.Hb),groups:a(b.groups)}}this.g("batch_autostart")&&this.Lb()};l.prototype.Lb=function(){this.pd=!0;this.kc()&&(this.ha=!0,d.h(this.H,function(a){a.start()}))};l.prototype.Mb=function(){this.ha=!1;d.h(this.H,function(a){a.stop();
|
|
135
|
+
a.clear()})};l.prototype.push=function(a){this.Ya([a])};l.prototype.disable=function(a){"undefined"===typeof a?this.ia.Md=!0:this.Ua=this.Ua.concat(a)};l.prototype.Yb=function(a){a=da(a);"base64"===this.g("api_payload_format")&&(a=d.Dd(a));return{data:a}};l.prototype.gb=function(a,b){var c=d.truncate(a.data,255),e=a.endpoint,f=a.jb,g=a.Te,k=a.Ke||{};b=b||ha;var h=!0,p=d.bind(function(){k.dd||(c=this.hc("before_send_"+a.type,c));return c?(z.log("MIXPANEL REQUEST:"),z.log(c),this.u(e,this.Yb(c),k,this.dc(b,
|
|
136
|
+
c))):null},this);this.ha&&!g?f.enqueue(c).then(function(q){q?b(1,c):p()}):h=p();return h&&c};l.prototype.track=Y(function(a,b,c,e){e||"function"!==typeof c||(e=c,c=null);c=c||{};var f=c.transport;f&&(c.Rb=f);f=c.send_immediately;"function"!==typeof e&&(e=ha);if(d.l(a))this.v("No event name provided to mixpanel.track");else if(this.$b(a))e(0);else{b=d.extend({},b);b.token=this.g("token");var g=this.persistence.Be(a);d.l(g)||(b.$duration=parseFloat((((new Date).getTime()-g)/1E3).toFixed(3)));this.ic();
|
|
137
|
+
g=this.g("track_marketing")?d.info.ue():{};b=d.extend({},d.info.sa({mp_loader:this.g("mp_loader")}),g,this.persistence.sa(),this.fa,this.Ac(),b);g=this.g("property_blacklist");d.isArray(g)?d.h(g,function(k){delete b[k]}):this.v("Invalid value for property_blacklist config: "+g);return this.gb({type:"events",data:{event:a,properties:b},endpoint:this.$("events")+"/"+this.g("api_routes").track,jb:this.H.Z,Te:f,Ke:c},e)}});l.prototype.Re=Y(function(a,b,c){d.isArray(b)||(b=[b]);var e={};e[a]=b;this.register(e);
|
|
138
|
+
return this.people.set(a,b,c)});l.prototype.yd=Y(function(a,b,c){var e=this.F(a),f={};void 0===e?(f[a]=[b],this.register(f)):-1===e.indexOf(b)&&(e.push(b),f[a]=e,this.register(f));return this.people.xa(a,b,c)});l.prototype.Ce=Y(function(a,b,c){var e=this.F(a);if(void 0!==e){var f=e.indexOf(b);-1<f&&(e.splice(f,1),this.register({sf:e}));0===e.length&&this.unregister(a)}return this.people.remove(a,b,c)});l.prototype.jf=Y(function(a,b,c,e){var f=d.extend({},b||{});d.h(c,function(g,k){null!==g&&void 0!==
|
|
139
|
+
g&&(f[k]=g)});return this.track(a,f,e)});l.prototype.qd=function(a,b){return a+"_"+JSON.stringify(b)};l.prototype.Yd=function(a,b){var c=this.qd(a,b),e=this.Xb[c];if(void 0===e||e.cb!==a||e.bb!==b)e=new C,e.la(this,a,b),this.Xb[c]=e;return e};l.prototype.Qb=Y(function(a,b){"object"!==typeof a&&(a={});b=b||{};b=b.event_name||"$mp_web_page_view";var c=d.extend(d.info.ve(),d.info.ma(),d.info.nc());a=d.extend({},c,a);return this.track(b,a)});l.prototype.hf=function(){return this.fb.call(this,ba,arguments)};
|
|
140
|
+
l.prototype.gf=function(){return this.fb.call(this,na,arguments)};l.prototype.af=function(a){d.l(a)?this.v("No event name provided to mixpanel.time_event"):this.$b(a)||this.persistence.Qe(a)};var Gb={persistent:!0};l.prototype.register=function(a,b){b=ya(b);b.persistent?this.persistence.register(a,b.days):d.extend(this.fa,a)};l.prototype.L=function(a,b,c){c=ya(c);c.persistent?this.persistence.L(a,b,c.days):("undefined"===typeof b&&(b="None"),d.h(a,function(e,f){this.fa.hasOwnProperty(f)&&this.fa[f]!==
|
|
141
|
+
b||(this.fa[f]=e)},this))};l.prototype.unregister=function(a,b){b=ya(b);b.persistent?this.persistence.unregister(a):delete this.fa[a]};l.prototype.fc=function(a,b){var c={};c[a]=b;this.register(c)};l.prototype.yb=function(a,b,c,e,f,g,k,h){var p=this.U();if(a&&p!==a){if("string"===typeof a&&0===a.indexOf("$device:"))return this.v("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:a})}this.F("$device_id")||this.L({$had_persisted_distinct_id:!0,$device_id:p},"");a!==p&&a!==this.F("__alias")&&
|
|
142
|
+
(this.unregister("__alias"),this.register({distinct_id:a}));this.ia.Cc=!0;this.people.ud(b,c,e,f,g,k,h);a!==p&&this.track("$identify",{distinct_id:a,$anon_distinct_id:p},{dd:!0});a!==p&&this.flags.rb()};l.prototype.reset=function(){this.Nb();this.persistence.clear();this.ia.Cc=!1;var a=d.Ta();this.L({distinct_id:"$device:"+a,$device_id:a},"");this.Xa()};l.prototype.U=function(){return this.F("distinct_id")};l.prototype.zd=function(a,b){if(a===this.F("$people_distinct_id"))return this.v("Attempting to create alias for existing People user - aborting."),
|
|
143
|
+
-2;var c=this;d.l(b)&&(b=this.U());if(a!==b)return this.fc("__alias",a),this.track("$create_alias",{alias:a,distinct_id:b},{dd:!0},function(){c.yb(a)});this.v("alias matches current distinct_id - skipping api call.");this.yb(a);return-1};l.prototype.we=function(a){this.fc("mp_name_tag",a)};l.prototype.Kb=function(a){d.j(a)&&(d.extend(this.config,a),a.batch_size&&d.h(this.H,function(b){b.Vc()}),this.g("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.g("disable_persistence")||
|
|
144
|
+
(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.ld(this.config),S=S||this.g("debug"),("autocapture"in a||"record_heatmap_data"in a)&&this.ib&&this.ib.B())};l.prototype.g=function(a){return this.config[a]};l.prototype.hc=function(a){var b=(this.config.hooks[a]||Hb).apply(this,aa.call(arguments,1));"undefined"===typeof b&&(this.v(a+" hook did not return a value"),b=null);return b};l.prototype.F=function(a){return this.persistence.Oa([a])};l.prototype.$=
|
|
145
|
+
function(a){return this.g("api_hosts")[a]||this.g("api_host")};l.prototype.toString=function(){var a=this.g("name");"mixpanel"!==a&&(a="mixpanel."+a);return a};l.prototype.$b=function(a){return d.Gc(H)||this.ia.Md||d.zb(this.Ua,a)};l.prototype.vd=function(){"localStorage"===this.g("opt_out_tracking_persistence_type")&&d.localStorage.pa()&&(!this.Ka()&&this.Ka({persistence_type:"cookie"})&&this.Kc({enable_persistence:!1}),!this.oa()&&this.oa({persistence_type:"cookie"})&&this.Gb({clear_persistence:!1}),
|
|
146
|
+
this.mc({persistence_type:"cookie",enable_persistence:!1}));this.oa()?this.ya({clear_persistence:!0}):this.Ka()||!this.g("opt_out_tracking_by_default")&&!d.cookie.get("mp_optout")||(d.cookie.remove("mp_optout"),this.Gb({clear_persistence:this.g("opt_out_persistence_by_default")}))};l.prototype.ya=function(a){if(a&&a.clear_persistence)a=!0;else if(a&&a.enable_persistence)a=!1;else return;this.g("disable_persistence")||this.persistence.disabled===a||this.persistence.$c(a);a?(this.Mb(),this.Nb()):this.pd&&
|
|
147
|
+
this.Lb()};l.prototype.ka=function(a,b){b=d.extend({track:d.bind(this.track,this),persistence_type:this.g("opt_out_tracking_persistence_type"),cookie_prefix:this.g("opt_out_tracking_cookie_prefix"),cookie_expiration:this.g("cookie_expiration"),cross_site_cookie:this.g("cross_site_cookie"),cross_subdomain_cookie:this.g("cross_subdomain_cookie"),cookie_domain:this.g("cookie_domain"),secure_cookie:this.g("secure_cookie"),ignore_dnt:this.g("ignore_dnt")},b);d.localStorage.pa()||(b.persistence_type="cookie");
|
|
148
|
+
return a(this.g("token"),{track:b.track,cf:b.track_event_name,ef:b.track_properties,Pc:b.persistence_type,Oc:b.cookie_prefix,oc:b.cookie_domain,pc:b.cookie_expiration,Ld:b.cross_site_cookie,qc:b.cross_subdomain_cookie,Ge:b.secure_cookie,Dc:b.ignore_dnt})};l.prototype.Kc=function(a){a=d.extend({enable_persistence:!0},a);this.ka(Tb,a);this.ya(a)};l.prototype.Gb=function(a){a=d.extend({clear_persistence:!0,delete_user:!0},a);a.delete_user&&this.people&&this.people.eb()&&(this.people.tc(),this.people.lc());
|
|
149
|
+
this.ka(Ub,a);this.ya(a)};l.prototype.Ka=function(a){return this.ka(Vb,a)};l.prototype.oa=function(a){return this.ka(nb,a)};l.prototype.mc=function(a){a=d.extend({enable_persistence:!0},a);this.ka(Xb,a);this.ya(a)};l.prototype.v=function(a,b){z.error.apply(z.error,arguments);try{b||a instanceof Error||(a=Error(a)),this.g("error_reporter")(a,b)}catch(c){z.error(c)}};l.prototype.init=l.prototype.B;l.prototype.reset=l.prototype.reset;l.prototype.disable=l.prototype.disable;l.prototype.time_event=l.prototype.af;
|
|
150
|
+
l.prototype.track=l.prototype.track;l.prototype.track_links=l.prototype.hf;l.prototype.track_forms=l.prototype.gf;l.prototype.track_pageview=l.prototype.Qb;l.prototype.register=l.prototype.register;l.prototype.register_once=l.prototype.L;l.prototype.unregister=l.prototype.unregister;l.prototype.identify=l.prototype.yb;l.prototype.alias=l.prototype.zd;l.prototype.name_tag=l.prototype.we;l.prototype.set_config=l.prototype.Kb;l.prototype.get_config=l.prototype.g;l.prototype.get_api_host=l.prototype.$;
|
|
151
|
+
l.prototype.get_property=l.prototype.F;l.prototype.get_distinct_id=l.prototype.U;l.prototype.toString=l.prototype.toString;l.prototype.opt_out_tracking=l.prototype.Gb;l.prototype.opt_in_tracking=l.prototype.Kc;l.prototype.has_opted_out_tracking=l.prototype.oa;l.prototype.has_opted_in_tracking=l.prototype.Ka;l.prototype.clear_opt_in_out_tracking=l.prototype.mc;l.prototype.get_group=l.prototype.Yd;l.prototype.set_group=l.prototype.Re;l.prototype.add_group=l.prototype.yd;l.prototype.remove_group=l.prototype.Ce;
|
|
152
|
+
l.prototype.track_with_groups=l.prototype.jf;l.prototype.start_batch_senders=l.prototype.Lb;l.prototype.stop_batch_senders=l.prototype.Mb;l.prototype.start_session_recording=l.prototype.Ue;l.prototype.stop_session_recording=l.prototype.Nb;l.prototype.pause_session_recording=l.prototype.ye;l.prototype.resume_session_recording=l.prototype.De;l.prototype.get_session_recording_properties=l.prototype.Ac;l.prototype.get_session_replay_url=l.prototype.$d;l.prototype.get_tab_id=l.prototype.Bc;l.prototype.DEFAULT_API_ROUTES=
|
|
153
|
+
Bb;l.prototype.__get_recorder=l.prototype.od;y.prototype.properties=y.prototype.sa;y.prototype.update_search_keyword=y.prototype.md;y.prototype.update_referrer_info=y.prototype.Sb;y.prototype.get_cross_subdomain=y.prototype.Xd;y.prototype.clear=y.prototype.clear;var R={};(function(a){Sa=a;xa=1;E=r.mixpanel;d.l(E)?z.s('"mixpanel" object not initialized. Ensure you are using the latest version of the Mixpanel JS Library along with the snippet we provide.'):E.__loaded||E.config&&E.persistence?z.s("The Mixpanel library has already been downloaded at least once. Ensure that the Mixpanel code snippet only appears once on the page (and is not double-loaded by a tag manager) in order to avoid errors."):
|
|
154
|
+
1.1>(E.__SV||0)?z.s("Version mismatch; please ensure you're using the latest version of the Mixpanel code snippet."):(d.h(E._i,function(b){b&&d.isArray(b)&&(R[b[b.length-1]]=ma.apply(this,b))}),Eb(),E.init(),d.h(R,function(b){b.Aa()}),Db())})(function(a,b){var c=document.createElement("script");c.type="text/javascript";c.async=!0;c.onload=b;c.src=a;document.head.appendChild(c)})})()
|