(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{lLqN:function(e,t,r){"use strict";var i,o={DEBUG:!1,LIB_VERSION:"2.49.0"};if("undefined"==typeof window){var n={hostname:""};i={navigator:{userAgent:""},document:{location:n,referrer:""},screen:{width:0,height:0},location:n}}else i=window;var s,a,c,p,u,_,h,l,d,f,g,m,y,v=Array.prototype,b=Function.prototype,k=Object.prototype,x=v.slice,w=k.toString,S=k.hasOwnProperty,q=i.console,E=i.navigator,$=i.document,O=i.opera,I=i.screen,D=E.userAgent,A=b.bind,T=v.forEach,B=v.indexOf,U=v.map,P=Array.isArray,C={},j={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},N={log:function(){if(o.DEBUG&&!j.isUndefined(q)&&q)try{q.log.apply(q,arguments)}catch(e){j.each(arguments,(function(e){q.log(e)}))}},warn:function(){if(o.DEBUG&&!j.isUndefined(q)&&q){var e=["Mixpanel warning:"].concat(j.toArray(arguments));try{q.warn.apply(q,e)}catch(t){j.each(e,(function(e){q.warn(e)}))}}},error:function(){if(o.DEBUG&&!j.isUndefined(q)&&q){var e=["Mixpanel error:"].concat(j.toArray(arguments));try{q.error.apply(q,e)}catch(t){j.each(e,(function(e){q.error(e)}))}}},critical:function(){if(!j.isUndefined(q)&&q){var e=["Mixpanel error:"].concat(j.toArray(arguments));try{q.error.apply(q,e)}catch(t){j.each(e,(function(e){q.error(e)}))}}}},M=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(N,arguments)}},F=function(e){return{log:M(N.log,e),error:M(N.error,e),critical:M(N.critical,e)}};j.bind=function(e,t){var r,i;if(A&&e.bind===A)return A.apply(e,x.call(arguments,1));if(!j.isFunction(e))throw new TypeError;return r=x.call(arguments,2),i=function(){if(!(this instanceof i))return e.apply(t,r.concat(x.call(arguments)));var o={};o.prototype=e.prototype;var n=new o;o.prototype=null;var s=e.apply(n,r.concat(x.call(arguments)));return Object(s)===s?s:n}},j.each=function(e,t,r){if(null!=e)if(T&&e.forEach===T)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,o=e.length;i0&&(t[r]=e)})),t},j.truncate=function(e,t){var r;return"string"==typeof e?r=e.slice(0,t):j.isArray(e)?(r=[],j.each(e,(function(e){r.push(j.truncate(e,t))}))):j.isObject(e)?(r={},j.each(e,(function(e,i){r[i]=j.truncate(e,t)}))):r=e,r},j.JSONEncode=function(e){var t=function(e){var t=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,r={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return t.lastIndex=0,t.test(e)?'"'+e.replace(t,(function(e){var t=r[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'};return function e(r,i){var o="",n=0,s="",a="",c=0,p=o,u=[],_=i[r];switch(_&&"object"==typeof _&&"function"==typeof _.toJSON&&(_=_.toJSON(r)),typeof _){case"string":return t(_);case"number":return isFinite(_)?String(_):"null";case"boolean":case"null":return String(_);case"object":if(!_)return"null";if(o+=" ",u=[],"[object Array]"===w.apply(_)){for(c=_.length,n=0;n="0"&&a<="9";)t+=a,h();if("."===a)for(t+=".";h()&&a>="0"&&a<="9";)t+=a;if("e"===a||"E"===a)for(t+=a,h(),"-"!==a&&"+"!==a||(t+=a,h());a>="0"&&a<="9";)t+=a,h();if(e=+t,isFinite(e))return e;_("Bad number")},d=function(){var e,t,r,i="";if('"'===a)for(;h();){if('"'===a)return h(),i;if("\\"===a)if(h(),"u"===a){for(r=0,t=0;t<4&&(e=parseInt(h(),16),isFinite(e));t+=1)r=16*r+e;i+=String.fromCharCode(r)}else{if("string"!=typeof u[a])break;i+=u[a]}else i+=a}_("Bad string")},f=function(){for(;a&&a<=" ";)h()},g=function(){var e=[];if("["===a){if(h("["),f(),"]"===a)return h("]"),e;for(;a;){if(e.push(p()),f(),"]"===a)return h("]"),e;h(","),f()}}_("Bad array")},m=function(){var e,t={};if("{"===a){if(h("{"),f(),"}"===a)return h("}"),t;for(;a;){if(e=d(),f(),h(":"),Object.hasOwnProperty.call(t,e)&&_('Duplicate key "'+e+'"'),t[e]=p(),f(),"}"===a)return h("}"),t;h(","),f()}}_("Bad object")},p=function(){switch(f(),a){case"{":return m();case"[":return g();case'"':return d();case"-":return l();default:return a>="0"&&a<="9"?l():function(){switch(a){case"t":return h("t"),h("r"),h("u"),h("e"),!0;case"f":return h("f"),h("a"),h("l"),h("s"),h("e"),!1;case"n":return h("n"),h("u"),h("l"),h("l"),null}_('Unexpected "'+a+'"')}()}},function(e){var t;return c=e,s=0,a=" ",t=p(),f(),a&&_("Syntax error"),t}),j.base64Encode=function(e){var t,r,i,o,n,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,c=0,p="",u=[];if(!e)return e;e=j.utf8Encode(e);do{t=(n=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,r=n>>12&63,i=n>>6&63,o=63&n,u[c++]=s.charAt(t)+s.charAt(r)+s.charAt(i)+s.charAt(o)}while(a127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),null!==a&&(r>t&&(n+=e.substring(t,r)),n+=a,t=r=o+1)}return r>t&&(n+=e.substring(t,e.length)),n},j.UUID=(y=function(){var e,t=1*new Date;if(i.performance&&i.performance.now)e=i.performance.now();else for(e=0;t==1*new Date;)e++;return t.toString(16)+Math.floor(e).toString(16)},function(){var e=(I.height*I.width).toString(16);return y()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,r=D,i=[],o=0;function n(e,t){var r,o=0;for(r=0;r=4&&(o=n(o,i),i=[]);return i.length>0&&(o=n(o,i)),o.toString(16)}()+"-"+e+"-"+y()});var R=["ahrefsbot","ahrefssiteaudit","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];j.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t=0}function i(t){if(!$.getElementsByTagName)return[];var i,o,n,s,a,c,p,u,_,h,l=t.split(" "),d=[$];for(c=0;c-1){n=(o=i.split("#"))[0];var f=o[1],g=$.getElementById(f);if(!g||n&&g.nodeName.toLowerCase()!=n)return[];d=[g]}else if(i.indexOf(".")>-1){n=(o=i.split("."))[0];var m=o[1];for(n||(n="*"),s=[],a=0,p=0;p-1};break;default:v=function(e){return e.getAttribute(b)}}for(d=[],h=0,p=0;p=3?t[2]:""},currentUrl:function(){return i.location.href},properties:function(e){return"object"!=typeof e&&(e={}),j.extend(j.strip_empty_properties({$os:j.info.os(),$browser:j.info.browser(D,E.vendor,O),$referrer:$.referrer,$referring_domain:j.info.referringDomain($.referrer),$device:j.info.device(D)}),{$current_url:j.info.currentUrl(),$browser_version:j.info.browserVersion(D,E.vendor,O),$screen_height:I.height,$screen_width:I.width,mp_lib:"web",$lib_version:o.LIB_VERSION,$insert_id:K(),time:j.timestamp()/1e3},j.strip_empty_properties(e))},people_properties:function(){return j.extend(j.strip_empty_properties({$os:j.info.os(),$browser:j.info.browser(D,E.vendor,O)}),{$browser_version:j.info.browserVersion(D,E.vendor,O)})},mpPageViewProperties:function(){return j.strip_empty_properties({current_page_title:$.title,current_domain:i.location.hostname,current_url_path:i.location.pathname,current_url_protocol:i.location.protocol,current_url_search:i.location.search})}};var K=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},G=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,V=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,W=function(e){var t=V,r=e.split("."),i=r[r.length-1];(i.length>4||"com"===i||"org"===i)&&(t=G);var o=e.match(t);return o?o[0]:""},X=null,Y=null;"undefined"!=typeof JSON&&(X=JSON.stringify,Y=JSON.parse),X=X||j.JSONEncode,Y=Y||j.JSONDecode,j.toArray=j.toArray,j.isObject=j.isObject,j.JSONEncode=j.JSONEncode,j.JSONDecode=j.JSONDecode,j.isBlockedUA=j.isBlockedUA,j.isEmptyObject=j.isEmptyObject,j.info=j.info,j.info.device=j.info.device,j.info.browser=j.info.browser,j.info.browserVersion=j.info.browserVersion,j.info.properties=j.info.properties;var Z=function(){};Z.prototype.create_properties=function(){},Z.prototype.event_handler=function(){},Z.prototype.after_track_handler=function(){},Z.prototype.init=function(e){return this.mp=e,this},Z.prototype.track=function(e,t,r,i){var o=this,n=j.dom_query(e);if(0!==n.length)return j.each(n,(function(e){j.register_event(e,this.override_event,(function(e){var n={},s=o.create_properties(r,this),a=o.mp.get_config("track_links_timeout");o.event_handler(e,this,n),window.setTimeout(o.track_callback(i,s,n,!0),a),o.mp.track(t,s,o.track_callback(i,s,n))}))}),this),!0;N.error("The DOM query ("+e+") returned 0 elements")},Z.prototype.track_callback=function(e,t,r,i){i=i||!1;var o=this;return function(){r.callback_fired||(r.callback_fired=!0,e&&!1===e(i,t)||o.after_track_handler(t,r,i))}},Z.prototype.create_properties=function(e,t){return"function"==typeof e?e(t):j.extend({},e)};var ee=function(){this.override_event="click"};j.inherit(ee,Z),ee.prototype.create_properties=function(e,t){var r=ee.superclass.create_properties.apply(this,arguments);return t.href&&(r.url=t.href),r},ee.prototype.event_handler=function(e,t,r){r.new_tab=2===e.which||e.metaKey||e.ctrlKey||"_blank"===t.target,r.href=t.href,r.new_tab||e.preventDefault()},ee.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout((function(){window.location=t.href}),0)};var te=function(){this.override_event="submit"};j.inherit(te,Z),te.prototype.event_handler=function(e,t,r){r.element=t,e.preventDefault()},te.prototype.after_track_handler=function(e,t){setTimeout((function(){t.element.submit()}),0)};var re=F("lock"),ie=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3};ie.prototype.withLock=function(e,t,r){r||"function"==typeof t||(r=t,t=null);var i=r||(new Date).getTime()+"|"+Math.random(),o=(new Date).getTime(),n=this.storageKey,s=this.pollIntervalMS,a=this.timeoutMS,c=this.storage,p=n+":X",u=n+":Y",_=n+":Z",h=function(e){t&&t(e)},l=function(e){if((new Date).getTime()-o>a)return re.error("Timeout waiting for mutex on "+n+"; clearing lock. ["+i+"]"),c.removeItem(_),c.removeItem(u),void g();setTimeout((function(){try{e()}catch(t){h(t)}}),s*(Math.random()+.1))},d=function e(t,r){t()?r():l((function(){e(t,r)}))},f=function(){var e=c.getItem(u);if(e&&e!==i)return!1;if(c.setItem(u,i),c.getItem(u)===i)return!0;if(!z(c,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},g=function e(){c.setItem(p,i),d(f,(function(){c.getItem(p)!==i?l((function(){c.getItem(u)===i?d((function(){return!c.getItem(_)}),m):e()})):m()}))},m=function(){c.setItem(_,"1");try{e()}finally{c.removeItem(_),c.getItem(u)===i&&c.removeItem(u),c.getItem(p)===i&&c.removeItem(p)}};try{if(!z(c,!0))throw new Error("localStorage support check failed");g()}catch(y){h(y)}};var oe=F("batch"),ne=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.reportError=t.errorReporter||j.bind(oe.error,oe),this.lock=new ie(e,{storage:this.storage}),this.pid=t.pid||null,this.memQueue=[]};ne.prototype.enqueue=function(e,t,r){var i={id:K(),flushAfter:(new Date).getTime()+2*t,payload:e};this.lock.withLock(j.bind((function(){var t;try{var o=this.readFromStorage();o.push(i),(t=this.saveToStorage(o))&&this.memQueue.push(i)}catch(n){this.reportError("Error enqueueing item",e),t=!1}r&&r(t)}),this),j.bind((function(e){this.reportError("Error acquiring storage lock",e),r&&r(!1)}),this),this.pid)},ne.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);if(t.lengthn.flushAfter&&!i[n.id]&&(n.orphaned=!0,t.push(n),t.length>=e))break}}}return t};var se=function(e,t){var r=[];return j.each(e,(function(e){e.id&&!t[e.id]&&r.push(e)})),r};ne.prototype.removeItemsByID=function(e,t){var r={};j.each(e,(function(e){r[e]=!0})),this.memQueue=se(this.memQueue,r);var i=j.bind((function(){var t;try{var i=this.readFromStorage();if(i=se(i,r),t=this.saveToStorage(i)){i=this.readFromStorage();for(var o=0;o5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:e,batchSize:n.length,timesSent:this.itemIdsSentSuccessfully[i]}),r=!1):this.reportError("[dupe] found item with no ID",{item:e}),r&&s.push(t)}a[e.id]=t}),this),s.length<1)return void this.resetFlush();this.requestInProgress=!0;var c=j.bind((function(o){this.requestInProgress=!1;try{var s=!1;if(e.unloading)this.queue.updatePayloads(a);else if(j.isObject(o)&&"timeout"===o.error&&(new Date).getTime()-r>=t)this.reportError("Network timeout; retrying"),this.flush();else if(j.isObject(o)&&o.xhr_req&&(o.xhr_req.status>=500||429===o.xhr_req.status||"timeout"===o.error)){var c=2*this.flushInterval,p=o.xhr_req.responseHeaders;if(p){var u=p["Retry-After"];u&&(c=1e3*parseInt(u,10)||c)}c=Math.min(6e5,c),this.reportError("Error; retry in "+c+" ms"),this.scheduleFlush(c)}else if(j.isObject(o)&&o.xhr_req&&413===o.xhr_req.status)if(n.length>1){var _=Math.max(1,Math.floor(i/2));this.batchSize=Math.min(this.batchSize,_,n.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",n),this.resetBatchSize(),s=!0;else s=!0;s&&(this.queue.removeItemsByID(j.map(n,(function(e){return e.id})),j.bind((function(e){e?(this.consecutiveRemovalFailures=0,this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())}),this)),j.each(n,j.bind((function(e){var t=e.id;t?(this.itemIdsSentSuccessfully[t]=this.itemIdsSentSuccessfully[t]||0,this.itemIdsSentSuccessfully[t]++,this.itemIdsSentSuccessfully[t]>5&&this.reportError("[dupe] item ID sent too many times",{item:e,batchSize:n.length,timesSent:this.itemIdsSentSuccessfully[t]})):this.reportError("[dupe] found item with no ID while removing",{item:e})}),this)))}catch(h){this.reportError("Error handling API response",h),this.resetFlush()}}),this),p={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};e.unloading&&(p.transport="sendBeacon"),ce.log("MIXPANEL REQUEST:",s),this.sendRequest(s,p,c)}catch(u){this.reportError("Error flushing request queue",u),this.resetFlush()}},pe.prototype.reportError=function(e,t){if(ce.error.apply(ce.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(t){ce.error(t)}};function ue(e,t){ke(!0,e,t)}function _e(e,t){ke(!1,e,t)}function he(e,t){return"1"===be(e,t)}function le(e,t){if(function(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||i,r=t.navigator||{},o=!1;return j.each([r.doNotTrack,r.msDoNotTrack,t.doNotTrack],(function(e){j.includes([!0,1,"1","yes"],e)&&(o=!0)})),o}(t))return N.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"'),!0;var r="0"===be(e,t);return r&&N.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),r}function de(e){return xe(e,(function(e){return this.get_config(e)}))}function fe(e){return xe(e,(function(e){return this._get_config(e)}))}function ge(e){return xe(e,(function(e){return this._get_config(e)}))}function me(e,t){ye(t=t||{}).remove(ve(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function ye(e){return"localStorage"===(e=e||{}).persistenceType?j.localStorage:j.cookie}function ve(e,t){return((t=t||{}).persistencePrefix||"__mp_opt_in_out_")+e}function be(e,t){return ye(t).get(ve(e,t))}function ke(e,t,r){j.isString(t)&&t.length?(ye(r=r||{}).set(ve(t,r),e?1:0,j.isNumber(r.cookieExpiration)?r.cookieExpiration:null,!!r.crossSubdomainCookie,!!r.secureCookie,!!r.crossSiteCookie,r.cookieDomain),r.track&&e&&r.track(r.trackEventName||"$opt_in",r.trackProperties,{send_immediately:!0})):N.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function xe(e,t){return function(){var r=!1;try{var i=t.call(this,"token"),o=t.call(this,"ignore_dnt"),n=t.call(this,"opt_out_tracking_persistence_type"),s=t.call(this,"opt_out_tracking_cookie_prefix"),a=t.call(this,"window");i&&(r=le(i,{ignoreDnt:o,persistenceType:n,persistencePrefix:s,window:a}))}catch(p){N.error("Unexpected error when checking tracking opt-out status: "+p)}if(!r)return e.apply(this,arguments);var c=arguments[arguments.length-1];"function"==typeof c&&c(0)}}var we={set_action:function(e,t){var r={},i={};return j.isObject(e)?j.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,r.$set=i,r},unset_action:function(e){var t={},r=[];return j.isArray(e)||(e=[e]),j.each(e,(function(e){this._is_reserved_property(e)||r.push(e)}),this),t.$unset=r,t},set_once_action:function(e,t){var r={},i={};return j.isObject(e)?j.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,r.$set_once=i,r},union_action:function(e,t){var r={},i={};return j.isObject(e)?j.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=j.isArray(e)?e:[e])}),this):i[e]=j.isArray(t)?t:[t],r.$union=i,r},append_action:function(e,t){var r={},i={};return j.isObject(e)?j.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,r.$append=i,r},remove_action:function(e,t){var r={},i={};return j.isObject(e)?j.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,r.$remove=i,r},delete_action:function(){var e={$delete:""};return e}},Se=function(){};j.extend(Se.prototype,we),Se.prototype._init=function(e,t,r){this._mixpanel=e,this._group_key=t,this._group_id=r},Se.prototype.set=ge((function(e,t,r){var i=this.set_action(e,t);return j.isObject(e)&&(r=t),this._send_request(i,r)})),Se.prototype.set_once=ge((function(e,t,r){var i=this.set_once_action(e,t);return j.isObject(e)&&(r=t),this._send_request(i,r)})),Se.prototype.unset=ge((function(e,t){var r=this.unset_action(e);return this._send_request(r,t)})),Se.prototype.union=ge((function(e,t,r){j.isObject(e)&&(r=t);var i=this.union_action(e,t);return this._send_request(i,r)})),Se.prototype.delete=ge((function(e){var t=this.delete_action();return this._send_request(t,e)})),Se.prototype.remove=ge((function(e,t,r){var i=this.remove_action(e,t);return this._send_request(i,r)})),Se.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var r=j.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:r,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},t)},Se.prototype._is_reserved_property=function(e){return"$group_key"===e||"$group_id"===e},Se.prototype._get_config=function(e){return this._mixpanel.get_config(e)},Se.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},Se.prototype.remove=Se.prototype.remove,Se.prototype.set=Se.prototype.set,Se.prototype.set_once=Se.prototype.set_once,Se.prototype.union=Se.prototype.union,Se.prototype.unset=Se.prototype.unset,Se.prototype.toString=Se.prototype.toString;var qe=function(){};j.extend(qe.prototype,we),qe.prototype._init=function(e){this._mixpanel=e},qe.prototype.set=fe((function(e,t,r){var i=this.set_action(e,t);return j.isObject(e)&&(r=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),i.$set=j.extend({},j.info.people_properties(),i.$set),this._send_request(i,r)})),qe.prototype.set_once=fe((function(e,t,r){var i=this.set_once_action(e,t);return j.isObject(e)&&(r=t),this._send_request(i,r)})),qe.prototype.unset=fe((function(e,t){var r=this.unset_action(e);return this._send_request(r,t)})),qe.prototype.increment=fe((function(e,t,r){var i={},o={};return j.isObject(e)?(j.each(e,(function(e,t){if(!this._is_reserved_property(t)){if(isNaN(parseFloat(e)))return void N.error("Invalid increment value passed to mixpanel.people.increment - must be a number");o[t]=e}}),this),r=t):(j.isUndefined(t)&&(t=1),o[e]=t),i.$add=o,this._send_request(i,r)})),qe.prototype.append=fe((function(e,t,r){j.isObject(e)&&(r=t);var i=this.append_action(e,t);return this._send_request(i,r)})),qe.prototype.remove=fe((function(e,t,r){j.isObject(e)&&(r=t);var i=this.remove_action(e,t);return this._send_request(i,r)})),qe.prototype.union=fe((function(e,t,r){j.isObject(e)&&(r=t);var i=this.union_action(e,t);return this._send_request(i,r)})),qe.prototype.track_charge=fe((function(e,t,r){if(j.isNumber(e)||(e=parseFloat(e),!isNaN(e)))return this.append("$transactions",j.extend({$amount:e},t),r);N.error("Invalid value passed to mixpanel.people.track_charge - must be a number")})),qe.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},qe.prototype.delete_user=function(){if(this._identify_called()){var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)}N.error("mixpanel.people.delete_user() requires you to call identify() first")},qe.prototype.toString=function(){return this._mixpanel.toString()+".people"},qe.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var r=this._mixpanel.get_property("$device_id"),i=this._mixpanel.get_property("$user_id"),o=this._mixpanel.get_property("$had_persisted_distinct_id");r&&(e.$device_id=r),i&&(e.$user_id=i),o&&(e.$had_persisted_distinct_id=o);var n=j.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:n,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),j.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),j.truncate(n,255))},qe.prototype._get_config=function(e){return this._mixpanel.get_config(e)},qe.prototype._identify_called=function(){return!0===this._mixpanel._flags.identify_called},qe.prototype._enqueue=function(e){"$set"in e?this._mixpanel.persistence._add_to_people_queue("$set",e):"$set_once"in e?this._mixpanel.persistence._add_to_people_queue("$set_once",e):"$unset"in e?this._mixpanel.persistence._add_to_people_queue("$unset",e):"$add"in e?this._mixpanel.persistence._add_to_people_queue("$add",e):"$append"in e?this._mixpanel.persistence._add_to_people_queue("$append",e):"$remove"in e?this._mixpanel.persistence._add_to_people_queue("$remove",e):"$union"in e?this._mixpanel.persistence._add_to_people_queue("$union",e):N.error("Invalid call to _enqueue():",e)},qe.prototype._flush_one_queue=function(e,t,r,i){var o=this,n=j.extend({},this._mixpanel.persistence.load_queue(e)),s=n;j.isUndefined(n)||!j.isObject(n)||j.isEmptyObject(n)||(o._mixpanel.persistence._pop_from_people_queue(e,n),o._mixpanel.persistence.save(),i&&(s=i(n)),t.call(o,s,(function(t,i){0===t&&o._mixpanel.persistence._add_to_people_queue(e,n),j.isUndefined(r)||r(t,i)})))},qe.prototype._flush=function(e,t,r,i,o,n,s){var a=this;this._flush_one_queue("$set",this.set,e),this._flush_one_queue("$set_once",this.set_once,i),this._flush_one_queue("$unset",this.unset,n,(function(e){return j.keys(e)})),this._flush_one_queue("$add",this.increment,t),this._flush_one_queue("$union",this.union,o);var c=this._mixpanel.persistence.load_queue("$append");if(!j.isUndefined(c)&&j.isArray(c)&&c.length)for(var p,u=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue("$append",p),j.isUndefined(r)||r(e,t)},_=c.length-1;_>=0;_--)c=this._mixpanel.persistence.load_queue("$append"),p=c.pop(),a._mixpanel.persistence.save(),j.isEmptyObject(p)||a.append(p,u);var h=this._mixpanel.persistence.load_queue("$remove");if(!j.isUndefined(h)&&j.isArray(h)&&h.length)for(var l,d=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue("$remove",l),j.isUndefined(s)||s(e,t)},f=h.length-1;f>=0;f--)h=this._mixpanel.persistence.load_queue("$remove"),l=h.pop(),a._mixpanel.persistence.save(),j.isEmptyObject(l)||a.remove(l,d)},qe.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e},qe.prototype.set=qe.prototype.set,qe.prototype.set_once=qe.prototype.set_once,qe.prototype.unset=qe.prototype.unset,qe.prototype.increment=qe.prototype.increment,qe.prototype.append=qe.prototype.append,qe.prototype.remove=qe.prototype.remove,qe.prototype.union=qe.prototype.union,qe.prototype.track_charge=qe.prototype.track_charge,qe.prototype.clear_charges=qe.prototype.clear_charges,qe.prototype.delete_user=qe.prototype.delete_user,qe.prototype.toString=qe.prototype.toString;var Ee,$e,Oe=["__mps","__mpso","__mpus","__mpa","__mpap","__mpr","__mpu","$people_distinct_id","__alias","__timers"],Ie=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;"cookie"!==t&&"localStorage"!==t&&(N.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),"localStorage"===t&&j.localStorage.is_supported()?this.storage=j.localStorage:this.storage=j.cookie,this.load(),this.update_config(e),this.upgrade(e),this.save()};Ie.prototype.properties=function(){var e={};return this.load(),j.each(this.props,(function(t,r){j.include(Oe,r)||(e[r]=t)})),e},Ie.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=j.extend({},e))}},Ie.prototype.upgrade=function(e){var t,r,i=e.upgrade;i&&(t="mp_super_properties","string"==typeof i&&(t=i),r=this.storage.parse(t),this.storage.remove(t),this.storage.remove(t,!0),r&&(this.props=j.extend(this.props,r.all,r.events))),e.cookie_name||"mixpanel"===e.name||(t="mp_"+e.token+"_"+e.name,(r=this.storage.parse(t))&&(this.storage.remove(t),this.storage.remove(t,!0),this.register_once(r))),this.storage===j.localStorage&&(r=j.cookie.parse(this.name),j.cookie.remove(this.name),j.cookie.remove(this.name,!0),r&&this.register_once(r))},Ie.prototype.save=function(){this.disabled||this.storage.set(this.name,j.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},Ie.prototype.load_prop=function(e){return this.load(),this.props[e]},Ie.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},Ie.prototype.clear=function(){this.remove(),this.props={}},Ie.prototype.register_once=function(e,t,r){return!!j.isObject(e)&&(void 0===t&&(t="None"),this.expire_days=void 0===r?this.default_expiry:r,this.load(),j.each(e,(function(e,r){this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.props[r]=e)}),this),this.save(),!0)},Ie.prototype.register=function(e,t){return!!j.isObject(e)&&(this.expire_days=void 0===t?this.default_expiry:t,this.load(),j.extend(this.props,e),this.save(),!0)},Ie.prototype.unregister=function(e){this.load(),e in this.props&&(delete this.props[e],this.save())},Ie.prototype.update_search_keyword=function(e){this.register(j.info.searchInfo(e))},Ie.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:j.info.referringDomain(e)||"$direct"},"")},Ie.prototype.get_referrer_info=function(){return j.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},Ie.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)},Ie.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},Ie.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())},Ie.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())},Ie.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},Ie.prototype.get_cross_subdomain=function(){return this.cross_subdomain},Ie.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},Ie.prototype._add_to_people_queue=function(e,t){var r=this._get_queue_key(e),i=t[e],o=this._get_or_create_queue("$set"),n=this._get_or_create_queue("$set_once"),s=this._get_or_create_queue("$unset"),a=this._get_or_create_queue("$add"),c=this._get_or_create_queue("$union"),p=this._get_or_create_queue("$remove",[]),u=this._get_or_create_queue("$append",[]);"__mps"===r?(j.extend(o,i),this._pop_from_people_queue("$add",i),this._pop_from_people_queue("$union",i),this._pop_from_people_queue("$unset",i)):"__mpso"===r?(j.each(i,(function(e,t){t in n||(n[t]=e)})),this._pop_from_people_queue("$unset",i)):"__mpus"===r?j.each(i,(function(e){j.each([o,n,a,c],(function(t){e in t&&delete t[e]})),j.each(u,(function(t){e in t&&delete t[e]})),s[e]=!0})):"__mpa"===r?(j.each(i,(function(e,t){t in o?o[t]+=e:(t in a||(a[t]=0),a[t]+=e)}),this),this._pop_from_people_queue("$unset",i)):"__mpu"===r?(j.each(i,(function(e,t){j.isArray(e)&&(t in c||(c[t]=[]),c[t]=c[t].concat(e))})),this._pop_from_people_queue("$unset",i)):"__mpr"===r?(p.push(i),this._pop_from_people_queue("$append",i)):"__mpap"===r&&(u.push(i),this._pop_from_people_queue("$unset",i)),N.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),N.log(t),this.save()},Ie.prototype._pop_from_people_queue=function(e,t){var r=this.props[this._get_queue_key(e)];j.isUndefined(r)||j.each(t,(function(t,i){"$append"===e||"$remove"===e?j.each(r,(function(e){e[i]===t&&delete e[i]})):delete r[i]}),this)},Ie.prototype.load_queue=function(e){return this.load_prop(this._get_queue_key(e))},Ie.prototype._get_queue_key=function(e){return"$set"===e?"__mps":"$set_once"===e?"__mpso":"$unset"===e?"__mpus":"$add"===e?"__mpa":"$append"===e?"__mpap":"$remove"===e?"__mpr":"$union"===e?"__mpu":void N.error("Invalid queue:",e)},Ie.prototype._get_or_create_queue=function(e,t){var r=this._get_queue_key(e);return t=j.isUndefined(t)?{}:t,this.props[r]||(this.props[r]=t)},Ie.prototype.set_event_timer=function(e,t){var r=this.load_prop("__timers")||{};r[e]=t,this.props.__timers=r,this.save()},Ie.prototype.remove_event_timer=function(e){var t=(this.load_prop("__timers")||{})[e];return j.isUndefined(t)||(delete this.props.__timers[e],this.save()),t};var De=function(e){return e},Ae=function(){},Te=i.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Be=!Te&&-1===D.indexOf("MSIE")&&-1===D.indexOf("Mozilla"),Ue=null;E.sendBeacon&&(Ue=function(){return E.sendBeacon.apply(E,arguments)});var Pe={track:"track/",engage:"engage/",groups:"groups/"},Ce={api_host:"https://api-js.mixpanel.com",api_routes:Pe,api_method:"POST",api_transport:"XHR",api_payload_format:"base64",app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:Ae,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:Ae,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,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:{}},je=!1,Ne=function(){},Me=function(e,t,r){var i,n="mixpanel"===r?$e:$e[r];if(n&&0===Ee)i=n;else{if(n&&!j.isArray(n))return void N.error("You have already initialized "+r);i=new Ne}if(i._cached_groups={},i._init(e,t,r),i.people=new qe,i.people._init(i),!i.get_config("skip_first_touch_marketing")){var s=j.info.campaignParams(null),a={},c=!1;j.each(s,(function(e,t){a["initial_"+t]=e,e&&(c=!0)})),c&&i.people.set_once(a)}return o.DEBUG=o.DEBUG||i.get_config("debug"),!j.isUndefined(n)&&j.isArray(n)&&(i._execute_array.call(i.people,n.people),i._execute_array(n)),i};Ne.prototype.init=function(e,t,r){if(j.isUndefined(r))this.report_error("You must name your new library: init(token, config, name)");else{if("mixpanel"!==r){var i=Me(e,t,r);return $e[r]=i,i._loaded(),i}this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet")}},Ne.prototype._init=function(e,t,r){t=t||{},this.__loaded=!0,this.config={};var o={};"api_payload_format"in t||(t.api_host||Ce.api_host).match(/\.mixpanel\.com/)&&(o.api_payload_format="json");if(this.set_config(j.extend({},Ce,o,t,{name:r,token:e,callback_fn:("mixpanel"===r?r:"mixpanel."+r)+"._jsc"})),this._jsc=Ae,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests)if(j.localStorage.is_supported(!0)&&Te){if(this.init_batchers(),Ue&&i.addEventListener){var n=j.bind((function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})}),this);i.addEventListener("pagehide",(function(e){e.persisted&&n()})),i.addEventListener("visibilitychange",(function(){"hidden"===$.visibilityState&&n()}))}}else this._batch_requests=!1,N.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),j.each(this.get_batcher_configs(),(function(e){N.log("Clearing batch queue "+e.queue_key),j.localStorage.remove(e.queue_key)}));this.persistence=this.cookie=new Ie(this.config),this.unpersisted_superprops={},this._gdpr_init();var s=j.UUID();this.get_distinct_id()||this.register_once({distinct_id:"$device:"+s,$device_id:s},"");var a=this.get_config("track_pageview");a&&this._init_url_change_tracking(a)},Ne.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var e=j.info.campaignParams(null);j.each(e,function(e,t){this.unregister(t)}.bind(this))}},Ne.prototype._set_default_superprops=function(){this.persistence.update_search_keyword($.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(j.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info($.referrer)},Ne.prototype._dom_loaded=function(){j.each(this.__dom_loaded_queue,(function(e){this._track_dom.apply(this,e)}),this),this.has_opted_out_tracking()||j.each(this.__request_queue,(function(e){this._send_request.apply(this,e)}),this),delete this.__dom_loaded_queue,delete this.__request_queue},Ne.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!je)return this.__dom_loaded_queue.push([e,t]),!1;var r=(new e).init(this);return r.track.apply(r,t)},Ne.prototype._init_url_change_tracking=function(e){var t="";if(this.track_pageview()&&(t=j.info.currentUrl()),j.include(["full-url","url-with-path-and-query-string","url-with-path"],e)){i.addEventListener("popstate",(function(){i.dispatchEvent(new Event("mp_locationchange"))})),i.addEventListener("hashchange",(function(){i.dispatchEvent(new Event("mp_locationchange"))}));var r=i.history.pushState;"function"==typeof r&&(i.history.pushState=function(e,t,o){r.call(i.history,e,t,o),i.dispatchEvent(new Event("mp_locationchange"))});var o=i.history.replaceState;"function"==typeof o&&(i.history.replaceState=function(e,t,r){o.call(i.history,e,t,r),i.dispatchEvent(new Event("mp_locationchange"))}),i.addEventListener("mp_locationchange",function(){var r=j.info.currentUrl(),i=!1;("full-url"===e?i=r!==t:"url-with-path-and-query-string"===e?i=r.split("#")[0]!==t.split("#")[0]:"url-with-path"===e&&(i=r.split("#")[0].split("?")[0]!==t.split("#")[0].split("?")[0]),i)&&(this.track_pageview()&&(t=r))}.bind(this))}},Ne.prototype._prepare_callback=function(e,t){if(j.isUndefined(e))return null;if(Te){return function(r){e(r,t)}}var r=this._jsc,i=""+Math.floor(1e8*Math.random()),o=this.get_config("callback_fn")+"["+i+"]";return r[i]=function(o){delete r[i],e(o,t)},o},Ne.prototype._send_request=function(e,t,r,i){var o=!0;if(Be)return this.__request_queue.push(arguments),o;var n={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},s=null;i||!j.isFunction(r)&&"string"!=typeof r||(i=r,r=null),r=j.extend(n,r||{}),Te||(r.method="GET");var a="POST"===r.method,c=Ue&&a&&"sendbeacon"===r.transport.toLowerCase(),p=r.verbose;t.verbose&&(p=!0),this.get_config("test")&&(t.test=1),p&&(t.verbose=1),this.get_config("img")&&(t.img=1),Te||(i?t.callback=i:(p||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=(new Date).getTime().toString(),a&&(s="data="+encodeURIComponent(t.data),delete t.data),e+="?"+j.HTTPBuildQuery(t);var u=this;if("img"in t){var _=$.createElement("img");_.src=e,$.body.appendChild(_)}else if(c){try{o=Ue(e,s)}catch(m){u.report_error(m),o=!1}try{i&&i(o?1:0)}catch(m){u.report_error(m)}}else if(Te)try{var h=new XMLHttpRequest;h.open(r.method,e,!0);var l=this.get_config("xhr_headers");if(a&&(l["Content-Type"]="application/x-www-form-urlencoded"),j.each(l,(function(e,t){h.setRequestHeader(t,e)})),r.timeout_ms&&void 0!==h.timeout){h.timeout=r.timeout_ms;var d=(new Date).getTime()}h.withCredentials=!0,h.onreadystatechange=function(){var e;if(4===h.readyState)if(200===h.status){if(i)if(p){var t;try{t=j.JSONDecode(h.responseText)}catch(m){if(u.report_error(m),!r.ignore_json_errors)return;t=h.responseText}i(t)}else i(Number(h.responseText))}else e=h.timeout&&!h.status&&(new Date).getTime()-d>=h.timeout?"timeout":"Bad HTTP status: "+h.status+" "+h.statusText,u.report_error(e),i&&i(p?{status:0,error:e,xhr_req:h}:0)},h.send(s)}catch(m){u.report_error(m),o=!1}else{var f=$.createElement("script");f.type="text/javascript",f.async=!0,f.defer=!0,f.src=e;var g=$.getElementsByTagName("script")[0];g.parentNode.insertBefore(f,g)}return o},Ne.prototype._execute_array=function(e){var t,r=[],i=[],o=[];j.each(e,(function(e){e&&(t=e[0],j.isArray(t)?o.push(e):"function"==typeof e?e.call(this):j.isArray(e)&&"alias"===t?r.push(e):j.isArray(e)&&-1!==t.indexOf("track")&&"function"==typeof this[t]?o.push(e):i.push(e))}),this);var n=function(e,t){j.each(e,(function(e){if(j.isArray(e[0])){var r=t;j.each(e,(function(e){r=r[e[0]].apply(r,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};n(r,this),n(i,this),n(o,this)},Ne.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},Ne.prototype.get_batcher_configs=function(){var e="__mpq_"+this.get_config("token"),t=this.get_config("api_routes");return this._batcher_configs=this._batcher_configs||{events:{type:"events",endpoint:"/"+t.track,queue_key:e+"_ev"},people:{type:"people",endpoint:"/"+t.engage,queue_key:e+"_pp"},groups:{type:"groups",endpoint:"/"+t.groups,queue_key:e+"_gr"}},this._batcher_configs},Ne.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var e=j.bind((function(e){return new pe(e.queue_key,{libConfig:this.config,sendRequestFunc:j.bind((function(t,r,i){this._send_request(this.get_config("api_host")+e.endpoint,this._encode_data_for_request(t),r,this._prepare_callback(i,t))}),this),beforeSendHook:j.bind((function(t){return this._run_hook("before_send_"+e.type,t)}),this),errorReporter:this.get_config("error_reporter"),stopAllBatchingFunc:j.bind(this.stop_batch_senders,this)})}),this),t=this.get_batcher_configs();this.request_batchers={events:e(t.events),people:e(t.people),groups:e(t.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},Ne.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,j.each(this.request_batchers,(function(e){e.start()})))},Ne.prototype.stop_batch_senders=function(){this._batch_requests=!1,j.each(this.request_batchers,(function(e){e.stop(),e.clear()}))},Ne.prototype.push=function(e){this._execute_array([e])},Ne.prototype.disable=function(e){void 0===e?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},Ne.prototype._encode_data_for_request=function(e){var t=j.JSONEncode(e);return"base64"===this.get_config("api_payload_format")&&(t=j.base64Encode(t)),{data:t}},Ne.prototype._track_or_batch=function(e,t){var r=j.truncate(e.data,255),i=e.endpoint,o=e.batcher,n=e.should_send_immediately,s=e.send_request_options||{};t=t||Ae;var a=!0,c=j.bind((function(){return s.skip_hooks||(r=this._run_hook("before_send_"+e.type,r)),r?(N.log("MIXPANEL REQUEST:"),N.log(r),this._send_request(i,this._encode_data_for_request(r),s,this._prepare_callback(t,r))):null}),this);return this._batch_requests&&!n?o.enqueue(r,(function(e){e?t(1,r):c()})):a=c(),a&&r},Ne.prototype.track=de((function(e,t,r,i){i||"function"!=typeof r||(i=r,r=null);var o=(r=r||{}).transport;o&&(r.transport=o);var n=r.send_immediately;if("function"!=typeof i&&(i=Ae),j.isUndefined(e))this.report_error("No event name provided to mixpanel.track");else{if(!this._event_is_disabled(e)){(t=j.extend({},t)).token=this.get_config("token");var s=this.persistence.remove_event_timer(e);if(!j.isUndefined(s)){var a=(new Date).getTime()-s;t.$duration=parseFloat((a/1e3).toFixed(3))}this._set_default_superprops();var c=this.get_config("track_marketing")?j.info.marketingParams():{};t=j.extend({},j.info.properties({mp_loader:this.get_config("mp_loader")}),c,this.persistence.properties(),this.unpersisted_superprops,t);var p=this.get_config("property_blacklist");j.isArray(p)?j.each(p,(function(e){delete t[e]})):this.report_error("Invalid value for property_blacklist config: "+p);var u={event:e,properties:t};return this._track_or_batch({type:"events",data:u,endpoint:this.get_config("api_host")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:n,send_request_options:r},i)}i(0)}})),Ne.prototype.set_group=de((function(e,t,r){j.isArray(t)||(t=[t]);var i={};return i[e]=t,this.register(i),this.people.set(e,t,r)})),Ne.prototype.add_group=de((function(e,t,r){var i=this.get_property(e),o={};return void 0===i?(o[e]=[t],this.register(o)):-1===i.indexOf(t)&&(i.push(t),o[e]=i,this.register(o)),this.people.union(e,t,r)})),Ne.prototype.remove_group=de((function(e,t,r){var i=this.get_property(e);if(void 0!==i){var o=i.indexOf(t);o>-1&&(i.splice(o,1),this.register({group_key:i})),0===i.length&&this.unregister(e)}return this.people.remove(e,t,r)})),Ne.prototype.track_with_groups=de((function(e,t,r,i){var o=j.extend({},t||{});return j.each(r,(function(e,t){null!=e&&(o[t]=e)})),this.track(e,o,i)})),Ne.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},Ne.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},Ne.prototype.get_group=function(e,t){var r=this._create_map_key(e,t),i=this._cached_groups[r];return void 0!==i&&i._group_key===e&&i._group_id===t||((i=new Se)._init(this,e,t),this._cached_groups[r]=i),i},Ne.prototype.track_pageview=de((function(e,t){"object"!=typeof e&&(e={});var r=(t=t||{}).event_name||"$mp_web_page_view",i=j.extend(j.info.mpPageViewProperties(),j.info.campaignParams(),j.info.clickParams()),o=j.extend({},i,e);return this.track(r,o)})),Ne.prototype.track_links=function(){return this._track_dom.call(this,ee,arguments)},Ne.prototype.track_forms=function(){return this._track_dom.call(this,te,arguments)},Ne.prototype.time_event=function(e){j.isUndefined(e)?this.report_error("No event name provided to mixpanel.time_event"):this._event_is_disabled(e)||this.persistence.set_event_timer(e,(new Date).getTime())};var Fe={persistent:!0},Re=function(e){var t;return t=j.isObject(e)?e:j.isUndefined(e)?{}:{days:e},j.extend({},Fe,t)};Ne.prototype.register=function(e,t){var r=Re(t);r.persistent?this.persistence.register(e,r.days):j.extend(this.unpersisted_superprops,e)},Ne.prototype.register_once=function(e,t,r){var i=Re(r);i.persistent?this.persistence.register_once(e,t,i.days):(void 0===t&&(t="None"),j.each(e,(function(e,r){this.unpersisted_superprops.hasOwnProperty(r)&&this.unpersisted_superprops[r]!==t||(this.unpersisted_superprops[r]=e)}),this))},Ne.prototype.unregister=function(e,t){(t=Re(t)).persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]},Ne.prototype._register_single=function(e,t){var r={};r[e]=t,this.register(r)},Ne.prototype.identify=function(e,t,r,i,o,n,s,a){var c=this.get_distinct_id();if(e&&c!==e){if("string"==typeof e&&0===e.indexOf("$device:"))return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var p=c;this.register_once({$had_persisted_distinct_id:!0,$device_id:p},"")}e!==c&&e!==this.get_property("__alias")&&(this.unregister("__alias"),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,r,i,o,n,s,a),e!==c&&this.track("$identify",{distinct_id:e,$anon_distinct_id:c},{skip_hooks:!0})},Ne.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=j.UUID();this.register_once({distinct_id:"$device:"+e,$device_id:e},"")},Ne.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},Ne.prototype.alias=function(e,t){if(e===this.get_property("$people_distinct_id"))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var r=this;return j.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single("__alias",e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},(function(){r.identify(e)}))):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},Ne.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},Ne.prototype.set_config=function(e){j.isObject(e)&&(j.extend(this.config,e),e.batch_size&&j.each(this.request_batchers,(function(e){e.resetBatchSize()})),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),o.DEBUG=o.DEBUG||this.get_config("debug"))},Ne.prototype.get_config=function(e){return this.config[e]},Ne.prototype._run_hook=function(e){var t=(this.config.hooks[e]||De).apply(this,x.call(arguments,1));return void 0===t&&(this.report_error(e+" hook did not return a value"),t=null),t},Ne.prototype.get_property=function(e){return this.persistence.load_prop([e])},Ne.prototype.toString=function(){var e=this.get_config("name");return"mixpanel"!==e&&(e="mixpanel."+e),e},Ne.prototype._event_is_disabled=function(e){return j.isBlockedUA(D)||this._flags.disable_all_events||j.include(this.__disabled_events,e)},Ne.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_tracking_persistence_type")&&j.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_tracking()||!this.get_config("opt_out_tracking_by_default")&&!j.cookie.get("mp_optout")||(j.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},Ne.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t),t?this.stop_batch_senders():this._batchers_were_started&&this.start_batch_senders()},Ne.prototype._gdpr_call_func=function(e,t){return t=j.extend({track:j.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),j.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})},Ne.prototype.opt_in_tracking=function(e){e=j.extend({enable_persistence:!0},e),this._gdpr_call_func(ue,e),this._gdpr_update_persistence(e)},Ne.prototype.opt_out_tracking=function(e){(e=j.extend({clear_persistence:!0,delete_user:!0},e)).delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(_e,e),this._gdpr_update_persistence(e)},Ne.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(he,e)},Ne.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(le,e)},Ne.prototype.clear_opt_in_out_tracking=function(e){e=j.extend({enable_persistence:!0},e),this._gdpr_call_func(me,e),this._gdpr_update_persistence(e)},Ne.prototype.report_error=function(e,t){N.error.apply(N.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(t){N.error(t)}},Ne.prototype.init=Ne.prototype.init,Ne.prototype.reset=Ne.prototype.reset,Ne.prototype.disable=Ne.prototype.disable,Ne.prototype.time_event=Ne.prototype.time_event,Ne.prototype.track=Ne.prototype.track,Ne.prototype.track_links=Ne.prototype.track_links,Ne.prototype.track_forms=Ne.prototype.track_forms,Ne.prototype.track_pageview=Ne.prototype.track_pageview,Ne.prototype.register=Ne.prototype.register,Ne.prototype.register_once=Ne.prototype.register_once,Ne.prototype.unregister=Ne.prototype.unregister,Ne.prototype.identify=Ne.prototype.identify,Ne.prototype.alias=Ne.prototype.alias,Ne.prototype.name_tag=Ne.prototype.name_tag,Ne.prototype.set_config=Ne.prototype.set_config,Ne.prototype.get_config=Ne.prototype.get_config,Ne.prototype.get_property=Ne.prototype.get_property,Ne.prototype.get_distinct_id=Ne.prototype.get_distinct_id,Ne.prototype.toString=Ne.prototype.toString,Ne.prototype.opt_out_tracking=Ne.prototype.opt_out_tracking,Ne.prototype.opt_in_tracking=Ne.prototype.opt_in_tracking,Ne.prototype.has_opted_out_tracking=Ne.prototype.has_opted_out_tracking,Ne.prototype.has_opted_in_tracking=Ne.prototype.has_opted_in_tracking,Ne.prototype.clear_opt_in_out_tracking=Ne.prototype.clear_opt_in_out_tracking,Ne.prototype.get_group=Ne.prototype.get_group,Ne.prototype.set_group=Ne.prototype.set_group,Ne.prototype.add_group=Ne.prototype.add_group,Ne.prototype.remove_group=Ne.prototype.remove_group,Ne.prototype.track_with_groups=Ne.prototype.track_with_groups,Ne.prototype.start_batch_senders=Ne.prototype.start_batch_senders,Ne.prototype.stop_batch_senders=Ne.prototype.stop_batch_senders,Ne.prototype.DEFAULT_API_ROUTES=Pe,Ie.prototype.properties=Ie.prototype.properties,Ie.prototype.update_search_keyword=Ie.prototype.update_search_keyword,Ie.prototype.update_referrer_info=Ie.prototype.update_referrer_info,Ie.prototype.get_cross_subdomain=Ie.prototype.get_cross_subdomain,Ie.prototype.clear=Ie.prototype.clear;var Le={},ze=function(){$e.init=function(e,t,r){if(r)return $e[r]||($e[r]=Le[r]=Me(e,t,r),$e[r]._loaded()),$e[r];var o=$e;Le.mixpanel?o=Le.mixpanel:e&&((o=Me(e,t,"mixpanel"))._loaded(),Le.mixpanel=o),$e=o,1===Ee&&(i.mixpanel=$e),j.each(Le,(function(e,t){"mixpanel"!==t&&($e[t]=e)})),$e._=j}};var Je=(Ee=0,$e=new Ne,ze(),$e.init(),function(){function e(){e.done||(e.done=!0,je=!0,Be=!1,j.each(Le,(function(e){e._dom_loaded()})))}if($.addEventListener)"complete"===$.readyState?e():$.addEventListener("DOMContentLoaded",e,!1);else if($.attachEvent){$.attachEvent("onreadystatechange",e);var t=!1;try{t=null===i.frameElement}catch(r){}$.documentElement.doScroll&&t&&function t(){try{$.documentElement.doScroll("left")}catch(r){return void setTimeout(t,1)}e()}()}j.register_event(i,"load",e,!0)}(),$e);e.exports=Je}}]);