(self.webpackChunk_9gag_site=self.webpackChunk_9gag_site||[]).push([[642],{8891:e=>{"use strict";var t,r={DEBUG:!1,LIB_VERSION:"2.45.0"};if("undefined"==typeof window){var i={hostname:""};t={navigator:{userAgent:""},document:{location:i,referrer:""},screen:{width:0,height:0},location:i}}else t=window;var o,n,s,a,c,p,u,_,h,l,f,d=Array.prototype,g=Function.prototype,m=Object.prototype,y=d.slice,v=m.toString,b=m.hasOwnProperty,k=t.console,x=t.navigator,w=t.document,q=t.opera,S=t.screen,E=x.userAgent,O=g.bind,I=d.forEach,D=d.indexOf,A=d.map,T=Array.isArray,$={},B={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},U={log:function(){if(r.DEBUG&&!B.isUndefined(k)&&k)try{k.log.apply(k,arguments)}catch(e){B.each(arguments,(function(e){k.log(e)}))}},warn:function(){if(r.DEBUG&&!B.isUndefined(k)&&k){var e=["Mixpanel warning:"].concat(B.toArray(arguments));try{k.warn.apply(k,e)}catch(t){B.each(e,(function(e){k.warn(e)}))}}},error:function(){if(r.DEBUG&&!B.isUndefined(k)&&k){var e=["Mixpanel error:"].concat(B.toArray(arguments));try{k.error.apply(k,e)}catch(t){B.each(e,(function(e){k.error(e)}))}}},critical:function(){if(!B.isUndefined(k)&&k){var e=["Mixpanel error:"].concat(B.toArray(arguments));try{k.error.apply(k,e)}catch(t){B.each(e,(function(e){k.error(e)}))}}}},C=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(U,arguments)}},j=function(e){return{log:C(U.log,e),error:C(U.error,e),critical:C(U.critical,e)}};B.bind=function(e,t){var r,i;if(O&&e.bind===O)return O.apply(e,y.call(arguments,1));if(!B.isFunction(e))throw new TypeError;return r=y.call(arguments,2),i=function(){if(!(this instanceof i))return e.apply(t,r.concat(y.call(arguments)));var o={};o.prototype=e.prototype;var n=new o;o.prototype=null;var s=e.apply(n,r.concat(y.call(arguments)));return Object(s)===s?s:n}},B.each=function(e,t,r){if(null!=e)if(I&&e.forEach===I)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,o=e.length;i0&&(t[r]=e)})),t},B.truncate=function(e,t){var r;return"string"==typeof e?r=e.slice(0,t):B.isArray(e)?(r=[],B.each(e,(function(e){r.push(B.truncate(e,t))}))):B.isObject(e)?(r={},B.each(e,(function(e,i){r[i]=B.truncate(e,t)}))):r=e,r},B.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+'"'},r=function(e,i){var o="",n=0,s="",a="",c=0,p=o,u=[],_=i[e];switch(_&&"object"==typeof _&&"function"==typeof _.toJSON&&(_=_.toJSON(e)),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]"===v.apply(_)){for(c=_.length,n=0;n="0"&&n<="9";)t+=n,u();if("."===n)for(t+=".";u()&&n>="0"&&n<="9";)t+=n;if("e"===n||"E"===n)for(t+=n,u(),"-"!==n&&"+"!==n||(t+=n,u());n>="0"&&n<="9";)t+=n,u();if(e=+t,isFinite(e))return e;p("Bad number")},h=function(){var e,t,r,i="";if('"'===n)for(;u();){if('"'===n)return u(),i;if("\\"===n)if(u(),"u"===n){for(r=0,t=0;t<4&&(e=parseInt(u(),16),isFinite(e));t+=1)r=16*r+e;i+=String.fromCharCode(r)}else{if("string"!=typeof c[n])break;i+=c[n]}else i+=n}p("Bad string")},l=function(){for(;n&&n<=" ";)u()},a=function(){switch(l(),n){case"{":return function(){var e,t={};if("{"===n){if(u("{"),l(),"}"===n)return u("}"),t;for(;n;){if(e=h(),l(),u(":"),Object.hasOwnProperty.call(t,e)&&p('Duplicate key "'+e+'"'),t[e]=a(),l(),"}"===n)return u("}"),t;u(","),l()}}p("Bad object")}();case"[":return function(){var e=[];if("["===n){if(u("["),l(),"]"===n)return u("]"),e;for(;n;){if(e.push(a()),l(),"]"===n)return u("]"),e;u(","),l()}}p("Bad array")}();case'"':return h();case"-":return _();default:return n>="0"&&n<="9"?_():function(){switch(n){case"t":return u("t"),u("r"),u("u"),u("e"),!0;case"f":return u("f"),u("a"),u("l"),u("s"),u("e"),!1;case"n":return u("n"),u("u"),u("l"),u("l"),null}p('Unexpected "'+n+'"')}()}},function(e){var t;return s=e,o=0,n=" ",t=a(),l(),n&&p("Syntax error"),t}),B.base64Encode=function(e){var t,r,i,o,n,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,c=0,p="",u=[];if(!e)return e;e=B.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},B.UUID=(f=function(){for(var e=1*new Date,t=0;e==1*new Date;)t++;return e.toString(16)+t.toString(16)},function(){var e=(S.height*S.width).toString(16);return f()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,r=E,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+"-"+f()});var N=["ahrefsbot","baiduspider","bingbot","bingpreview","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"];B.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t=0}function i(t){if(!w.getElementsByTagName)return[];var i,o,n,s,a,c,p,u,_,h,l=t.split(" "),f=[w];for(c=0;c-1){n=(o=i.split("#"))[0];var d=o[1],g=w.getElementById(d);if(!g||n&&g.nodeName.toLowerCase()!=n)return[];f=[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(f=[],h=0,p=0;p=3?t[2]:""},properties:function(){return B.extend(B.strip_empty_properties({$os:B.info.os(),$browser:B.info.browser(E,x.vendor,q),$referrer:w.referrer,$referring_domain:B.info.referringDomain(w.referrer),$device:B.info.device(E)}),{$current_url:t.location.href,$browser_version:B.info.browserVersion(E,x.vendor,q),$screen_height:S.height,$screen_width:S.width,mp_lib:"web",$lib_version:r.LIB_VERSION,$insert_id:R(),time:B.timestamp()/1e3})},people_properties:function(){return B.extend(B.strip_empty_properties({$os:B.info.os(),$browser:B.info.browser(E,x.vendor,q)}),{$browser_version:B.info.browserVersion(E,x.vendor,q)})},pageviewInfo:function(e){return B.strip_empty_properties({mp_page:e,mp_referrer:w.referrer,mp_browser:B.info.browser(E,x.vendor,q),mp_platform:B.info.os()})}};var R=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},z=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,L=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,J=function(e){var t=L,r=e.split("."),i=r[r.length-1];(i.length>4||"com"===i||"org"===i)&&(t=z);var o=e.match(t);return o?o[0]:""},Q=null,H=null;"undefined"!=typeof JSON&&(Q=JSON.stringify,H=JSON.parse),Q=Q||B.JSONEncode,H=H||B.JSONDecode,B.toArray=B.toArray,B.isObject=B.isObject,B.JSONEncode=B.JSONEncode,B.JSONDecode=B.JSONDecode,B.isBlockedUA=B.isBlockedUA,B.isEmptyObject=B.isEmptyObject,B.info=B.info,B.info.device=B.info.device,B.info.browser=B.info.browser,B.info.browserVersion=B.info.browserVersion,B.info.properties=B.info.properties;var K=function(){};K.prototype.create_properties=function(){},K.prototype.event_handler=function(){},K.prototype.after_track_handler=function(){},K.prototype.init=function(e){return this.mp=e,this},K.prototype.track=function(e,t,r,i){var o=this,n=B.dom_query(e);if(0!==n.length)return B.each(n,(function(e){B.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;U.error("The DOM query ("+e+") returned 0 elements")},K.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))}},K.prototype.create_properties=function(e,t){return"function"==typeof e?e(t):B.extend({},e)};var G=function(){this.override_event="click"};B.inherit(G,K),G.prototype.create_properties=function(e,t){var r=G.superclass.create_properties.apply(this,arguments);return t.href&&(r.url=t.href),r},G.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()},G.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout((function(){window.location=t.href}),0)};var V=function(){this.override_event="submit"};B.inherit(V,K),V.prototype.event_handler=function(e,t,r){r.element=t,e.preventDefault()},V.prototype.after_track_handler=function(e,t){setTimeout((function(){t.element.submit()}),0)};var W=j("lock"),X=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3};X.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 W.error("Timeout waiting for mutex on "+n+"; clearing lock. ["+i+"]"),c.removeItem(_),c.removeItem(u),void g();setTimeout((function(){try{e()}catch(e){h(e)}}),s*(Math.random()+.1))},f=function(e,t){e()?t():l((function(){f(e,t)}))},d=function(){var e=c.getItem(u);if(e&&e!==i)return!1;if(c.setItem(u,i),c.getItem(u)===i)return!0;if(!P(c,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},g=function(){c.setItem(p,i),f(d,(function(){c.getItem(p)!==i?l((function(){c.getItem(u)===i?f((function(){return!c.getItem(_)}),m):g()})):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(!P(c,!0))throw new Error("localStorage support check failed");g()}catch(e){h(e)}};var Y=j("batch"),Z=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.reportError=t.errorReporter||B.bind(Y.error,Y),this.lock=new X(e,{storage:this.storage}),this.pid=t.pid||null,this.memQueue=[]};Z.prototype.enqueue=function(e,t,r){var i={id:R(),flushAfter:(new Date).getTime()+2*t,payload:e};this.lock.withLock(B.bind((function(){var t;try{var o=this.readFromStorage();o.push(i),(t=this.saveToStorage(o))&&this.memQueue.push(i)}catch(r){this.reportError("Error enqueueing item",e),t=!1}r&&r(t)}),this),B.bind((function(e){this.reportError("Error acquiring storage lock",e),r&&r(!1)}),this),this.pid)},Z.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 ee=function(e,t){var r=[];return B.each(e,(function(e){e.id&&!t[e.id]&&r.push(e)})),r};Z.prototype.removeItemsByID=function(e,t){var r={};B.each(e,(function(e){r[e]=!0})),this.memQueue=ee(this.memQueue,r);var i=B.bind((function(){var t;try{var i=this.readFromStorage();if(i=ee(i,r),t=this.saveToStorage(i)){i=this.readFromStorage();for(var o=0;o=t)this.reportError("Network timeout; retrying"),this.flush();else if(B.isObject(n)&&n.xhr_req&&(n.xhr_req.status>=500||429===n.xhr_req.status||"timeout"===n.error)){var c=2*this.flushInterval,p=n.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(B.isObject(n)&&n.xhr_req&&413===n.xhr_req.status)if(o.length>1){var _=Math.max(1,Math.floor(i/2));this.batchSize=Math.min(this.batchSize,_,o.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",o),this.resetBatchSize(),a=!0;else a=!0;a&&this.queue.removeItemsByID(B.map(o,(function(e){return e.id})),B.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))}catch(e){this.reportError("Error handling API response",e),this.resetFlush()}}),this),c={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};e.unloading&&(c.transport="sendBeacon"),re.log("MIXPANEL REQUEST:",n),this.sendRequest(n,c,a)}catch(e){this.reportError("Error flushing request queue",e),this.resetFlush()}},ie.prototype.reportError=function(e,t){if(re.error.apply(re.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(t){re.error(t)}};var me="$set",ye="$set_once",ve="$unset",be="$add",ke="$append",xe="$union",we="$remove",qe={set_action:function(e,t){var r={},i={};return B.isObject(e)?B.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 B.isArray(e)||(e=[e]),B.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 B.isObject(e)?B.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 B.isObject(e)?B.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=B.isArray(e)?e:[e])}),this):i[e]=B.isArray(t)?t:[t],r.$union=i,r},append_action:function(e,t){var r={},i={};return B.isObject(e)?B.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 B.isObject(e)?B.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,r.$remove=i,r},delete_action:function(){return{$delete:""}}},Se=function(){};B.extend(Se.prototype,qe),Se.prototype._init=function(e,t,r){this._mixpanel=e,this._group_key=t,this._group_id=r},Se.prototype.set=ue((function(e,t,r){var i=this.set_action(e,t);return B.isObject(e)&&(r=t),this._send_request(i,r)})),Se.prototype.set_once=ue((function(e,t,r){var i=this.set_once_action(e,t);return B.isObject(e)&&(r=t),this._send_request(i,r)})),Se.prototype.unset=ue((function(e,t){var r=this.unset_action(e);return this._send_request(r,t)})),Se.prototype.union=ue((function(e,t,r){B.isObject(e)&&(r=t);var i=this.union_action(e,t);return this._send_request(i,r)})),Se.prototype.delete=ue((function(e){var t=this.delete_action();return this._send_request(t,e)})),Se.prototype.remove=ue((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=B.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:r,endpoint:this._get_config("api_host")+"/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 Ee=function(){};B.extend(Ee.prototype,qe),Ee.prototype._init=function(e){this._mixpanel=e},Ee.prototype.set=pe((function(e,t,r){var i=this.set_action(e,t);return B.isObject(e)&&(r=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),i.$set=B.extend({},B.info.people_properties(),this._mixpanel.persistence.get_referrer_info(),i.$set),this._send_request(i,r)})),Ee.prototype.set_once=pe((function(e,t,r){var i=this.set_once_action(e,t);return B.isObject(e)&&(r=t),this._send_request(i,r)})),Ee.prototype.unset=pe((function(e,t){var r=this.unset_action(e);return this._send_request(r,t)})),Ee.prototype.increment=pe((function(e,t,r){var i={},o={};return B.isObject(e)?(B.each(e,(function(e,t){if(!this._is_reserved_property(t)){if(isNaN(parseFloat(e)))return void U.error("Invalid increment value passed to mixpanel.people.increment - must be a number");o[t]=e}}),this),r=t):(B.isUndefined(t)&&(t=1),o[e]=t),i.$add=o,this._send_request(i,r)})),Ee.prototype.append=pe((function(e,t,r){B.isObject(e)&&(r=t);var i=this.append_action(e,t);return this._send_request(i,r)})),Ee.prototype.remove=pe((function(e,t,r){B.isObject(e)&&(r=t);var i=this.remove_action(e,t);return this._send_request(i,r)})),Ee.prototype.union=pe((function(e,t,r){B.isObject(e)&&(r=t);var i=this.union_action(e,t);return this._send_request(i,r)})),Ee.prototype.track_charge=pe((function(e,t,r){if(B.isNumber(e)||(e=parseFloat(e),!isNaN(e)))return this.append("$transactions",B.extend({$amount:e},t),r);U.error("Invalid value passed to mixpanel.people.track_charge - must be a number")})),Ee.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},Ee.prototype.delete_user=function(){if(this._identify_called()){var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)}U.error("mixpanel.people.delete_user() requires you to call identify() first")},Ee.prototype.toString=function(){return this._mixpanel.toString()+".people"},Ee.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=B.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:n,endpoint:this._get_config("api_host")+"/engage/",batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),B.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),B.truncate(n,255))},Ee.prototype._get_config=function(e){return this._mixpanel.get_config(e)},Ee.prototype._identify_called=function(){return!0===this._mixpanel._flags.identify_called},Ee.prototype._enqueue=function(e){me in e?this._mixpanel.persistence._add_to_people_queue(me,e):ye in e?this._mixpanel.persistence._add_to_people_queue(ye,e):ve in e?this._mixpanel.persistence._add_to_people_queue(ve,e):be in e?this._mixpanel.persistence._add_to_people_queue(be,e):ke in e?this._mixpanel.persistence._add_to_people_queue(ke,e):we in e?this._mixpanel.persistence._add_to_people_queue(we,e):xe in e?this._mixpanel.persistence._add_to_people_queue(xe,e):U.error("Invalid call to _enqueue():",e)},Ee.prototype._flush_one_queue=function(e,t,r,i){var o=this,n=B.extend({},this._mixpanel.persistence._get_queue(e)),s=n;B.isUndefined(n)||!B.isObject(n)||B.isEmptyObject(n)||(o._mixpanel.persistence._pop_from_people_queue(e,n),i&&(s=i(n)),t.call(o,s,(function(t,i){0===t&&o._mixpanel.persistence._add_to_people_queue(e,n),B.isUndefined(r)||r(t,i)})))},Ee.prototype._flush=function(e,t,r,i,o,n,s){var a=this,c=this._mixpanel.persistence._get_queue(ke),p=this._mixpanel.persistence._get_queue(we);if(this._flush_one_queue(me,this.set,e),this._flush_one_queue(ye,this.set_once,i),this._flush_one_queue(ve,this.unset,n,(function(e){return B.keys(e)})),this._flush_one_queue(be,this.increment,t),this._flush_one_queue(xe,this.union,o),!B.isUndefined(c)&&B.isArray(c)&&c.length){for(var u,_=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(ke,u),B.isUndefined(r)||r(e,t)},h=c.length-1;h>=0;h--)u=c.pop(),B.isEmptyObject(u)||a.append(u,_);a._mixpanel.persistence.save()}if(!B.isUndefined(p)&&B.isArray(p)&&p.length){for(var l,f=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(we,l),B.isUndefined(s)||s(e,t)},d=p.length-1;d>=0;d--)l=p.pop(),B.isEmptyObject(l)||a.remove(l,f);a._mixpanel.persistence.save()}},Ee.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e},Ee.prototype.set=Ee.prototype.set,Ee.prototype.set_once=Ee.prototype.set_once,Ee.prototype.unset=Ee.prototype.unset,Ee.prototype.increment=Ee.prototype.increment,Ee.prototype.append=Ee.prototype.append,Ee.prototype.remove=Ee.prototype.remove,Ee.prototype.union=Ee.prototype.union,Ee.prototype.track_charge=Ee.prototype.track_charge,Ee.prototype.clear_charges=Ee.prototype.clear_charges,Ee.prototype.delete_user=Ee.prototype.delete_user,Ee.prototype.toString=Ee.prototype.toString;var Oe,Ie,De="__mps",Ae="__mpso",Te="__mpus",$e="__mpa",Be="__mpap",Ue="__mpr",Ce="__mpu",je="$people_distinct_id",Ne="__alias",Me=[De,Ae,Te,$e,Be,Ue,Ce,je,Ne,"__timers"],Pe=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&&(U.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),"localStorage"===t&&B.localStorage.is_supported()?this.storage=B.localStorage:this.storage=B.cookie,this.load(),this.update_config(e),this.upgrade(e),this.save()};Pe.prototype.properties=function(){var e={};return B.each(this.props,(function(t,r){B.include(Me,r)||(e[r]=t)})),e},Pe.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=B.extend({},e))}},Pe.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=B.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===B.localStorage&&(r=B.cookie.parse(this.name),B.cookie.remove(this.name),B.cookie.remove(this.name,!0),r&&this.register_once(r))},Pe.prototype.save=function(){this.disabled||this.storage.set(this.name,B.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},Pe.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},Pe.prototype.clear=function(){this.remove(),this.props={}},Pe.prototype.register_once=function(e,t,r){return!!B.isObject(e)&&(void 0===t&&(t="None"),this.expire_days=void 0===r?this.default_expiry:r,B.each(e,(function(e,r){this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.props[r]=e)}),this),this.save(),!0)},Pe.prototype.register=function(e,t){return!!B.isObject(e)&&(this.expire_days=void 0===t?this.default_expiry:t,B.extend(this.props,e),this.save(),!0)},Pe.prototype.unregister=function(e){e in this.props&&(delete this.props[e],this.save())},Pe.prototype.update_campaign_params=function(){this.campaign_params_saved||(this.register_once(B.info.campaignParams()),this.campaign_params_saved=!0)},Pe.prototype.update_search_keyword=function(e){this.register(B.info.searchInfo(e))},Pe.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:B.info.referringDomain(e)||"$direct"},"")},Pe.prototype.get_referrer_info=function(){return B.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},Pe.prototype.safe_merge=function(e){return B.each(this.props,(function(t,r){r in e||(e[r]=t)})),e},Pe.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)},Pe.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},Pe.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())},Pe.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())},Pe.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},Pe.prototype.get_cross_subdomain=function(){return this.cross_subdomain},Pe.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},Pe.prototype._add_to_people_queue=function(e,t){var r=this._get_queue_key(e),i=t[e],o=this._get_or_create_queue(me),n=this._get_or_create_queue(ye),s=this._get_or_create_queue(ve),a=this._get_or_create_queue(be),c=this._get_or_create_queue(xe),p=this._get_or_create_queue(we,[]),u=this._get_or_create_queue(ke,[]);r===De?(B.extend(o,i),this._pop_from_people_queue(be,i),this._pop_from_people_queue(xe,i),this._pop_from_people_queue(ve,i)):r===Ae?(B.each(i,(function(e,t){t in n||(n[t]=e)})),this._pop_from_people_queue(ve,i)):r===Te?B.each(i,(function(e){B.each([o,n,a,c],(function(t){e in t&&delete t[e]})),B.each(u,(function(t){e in t&&delete t[e]})),s[e]=!0})):r===$e?(B.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(ve,i)):r===Ce?(B.each(i,(function(e,t){B.isArray(e)&&(t in c||(c[t]=[]),c[t]=c[t].concat(e))})),this._pop_from_people_queue(ve,i)):r===Ue?(p.push(i),this._pop_from_people_queue(ke,i)):r===Be&&(u.push(i),this._pop_from_people_queue(ve,i)),U.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),U.log(t),this.save()},Pe.prototype._pop_from_people_queue=function(e,t){var r=this._get_queue(e);B.isUndefined(r)||(B.each(t,(function(t,i){e===ke||e===we?B.each(r,(function(e){e[i]===t&&delete e[i]})):delete r[i]}),this),this.save())},Pe.prototype._get_queue_key=function(e){return e===me?De:e===ye?Ae:e===ve?Te:e===be?$e:e===ke?Be:e===we?Ue:e===xe?Ce:void U.error("Invalid queue:",e)},Pe.prototype._get_queue=function(e){return this.props[this._get_queue_key(e)]},Pe.prototype._get_or_create_queue=function(e,t){var r=this._get_queue_key(e);return t=B.isUndefined(t)?{}:t,this.props[r]||(this.props[r]=t)},Pe.prototype.set_event_timer=function(e,t){var r=this.props.__timers||{};r[e]=t,this.props.__timers=r,this.save()},Pe.prototype.remove_event_timer=function(e){var t=(this.props.__timers||{})[e];return B.isUndefined(t)||(delete this.props.__timers[e],this.save()),t};var Fe=function(e){return e},Re=function(){},ze="mixpanel",Le="base64",Je=t.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Qe=!Je&&-1===E.indexOf("MSIE")&&-1===E.indexOf("Mozilla"),He=null;x.sendBeacon&&(He=function(){return x.sendBeacon.apply(x,arguments)});var Ke={api_host:"https://api-js.mixpanel.com",api_method:"POST",api_transport:"XHR",api_payload_format:Le,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:Re,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:Re,store_google:!0,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:{}},Ge=!1,Ve=function(){},We=function(e,t,i){var o,n=i===ze?Ie:Ie[i];if(n&&0===Oe)o=n;else{if(n&&!B.isArray(n))return void U.error("You have already initialized "+i);o=new Ve}return o._cached_groups={},o._init(e,t,i),o.people=new Ee,o.people._init(o),r.DEBUG=r.DEBUG||o.get_config("debug"),!B.isUndefined(n)&&B.isArray(n)&&(o._execute_array.call(o.people,n.people),o._execute_array(n)),o};Ve.prototype.init=function(e,t,r){if(B.isUndefined(r))this.report_error("You must name your new library: init(token, config, name)");else{if(r!==ze){var i=We(e,t,r);return Ie[r]=i,i._loaded(),i}this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet")}},Ve.prototype._init=function(e,r,i){r=r||{},this.__loaded=!0,this.config={};var o={};if("api_payload_format"in r||(r.api_host||Ke.api_host).match(/\.mixpanel\.com$/)&&(o.api_payload_format="json"),this.set_config(B.extend({},Ke,o,r,{name:i,token:e,callback_fn:(i===ze?i:"mixpanel."+i)+"._jsc"})),this._jsc=Re,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(B.localStorage.is_supported(!0)&&Je){if(this.init_batchers(),He&&t.addEventListener){var n=B.bind((function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})}),this);t.addEventListener("pagehide",(function(e){e.persisted&&n()})),t.addEventListener("visibilitychange",(function(){"hidden"===w.visibilityState&&n()}))}}else this._batch_requests=!1,U.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support");this.persistence=this.cookie=new Pe(this.config),this.unpersisted_superprops={},this._gdpr_init();var s=B.UUID();this.get_distinct_id()||this.register_once({distinct_id:s,$device_id:s},"")},Ve.prototype._loaded=function(){this.get_config("loaded")(this),this._set_default_superprops()},Ve.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(w.referrer),this.get_config("store_google")&&this.persistence.update_campaign_params(),this.get_config("save_referrer")&&this.persistence.update_referrer_info(w.referrer)},Ve.prototype._dom_loaded=function(){B.each(this.__dom_loaded_queue,(function(e){this._track_dom.apply(this,e)}),this),this.has_opted_out_tracking()||B.each(this.__request_queue,(function(e){this._send_request.apply(this,e)}),this),delete this.__dom_loaded_queue,delete this.__request_queue},Ve.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(!Ge)return this.__dom_loaded_queue.push([e,t]),!1;var r=(new e).init(this);return r.track.apply(r,t)},Ve.prototype._prepare_callback=function(e,t){if(B.isUndefined(e))return null;if(Je)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},Ve.prototype._send_request=function(e,t,r,i){var o=!0;if(Qe)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||!B.isFunction(r)&&"string"!=typeof r||(i=r,r=null),r=B.extend(n,r||{}),Je||(r.method="GET");var a="POST"===r.method,c=He&&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),Je||(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+="?"+B.HTTPBuildQuery(t);var u=this;if("img"in t){var _=w.createElement("img");_.src=e,w.body.appendChild(_)}else if(c){try{o=He(e,s)}catch(e){u.report_error(e),o=!1}try{i&&i(o?1:0)}catch(e){u.report_error(e)}}else if(Je)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"),B.each(l,(function(e,t){h.setRequestHeader(t,e)})),r.timeout_ms&&void 0!==h.timeout){h.timeout=r.timeout_ms;var f=(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=B.JSONDecode(h.responseText)}catch(e){if(u.report_error(e),!r.ignore_json_errors)return;t=h.responseText}i(t)}else i(Number(h.responseText))}else e=h.timeout&&!h.status&&(new Date).getTime()-f>=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(e){u.report_error(e),o=!1}else{var d=w.createElement("script");d.type="text/javascript",d.async=!0,d.defer=!0,d.src=e;var g=w.getElementsByTagName("script")[0];g.parentNode.insertBefore(d,g)}return o},Ve.prototype._execute_array=function(e){var t,r=[],i=[],o=[];B.each(e,(function(e){e&&(t=e[0],B.isArray(t)?o.push(e):"function"==typeof e?e.call(this):B.isArray(e)&&"alias"===t?r.push(e):B.isArray(e)&&-1!==t.indexOf("track")&&"function"==typeof this[t]?o.push(e):i.push(e))}),this);var n=function(e,t){B.each(e,(function(e){if(B.isArray(e[0])){var r=t;B.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)},Ve.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},Ve.prototype.init_batchers=function(){var e=this.get_config("token");if(!this.are_batchers_initialized()){var t=B.bind((function(t){return new ie("__mpq_"+e+t.queue_suffix,{libConfig:this.config,sendRequestFunc:B.bind((function(e,r,i){this._send_request(this.get_config("api_host")+t.endpoint,this._encode_data_for_request(e),r,this._prepare_callback(i,e))}),this),beforeSendHook:B.bind((function(e){return this._run_hook("before_send_"+t.type,e)}),this),errorReporter:this.get_config("error_reporter"),stopAllBatchingFunc:B.bind(this.stop_batch_senders,this)})}),this);this.request_batchers={events:t({type:"events",endpoint:"/track/",queue_suffix:"_ev"}),people:t({type:"people",endpoint:"/engage/",queue_suffix:"_pp"}),groups:t({type:"groups",endpoint:"/groups/",queue_suffix:"_gr"})}}this.get_config("batch_autostart")&&this.start_batch_senders()},Ve.prototype.start_batch_senders=function(){this.are_batchers_initialized()&&(this._batch_requests=!0,B.each(this.request_batchers,(function(e){e.start()})))},Ve.prototype.stop_batch_senders=function(){this._batch_requests=!1,B.each(this.request_batchers,(function(e){e.stop(),e.clear()}))},Ve.prototype.push=function(e){this._execute_array([e])},Ve.prototype.disable=function(e){void 0===e?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},Ve.prototype._encode_data_for_request=function(e){var t=B.JSONEncode(e);return this.get_config("api_payload_format")===Le&&(t=B.base64Encode(t)),{data:t}},Ve.prototype._track_or_batch=function(e,t){var r=B.truncate(e.data,255),i=e.endpoint,o=e.batcher,n=e.should_send_immediately,s=e.send_request_options||{};t=t||Re;var a=!0,c=B.bind((function(){return s.skip_hooks||(r=this._run_hook("before_send_"+e.type,r)),r?(U.log("MIXPANEL REQUEST:"),U.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},Ve.prototype.track=ce((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=Re),B.isUndefined(e))this.report_error("No event name provided to mixpanel.track");else{if(!this._event_is_disabled(e)){(t=t||{}).token=this.get_config("token");var s=this.persistence.remove_event_timer(e);if(!B.isUndefined(s)){var a=(new Date).getTime()-s;t.$duration=parseFloat((a/1e3).toFixed(3))}this._set_default_superprops(),t=B.extend({},B.info.properties(),this.persistence.properties(),this.unpersisted_superprops,t);var c=this.get_config("property_blacklist");B.isArray(c)?B.each(c,(function(e){delete t[e]})):this.report_error("Invalid value for property_blacklist config: "+c);var p={event:e,properties:t};return this._track_or_batch({type:"events",data:p,endpoint:this.get_config("api_host")+"/track/",batcher:this.request_batchers.events,should_send_immediately:n,send_request_options:r},i)}i(0)}})),Ve.prototype.set_group=ce((function(e,t,r){B.isArray(t)||(t=[t]);var i={};return i[e]=t,this.register(i),this.people.set(e,t,r)})),Ve.prototype.add_group=ce((function(e,t,r){var i=this.get_property(e);if(void 0===i){var o={};o[e]=[t],this.register(o)}else-1===i.indexOf(t)&&(i.push(t),this.register(o));return this.people.union(e,t,r)})),Ve.prototype.remove_group=ce((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)})),Ve.prototype.track_with_groups=ce((function(e,t,r,i){var o=B.extend({},t||{});return B.each(r,(function(e,t){null!=e&&(o[t]=e)})),this.track(e,o,i)})),Ve.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},Ve.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},Ve.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},Ve.prototype.track_pageview=function(e){B.isUndefined(e)&&(e=w.location.href),this.track("mp_page_view",B.info.pageviewInfo(e))},Ve.prototype.track_links=function(){return this._track_dom.call(this,G,arguments)},Ve.prototype.track_forms=function(){return this._track_dom.call(this,V,arguments)},Ve.prototype.time_event=function(e){B.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 Xe={persistent:!0},Ye=function(e){var t;return t=B.isObject(e)?e:B.isUndefined(e)?{}:{days:e},B.extend({},Xe,t)};Ve.prototype.register=function(e,t){var r=Ye(t);r.persistent?this.persistence.register(e,r.days):B.extend(this.unpersisted_superprops,e)},Ve.prototype.register_once=function(e,t,r){var i=Ye(r);i.persistent?this.persistence.register_once(e,t,i.days):(void 0===t&&(t="None"),B.each(e,(function(e,r){this.unpersisted_superprops.hasOwnProperty(r)&&this.unpersisted_superprops[r]!==t||(this.unpersisted_superprops[r]=e)}),this))},Ve.prototype.unregister=function(e,t){(t=Ye(t)).persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]},Ve.prototype._register_single=function(e,t){var r={};r[e]=t,this.register(r)},Ve.prototype.identify=function(e,t,r,i,o,n,s,a){var c=this.get_distinct_id();if(this.register({$user_id:e}),!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(Ne)&&(this.unregister(Ne),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})},Ve.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=B.UUID();this.register_once({distinct_id:e,$device_id:e},"")},Ve.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},Ve.prototype.alias=function(e,t){if(e===this.get_property(je))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var r=this;return B.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Ne,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)},Ve.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},Ve.prototype.set_config=function(e){B.isObject(e)&&(B.extend(this.config,e),e.batch_size&&B.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),r.DEBUG=r.DEBUG||this.get_config("debug"))},Ve.prototype.get_config=function(e){return this.config[e]},Ve.prototype._run_hook=function(e){var t=(this.config.hooks[e]||Fe).apply(this,y.call(arguments,1));return void 0===t&&(this.report_error(e+" hook did not return a value"),t=null),t},Ve.prototype.get_property=function(e){return this.persistence.props[e]},Ve.prototype.toString=function(){var e=this.get_config("name");return e!==ze&&(e="mixpanel."+e),e},Ve.prototype._event_is_disabled=function(e){return B.isBlockedUA(E)||this._flags.disable_all_events||B.include(this.__disabled_events,e)},Ve.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_tracking_persistence_type")&&B.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")&&!B.cookie.get("mp_optout")||(B.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},Ve.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&&B.each(this.request_batchers,(function(e){e.clear()}))},Ve.prototype._gdpr_call_func=function(e,t){return t=B.extend({track:B.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),B.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})},Ve.prototype.opt_in_tracking=function(e){e=B.extend({enable_persistence:!0},e),this._gdpr_call_func(oe,e),this._gdpr_update_persistence(e)},Ve.prototype.opt_out_tracking=function(e){(e=B.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(ne,e),this._gdpr_update_persistence(e)},Ve.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(se,e)},Ve.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(ae,e)},Ve.prototype.clear_opt_in_out_tracking=function(e){e=B.extend({enable_persistence:!0},e),this._gdpr_call_func(_e,e),this._gdpr_update_persistence(e)},Ve.prototype.report_error=function(e,t){U.error.apply(U.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(t){U.error(t)}},Ve.prototype.init=Ve.prototype.init,Ve.prototype.reset=Ve.prototype.reset,Ve.prototype.disable=Ve.prototype.disable,Ve.prototype.time_event=Ve.prototype.time_event,Ve.prototype.track=Ve.prototype.track,Ve.prototype.track_links=Ve.prototype.track_links,Ve.prototype.track_forms=Ve.prototype.track_forms,Ve.prototype.track_pageview=Ve.prototype.track_pageview,Ve.prototype.register=Ve.prototype.register,Ve.prototype.register_once=Ve.prototype.register_once,Ve.prototype.unregister=Ve.prototype.unregister,Ve.prototype.identify=Ve.prototype.identify,Ve.prototype.alias=Ve.prototype.alias,Ve.prototype.name_tag=Ve.prototype.name_tag,Ve.prototype.set_config=Ve.prototype.set_config,Ve.prototype.get_config=Ve.prototype.get_config,Ve.prototype.get_property=Ve.prototype.get_property,Ve.prototype.get_distinct_id=Ve.prototype.get_distinct_id,Ve.prototype.toString=Ve.prototype.toString,Ve.prototype.opt_out_tracking=Ve.prototype.opt_out_tracking,Ve.prototype.opt_in_tracking=Ve.prototype.opt_in_tracking,Ve.prototype.has_opted_out_tracking=Ve.prototype.has_opted_out_tracking,Ve.prototype.has_opted_in_tracking=Ve.prototype.has_opted_in_tracking,Ve.prototype.clear_opt_in_out_tracking=Ve.prototype.clear_opt_in_out_tracking,Ve.prototype.get_group=Ve.prototype.get_group,Ve.prototype.set_group=Ve.prototype.set_group,Ve.prototype.add_group=Ve.prototype.add_group,Ve.prototype.remove_group=Ve.prototype.remove_group,Ve.prototype.track_with_groups=Ve.prototype.track_with_groups,Ve.prototype.start_batch_senders=Ve.prototype.start_batch_senders,Ve.prototype.stop_batch_senders=Ve.prototype.stop_batch_senders,Pe.prototype.properties=Pe.prototype.properties,Pe.prototype.update_search_keyword=Pe.prototype.update_search_keyword,Pe.prototype.update_referrer_info=Pe.prototype.update_referrer_info,Pe.prototype.get_cross_subdomain=Pe.prototype.get_cross_subdomain,Pe.prototype.clear=Pe.prototype.clear;var Ze={},et=(Oe=0,(Ie=new Ve).init=function(e,r,i){if(i)return Ie[i]||(Ie[i]=Ze[i]=We(e,r,i),Ie[i]._loaded()),Ie[i];var o=Ie;Ze.mixpanel?o=Ze.mixpanel:e&&((o=We(e,r,ze))._loaded(),Ze.mixpanel=o),Ie=o,1===Oe&&(t.mixpanel=Ie),B.each(Ze,(function(e,t){t!==ze&&(Ie[t]=e)})),Ie._=B},Ie.init(),function(){function e(){e.done||(e.done=!0,Ge=!0,Qe=!1,B.each(Ze,(function(e){e._dom_loaded()})))}if(w.addEventListener)"complete"===w.readyState?e():w.addEventListener("DOMContentLoaded",e,!1);else if(w.attachEvent){w.attachEvent("onreadystatechange",e);var r=!1;try{r=null===t.frameElement}catch(e){}w.documentElement.doScroll&&r&&function t(){try{w.documentElement.doScroll("left")}catch(e){return void setTimeout(t,1)}e()}()}B.register_event(t,"load",e,!0)}(),Ie);e.exports=et}}]);