@reservamos/browser-analytics 0.1.4-alpha.3 → 0.1.4-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,4 +27,4 @@ PERFORMANCE OF THIS SOFTWARE.
27
27
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
28
28
  PERFORMANCE OF THIS SOFTWARE.
29
29
  ***************************************************************************** */
30
- function __awaiter2(e,t,n,i){return new(n||(n=Promise))((function(t,s){function fulfilled(e){try{step(i.next(e))}catch(t){s(t)}}function rejected(e){try{step(i.throw(e))}catch(t){s(t)}}function step(e){e.done?t(e.value):function adopt(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((i=i.apply(e,[])).next())}))}for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),n=0;n<64;n++)t[e.charCodeAt(n)]=n;var encode2=function(t){var n,i=new Uint8Array(t),s=i.length,a="";for(n=0;n<s;n+=3)a+=e[i[n]>>2],a+=e[(3&i[n])<<4|i[n+1]>>4],a+=e[(15&i[n+1])<<2|i[n+2]>>6],a+=e[63&i[n+2]];return s%3==2?a=a.substring(0,a.length-1)+"=":s%3==1&&(a=a.substring(0,a.length-2)+"=="),a};const i=new Map,s=new Map;const a=self;a.onmessage=function(e){return __awaiter2(this,0,void 0,(function*(){if(!("OffscreenCanvas"in globalThis))return a.postMessage({id:e.data.id});{const{id:t,bitmap:n,width:c,height:d,dataURLOptions:u}=e.data,l=function getTransparentBlobFor(e,t,n){return __awaiter2(this,0,void 0,(function*(){const i=`${e}-${t}`;if("OffscreenCanvas"in globalThis){if(s.has(i))return s.get(i);const a=new OffscreenCanvas(e,t);a.getContext("2d");const c=yield a.convertToBlob(n),d=yield c.arrayBuffer(),u=encode2(d);return s.set(i,u),u}return""}))}(c,d,u),p=new OffscreenCanvas(c,d);p.getContext("2d").drawImage(n,0,0),n.close();const h=yield p.convertToBlob(u),f=h.type,m=yield h.arrayBuffer(),_=encode2(m);if(!i.has(t)&&(yield l)===_)return i.set(t,_),a.postMessage({id:t});if(i.get(t)===_)return a.postMessage({id:t});a.postMessage({id:t,type:f,base64:_,width:c,height:d}),i.set(t,_)}}))}}()}));class CanvasManager{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:i,blockSelector:s,recordCanvas:a,dataURLOptions:c}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&"all"===t&&this.initCanvasMutationObserver(n,i,s),a&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,i,s,{dataURLOptions:c})}initCanvasFPSObserver(e,t,n,i,s){const a=initCanvasContextObserver(t,n,i,!0),c=new Map,d=new At;d.onmessage=e=>{const{id:t}=e.data;if(c.set(t,!1),!("base64"in e.data))return;const{base64:n,type:i,width:s,height:a}=e.data;this.mutationCb({id:t,type:Ct["2D"],commands:[{property:"clearRect",args:[0,0,s,a]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:i}]},0,0]}]})};const u=1e3/e;let l,p=0;const takeCanvasSnapshots=e=>{p&&e-p<u||(p=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{isBlocked(t,n,i,!0)||e.push(t)})),e})().forEach((e=>__awaiter(this,0,void 0,(function*(){var t;const n=this.mirror.getId(e);if(c.get(n))return;if(0===e.width||0===e.height)return;if(c.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const i=yield createImageBitmap(e);d.postMessage({id:n,bitmap:i,width:e.width,height:e.height,dataURLOptions:s.dataURLOptions},[i])}))))),l=requestAnimationFrame(takeCanvasSnapshots)};l=requestAnimationFrame(takeCanvasSnapshots),this.resetObservers=()=>{a(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=initCanvasContextObserver(e,t,n,!1),s=function initCanvas2DMutationObserver(e,t,n,i){const s=[],a=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const d of a)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[d])continue;const a=patch(t.CanvasRenderingContext2D.prototype,d,(function(s){return function(...a){return isBlocked(this.canvas,n,i,!0)||setTimeout((()=>{const n=serializeArgs(a,t,this);e(this.canvas,{type:Ct["2D"],property:d,args:n})}),0),s.apply(this,a)}}));s.push(a)}catch(c){const n=hookSetter(t.CanvasRenderingContext2D.prototype,d,{set(t){e(this.canvas,{type:Ct["2D"],property:d,args:[t],setter:!0})}});s.push(n)}return()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),a=function initCanvasWebGLMutationObserver(e,t,n,i,s){const a=[];return a.push(...patchGLPrototype(t.WebGLRenderingContext.prototype,Ct.WebGL,e,n,i,0,t)),void 0!==t.WebGL2RenderingContext&&a.push(...patchGLPrototype(t.WebGL2RenderingContext.prototype,Ct.WebGL2,e,n,i,0,t)),()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{i(),s(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const setLatestRAFTimestamp=e=>{this.rafStamps.latestId=e,requestAnimationFrame(setLatestRAFTimestamp)};requestAnimationFrame(setLatestRAFTimestamp)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const i=n.map((e=>{const t=function __rest(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]])}return n}(e,["type"]);return t})),{type:s}=n[0];this.mutationCb({id:t,type:s,commands:i}),this.pendingCanvasMutations.delete(e)}}class StylesheetManager{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new StyleSheetMirror,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},i=[];for(const s of e){let e;this.styleMirror.has(s)?e=this.styleMirror.getId(s):(e=this.styleMirror.add(s),i.push({styleId:e,rules:Array.from(s.rules||CSSRule,((e,t)=>({rule:stringifyRule(e),index:t})))})),n.styleIds.push(e)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class ProcessedNodeManager{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame((()=>{this.clear(),this.loop&&this.periodicallyClear()}))}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some((e=>e!==t))}add(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function wrapEvent(e){return Object.assign(Object.assign({},e),{timestamp:kt()})}let Lt,jt,Ft,Ut=!1;const qt=function createMirror(){return new Mirror}();function record(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:s="rr-block",blockSelector:a=null,ignoreClass:c="rr-ignore",ignoreSelector:d=null,maskTextClass:u="rr-mask",maskTextSelector:l=null,inlineStylesheet:p=!0,maskAllInputs:h,maskInputOptions:f,slimDOMOptions:m,maskInputFn:_,maskTextFn:g,hooks:y,packFn:v,sampling:b={},dataURLOptions:S={},mousemoveWait:w,recordDOM:I=!0,recordCanvas:x=!1,recordCrossOriginIframes:C=!1,recordAfter:O=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:T=!1,collectFonts:R=!1,inlineImages:N=!1,plugins:Z,keepIframeSrcFn:P=()=>!1,ignoreCSSAttributes:D=new Set([]),errorHandler:A}=e;!function registerErrorHandler(e){Ot=e}(A);const L=!C||window.parent===window;let j=!1;if(!L)try{window.parent.document&&(j=!1)}catch(G){j=!0}if(L&&!t)throw new Error("emit function is required");void 0!==w&&void 0===b.mousemove&&(b.mousemove=w),qt.reset();const U=!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==f?f:{password:!0},q=!0===m||"all"===m?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===m,headMetaDescKeywords:"all"===m}:m||{};let $;!function polyfill(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let B=0;const eventProcessor=e=>{for(const t of Z||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!j&&(e=v(e)),e};Lt=(e,s)=>{var a;if(!(null===(a=Tt[0])||void 0===a?void 0:a.isFrozen())||e.type===wt.FullSnapshot||e.type===wt.IncrementalSnapshot&&e.data.source===It.Mutation||Tt.forEach((e=>e.unfreeze())),L)null==t||t(eventProcessor(e),s);else if(j){const t={type:"rrweb",event:eventProcessor(e),origin:window.location.origin,isCheckout:s};window.parent.postMessage(t,"*")}if(e.type===wt.FullSnapshot)$=e,B=0;else if(e.type===wt.IncrementalSnapshot){if(e.data.source===It.Mutation&&e.data.isAttachIframe)return;B++;const t=i&&B>=i,s=n&&e.timestamp-$.timestamp>n;(t||s)&&jt(!0)}};const wrappedMutationEmit=e=>{Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.Mutation},e)}))},wrappedScrollEmit=e=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.Scroll},e)})),wrappedCanvasMutationEmit=e=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.CanvasMutation},e)})),z=new StylesheetManager({mutationCb:wrappedMutationEmit,adoptedStyleSheetCb:e=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.AdoptedStyleSheet},e)}))}),W=new IframeManager({mirror:qt,mutationCb:wrappedMutationEmit,stylesheetManager:z,recordCrossOriginIframes:C,wrappedEmit:Lt});for(const Y of Z||[])Y.getMirror&&Y.getMirror({nodeMirror:qt,crossOriginIframeMirror:W.crossOriginIframeMirror,crossOriginIframeStyleMirror:W.crossOriginIframeStyleMirror});const K=new ProcessedNodeManager;Ft=new CanvasManager({recordCanvas:x,mutationCb:wrappedCanvasMutationEmit,win:window,blockClass:s,blockSelector:a,mirror:qt,sampling:b.canvas,dataURLOptions:S});const H=new ShadowDomManager({mutationCb:wrappedMutationEmit,scrollCb:wrappedScrollEmit,bypassOptions:{blockClass:s,blockSelector:a,maskTextClass:u,maskTextSelector:l,inlineStylesheet:p,maskInputOptions:U,dataURLOptions:S,maskTextFn:g,maskInputFn:_,recordCanvas:x,inlineImages:N,sampling:b,slimDOMOptions:q,iframeManager:W,stylesheetManager:z,canvasManager:Ft,keepIframeSrcFn:P,processedNodeManager:K},mirror:qt});jt=(e=!1)=>{if(!I)return;Lt(wrapEvent({type:wt.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),e),z.reset(),H.init(),Tt.forEach((e=>e.lock()));const t=function snapshot(e,t){const{mirror:n=new Mirror,blockClass:i="rr-block",blockSelector:s=null,maskTextClass:a="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:p=!1,maskTextFn:h,maskInputFn:f,slimDOM:m=!1,dataURLOptions:_,preserveWhiteSpace:g,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:w,keepIframeSrcFn:I=()=>!1}=t||{};return serializeNodeWithId(e,{doc:e,mirror:n,blockClass:i,blockSelector:s,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===p?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===p?{password:!0}:p,maskTextFn:h,maskInputFn:f,slimDOMOptions:!0===m||"all"===m?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===m,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===m?{}:m,dataURLOptions:_,inlineImages:u,recordCanvas:l,preserveWhiteSpace:g,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:w,keepIframeSrcFn:I,newlyAddedElement:!1})}(document,{mirror:qt,blockClass:s,blockSelector:a,maskTextClass:u,maskTextSelector:l,inlineStylesheet:p,maskAllInputs:U,maskTextFn:g,slimDOM:q,dataURLOptions:S,recordCanvas:x,inlineImages:N,onSerialize:e=>{isSerializedIframe(e,qt)&&W.addIframe(e),isSerializedStylesheet(e,qt)&&z.trackLinkElement(e),hasShadowRoot(e)&&H.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{W.attachIframe(e,t),H.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{z.attachLinkElement(e,t)},keepIframeSrcFn:P});if(!t)return console.warn("Failed to snapshot the document");Lt(wrapEvent({type:wt.FullSnapshot,data:{node:t,initialOffset:getWindowScroll(window)}}),e),Tt.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,qt.getId(document))};try{const e=[],observe=e=>{var t;return callbackWrapper(initObservers)({mutationCb:wrappedMutationEmit,mousemoveCb:(e,t)=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.MouseInteraction},e)})),scrollCb:wrappedScrollEmit,viewportResizeCb:e=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.ViewportResize},e)})),inputCb:e=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.Input},e)})),mediaInteractionCb:e=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.MediaInteraction},e)})),styleSheetRuleCb:e=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.StyleSheetRule},e)})),styleDeclarationCb:e=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.StyleDeclaration},e)})),canvasMutationCb:wrappedCanvasMutationEmit,fontCb:e=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.Font},e)})),selectionCb:e=>{Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.Selection},e)}))},customElementCb:e=>{Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.CustomElement},e)}))},blockClass:s,ignoreClass:c,ignoreSelector:d,maskTextClass:u,maskTextSelector:l,maskInputOptions:U,inlineStylesheet:p,sampling:b,recordDOM:I,recordCanvas:x,inlineImages:N,userTriggeredOnInput:T,collectFonts:R,doc:e,maskInputFn:_,maskTextFn:g,keepIframeSrcFn:P,blockSelector:a,slimDOMOptions:q,dataURLOptions:S,mirror:qt,iframeManager:W,stylesheetManager:z,shadowDomManager:H,processedNodeManager:K,canvasManager:Ft,ignoreCSSAttributes:D,plugins:(null===(t=null==Z?void 0:Z.filter((e=>e.observer)))||void 0===t?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>Lt(wrapEvent({type:wt.Plugin,data:{plugin:e.name,payload:t}}))}))))||[]},y)};W.addLoadListener((t=>{try{e.push(observe(t.contentDocument))}catch(Xt){console.warn(Xt)}}));const init2=()=>{jt(),e.push(observe(document)),Ut=!0};return"interactive"===document.readyState||"complete"===document.readyState?init2():(e.push(on("DOMContentLoaded",(()=>{Lt(wrapEvent({type:wt.DomContentLoaded,data:{}})),"DOMContentLoaded"===O&&init2()}))),e.push(on("load",(()=>{Lt(wrapEvent({type:wt.Load,data:{}})),"load"===O&&init2()}),window))),()=>{e.forEach((e=>e())),K.destroy(),Ut=!1,function unregisterErrorHandler(){Ot=void 0}()}}catch(Xt){console.warn(Xt)}}record.addCustomEvent=(e,t)=>{if(!Ut)throw new Error("please add custom event after start recording");Lt(wrapEvent({type:wt.Custom,data:{tag:e,payload:t}}))},record.freezePage=()=>{Tt.forEach((e=>e.freeze()))},record.takeFullSnapshot=e=>{if(!Ut)throw new Error("please take full snapshot after start recording");jt(e)},record.mirror=qt;var $t,Bt=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Bt||{}),zt=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(zt||{}),Wt={DEBUG:!1,LIB_VERSION:"2.55.1"};if("undefined"==typeof window){var Vt={hostname:""};$t={navigator:{userAgent:"",onLine:!0},document:{location:Vt,referrer:""},screen:{width:0,height:0},location:Vt}}else $t=window;var Kt,Ht,Gt,Yt,Jt,Xt,Qt,er,tr,rr,nr=864e5,ir=8e3,or=Array.prototype,sr=Function.prototype,ar=Object.prototype,cr=or.slice,dr=ar.toString,ur=ar.hasOwnProperty,lr=$t.console,pr=$t.navigator,hr=$t.document,fr=$t.opera,mr=$t.screen,_r=pr.userAgent,gr=sr.bind,yr=or.forEach,vr=or.indexOf,br=or.map,Sr=Array.isArray,kr={},wr={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},Ir={log:function(){if(Wt.DEBUG&&!wr.isUndefined(lr)&&lr)try{lr.log.apply(lr,arguments)}catch(e){wr.each(arguments,(function(e){lr.log(e)}))}},warn:function(){if(Wt.DEBUG&&!wr.isUndefined(lr)&&lr){var e=["Mixpanel warning:"].concat(wr.toArray(arguments));try{lr.warn.apply(lr,e)}catch(t){wr.each(e,(function(e){lr.warn(e)}))}}},error:function(){if(Wt.DEBUG&&!wr.isUndefined(lr)&&lr){var e=["Mixpanel error:"].concat(wr.toArray(arguments));try{lr.error.apply(lr,e)}catch(t){wr.each(e,(function(e){lr.error(e)}))}}},critical:function(){if(!wr.isUndefined(lr)&&lr){var e=["Mixpanel error:"].concat(wr.toArray(arguments));try{lr.error.apply(lr,e)}catch(t){wr.each(e,(function(e){lr.error(e)}))}}}},log_func_with_prefix=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(Ir,arguments)}},console_with_prefix=function(e){return{log:log_func_with_prefix(Ir.log,e),error:log_func_with_prefix(Ir.error,e),critical:log_func_with_prefix(Ir.critical,e)}};wr.bind=function(e,t){var n,i;if(gr&&e.bind===gr)return gr.apply(e,cr.call(arguments,1));if(!wr.isFunction(e))throw new TypeError;return n=cr.call(arguments,2),i=function(){if(!(this instanceof i))return e.apply(t,n.concat(cr.call(arguments)));var s={};s.prototype=e.prototype;var a=new s;s.prototype=null;var c=e.apply(a,n.concat(cr.call(arguments)));return Object(c)===c?c:a},i},wr.each=function(e,t,n){if(null!=e)if(yr&&e.forEach===yr)e.forEach(t,n);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(i in e&&t.call(n,e[i],i,e)===kr)return}else for(var a in e)if(ur.call(e,a)&&t.call(n,e[a],a,e)===kr)return},wr.extend=function(e){return wr.each(cr.call(arguments,1),(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},wr.isArray=Sr||function(e){return"[object Array]"===dr.call(e)},wr.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(t){return!1}},wr.isArguments=function(e){return!(!e||!ur.call(e,"callee"))},wr.toArray=function(e){return e?e.toArray?e.toArray():wr.isArray(e)||wr.isArguments(e)?cr.call(e):wr.values(e):[]},wr.map=function(e,t,n){if(br&&e.map===br)return e.map(t,n);var i=[];return wr.each(e,(function(e){i.push(t.call(n,e))})),i},wr.keys=function(e){var t=[];return null===e||wr.each(e,(function(e,n){t[t.length]=n})),t},wr.values=function(e){var t=[];return null===e||wr.each(e,(function(e){t[t.length]=e})),t},wr.include=function(e,t){var n=!1;return null===e?n:vr&&e.indexOf===vr?-1!=e.indexOf(t):(wr.each(e,(function(e){if(n||(n=e===t))return kr})),n)},wr.includes=function(e,t){return-1!==e.indexOf(t)},wr.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},wr.isObject=function(e){return e===Object(e)&&!wr.isArray(e)},wr.isEmptyObject=function(e){if(wr.isObject(e)){for(var t in e)if(ur.call(e,t))return!1;return!0}return!1},wr.isUndefined=function(e){return void 0===e},wr.isString=function(e){return"[object String]"==dr.call(e)},wr.isDate=function(e){return"[object Date]"==dr.call(e)},wr.isNumber=function(e){return"[object Number]"==dr.call(e)},wr.isElement=function(e){return!(!e||1!==e.nodeType)},wr.encodeDates=function(e){return wr.each(e,(function(t,n){wr.isDate(t)?e[n]=wr.formatDate(t):wr.isObject(t)&&(e[n]=wr.encodeDates(t))})),e},wr.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},wr.formatDate=function(e){function pad(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+pad(e.getUTCMonth()+1)+"-"+pad(e.getUTCDate())+"T"+pad(e.getUTCHours())+":"+pad(e.getUTCMinutes())+":"+pad(e.getUTCSeconds())},wr.strip_empty_properties=function(e){var t={};return wr.each(e,(function(e,n){wr.isString(e)&&e.length>0&&(t[n]=e)})),t},wr.truncate=function(e,t){var n;return"string"==typeof e?n=e.slice(0,t):wr.isArray(e)?(n=[],wr.each(e,(function(e){n.push(wr.truncate(e,t))}))):wr.isObject(e)?(n={},wr.each(e,(function(e,i){n[i]=wr.truncate(e,t)}))):n=e,n},wr.JSONEncode=function(){return function(e){var quote=function(e){var t=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return t.lastIndex=0,t.test(e)?'"'+e.replace(t,(function(e){var t=n[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'},str=function(e,t){var n="",i=0,s="",a="",c=0,d=n,u=[],l=t[e];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(e)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(n+=" ",u=[],"[object Array]"===dr.apply(l)){for(c=l.length,i=0;i<c;i+=1)u[i]=str(i,l)||"null";return a=0===u.length?"[]":n?"[\n"+n+u.join(",\n"+n)+"\n"+d+"]":"["+u.join(",")+"]",n=d,a}for(s in l)ur.call(l,s)&&(a=str(s,l))&&u.push(quote(s)+(n?": ":":")+a);return a=0===u.length?"{}":n?"{"+u.join(",")+d+"}":"{"+u.join(",")+"}",n=d,a}};return str("",{"":e})}}(),wr.JSONDecode=(Jt={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},Xt=function(e){var t=new SyntaxError(e);throw t.at=Kt,t.text=Gt,t},Qt=function(e){return e&&e!==Ht&&Xt("Expected '"+e+"' instead of '"+Ht+"'"),Ht=Gt.charAt(Kt),Kt+=1,Ht},er=function(){var e,t="";for("-"===Ht&&(t="-",Qt("-"));Ht>="0"&&Ht<="9";)t+=Ht,Qt();if("."===Ht)for(t+=".";Qt()&&Ht>="0"&&Ht<="9";)t+=Ht;if("e"===Ht||"E"===Ht)for(t+=Ht,Qt(),"-"!==Ht&&"+"!==Ht||(t+=Ht,Qt());Ht>="0"&&Ht<="9";)t+=Ht,Qt();if(e=+t,isFinite(e))return e;Xt("Bad number")},tr=function(){var e,t,n,i="";if('"'===Ht)for(;Qt();){if('"'===Ht)return Qt(),i;if("\\"===Ht)if(Qt(),"u"===Ht){for(n=0,t=0;t<4&&(e=parseInt(Qt(),16),isFinite(e));t+=1)n=16*n+e;i+=String.fromCharCode(n)}else{if("string"!=typeof Jt[Ht])break;i+=Jt[Ht]}else i+=Ht}Xt("Bad string")},rr=function(){for(;Ht&&Ht<=" ";)Qt()},Yt=function(){switch(rr(),Ht){case"{":return function(){var e,t={};if("{"===Ht){if(Qt("{"),rr(),"}"===Ht)return Qt("}"),t;for(;Ht;){if(e=tr(),rr(),Qt(":"),Object.hasOwnProperty.call(t,e)&&Xt('Duplicate key "'+e+'"'),t[e]=Yt(),rr(),"}"===Ht)return Qt("}"),t;Qt(","),rr()}}Xt("Bad object")}();case"[":return function(){var e=[];if("["===Ht){if(Qt("["),rr(),"]"===Ht)return Qt("]"),e;for(;Ht;){if(e.push(Yt()),rr(),"]"===Ht)return Qt("]"),e;Qt(","),rr()}}Xt("Bad array")}();case'"':return tr();case"-":return er();default:return Ht>="0"&&Ht<="9"?er():function(){switch(Ht){case"t":return Qt("t"),Qt("r"),Qt("u"),Qt("e"),!0;case"f":return Qt("f"),Qt("a"),Qt("l"),Qt("s"),Qt("e"),!1;case"n":return Qt("n"),Qt("u"),Qt("l"),Qt("l"),null}Xt('Unexpected "'+Ht+'"')}()}},function(e){var t;return Gt=e,Kt=0,Ht=" ",t=Yt(),rr(),Ht&&Xt("Syntax error"),t}),wr.base64Encode=function(e){var t,n,i,s,a,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=0,u=0,l="",p=[];if(!e)return e;e=wr.utf8Encode(e);do{t=(a=e.charCodeAt(d++)<<16|e.charCodeAt(d++)<<8|e.charCodeAt(d++))>>18&63,n=a>>12&63,i=a>>6&63,s=63&a,p[u++]=c.charAt(t)+c.charAt(n)+c.charAt(i)+c.charAt(s)}while(d<e.length);switch(l=p.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l},wr.utf8Encode=function(e){var t,n,i,s,a="";for(t=n=0,i=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,s=0;s<i;s++){var c=e.charCodeAt(s),d=null;c<128?n++:d=c>127&&c<2048?String.fromCharCode(c>>6|192,63&c|128):String.fromCharCode(c>>12|224,c>>6&63|128,63&c|128),null!==d&&(n>t&&(a+=e.substring(t,n)),a+=d,t=n=s+1)}return n>t&&(a+=e.substring(t,e.length)),a},wr.UUID=function(){var T2=function(){var e,t=1*new Date;if($t.performance&&$t.performance.now)e=$t.performance.now();else for(e=0;t==1*new Date;)e++;return t.toString(16)+Math.floor(e).toString(16)};return function(){var e=(mr.height*mr.width).toString(16);return T2()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,n=_r,i=[],s=0;function xor(e,t){var n,s=0;for(n=0;n<t.length;n++)s|=i[n]<<8*n;return e^s}for(e=0;e<n.length;e++)t=n.charCodeAt(e),i.unshift(255&t),i.length>=4&&(s=xor(s,i),i=[]);return i.length>0&&(s=xor(s,i)),s.toString(16)}()+"-"+e+"-"+T2()}}();var xr=["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"];wr.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<xr.length;t++)if(-1!==e.indexOf(xr[t]))return!0;return!1},wr.HTTPBuildQuery=function(e,t){var n,i,s=[];return wr.isUndefined(t)&&(t="&"),wr.each(e,(function(e,t){n=encodeURIComponent(e.toString()),i=encodeURIComponent(t),s[s.length]=i+"="+n})),s.join(t)},wr.getQueryParam=function(e,t){t=t.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var n=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);if(null===n||n&&"string"!=typeof n[1]&&n[1].length)return"";var i=n[1];try{i=decodeURIComponent(i)}catch(s){Ir.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},wr.cookie={get:function(e){for(var t=e+"=",n=hr.cookie.split(";"),i=0;i<n.length;i++){for(var s=n[i];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}return null},parse:function(e){var t;try{t=wr.JSONDecode(wr.cookie.get(e))||{}}catch(n){}return t},set_seconds:function(e,t,n,i,s,a,c){var d="",u="",l="";if(c)d="; domain="+c;else if(i){var p=extract_domain(hr.location.hostname);d=p?"; domain=."+p:""}if(n){var h=new Date;h.setTime(h.getTime()+1e3*n),u="; expires="+h.toGMTString()}a&&(s=!0,l="; SameSite=None"),s&&(l+="; secure"),hr.cookie=e+"="+encodeURIComponent(t)+u+"; path=/"+d+l},set:function(e,t,n,i,s,a,c){var d="",u="",l="";if(c)d="; domain="+c;else if(i){var p=extract_domain(hr.location.hostname);d=p?"; domain=."+p:""}if(n){var h=new Date;h.setTime(h.getTime()+24*n*60*60*1e3),u="; expires="+h.toGMTString()}a&&(s=!0,l="; SameSite=None"),s&&(l+="; secure");var f=e+"="+encodeURIComponent(t)+u+"; path=/"+d+l;return hr.cookie=f,f},remove:function(e,t,n){wr.cookie.set(e,"",-1,t,!1,!1,n)}};var Er=null,localStorageSupported=function(e,t){if(null!==Er&&!t)return Er;var n=!0;try{e=e||window.localStorage;var i="__mplss_"+cheap_guid(8);e.setItem(i,"xyz"),"xyz"!==e.getItem(i)&&(n=!1),e.removeItem(i)}catch(s){n=!1}return Er=n,n};wr.localStorage={is_supported:function(e){var t=localStorageSupported(null,e);return t||Ir.error("localStorage unsupported; falling back to cookie store"),t},error:function(e){Ir.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(t){wr.localStorage.error(t)}return null},parse:function(e){try{return wr.JSONDecode(wr.localStorage.get(e))||{}}catch(t){}return null},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(n){wr.localStorage.error(n)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(t){wr.localStorage.error(t)}}},wr.register_event=function(){function fixEvent(e){return e&&(e.preventDefault=fixEvent.preventDefault,e.stopPropagation=fixEvent.stopPropagation),e}return fixEvent.preventDefault=function(){this.returnValue=!1},fixEvent.stopPropagation=function(){this.cancelBubble=!0},function(e,t,n,i,s){if(e)if(e.addEventListener&&!i)e.addEventListener(t,n,!!s);else{var a="on"+t,c=e[a];e[a]=function makeHandler(e,t,n){var handler=function(i){if(i=i||fixEvent(window.event)){var s,a,c=!0;return wr.isFunction(n)&&(s=n(i)),a=t.call(e,i),!1!==s&&!1!==a||(c=!1),c}};return handler}(e,n,c)}else Ir.error("No valid element provided to register_event")}}();var Cr=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');wr.dom_query=function(){function getAllChildren(e){return e.all?e.all:e.getElementsByTagName("*")}var e=/[\t\r\n]/g;function hasClass(t,n){var i=" "+n+" ";return(" "+t.className+" ").replace(e," ").indexOf(i)>=0}function getElementsBySelector(e){if(!hr.getElementsByTagName)return[];var t,n,i,s,a,c,d,u,l,p,h=e.split(" "),f=[hr];for(c=0;c<h.length;c++)if((t=h[c].replace(/^\s+/,"").replace(/\s+$/,"")).indexOf("#")>-1){i=(n=t.split("#"))[0];var m=n[1],_=hr.getElementById(m);if(!_||i&&_.nodeName.toLowerCase()!=i)return[];f=[_]}else if(t.indexOf(".")>-1){i=(n=t.split("."))[0];var g=n[1];for(i||(i="*"),s=[],a=0,d=0;d<f.length;d++)for(l="*"==i?getAllChildren(f[d]):f[d].getElementsByTagName(i),u=0;u<l.length;u++)s[a++]=l[u];for(f=[],p=0,d=0;d<s.length;d++)s[d].className&&wr.isString(s[d].className)&&hasClass(s[d],g)&&(f[p++]=s[d])}else{var y=t.match(Cr);if(y){i=y[1];var v,b=y[2],S=y[3],w=y[4];for(i||(i="*"),s=[],a=0,d=0;d<f.length;d++)for(l="*"==i?getAllChildren(f[d]):f[d].getElementsByTagName(i),u=0;u<l.length;u++)s[a++]=l[u];switch(f=[],p=0,S){case"=":v=function(e){return e.getAttribute(b)==w};break;case"~":v=function(e){return e.getAttribute(b).match(new RegExp("\\b"+w+"\\b"))};break;case"|":v=function(e){return e.getAttribute(b).match(new RegExp("^"+w+"-?"))};break;case"^":v=function(e){return 0===e.getAttribute(b).indexOf(w)};break;case"$":v=function(e){return e.getAttribute(b).lastIndexOf(w)==e.getAttribute(b).length-w.length};break;case"*":v=function(e){return e.getAttribute(b).indexOf(w)>-1};break;default:v=function(e){return e.getAttribute(b)}}for(f=[],p=0,d=0;d<s.length;d++)v(s[d])&&(f[p++]=s[d])}else{for(i=t,s=[],a=0,d=0;d<f.length;d++)for(l=f[d].getElementsByTagName(i),u=0;u<l.length;u++)s[a++]=l[u];f=s}}return f}return function(e){return wr.isElement(e)?[e]:wr.isObject(e)&&!wr.isUndefined(e.length)?e:getElementsBySelector.call(this,e)}}();var Or=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],Tr=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];wr.info={campaignParams:function(e){var t="",n={};return wr.each(Or,(function(i){(t=wr.getQueryParam(hr.URL,i)).length?n[i]=t:void 0!==e&&(n[i]=e)})),n},clickParams:function(){var e="",t={};return wr.each(Tr,(function(n){(e=wr.getQueryParam(hr.URL,n)).length&&(t[n]=e)})),t},marketingParams:function(){return wr.extend(wr.info.campaignParams(),wr.info.clickParams())},searchEngine:function(e){return 0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(e){var t=wr.info.searchEngine(e),n="yahoo"!=t?"q":"p",i={};if(null!==t){i.$search_engine=t;var s=wr.getQueryParam(e,n);s.length&&(i.mp_keyword=s)}return i},browser:function(e,t,n){return t=t||"",n||wr.includes(e," OPR/")?wr.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":wr.includes(e,"IEMobile")||wr.includes(e,"WPDesktop")?"Internet Explorer Mobile":wr.includes(e,"SamsungBrowser/")?"Samsung Internet":wr.includes(e,"Edge")||wr.includes(e,"Edg/")?"Microsoft Edge":wr.includes(e,"FBIOS")?"Facebook Mobile":wr.includes(e,"Chrome")?"Chrome":wr.includes(e,"CriOS")?"Chrome iOS":wr.includes(e,"UCWEB")||wr.includes(e,"UCBrowser")?"UC Browser":wr.includes(e,"FxiOS")?"Firefox iOS":wr.includes(t,"Apple")?wr.includes(e,"Mobile")?"Mobile Safari":"Safari":wr.includes(e,"Android")?"Android Mobile":wr.includes(e,"Konqueror")?"Konqueror":wr.includes(e,"Firefox")?"Firefox":wr.includes(e,"MSIE")||wr.includes(e,"Trident/")?"Internet Explorer":wr.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var i={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[wr.info.browser(e,t,n)];if(void 0===i)return null;var s=e.match(i);return s?parseFloat(s[s.length-2]):null},os:function(){var e=_r;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},currentUrl:function(){return $t.location.href},properties:function(e){return"object"!=typeof e&&(e={}),wr.extend(wr.strip_empty_properties({$os:wr.info.os(),$browser:wr.info.browser(_r,pr.vendor,fr),$referrer:hr.referrer,$referring_domain:wr.info.referringDomain(hr.referrer),$device:wr.info.device(_r)}),{$current_url:wr.info.currentUrl(),$browser_version:wr.info.browserVersion(_r,pr.vendor,fr),$screen_height:mr.height,$screen_width:mr.width,mp_lib:"web",$lib_version:Wt.LIB_VERSION,$insert_id:cheap_guid(),time:wr.timestamp()/1e3},wr.strip_empty_properties(e))},people_properties:function(){return wr.extend(wr.strip_empty_properties({$os:wr.info.os(),$browser:wr.info.browser(_r,pr.vendor,fr)}),{$browser_version:wr.info.browserVersion(_r,pr.vendor,fr)})},mpPageViewProperties:function(){return wr.strip_empty_properties({current_page_title:hr.title,current_domain:$t.location.hostname,current_url_path:$t.location.pathname,current_url_protocol:$t.location.protocol,current_url_search:$t.location.search})}};var cheap_guid=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},Rr=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,Mr=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,extract_domain=function(e){var t=Mr,n=e.split("."),i=n[n.length-1];(i.length>4||"com"===i||"org"===i)&&(t=Rr);var s=e.match(t);return s?s[0]:""},Nr=null,Zr=null;"undefined"!=typeof JSON&&(Nr=JSON.stringify,Zr=JSON.parse),Nr=Nr||wr.JSONEncode,Zr=Zr||wr.JSONDecode,wr.toArray=wr.toArray,wr.isObject=wr.isObject,wr.JSONEncode=wr.JSONEncode,wr.JSONDecode=wr.JSONDecode,wr.isBlockedUA=wr.isBlockedUA,wr.isEmptyObject=wr.isEmptyObject,wr.info=wr.info,wr.info.device=wr.info.device,wr.info.browser=wr.info.browser,wr.info.browserVersion=wr.info.browserVersion,wr.info.properties=wr.info.properties;var Pr="__mp_opt_in_out_";function optIn(e,t){_optInOut(!0,e,t)}function optOut(e,t){_optInOut(!1,e,t)}function hasOptedIn(e,t){return"1"===_getStorageValue(e,t)}function hasOptedOut(e,t){if(function _hasDoNotTrackFlagOn(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||$t,n=t.navigator||{},i=!1;return wr.each([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){wr.includes([!0,1,"1","yes"],e)&&(i=!0)})),i}(t))return Ir.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 n="0"===_getStorageValue(e,t);return n&&Ir.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),n}function addOptOutCheckMixpanelLib(e){return _addOptOutCheck(e,(function(e){return this.get_config(e)}))}function addOptOutCheckMixpanelPeople(e){return _addOptOutCheck(e,(function(e){return this._get_config(e)}))}function addOptOutCheckMixpanelGroup(e){return _addOptOutCheck(e,(function(e){return this._get_config(e)}))}function clearOptInOut(e,t){_getStorage(t=t||{}).remove(_getStorageKey(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function _getStorage(e){return"localStorage"===(e=e||{}).persistenceType?wr.localStorage:wr.cookie}function _getStorageKey(e,t){return((t=t||{}).persistencePrefix||Pr)+e}function _getStorageValue(e,t){return _getStorage(t).get(_getStorageKey(e,t))}function _optInOut(e,t,n){wr.isString(t)&&t.length?(_getStorage(n=n||{}).set(_getStorageKey(t,n),e?1:0,wr.isNumber(n.cookieExpiration)?n.cookieExpiration:null,!!n.crossSubdomainCookie,!!n.secureCookie,!!n.crossSiteCookie,n.cookieDomain),n.track&&e&&n.track(n.trackEventName||"$opt_in",n.trackProperties,{send_immediately:!0})):Ir.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function _addOptOutCheck(e,t){return function(){var n=!1;try{var i=t.call(this,"token"),s=t.call(this,"ignore_dnt"),a=t.call(this,"opt_out_tracking_persistence_type"),c=t.call(this,"opt_out_tracking_cookie_prefix"),d=t.call(this,"window");i&&(n=hasOptedOut(i,{ignoreDnt:s,persistenceType:a,persistencePrefix:c,window:d}))}catch(l){Ir.error("Unexpected error when checking tracking opt-out status: "+l)}if(!n)return e.apply(this,arguments);var u=arguments[arguments.length-1];"function"==typeof u&&u(0)}}var Dr=console_with_prefix("lock"),SharedLock=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3};SharedLock.prototype.withLock=function(e,t,n){n||"function"==typeof t||(n=t,t=null);var i=n||(new Date).getTime()+"|"+Math.random(),s=(new Date).getTime(),a=this.storageKey,c=this.pollIntervalMS,d=this.timeoutMS,u=this.storage,l=a+":X",p=a+":Y",h=a+":Z",reportError=function(e){t&&t(e)},delay=function(e){if((new Date).getTime()-s>d)return Dr.error("Timeout waiting for mutex on "+a+"; clearing lock. ["+i+"]"),u.removeItem(h),u.removeItem(p),void loop();setTimeout((function(){try{e()}catch(t){reportError(t)}}),c*(Math.random()+.1))},waitFor=function(e,t){e()?t():delay((function(){waitFor(e,t)}))},getSetY=function(){var e=u.getItem(p);if(e&&e!==i)return!1;if(u.setItem(p,i),u.getItem(p)===i)return!0;if(!localStorageSupported(u,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},loop=function(){u.setItem(l,i),waitFor(getSetY,(function(){u.getItem(l)!==i?delay((function(){u.getItem(p)===i?waitFor((function(){return!u.getItem(h)}),criticalSection):loop()})):criticalSection()}))},criticalSection=function(){u.setItem(h,"1");try{e()}finally{u.removeItem(h),u.getItem(p)===i&&u.removeItem(p),u.getItem(l)===i&&u.removeItem(l)}};try{if(!localStorageSupported(u,!0))throw new Error("localStorage support check failed");loop()}catch(f){reportError(f)}};var Ar=console_with_prefix("batch"),RequestQueue=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.reportError=t.errorReporter||wr.bind(Ar.error,Ar),this.lock=new SharedLock(e,{storage:this.storage}),this.usePersistence=t.usePersistence,this.pid=t.pid||null,this.memQueue=[]};RequestQueue.prototype.enqueue=function(e,t,n){var i={id:cheap_guid(),flushAfter:(new Date).getTime()+2*t,payload:e};this.usePersistence?this.lock.withLock(wr.bind((function lockAcquired(){var t;try{var s=this.readFromStorage();s.push(i),(t=this.saveToStorage(s))&&this.memQueue.push(i)}catch(a){this.reportError("Error enqueueing item",e),t=!1}n&&n(t)}),this),wr.bind((function lockFailure(e){this.reportError("Error acquiring storage lock",e),n&&n(!1)}),this),this.pid):(this.memQueue.push(i),n&&n(!0))},RequestQueue.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);if(this.usePersistence&&t.length<e){var n=this.readFromStorage();if(n.length){var i={};wr.each(t,(function(e){i[e.id]=!0}));for(var s=0;s<n.length;s++){var a=n[s];if((new Date).getTime()>a.flushAfter&&!i[a.id]&&(a.orphaned=!0,t.push(a),t.length>=e))break}}}return t};var filterOutIDsAndInvalid=function(e,t){var n=[];return wr.each(e,(function(e){e.id&&!t[e.id]&&n.push(e)})),n};RequestQueue.prototype.removeItemsByID=function(e,t){var n={};if(wr.each(e,(function(e){n[e]=!0})),this.memQueue=filterOutIDsAndInvalid(this.memQueue,n),this.usePersistence){var i=wr.bind((function(){var t;try{var i=this.readFromStorage();if(i=filterOutIDsAndInvalid(i,n),t=this.saveToStorage(i)){i=this.readFromStorage();for(var s=0;s<i.length;s++){var a=i[s];if(a.id&&n[a.id])return this.reportError("Item not removed from storage"),!1}}}catch(c){this.reportError("Error removing items",e),t=!1}return t}),this);this.lock.withLock((function lockAcquired(){var e=i();t&&t(e)}),wr.bind((function lockFailure(e){var n=!1;if(this.reportError("Error acquiring storage lock",e),!localStorageSupported(this.storage,!0)&&!(n=i()))try{this.storage.removeItem(this.storageKey)}catch(s){this.reportError("Error clearing queue",s)}t&&t(n)}),this),this.pid)}else t&&t(!0)};var updatePayloads=function(e,t){var n=[];return wr.each(e,(function(e){var i=e.id;if(i in t){var s=t[i];null!==s&&(e.payload=s,n.push(e))}else n.push(e)})),n};RequestQueue.prototype.updatePayloads=function(e,t){this.memQueue=updatePayloads(this.memQueue,e),this.usePersistence?this.lock.withLock(wr.bind((function lockAcquired(){var n;try{var i=this.readFromStorage();i=updatePayloads(i,e),n=this.saveToStorage(i)}catch(s){this.reportError("Error updating items",e),n=!1}t&&t(n)}),this),wr.bind((function lockFailure(e){this.reportError("Error acquiring storage lock",e),t&&t(!1)}),this),this.pid):t&&t(!0)},RequestQueue.prototype.readFromStorage=function(){var e;try{(e=this.storage.getItem(this.storageKey))&&(e=Zr(e),wr.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null))}catch(t){this.reportError("Error retrieving queue",t),e=null}return e||[]},RequestQueue.prototype.saveToStorage=function(e){try{return this.storage.setItem(this.storageKey,Nr(e)),!0}catch(t){return this.reportError("Error saving queue",t),!1}},RequestQueue.prototype.clear=function(){this.memQueue=[],this.usePersistence&&this.storage.removeItem(this.storageKey)};var Lr=console_with_prefix("batch"),RequestBatcher=function(e,t){this.errorReporter=t.errorReporter,this.queue=new RequestQueue(e,{errorReporter:wr.bind(this.reportError,this),storage:t.storage,usePersistence:t.usePersistence}),this.libConfig=t.libConfig,this.sendRequest=t.sendRequestFunc,this.beforeSendHook=t.beforeSendHook,this.stopAllBatching=t.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=t.flushOnlyOnInterval||!1};RequestBatcher.prototype.enqueue=function(e,t){this.queue.enqueue(e,this.flushInterval,t)},RequestBatcher.prototype.start=function(){this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},RequestBatcher.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},RequestBatcher.prototype.clear=function(){this.queue.clear()},RequestBatcher.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},RequestBatcher.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},RequestBatcher.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(wr.bind((function(){this.stopped||this.flush()}),this),this.flushInterval))},RequestBatcher.prototype.flush=function(e){try{if(this.requestInProgress)return void Lr.log("Flush: Request already in progress");e=e||{};var t=this.libConfig.batch_request_timeout_ms,n=(new Date).getTime(),i=this.batchSize,s=this.queue.fillBatch(i),a=s.length===i,c=[],d={};if(wr.each(s,(function(e){var t=e.payload;if(this.beforeSendHook&&!e.orphaned&&(t=this.beforeSendHook(t)),t){t.event&&t.properties&&(t.properties=wr.extend({},t.properties,{mp_sent_by_lib_version:Wt.LIB_VERSION}));var n=!0,i=e.id;i?(this.itemIdsSentSuccessfully[i]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:e,batchSize:s.length,timesSent:this.itemIdsSentSuccessfully[i]}),n=!1):this.reportError("[dupe] found item with no ID",{item:e}),n&&c.push(t)}d[e.id]=t}),this),c.length<1)return void this.resetFlush();this.requestInProgress=!0;var u=wr.bind((function(c){this.requestInProgress=!1;try{var u=!1;if(e.unloading)this.queue.updatePayloads(d);else if(wr.isObject(c)&&"timeout"===c.error&&(new Date).getTime()-n>=t)this.reportError("Network timeout; retrying"),this.flush();else if(wr.isObject(c)&&(c.httpStatusCode>=500||429===c.httpStatusCode||c.httpStatusCode<=0&&(h=$t.navigator.onLine,!wr.isUndefined(h)&&!h)||"timeout"===c.error)){var l=2*this.flushInterval;c.retryAfter&&(l=1e3*parseInt(c.retryAfter,10)||l),l=Math.min(6e5,l),this.reportError("Error; retry in "+l+" ms"),this.scheduleFlush(l)}else if(wr.isObject(c)&&413===c.httpStatusCode)if(s.length>1){var p=Math.max(1,Math.floor(i/2));this.batchSize=Math.min(this.batchSize,p,s.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",s),this.resetBatchSize(),u=!0;else u=!0;u&&(this.queue.removeItemsByID(wr.map(s,(function(e){return e.id})),wr.bind((function(e){e?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!a?this.resetFlush():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)),wr.each(s,wr.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:s.length,timesSent:this.itemIdsSentSuccessfully[t]})):this.reportError("[dupe] found item with no ID while removing",{item:e})}),this)))}catch(f){this.reportError("Error handling API response",f),this.resetFlush()}var h}),this),l={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};e.unloading&&(l.transport="sendBeacon"),Lr.log("MIXPANEL REQUEST:",c),this.sendRequest(c,l,u)}catch(p){this.reportError("Error flushing request queue",p),this.resetFlush()}},RequestBatcher.prototype.reportError=function(e,t){if(Lr.error.apply(Lr.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(n){Lr.error(n)}};var jr=console_with_prefix("recorder"),Fr=$t.CompressionStream,Ur={batch_size:1e3,batch_flush_interval_ms:1e4,batch_request_timeout_ms:9e4,batch_autostart:!0},qr=new Set([zt.MouseMove,zt.MouseInteraction,zt.Scroll,zt.ViewportResize,zt.Input,zt.TouchMove,zt.MediaInteraction,zt.Drag,zt.Selection]);var MixpanelRecorder=function(e){this._mixpanel=e,this._stopRecording=null,this.recEvents=[],this.seqNo=0,this.replayId=null,this.replayStartTime=null,this.sendBatchId=null,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=nr,this.recordMinMs=0,this._initBatcher()};MixpanelRecorder.prototype._initBatcher=function(){this.batcher=new RequestBatcher("__mprec",{libConfig:Ur,sendRequestFunc:wr.bind(this.flushEventsWithOptOut,this),errorReporter:wr.bind(this.reportError,this),flushOnlyOnInterval:!0,usePersistence:!1})},MixpanelRecorder.prototype.get_config=function(e){return this._mixpanel.get_config(e)},MixpanelRecorder.prototype.startRecording=function(e){if(null===this._stopRecording){this.recordMaxMs=this.get_config("record_max_ms"),this.recordMaxMs>nr&&(this.recordMaxMs=nr,jr.critical("record_max_ms cannot be greater than "+nr+"ms. Capping value.")),this.recordMinMs=this.get_config("record_min_ms"),this.recordMinMs>ir&&(this.recordMinMs=ir,jr.critical("record_min_ms cannot be greater than 8000ms. Capping value.")),this.recEvents=[],this.seqNo=0,this.replayStartTime=(new Date).getTime(),this.replayId=wr.UUID(),e||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var t=wr.bind((function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(wr.bind((function(){jr.log("Idle timeout reached, restarting recording."),this.resetRecording()}),this),this.get_config("record_idle_timeout_ms"))}),this),n=this.get_config("record_block_selector");""!==n&&null!==n||(n=void 0),this._stopRecording=record({emit:wr.bind((function(e){this.batcher.enqueue(e),function isUserEvent(e){return e.type===Bt.IncrementalSnapshot&&qr.has(e.data.source)}(e)&&(this.batcher.stopped&&(new Date).getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),t())}),this),blockClass:this.get_config("record_block_class"),blockSelector:n,collectFonts:this.get_config("record_collect_fonts"),inlineImages:this.get_config("record_inline_images"),maskAllInputs:!0,maskTextClass:this.get_config("record_mask_text_class"),maskTextSelector:this.get_config("record_mask_text_selector")}),t(),this.maxTimeoutId=setTimeout(wr.bind(this.resetRecording,this),this.recordMaxMs)}else jr.log("Recording already in progress, skipping startRecording.")},MixpanelRecorder.prototype.resetRecording=function(){this.stopRecording(),this.startRecording(!0)},MixpanelRecorder.prototype.stopRecording=function(){null!==this._stopRecording&&(this._stopRecording(),this._stopRecording=null),this.batcher.stopped?this.batcher.clear():(this.batcher.flush(),this.batcher.stop()),this.replayId=null,clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId)},MixpanelRecorder.prototype.flushEventsWithOptOut=function(e,t,n){this._flushEvents(e,t,n,wr.bind(this._onOptOut,this))},MixpanelRecorder.prototype._onOptOut=function(e){0===e&&(this.recEvents=[],this.stopRecording())},MixpanelRecorder.prototype._sendRequest=function(e,t,n,i){var s=wr.bind((function(t,n){200===t.status&&this.replayId===e&&this.seqNo++,i({status:0,httpStatusCode:t.status,responseBody:n,retryAfter:t.headers.get("Retry-After")})}),this);$t.fetch(this.get_config("api_host")+"/"+this.get_config("api_routes").record+"?"+new URLSearchParams(t),{method:"POST",headers:{Authorization:"Basic "+btoa(this.get_config("token")+":"),"Content-Type":"application/octet-stream"},body:n}).then((function(e){e.json().then((function(t){s(e,t)})).catch((function(e){i({error:e})}))})).catch((function(e){i({error:e,httpStatusCode:0})}))},MixpanelRecorder.prototype._flushEvents=addOptOutCheckMixpanelLib((function(e,t,n){const i=e.length;if(i>0){var s=this.replayId,a=e[0].timestamp;0!==this.seqNo&&this.replayStartTime||(0!==this.seqNo&&this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=a);var c=e[i-1].timestamp-this.replayStartTime,d={distinct_id:String(this._mixpanel.get_distinct_id()),seq:this.seqNo,batch_start_time:a/1e3,replay_id:s,replay_length_ms:c,replay_start_time:this.replayStartTime/1e3},u=wr.JSONEncode(e),l=this._mixpanel.get_property("$device_id");l&&(d.$device_id=l);var p=this._mixpanel.get_property("$user_id");if(p&&(d.$user_id=p),Fr){var h=new Blob([u],{type:"application/json"}).stream().pipeThrough(new Fr("gzip"));new Response(h).blob().then(wr.bind((function(e){d.format="gzip",this._sendRequest(s,d,e,n)}),this))}else d.format="body",this._sendRequest(s,d,u,n)}})),MixpanelRecorder.prototype.reportError=function(e,t){jr.error.apply(jr.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(n){jr.error(n)}},$t.__mp_recorder=MixpanelRecorder;var DomTracker=function(){};DomTracker.prototype.create_properties=function(){},DomTracker.prototype.event_handler=function(){},DomTracker.prototype.after_track_handler=function(){},DomTracker.prototype.init=function(e){return this.mp=e,this},DomTracker.prototype.track=function(e,t,n,i){var s=this,a=wr.dom_query(e);if(0!==a.length)return wr.each(a,(function(e){wr.register_event(e,this.override_event,(function(e){var a={},c=s.create_properties(n,this),d=s.mp.get_config("track_links_timeout");s.event_handler(e,this,a),window.setTimeout(s.track_callback(i,c,a,!0),d),s.mp.track(t,c,s.track_callback(i,c,a))}))}),this),!0;Ir.error("The DOM query ("+e+") returned 0 elements")},DomTracker.prototype.track_callback=function(e,t,n,i){i=i||!1;var s=this;return function(){n.callback_fired||(n.callback_fired=!0,e&&!1===e(i,t)||s.after_track_handler(t,n,i))}},DomTracker.prototype.create_properties=function(e,t){return"function"==typeof e?e(t):wr.extend({},e)};var LinkTracker=function(){this.override_event="click"};wr.inherit(LinkTracker,DomTracker),LinkTracker.prototype.create_properties=function(e,t){var n=LinkTracker.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n},LinkTracker.prototype.event_handler=function(e,t,n){n.new_tab=2===e.which||e.metaKey||e.ctrlKey||"_blank"===t.target,n.href=t.href,n.new_tab||e.preventDefault()},LinkTracker.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout((function(){window.location=t.href}),0)};var FormTracker=function(){this.override_event="submit"};wr.inherit(FormTracker,DomTracker),FormTracker.prototype.event_handler=function(e,t,n){n.element=t,e.preventDefault()},FormTracker.prototype.after_track_handler=function(e,t){setTimeout((function(){t.element.submit()}),0)};var $r="$set",Br="$set_once",zr="$unset",Wr="$add",Vr="$append",Kr="$union",Hr="$remove",Gr={set_action:function(e,t){var n={},i={};return wr.isObject(e)?wr.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,n[$r]=i,n},unset_action:function(e){var t={},n=[];return wr.isArray(e)||(e=[e]),wr.each(e,(function(e){this._is_reserved_property(e)||n.push(e)}),this),t[zr]=n,t},set_once_action:function(e,t){var n={},i={};return wr.isObject(e)?wr.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,n[Br]=i,n},union_action:function(e,t){var n={},i={};return wr.isObject(e)?wr.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=wr.isArray(e)?e:[e])}),this):i[e]=wr.isArray(t)?t:[t],n[Kr]=i,n},append_action:function(e,t){var n={},i={};return wr.isObject(e)?wr.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,n[Vr]=i,n},remove_action:function(e,t){var n={},i={};return wr.isObject(e)?wr.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,n[Hr]=i,n},delete_action:function(){var e={$delete:""};return e}},MixpanelGroup=function(){};wr.extend(MixpanelGroup.prototype,Gr),MixpanelGroup.prototype._init=function(e,t,n){this._mixpanel=e,this._group_key=t,this._group_id=n},MixpanelGroup.prototype.set=addOptOutCheckMixpanelGroup((function(e,t,n){var i=this.set_action(e,t);return wr.isObject(e)&&(n=t),this._send_request(i,n)})),MixpanelGroup.prototype.set_once=addOptOutCheckMixpanelGroup((function(e,t,n){var i=this.set_once_action(e,t);return wr.isObject(e)&&(n=t),this._send_request(i,n)})),MixpanelGroup.prototype.unset=addOptOutCheckMixpanelGroup((function(e,t){var n=this.unset_action(e);return this._send_request(n,t)})),MixpanelGroup.prototype.union=addOptOutCheckMixpanelGroup((function(e,t,n){wr.isObject(e)&&(n=t);var i=this.union_action(e,t);return this._send_request(i,n)})),MixpanelGroup.prototype.delete=addOptOutCheckMixpanelGroup((function(e){var t=this.delete_action();return this._send_request(t,e)})),MixpanelGroup.prototype.remove=addOptOutCheckMixpanelGroup((function(e,t,n){var i=this.remove_action(e,t);return this._send_request(i,n)})),MixpanelGroup.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 n=wr.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:n,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},t)},MixpanelGroup.prototype._is_reserved_property=function(e){return"$group_key"===e||"$group_id"===e},MixpanelGroup.prototype._get_config=function(e){return this._mixpanel.get_config(e)},MixpanelGroup.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},MixpanelGroup.prototype.remove=MixpanelGroup.prototype.remove,MixpanelGroup.prototype.set=MixpanelGroup.prototype.set,MixpanelGroup.prototype.set_once=MixpanelGroup.prototype.set_once,MixpanelGroup.prototype.union=MixpanelGroup.prototype.union,MixpanelGroup.prototype.unset=MixpanelGroup.prototype.unset,MixpanelGroup.prototype.toString=MixpanelGroup.prototype.toString;var MixpanelPeople=function(){};wr.extend(MixpanelPeople.prototype,Gr),MixpanelPeople.prototype._init=function(e){this._mixpanel=e},MixpanelPeople.prototype.set=addOptOutCheckMixpanelPeople((function(e,t,n){var i=this.set_action(e,t);return wr.isObject(e)&&(n=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),i[$r]=wr.extend({},wr.info.people_properties(),i[$r]),this._send_request(i,n)})),MixpanelPeople.prototype.set_once=addOptOutCheckMixpanelPeople((function(e,t,n){var i=this.set_once_action(e,t);return wr.isObject(e)&&(n=t),this._send_request(i,n)})),MixpanelPeople.prototype.unset=addOptOutCheckMixpanelPeople((function(e,t){var n=this.unset_action(e);return this._send_request(n,t)})),MixpanelPeople.prototype.increment=addOptOutCheckMixpanelPeople((function(e,t,n){var i={},s={};return wr.isObject(e)?(wr.each(e,(function(e,t){if(!this._is_reserved_property(t)){if(isNaN(parseFloat(e)))return void Ir.error("Invalid increment value passed to mixpanel.people.increment - must be a number");s[t]=e}}),this),n=t):(wr.isUndefined(t)&&(t=1),s[e]=t),i[Wr]=s,this._send_request(i,n)})),MixpanelPeople.prototype.append=addOptOutCheckMixpanelPeople((function(e,t,n){wr.isObject(e)&&(n=t);var i=this.append_action(e,t);return this._send_request(i,n)})),MixpanelPeople.prototype.remove=addOptOutCheckMixpanelPeople((function(e,t,n){wr.isObject(e)&&(n=t);var i=this.remove_action(e,t);return this._send_request(i,n)})),MixpanelPeople.prototype.union=addOptOutCheckMixpanelPeople((function(e,t,n){wr.isObject(e)&&(n=t);var i=this.union_action(e,t);return this._send_request(i,n)})),MixpanelPeople.prototype.track_charge=addOptOutCheckMixpanelPeople((function(e,t,n){if(wr.isNumber(e)||(e=parseFloat(e),!isNaN(e)))return this.append("$transactions",wr.extend({$amount:e},t),n);Ir.error("Invalid value passed to mixpanel.people.track_charge - must be a number")})),MixpanelPeople.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},MixpanelPeople.prototype.delete_user=function(){if(this._identify_called()){var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)}Ir.error("mixpanel.people.delete_user() requires you to call identify() first")},MixpanelPeople.prototype.toString=function(){return this._mixpanel.toString()+".people"},MixpanelPeople.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var n=this._mixpanel.get_property("$device_id"),i=this._mixpanel.get_property("$user_id"),s=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),i&&(e.$user_id=i),s&&(e.$had_persisted_distinct_id=s);var a=wr.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:a,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),wr.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),wr.truncate(a,255))},MixpanelPeople.prototype._get_config=function(e){return this._mixpanel.get_config(e)},MixpanelPeople.prototype._identify_called=function(){return!0===this._mixpanel._flags.identify_called},MixpanelPeople.prototype._enqueue=function(e){$r in e?this._mixpanel.persistence._add_to_people_queue($r,e):Br in e?this._mixpanel.persistence._add_to_people_queue(Br,e):zr in e?this._mixpanel.persistence._add_to_people_queue(zr,e):Wr in e?this._mixpanel.persistence._add_to_people_queue(Wr,e):Vr in e?this._mixpanel.persistence._add_to_people_queue(Vr,e):Hr in e?this._mixpanel.persistence._add_to_people_queue(Hr,e):Kr in e?this._mixpanel.persistence._add_to_people_queue(Kr,e):Ir.error("Invalid call to _enqueue():",e)},MixpanelPeople.prototype._flush_one_queue=function(e,t,n,i){var s=this,a=wr.extend({},this._mixpanel.persistence.load_queue(e)),c=a;wr.isUndefined(a)||!wr.isObject(a)||wr.isEmptyObject(a)||(s._mixpanel.persistence._pop_from_people_queue(e,a),s._mixpanel.persistence.save(),i&&(c=i(a)),t.call(s,c,(function(t,i){0===t&&s._mixpanel.persistence._add_to_people_queue(e,a),wr.isUndefined(n)||n(t,i)})))},MixpanelPeople.prototype._flush=function(e,t,n,i,s,a,c){var d=this;this._flush_one_queue($r,this.set,e),this._flush_one_queue(Br,this.set_once,i),this._flush_one_queue(zr,this.unset,a,(function(e){return wr.keys(e)})),this._flush_one_queue(Wr,this.increment,t),this._flush_one_queue(Kr,this.union,s);var u=this._mixpanel.persistence.load_queue(Vr);if(!wr.isUndefined(u)&&wr.isArray(u)&&u.length)for(var l,append_callback=function(e,t){0===e&&d._mixpanel.persistence._add_to_people_queue(Vr,l),wr.isUndefined(n)||n(e,t)},p=u.length-1;p>=0;p--)u=this._mixpanel.persistence.load_queue(Vr),l=u.pop(),d._mixpanel.persistence.save(),wr.isEmptyObject(l)||d.append(l,append_callback);var h=this._mixpanel.persistence.load_queue(Hr);if(!wr.isUndefined(h)&&wr.isArray(h)&&h.length)for(var f,remove_callback=function(e,t){0===e&&d._mixpanel.persistence._add_to_people_queue(Hr,f),wr.isUndefined(c)||c(e,t)},m=h.length-1;m>=0;m--)h=this._mixpanel.persistence.load_queue(Hr),f=h.pop(),d._mixpanel.persistence.save(),wr.isEmptyObject(f)||d.remove(f,remove_callback)},MixpanelPeople.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e},MixpanelPeople.prototype.set=MixpanelPeople.prototype.set,MixpanelPeople.prototype.set_once=MixpanelPeople.prototype.set_once,MixpanelPeople.prototype.unset=MixpanelPeople.prototype.unset,MixpanelPeople.prototype.increment=MixpanelPeople.prototype.increment,MixpanelPeople.prototype.append=MixpanelPeople.prototype.append,MixpanelPeople.prototype.remove=MixpanelPeople.prototype.remove,MixpanelPeople.prototype.union=MixpanelPeople.prototype.union,MixpanelPeople.prototype.track_charge=MixpanelPeople.prototype.track_charge,MixpanelPeople.prototype.clear_charges=MixpanelPeople.prototype.clear_charges,MixpanelPeople.prototype.delete_user=MixpanelPeople.prototype.delete_user,MixpanelPeople.prototype.toString=MixpanelPeople.prototype.toString;var Yr,Jr="__mps",Xr="__mpso",Qr="__mpus",en="__mpa",tn="__mpap",rn="__mpr",nn="__mpu",sn="$people_distinct_id",an="__alias",cn="__timers",dn=[Jr,Xr,Qr,en,tn,rn,nn,sn,an,cn],MixpanelPersistence=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&&(Ir.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),"localStorage"===t&&wr.localStorage.is_supported()?this.storage=wr.localStorage:this.storage=wr.cookie,this.load(),this.update_config(e),this.upgrade(),this.save()};MixpanelPersistence.prototype.properties=function(){var e={};return this.load(),wr.each(this.props,(function(t,n){wr.include(dn,n)||(e[n]=t)})),e},MixpanelPersistence.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=wr.extend({},e))}},MixpanelPersistence.prototype.upgrade=function(){var e,t;this.storage===wr.localStorage?(e=wr.cookie.parse(this.name),wr.cookie.remove(this.name),wr.cookie.remove(this.name,!0),e&&this.register_once(e)):this.storage===wr.cookie&&(t=wr.localStorage.parse(this.name),wr.localStorage.remove(this.name),t&&this.register_once(t))},MixpanelPersistence.prototype.save=function(){this.disabled||this.storage.set(this.name,wr.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},MixpanelPersistence.prototype.load_prop=function(e){return this.load(),this.props[e]},MixpanelPersistence.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},MixpanelPersistence.prototype.clear=function(){this.remove(),this.props={}},MixpanelPersistence.prototype.register_once=function(e,t,n){return!!wr.isObject(e)&&(void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n,this.load(),wr.each(e,(function(e,n){this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e)}),this),this.save(),!0)},MixpanelPersistence.prototype.register=function(e,t){return!!wr.isObject(e)&&(this.expire_days=void 0===t?this.default_expiry:t,this.load(),wr.extend(this.props,e),this.save(),!0)},MixpanelPersistence.prototype.unregister=function(e){this.load(),e in this.props&&(delete this.props[e],this.save())},MixpanelPersistence.prototype.update_search_keyword=function(e){this.register(wr.info.searchInfo(e))},MixpanelPersistence.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:wr.info.referringDomain(e)||"$direct"},"")},MixpanelPersistence.prototype.get_referrer_info=function(){return wr.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},MixpanelPersistence.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)},MixpanelPersistence.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},MixpanelPersistence.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())},MixpanelPersistence.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())},MixpanelPersistence.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},MixpanelPersistence.prototype.get_cross_subdomain=function(){return this.cross_subdomain},MixpanelPersistence.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},MixpanelPersistence.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),i=t[e],s=this._get_or_create_queue($r),a=this._get_or_create_queue(Br),c=this._get_or_create_queue(zr),d=this._get_or_create_queue(Wr),u=this._get_or_create_queue(Kr),l=this._get_or_create_queue(Hr,[]),p=this._get_or_create_queue(Vr,[]);n===Jr?(wr.extend(s,i),this._pop_from_people_queue(Wr,i),this._pop_from_people_queue(Kr,i),this._pop_from_people_queue(zr,i)):n===Xr?(wr.each(i,(function(e,t){t in a||(a[t]=e)})),this._pop_from_people_queue(zr,i)):n===Qr?wr.each(i,(function(e){wr.each([s,a,d,u],(function(t){e in t&&delete t[e]})),wr.each(p,(function(t){e in t&&delete t[e]})),c[e]=!0})):n===en?(wr.each(i,(function(e,t){t in s?s[t]+=e:(t in d||(d[t]=0),d[t]+=e)}),this),this._pop_from_people_queue(zr,i)):n===nn?(wr.each(i,(function(e,t){wr.isArray(e)&&(t in u||(u[t]=[]),u[t]=u[t].concat(e))})),this._pop_from_people_queue(zr,i)):n===rn?(l.push(i),this._pop_from_people_queue(Vr,i)):n===tn&&(p.push(i),this._pop_from_people_queue(zr,i)),Ir.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),Ir.log(t),this.save()},MixpanelPersistence.prototype._pop_from_people_queue=function(e,t){var n=this.props[this._get_queue_key(e)];wr.isUndefined(n)||wr.each(t,(function(t,i){e===Vr||e===Hr?wr.each(n,(function(e){e[i]===t&&delete e[i]})):delete n[i]}),this)},MixpanelPersistence.prototype.load_queue=function(e){return this.load_prop(this._get_queue_key(e))},MixpanelPersistence.prototype._get_queue_key=function(e){return e===$r?Jr:e===Br?Xr:e===zr?Qr:e===Wr?en:e===Vr?tn:e===Hr?rn:e===Kr?nn:void Ir.error("Invalid queue:",e)},MixpanelPersistence.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=wr.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)},MixpanelPersistence.prototype.set_event_timer=function(e,t){var n=this.load_prop(cn)||{};n[e]=t,this.props[cn]=n,this.save()},MixpanelPersistence.prototype.remove_event_timer=function(e){var t=(this.load_prop(cn)||{})[e];return wr.isUndefined(t)||(delete this.props[cn][e],this.save()),t};var un,load_extra_bundle=function(e,t){throw new Error(e+" not available in this build.")},IDENTITY_FUNC=function(e){return e},NOOP_FUNC=function(){},ln="mixpanel",pn="base64",hn="$device:",fn=$t.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,mn=!fn&&-1===_r.indexOf("MSIE")&&-1===_r.indexOf("Mozilla"),_n=null;pr.sendBeacon&&(_n=function(){return pr.sendBeacon.apply(pr,arguments)});var gn={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},yn={api_host:"https://api-js.mixpanel.com",api_routes:gn,api_method:"POST",api_transport:"XHR",api_payload_format:pn,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:NOOP_FUNC,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:NOOP_FUNC,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:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video",record_collect_fonts:!1,record_idle_timeout_ms:18e5,record_inline_images:!1,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:nr,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},vn=!1,MixpanelLib=function(){},create_mplib=function(e,t,n){var i,s=n===ln?un:un[n];if(s&&0===Yr)i=s;else{if(s&&!wr.isArray(s))return void Ir.error("You have already initialized "+n);i=new MixpanelLib}if(i._cached_groups={},i._init(e,t,n),i.people=new MixpanelPeople,i.people._init(i),!i.get_config("skip_first_touch_marketing")){var a=wr.info.campaignParams(null),c={},d=!1;wr.each(a,(function(e,t){c["initial_"+t]=e,e&&(d=!0)})),d&&i.people.set_once(c)}return Wt.DEBUG=Wt.DEBUG||i.get_config("debug"),!wr.isUndefined(s)&&wr.isArray(s)&&(i._execute_array.call(i.people,s.people),i._execute_array(s)),i};MixpanelLib.prototype.init=function(e,t,n){if(wr.isUndefined(n))this.report_error("You must name your new library: init(token, config, name)");else{if(n!==ln){var i=create_mplib(e,t,n);return un[n]=i,i._loaded(),i}this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet")}},MixpanelLib.prototype._init=function(e,t,n){t=t||{},this.__loaded=!0,this.config={};var i={};"api_payload_format"in t||(t.api_host||yn.api_host).match(/\.mixpanel\.com/)&&(i.api_payload_format="json");if(this.set_config(wr.extend({},yn,i,t,{name:n,token:e,callback_fn:(n===ln?n:ln+"."+n)+"._jsc"})),this._jsc=NOOP_FUNC,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(wr.localStorage.is_supported(!0)&&fn){if(this.init_batchers(),_n&&$t.addEventListener){var s=wr.bind((function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})}),this);$t.addEventListener("pagehide",(function(e){e.persisted&&s()})),$t.addEventListener("visibilitychange",(function(){"hidden"===hr.visibilityState&&s()}))}}else this._batch_requests=!1,Ir.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),wr.each(this.get_batcher_configs(),(function(e){Ir.log("Clearing batch queue "+e.queue_key),wr.localStorage.remove(e.queue_key)}));this.persistence=this.cookie=new MixpanelPersistence(this.config),this.unpersisted_superprops={},this._gdpr_init();var a=wr.UUID();this.get_distinct_id()||this.register_once({distinct_id:hn+a,$device_id:a},"");var c=this.get_config("track_pageview");c&&this._init_url_change_tracking(c),this.get_config("record_sessions_percent")>0&&100*Math.random()<=this.get_config("record_sessions_percent")&&this.start_session_recording()},MixpanelLib.prototype.start_session_recording=addOptOutCheckMixpanelLib((function(){if($t.MutationObserver){var e=wr.bind((function(){this._recorder=this._recorder||new $t.__mp_recorder(this),this._recorder.startRecording()}),this);wr.isUndefined($t.__mp_recorder)?load_extra_bundle(this.get_config("recorder_src"),e):e()}else Ir.critical("Browser does not support MutationObserver; skipping session recording")})),MixpanelLib.prototype.stop_session_recording=function(){this._recorder?this._recorder.stopRecording():Ir.critical("Session recorder module not loaded")},MixpanelLib.prototype.get_session_recording_properties=function(){var e={};if(this._recorder){var t=this._recorder.replayId;t&&(e.$mp_replay_id=t)}return e},MixpanelLib.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=wr.info.campaignParams(null);wr.each(e,function(e,t){this.unregister(t)}.bind(this))}},MixpanelLib.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(hr.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(wr.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(hr.referrer)},MixpanelLib.prototype._dom_loaded=function(){wr.each(this.__dom_loaded_queue,(function(e){this._track_dom.apply(this,e)}),this),this.has_opted_out_tracking()||wr.each(this.__request_queue,(function(e){this._send_request.apply(this,e)}),this),delete this.__dom_loaded_queue,delete this.__request_queue},MixpanelLib.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(!vn)return this.__dom_loaded_queue.push([e,t]),!1;var n=(new e).init(this);return n.track.apply(n,t)},MixpanelLib.prototype._init_url_change_tracking=function(e){var t="";if(this.track_pageview()&&(t=wr.info.currentUrl()),wr.include(["full-url","url-with-path-and-query-string","url-with-path"],e)){$t.addEventListener("popstate",(function(){$t.dispatchEvent(new Event("mp_locationchange"))})),$t.addEventListener("hashchange",(function(){$t.dispatchEvent(new Event("mp_locationchange"))}));var n=$t.history.pushState;"function"==typeof n&&($t.history.pushState=function(e,t,i){n.call($t.history,e,t,i),$t.dispatchEvent(new Event("mp_locationchange"))});var i=$t.history.replaceState;"function"==typeof i&&($t.history.replaceState=function(e,t,n){i.call($t.history,e,t,n),$t.dispatchEvent(new Event("mp_locationchange"))}),$t.addEventListener("mp_locationchange",function(){var n=wr.info.currentUrl(),i=!1;("full-url"===e?i=n!==t:"url-with-path-and-query-string"===e?i=n.split("#")[0]!==t.split("#")[0]:"url-with-path"===e&&(i=n.split("#")[0].split("?")[0]!==t.split("#")[0].split("?")[0]),i)&&(this.track_pageview()&&(t=n))}.bind(this))}},MixpanelLib.prototype._prepare_callback=function(e,t){if(wr.isUndefined(e))return null;if(fn){return function(n){e(n,t)}}var n=this._jsc,i=""+Math.floor(1e8*Math.random()),s=this.get_config("callback_fn")+"["+i+"]";return n[i]=function(s){delete n[i],e(s,t)},s},MixpanelLib.prototype._send_request=function(e,t,n,i){var s=!0;if(mn)return this.__request_queue.push(arguments),s;var a={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},c=null;i||!wr.isFunction(n)&&"string"!=typeof n||(i=n,n=null),n=wr.extend(a,n||{}),fn||(n.method="GET");var d="POST"===n.method,u=_n&&d&&"sendbeacon"===n.transport.toLowerCase(),l=n.verbose;t.verbose&&(l=!0),this.get_config("test")&&(t.test=1),l&&(t.verbose=1),this.get_config("img")&&(t.img=1),fn||(i?t.callback=i:(l||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=(new Date).getTime().toString(),d&&(c="data="+encodeURIComponent(t.data),delete t.data),e+="?"+wr.HTTPBuildQuery(t);var p=this;if("img"in t){var h=hr.createElement("img");h.src=e,hr.body.appendChild(h)}else if(u){try{s=_n(e,c)}catch(v){p.report_error(v),s=!1}try{i&&i(s?1:0)}catch(v){p.report_error(v)}}else if(fn)try{var f=new XMLHttpRequest;f.open(n.method,e,!0);var m=this.get_config("xhr_headers");if(d&&(m["Content-Type"]="application/x-www-form-urlencoded"),wr.each(m,(function(e,t){f.setRequestHeader(t,e)})),n.timeout_ms&&void 0!==f.timeout){f.timeout=n.timeout_ms;var _=(new Date).getTime()}f.withCredentials=!0,f.onreadystatechange=function(){var e;if(4===f.readyState)if(200===f.status){if(i)if(l){var t;try{t=wr.JSONDecode(f.responseText)}catch(v){if(p.report_error(v),!n.ignore_json_errors)return;t=f.responseText}i(t)}else i(Number(f.responseText))}else if(e=f.timeout&&!f.status&&(new Date).getTime()-_>=f.timeout?"timeout":"Bad HTTP status: "+f.status+" "+f.statusText,p.report_error(e),i)if(l){var s=f.responseHeaders||{};i({status:0,httpStatusCode:f.status,error:e,retryAfter:s["Retry-After"]})}else i(0)},f.send(c)}catch(v){p.report_error(v),s=!1}else{var g=hr.createElement("script");g.type="text/javascript",g.async=!0,g.defer=!0,g.src=e;var y=hr.getElementsByTagName("script")[0];y.parentNode.insertBefore(g,y)}return s},MixpanelLib.prototype._execute_array=function(e){var t,n=[],i=[],s=[];wr.each(e,(function(e){e&&(t=e[0],wr.isArray(t)?s.push(e):"function"==typeof e?e.call(this):wr.isArray(e)&&"alias"===t?n.push(e):wr.isArray(e)&&-1!==t.indexOf("track")&&"function"==typeof this[t]?s.push(e):i.push(e))}),this);var execute=function(e,t){wr.each(e,(function(e){if(wr.isArray(e[0])){var n=t;wr.each(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};execute(n,this),execute(i,this),execute(s,this)},MixpanelLib.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},MixpanelLib.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},MixpanelLib.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var e=wr.bind((function(e){return new RequestBatcher(e.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:wr.bind((function(t,n,i){this._send_request(this.get_config("api_host")+e.endpoint,this._encode_data_for_request(t),n,this._prepare_callback(i,t))}),this),beforeSendHook:wr.bind((function(t){return this._run_hook("before_send_"+e.type,t)}),this),stopAllBatchingFunc:wr.bind(this.stop_batch_senders,this),usePersistence:!0})}),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()},MixpanelLib.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,wr.each(this.request_batchers,(function(e){e.start()})))},MixpanelLib.prototype.stop_batch_senders=function(){this._batch_requests=!1,wr.each(this.request_batchers,(function(e){e.stop(),e.clear()}))},MixpanelLib.prototype.push=function(e){this._execute_array([e])},MixpanelLib.prototype.disable=function(e){void 0===e?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},MixpanelLib.prototype._encode_data_for_request=function(e){var t=wr.JSONEncode(e);return this.get_config("api_payload_format")===pn&&(t=wr.base64Encode(t)),{data:t}},MixpanelLib.prototype._track_or_batch=function(e,t){var n=wr.truncate(e.data,255),i=e.endpoint,s=e.batcher,a=e.should_send_immediately,c=e.send_request_options||{};t=t||NOOP_FUNC;var d=!0,u=wr.bind((function(){return c.skip_hooks||(n=this._run_hook("before_send_"+e.type,n)),n?(Ir.log("MIXPANEL REQUEST:"),Ir.log(n),this._send_request(i,this._encode_data_for_request(n),c,this._prepare_callback(t,n))):null}),this);return this._batch_requests&&!a?s.enqueue(n,(function(e){e?t(1,n):u()})):d=u(),d&&n},MixpanelLib.prototype.track=addOptOutCheckMixpanelLib((function(e,t,n,i){i||"function"!=typeof n||(i=n,n=null);var s=(n=n||{}).transport;s&&(n.transport=s);var a=n.send_immediately;if("function"!=typeof i&&(i=NOOP_FUNC),wr.isUndefined(e))this.report_error("No event name provided to mixpanel.track");else{if(!this._event_is_disabled(e)){(t=wr.extend({},t)).token=this.get_config("token");var c=this.persistence.remove_event_timer(e);if(!wr.isUndefined(c)){var d=(new Date).getTime()-c;t.$duration=parseFloat((d/1e3).toFixed(3))}this._set_default_superprops();var u=this.get_config("track_marketing")?wr.info.marketingParams():{};t=wr.extend({},wr.info.properties({mp_loader:this.get_config("mp_loader")}),u,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),t);var l=this.get_config("property_blacklist");wr.isArray(l)?wr.each(l,(function(e){delete t[e]})):this.report_error("Invalid value for property_blacklist config: "+l);var p={event:e,properties:t};return this._track_or_batch({type:"events",data:p,endpoint:this.get_config("api_host")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:a,send_request_options:n},i)}i(0)}})),MixpanelLib.prototype.set_group=addOptOutCheckMixpanelLib((function(e,t,n){wr.isArray(t)||(t=[t]);var i={};return i[e]=t,this.register(i),this.people.set(e,t,n)})),MixpanelLib.prototype.add_group=addOptOutCheckMixpanelLib((function(e,t,n){var i=this.get_property(e),s={};return void 0===i?(s[e]=[t],this.register(s)):-1===i.indexOf(t)&&(i.push(t),s[e]=i,this.register(s)),this.people.union(e,t,n)})),MixpanelLib.prototype.remove_group=addOptOutCheckMixpanelLib((function(e,t,n){var i=this.get_property(e);if(void 0!==i){var s=i.indexOf(t);s>-1&&(i.splice(s,1),this.register({group_key:i})),0===i.length&&this.unregister(e)}return this.people.remove(e,t,n)})),MixpanelLib.prototype.track_with_groups=addOptOutCheckMixpanelLib((function(e,t,n,i){var s=wr.extend({},t||{});return wr.each(n,(function(e,t){null!=e&&(s[t]=e)})),this.track(e,s,i)})),MixpanelLib.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},MixpanelLib.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},MixpanelLib.prototype.get_group=function(e,t){var n=this._create_map_key(e,t),i=this._cached_groups[n];return void 0!==i&&i._group_key===e&&i._group_id===t||((i=new MixpanelGroup)._init(this,e,t),this._cached_groups[n]=i),i},MixpanelLib.prototype.track_pageview=addOptOutCheckMixpanelLib((function(e,t){"object"!=typeof e&&(e={});var n=(t=t||{}).event_name||"$mp_web_page_view",i=wr.extend(wr.info.mpPageViewProperties(),wr.info.campaignParams(),wr.info.clickParams()),s=wr.extend({},i,e);return this.track(n,s)})),MixpanelLib.prototype.track_links=function(){return this._track_dom.call(this,LinkTracker,arguments)},MixpanelLib.prototype.track_forms=function(){return this._track_dom.call(this,FormTracker,arguments)},MixpanelLib.prototype.time_event=function(e){wr.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 bn={persistent:!0},options_for_register=function(e){var t;return t=wr.isObject(e)?e:wr.isUndefined(e)?{}:{days:e},wr.extend({},bn,t)};MixpanelLib.prototype.register=function(e,t){var n=options_for_register(t);n.persistent?this.persistence.register(e,n.days):wr.extend(this.unpersisted_superprops,e)},MixpanelLib.prototype.register_once=function(e,t,n){var i=options_for_register(n);i.persistent?this.persistence.register_once(e,t,i.days):(void 0===t&&(t="None"),wr.each(e,(function(e,n){this.unpersisted_superprops.hasOwnProperty(n)&&this.unpersisted_superprops[n]!==t||(this.unpersisted_superprops[n]=e)}),this))},MixpanelLib.prototype.unregister=function(e,t){(t=options_for_register(t)).persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]},MixpanelLib.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)},MixpanelLib.prototype.identify=function(e,t,n,i,s,a,c,d){var u=this.get_distinct_id();if(e&&u!==e){if("string"==typeof e&&0===e.indexOf(hn))return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var l=u;this.register_once({$had_persisted_distinct_id:!0,$device_id:l},"")}e!==u&&e!==this.get_property(an)&&(this.unregister(an),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,n,i,s,a,c,d),e!==u&&this.track("$identify",{distinct_id:e,$anon_distinct_id:u},{skip_hooks:!0})},MixpanelLib.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=wr.UUID();this.register_once({distinct_id:hn+e,$device_id:e},"")},MixpanelLib.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},MixpanelLib.prototype.alias=function(e,t){if(e===this.get_property(sn))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return wr.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(an,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},(function(){n.identify(e)}))):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},MixpanelLib.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},MixpanelLib.prototype.set_config=function(e){wr.isObject(e)&&(wr.extend(this.config,e),e.batch_size&&wr.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),Wt.DEBUG=Wt.DEBUG||this.get_config("debug"))},MixpanelLib.prototype.get_config=function(e){return this.config[e]},MixpanelLib.prototype._run_hook=function(e){var t=(this.config.hooks[e]||IDENTITY_FUNC).apply(this,cr.call(arguments,1));return void 0===t&&(this.report_error(e+" hook did not return a value"),t=null),t},MixpanelLib.prototype.get_property=function(e){return this.persistence.load_prop([e])},MixpanelLib.prototype.toString=function(){var e=this.get_config("name");return e!==ln&&(e=ln+"."+e),e},MixpanelLib.prototype._event_is_disabled=function(e){return wr.isBlockedUA(_r)||this._flags.disable_all_events||wr.include(this.__disabled_events,e)},MixpanelLib.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_tracking_persistence_type")&&wr.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")&&!wr.cookie.get("mp_optout")||(wr.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},MixpanelLib.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()},MixpanelLib.prototype._gdpr_call_func=function(e,t){return t=wr.extend({track:wr.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),wr.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})},MixpanelLib.prototype.opt_in_tracking=function(e){e=wr.extend({enable_persistence:!0},e),this._gdpr_call_func(optIn,e),this._gdpr_update_persistence(e)},MixpanelLib.prototype.opt_out_tracking=function(e){(e=wr.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(optOut,e),this._gdpr_update_persistence(e)},MixpanelLib.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(hasOptedIn,e)},MixpanelLib.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(hasOptedOut,e)},MixpanelLib.prototype.clear_opt_in_out_tracking=function(e){e=wr.extend({enable_persistence:!0},e),this._gdpr_call_func(clearOptInOut,e),this._gdpr_update_persistence(e)},MixpanelLib.prototype.report_error=function(e,t){Ir.error.apply(Ir.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(n){Ir.error(n)}},MixpanelLib.prototype.init=MixpanelLib.prototype.init,MixpanelLib.prototype.reset=MixpanelLib.prototype.reset,MixpanelLib.prototype.disable=MixpanelLib.prototype.disable,MixpanelLib.prototype.time_event=MixpanelLib.prototype.time_event,MixpanelLib.prototype.track=MixpanelLib.prototype.track,MixpanelLib.prototype.track_links=MixpanelLib.prototype.track_links,MixpanelLib.prototype.track_forms=MixpanelLib.prototype.track_forms,MixpanelLib.prototype.track_pageview=MixpanelLib.prototype.track_pageview,MixpanelLib.prototype.register=MixpanelLib.prototype.register,MixpanelLib.prototype.register_once=MixpanelLib.prototype.register_once,MixpanelLib.prototype.unregister=MixpanelLib.prototype.unregister,MixpanelLib.prototype.identify=MixpanelLib.prototype.identify,MixpanelLib.prototype.alias=MixpanelLib.prototype.alias,MixpanelLib.prototype.name_tag=MixpanelLib.prototype.name_tag,MixpanelLib.prototype.set_config=MixpanelLib.prototype.set_config,MixpanelLib.prototype.get_config=MixpanelLib.prototype.get_config,MixpanelLib.prototype.get_property=MixpanelLib.prototype.get_property,MixpanelLib.prototype.get_distinct_id=MixpanelLib.prototype.get_distinct_id,MixpanelLib.prototype.toString=MixpanelLib.prototype.toString,MixpanelLib.prototype.opt_out_tracking=MixpanelLib.prototype.opt_out_tracking,MixpanelLib.prototype.opt_in_tracking=MixpanelLib.prototype.opt_in_tracking,MixpanelLib.prototype.has_opted_out_tracking=MixpanelLib.prototype.has_opted_out_tracking,MixpanelLib.prototype.has_opted_in_tracking=MixpanelLib.prototype.has_opted_in_tracking,MixpanelLib.prototype.clear_opt_in_out_tracking=MixpanelLib.prototype.clear_opt_in_out_tracking,MixpanelLib.prototype.get_group=MixpanelLib.prototype.get_group,MixpanelLib.prototype.set_group=MixpanelLib.prototype.set_group,MixpanelLib.prototype.add_group=MixpanelLib.prototype.add_group,MixpanelLib.prototype.remove_group=MixpanelLib.prototype.remove_group,MixpanelLib.prototype.track_with_groups=MixpanelLib.prototype.track_with_groups,MixpanelLib.prototype.start_batch_senders=MixpanelLib.prototype.start_batch_senders,MixpanelLib.prototype.stop_batch_senders=MixpanelLib.prototype.stop_batch_senders,MixpanelLib.prototype.start_session_recording=MixpanelLib.prototype.start_session_recording,MixpanelLib.prototype.stop_session_recording=MixpanelLib.prototype.stop_session_recording,MixpanelLib.prototype.get_session_recording_properties=MixpanelLib.prototype.get_session_recording_properties,MixpanelLib.prototype.DEFAULT_API_ROUTES=gn,MixpanelPersistence.prototype.properties=MixpanelPersistence.prototype.properties,MixpanelPersistence.prototype.update_search_keyword=MixpanelPersistence.prototype.update_search_keyword,MixpanelPersistence.prototype.update_referrer_info=MixpanelPersistence.prototype.update_referrer_info,MixpanelPersistence.prototype.get_cross_subdomain=MixpanelPersistence.prototype.get_cross_subdomain,MixpanelPersistence.prototype.clear=MixpanelPersistence.prototype.clear;var Sn={},override_mp_init_func=function(){un.init=function(e,t,n){if(n)return un[n]||(un[n]=Sn[n]=create_mplib(e,t,n),un[n]._loaded()),un[n];var i=un;Sn[ln]?i=Sn[ln]:e&&((i=create_mplib(e,t,ln))._loaded(),Sn[ln]=i),un=i,1===Yr&&($t[ln]=un),wr.each(Sn,(function(e,t){t!==ln&&(un[t]=e)})),un._=wr}};var kn=function init_as_module(e){return load_extra_bundle=e,Yr=0,un=new MixpanelLib,override_mp_init_func(),un.init(),function(){function dom_loaded_handler(){dom_loaded_handler.done||(dom_loaded_handler.done=!0,vn=!0,mn=!1,wr.each(Sn,(function(e){e._dom_loaded()})))}if(hr.addEventListener)"complete"===hr.readyState?dom_loaded_handler():hr.addEventListener("DOMContentLoaded",dom_loaded_handler,!1);else if(hr.attachEvent){hr.attachEvent("onreadystatechange",dom_loaded_handler);var e=!1;try{e=null===$t.frameElement}catch(t){}hr.documentElement.doScroll&&e&&function do_scroll_check(){try{hr.documentElement.doScroll("left")}catch(t){return void setTimeout(do_scroll_check,1)}dom_loaded_handler()}()}wr.register_event($t,"load",dom_loaded_handler,!0)}(),un}((function loadNoop(e,t){t()}));function isReady(){return void 0!==window.mixpanel}const wn={init:function init$1(e,t=!1){return new Promise((n=>{kn.init(e,{debug:t,loaded:()=>{window.mixpanel=kn,n()}})}))},isReady:isReady,track:function track(e,t){isReady()&&kn.track(e,t)},identify:function identify$1(e,t){isReady()&&(kn.identify(e),kn.people.set(t))},attachProperty:function attachProperty(e,t){isReady()&&kn.people.union(e,[t])}},In=["Track Test"];async function trackEvent(e,t){if(!wn.isReady())throw new Error("Mixpanel is not initialized.");try{Tn.parseEventProps(e,t);const n=!In.includes(e),i=await ot.getFingerprint(n),s={...{"User Fingerprint":i},...t};wn.track(e,s)}catch(Xt){throw console.error("Error tracking event:",Xt),Xt}}const xn=ge.object({Arrival:ge.string().refine(dateValidation,{message:"Invalid arrival date or datetime format. Must include at least YYYY-MM-DD"}),Departure:ge.string().refine(dateValidation,{message:"Invalid departure date or datetime format. Must include at least YYYY-MM-DD"}),Destination:ge.string().min(1,"Destination is required"),"Destination Terminal":ge.string().min(1,"Destination Terminal is required"),Line:ge.string().min(1,"Line is required").optional(),Origin:ge.string().min(1,"Origin is required"),"Origin Terminal":ge.string().min(1,"Origin Terminal is required"),Price:ge.number().positive("Price must be a positive number"),Route:ge.string().min(1,"Route is required"),Stops:ge.number().int("Stops must be an integer").nonnegative().optional(),Tickets:ge.number().int("Tickets must be an integer").positive(),Transporter:ge.string().min(1,"Transporter is required"),"User Fingerprint":ge.string().or(ge.null()).refine(userFingerPrintValidation,{message:"User fingerprint must be a string or null"}).optional(),Way:ge.enum(["Departure","Return"],{description:"Way must be either 'Departure' or 'Return'"}),product:ge.enum(ve).refine((e=>ve.includes(e)),{message:`Product must be one of: ${ve.join(", ")}`})}),En=ge.object({}),Cn=ge.object({mixpanelToken:ge.string().min(1,"Mixpanel token is required"),debug:ge.boolean().optional(),identificationKey:ge.string().min(1,"Identification key is required")}),SchemaErrorFormatter=e=>e.issues.map((e=>{let t="INVALID_FIELD",n="",i="",s="";return"invalid_type"===e.code?(t="TYPE_MISMATCH",n=e.expected,i=e.received,s=`Expected ${n} but received ${i}. Please provide a value of type ${n}.`):"too_small"===e.code?(t="VALUE_TOO_SMALL",s=`Increase the value to at least ${e.minimum}.`):"too_big"===e.code?(t="VALUE_TOO_BIG",s=`Reduce the value to no more than ${e.maximum}.`):(t="INVALID_FIELD",s="Ensure the field matches the expected format and value type."),{field:e.path.join("."),error_type:t,expected:n,received:i,message:e.message,suggestion:s}})),On={"Track Test":En,Search:be,"Seat Change":xn};function validateProps(e,t){try{t.parse(e)}catch(Xt){if(Xt instanceof ZodError){throw{message:"Schema validation failed",errors:SchemaErrorFormatter(Xt)}}throw{message:"Unknown validation error"}}}const Tn={parseEventProps:function parseEventProps(e,t){const n=On[e];if(!n)throw{message:`Event ${e} not found`};try{n.parse(t)}catch(Xt){if(Xt instanceof ZodError){throw{message:"Schema validation failed",errors:SchemaErrorFormatter(Xt)}}throw{message:"Unknown validation error"}}},parseInitProps:function parseInitProps(e){validateProps(e,Cn)},parseIdentifyProps:function parseIdentifyProps(e){validateProps(e,ye)}},Rn=["firstName","lastName","email","phone"];const Mn={init:async function init(e){Tn.parseInitProps(e);const{mixpanelToken:t,debug:n=!1,identificationKey:i}=e;await wn.init(t,n);try{await ot.initFingerprint(i)}catch(Xt){console.error("Error initializing identification service:",Xt)}!function onLoaded(){window.dispatchEvent(new CustomEvent("Tracker Ready"))}()},identify:async function identify(e,t={}){if(!wn.isReady())throw new Error("Analytics service is not initialized");try{if(Tn.parseIdentifyProps(t),!e)throw new Error("User ID is required");const n=function mapProperties(e){return{$first_name:null==e?void 0:e.firstName,$last_name:null==e?void 0:e.lastName,$email:null==e?void 0:e.email,$phone:null==e?void 0:e.phone,...Object.keys(e).reduce(((t,n)=>(Rn.includes(n)||(t[n]=e[n]),t)),{})}}(t);wn.identify(e,n);const i=await ot.getFingerprint();i&&wn.attachProperty("Known Fingerprints",i)}catch(Xt){console.error("Error attaching fingerprint:",Xt)}},track:{test:function trackTest(){trackEvent("Track Test",{})},search:function trackSearch(e){trackEvent("Search",e)},seatChange:async e=>{trackEvent("Seat Change",e)}}};module.exports=Mn;
30
+ function __awaiter2(e,t,n,i){return new(n||(n=Promise))((function(t,s){function fulfilled(e){try{step(i.next(e))}catch(t){s(t)}}function rejected(e){try{step(i.throw(e))}catch(t){s(t)}}function step(e){e.done?t(e.value):function adopt(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((i=i.apply(e,[])).next())}))}for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),n=0;n<64;n++)t[e.charCodeAt(n)]=n;var encode2=function(t){var n,i=new Uint8Array(t),s=i.length,a="";for(n=0;n<s;n+=3)a+=e[i[n]>>2],a+=e[(3&i[n])<<4|i[n+1]>>4],a+=e[(15&i[n+1])<<2|i[n+2]>>6],a+=e[63&i[n+2]];return s%3==2?a=a.substring(0,a.length-1)+"=":s%3==1&&(a=a.substring(0,a.length-2)+"=="),a};const i=new Map,s=new Map;const a=self;a.onmessage=function(e){return __awaiter2(this,0,void 0,(function*(){if(!("OffscreenCanvas"in globalThis))return a.postMessage({id:e.data.id});{const{id:t,bitmap:n,width:c,height:d,dataURLOptions:u}=e.data,l=function getTransparentBlobFor(e,t,n){return __awaiter2(this,0,void 0,(function*(){const i=`${e}-${t}`;if("OffscreenCanvas"in globalThis){if(s.has(i))return s.get(i);const a=new OffscreenCanvas(e,t);a.getContext("2d");const c=yield a.convertToBlob(n),d=yield c.arrayBuffer(),u=encode2(d);return s.set(i,u),u}return""}))}(c,d,u),p=new OffscreenCanvas(c,d);p.getContext("2d").drawImage(n,0,0),n.close();const h=yield p.convertToBlob(u),f=h.type,m=yield h.arrayBuffer(),_=encode2(m);if(!i.has(t)&&(yield l)===_)return i.set(t,_),a.postMessage({id:t});if(i.get(t)===_)return a.postMessage({id:t});a.postMessage({id:t,type:f,base64:_,width:c,height:d}),i.set(t,_)}}))}}()}));class CanvasManager{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:i,blockSelector:s,recordCanvas:a,dataURLOptions:c}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&"all"===t&&this.initCanvasMutationObserver(n,i,s),a&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,i,s,{dataURLOptions:c})}initCanvasFPSObserver(e,t,n,i,s){const a=initCanvasContextObserver(t,n,i,!0),c=new Map,d=new At;d.onmessage=e=>{const{id:t}=e.data;if(c.set(t,!1),!("base64"in e.data))return;const{base64:n,type:i,width:s,height:a}=e.data;this.mutationCb({id:t,type:Ct["2D"],commands:[{property:"clearRect",args:[0,0,s,a]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:i}]},0,0]}]})};const u=1e3/e;let l,p=0;const takeCanvasSnapshots=e=>{p&&e-p<u||(p=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{isBlocked(t,n,i,!0)||e.push(t)})),e})().forEach((e=>__awaiter(this,0,void 0,(function*(){var t;const n=this.mirror.getId(e);if(c.get(n))return;if(0===e.width||0===e.height)return;if(c.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const i=yield createImageBitmap(e);d.postMessage({id:n,bitmap:i,width:e.width,height:e.height,dataURLOptions:s.dataURLOptions},[i])}))))),l=requestAnimationFrame(takeCanvasSnapshots)};l=requestAnimationFrame(takeCanvasSnapshots),this.resetObservers=()=>{a(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=initCanvasContextObserver(e,t,n,!1),s=function initCanvas2DMutationObserver(e,t,n,i){const s=[],a=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const d of a)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[d])continue;const a=patch(t.CanvasRenderingContext2D.prototype,d,(function(s){return function(...a){return isBlocked(this.canvas,n,i,!0)||setTimeout((()=>{const n=serializeArgs(a,t,this);e(this.canvas,{type:Ct["2D"],property:d,args:n})}),0),s.apply(this,a)}}));s.push(a)}catch(c){const n=hookSetter(t.CanvasRenderingContext2D.prototype,d,{set(t){e(this.canvas,{type:Ct["2D"],property:d,args:[t],setter:!0})}});s.push(n)}return()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),a=function initCanvasWebGLMutationObserver(e,t,n,i,s){const a=[];return a.push(...patchGLPrototype(t.WebGLRenderingContext.prototype,Ct.WebGL,e,n,i,0,t)),void 0!==t.WebGL2RenderingContext&&a.push(...patchGLPrototype(t.WebGL2RenderingContext.prototype,Ct.WebGL2,e,n,i,0,t)),()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{i(),s(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const setLatestRAFTimestamp=e=>{this.rafStamps.latestId=e,requestAnimationFrame(setLatestRAFTimestamp)};requestAnimationFrame(setLatestRAFTimestamp)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const i=n.map((e=>{const t=function __rest(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]])}return n}(e,["type"]);return t})),{type:s}=n[0];this.mutationCb({id:t,type:s,commands:i}),this.pendingCanvasMutations.delete(e)}}class StylesheetManager{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new StyleSheetMirror,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},i=[];for(const s of e){let e;this.styleMirror.has(s)?e=this.styleMirror.getId(s):(e=this.styleMirror.add(s),i.push({styleId:e,rules:Array.from(s.rules||CSSRule,((e,t)=>({rule:stringifyRule(e),index:t})))})),n.styleIds.push(e)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class ProcessedNodeManager{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame((()=>{this.clear(),this.loop&&this.periodicallyClear()}))}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some((e=>e!==t))}add(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function wrapEvent(e){return Object.assign(Object.assign({},e),{timestamp:kt()})}let Lt,jt,Ft,Ut=!1;const qt=function createMirror(){return new Mirror}();function record(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:s="rr-block",blockSelector:a=null,ignoreClass:c="rr-ignore",ignoreSelector:d=null,maskTextClass:u="rr-mask",maskTextSelector:l=null,inlineStylesheet:p=!0,maskAllInputs:h,maskInputOptions:f,slimDOMOptions:m,maskInputFn:_,maskTextFn:g,hooks:y,packFn:v,sampling:b={},dataURLOptions:S={},mousemoveWait:w,recordDOM:I=!0,recordCanvas:x=!1,recordCrossOriginIframes:C=!1,recordAfter:O=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:T=!1,collectFonts:R=!1,inlineImages:N=!1,plugins:Z,keepIframeSrcFn:P=()=>!1,ignoreCSSAttributes:D=new Set([]),errorHandler:A}=e;!function registerErrorHandler(e){Ot=e}(A);const L=!C||window.parent===window;let j=!1;if(!L)try{window.parent.document&&(j=!1)}catch(G){j=!0}if(L&&!t)throw new Error("emit function is required");void 0!==w&&void 0===b.mousemove&&(b.mousemove=w),qt.reset();const U=!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==f?f:{password:!0},q=!0===m||"all"===m?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===m,headMetaDescKeywords:"all"===m}:m||{};let $;!function polyfill(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let B=0;const eventProcessor=e=>{for(const t of Z||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!j&&(e=v(e)),e};Lt=(e,s)=>{var a;if(!(null===(a=Tt[0])||void 0===a?void 0:a.isFrozen())||e.type===wt.FullSnapshot||e.type===wt.IncrementalSnapshot&&e.data.source===It.Mutation||Tt.forEach((e=>e.unfreeze())),L)null==t||t(eventProcessor(e),s);else if(j){const t={type:"rrweb",event:eventProcessor(e),origin:window.location.origin,isCheckout:s};window.parent.postMessage(t,"*")}if(e.type===wt.FullSnapshot)$=e,B=0;else if(e.type===wt.IncrementalSnapshot){if(e.data.source===It.Mutation&&e.data.isAttachIframe)return;B++;const t=i&&B>=i,s=n&&e.timestamp-$.timestamp>n;(t||s)&&jt(!0)}};const wrappedMutationEmit=e=>{Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.Mutation},e)}))},wrappedScrollEmit=e=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.Scroll},e)})),wrappedCanvasMutationEmit=e=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.CanvasMutation},e)})),z=new StylesheetManager({mutationCb:wrappedMutationEmit,adoptedStyleSheetCb:e=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.AdoptedStyleSheet},e)}))}),W=new IframeManager({mirror:qt,mutationCb:wrappedMutationEmit,stylesheetManager:z,recordCrossOriginIframes:C,wrappedEmit:Lt});for(const Y of Z||[])Y.getMirror&&Y.getMirror({nodeMirror:qt,crossOriginIframeMirror:W.crossOriginIframeMirror,crossOriginIframeStyleMirror:W.crossOriginIframeStyleMirror});const K=new ProcessedNodeManager;Ft=new CanvasManager({recordCanvas:x,mutationCb:wrappedCanvasMutationEmit,win:window,blockClass:s,blockSelector:a,mirror:qt,sampling:b.canvas,dataURLOptions:S});const H=new ShadowDomManager({mutationCb:wrappedMutationEmit,scrollCb:wrappedScrollEmit,bypassOptions:{blockClass:s,blockSelector:a,maskTextClass:u,maskTextSelector:l,inlineStylesheet:p,maskInputOptions:U,dataURLOptions:S,maskTextFn:g,maskInputFn:_,recordCanvas:x,inlineImages:N,sampling:b,slimDOMOptions:q,iframeManager:W,stylesheetManager:z,canvasManager:Ft,keepIframeSrcFn:P,processedNodeManager:K},mirror:qt});jt=(e=!1)=>{if(!I)return;Lt(wrapEvent({type:wt.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),e),z.reset(),H.init(),Tt.forEach((e=>e.lock()));const t=function snapshot(e,t){const{mirror:n=new Mirror,blockClass:i="rr-block",blockSelector:s=null,maskTextClass:a="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:p=!1,maskTextFn:h,maskInputFn:f,slimDOM:m=!1,dataURLOptions:_,preserveWhiteSpace:g,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:w,keepIframeSrcFn:I=()=>!1}=t||{};return serializeNodeWithId(e,{doc:e,mirror:n,blockClass:i,blockSelector:s,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===p?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===p?{password:!0}:p,maskTextFn:h,maskInputFn:f,slimDOMOptions:!0===m||"all"===m?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===m,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===m?{}:m,dataURLOptions:_,inlineImages:u,recordCanvas:l,preserveWhiteSpace:g,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:w,keepIframeSrcFn:I,newlyAddedElement:!1})}(document,{mirror:qt,blockClass:s,blockSelector:a,maskTextClass:u,maskTextSelector:l,inlineStylesheet:p,maskAllInputs:U,maskTextFn:g,slimDOM:q,dataURLOptions:S,recordCanvas:x,inlineImages:N,onSerialize:e=>{isSerializedIframe(e,qt)&&W.addIframe(e),isSerializedStylesheet(e,qt)&&z.trackLinkElement(e),hasShadowRoot(e)&&H.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{W.attachIframe(e,t),H.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{z.attachLinkElement(e,t)},keepIframeSrcFn:P});if(!t)return console.warn("Failed to snapshot the document");Lt(wrapEvent({type:wt.FullSnapshot,data:{node:t,initialOffset:getWindowScroll(window)}}),e),Tt.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,qt.getId(document))};try{const e=[],observe=e=>{var t;return callbackWrapper(initObservers)({mutationCb:wrappedMutationEmit,mousemoveCb:(e,t)=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.MouseInteraction},e)})),scrollCb:wrappedScrollEmit,viewportResizeCb:e=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.ViewportResize},e)})),inputCb:e=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.Input},e)})),mediaInteractionCb:e=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.MediaInteraction},e)})),styleSheetRuleCb:e=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.StyleSheetRule},e)})),styleDeclarationCb:e=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.StyleDeclaration},e)})),canvasMutationCb:wrappedCanvasMutationEmit,fontCb:e=>Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.Font},e)})),selectionCb:e=>{Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.Selection},e)}))},customElementCb:e=>{Lt(wrapEvent({type:wt.IncrementalSnapshot,data:Object.assign({source:It.CustomElement},e)}))},blockClass:s,ignoreClass:c,ignoreSelector:d,maskTextClass:u,maskTextSelector:l,maskInputOptions:U,inlineStylesheet:p,sampling:b,recordDOM:I,recordCanvas:x,inlineImages:N,userTriggeredOnInput:T,collectFonts:R,doc:e,maskInputFn:_,maskTextFn:g,keepIframeSrcFn:P,blockSelector:a,slimDOMOptions:q,dataURLOptions:S,mirror:qt,iframeManager:W,stylesheetManager:z,shadowDomManager:H,processedNodeManager:K,canvasManager:Ft,ignoreCSSAttributes:D,plugins:(null===(t=null==Z?void 0:Z.filter((e=>e.observer)))||void 0===t?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>Lt(wrapEvent({type:wt.Plugin,data:{plugin:e.name,payload:t}}))}))))||[]},y)};W.addLoadListener((t=>{try{e.push(observe(t.contentDocument))}catch(Xt){console.warn(Xt)}}));const init2=()=>{jt(),e.push(observe(document)),Ut=!0};return"interactive"===document.readyState||"complete"===document.readyState?init2():(e.push(on("DOMContentLoaded",(()=>{Lt(wrapEvent({type:wt.DomContentLoaded,data:{}})),"DOMContentLoaded"===O&&init2()}))),e.push(on("load",(()=>{Lt(wrapEvent({type:wt.Load,data:{}})),"load"===O&&init2()}),window))),()=>{e.forEach((e=>e())),K.destroy(),Ut=!1,function unregisterErrorHandler(){Ot=void 0}()}}catch(Xt){console.warn(Xt)}}record.addCustomEvent=(e,t)=>{if(!Ut)throw new Error("please add custom event after start recording");Lt(wrapEvent({type:wt.Custom,data:{tag:e,payload:t}}))},record.freezePage=()=>{Tt.forEach((e=>e.freeze()))},record.takeFullSnapshot=e=>{if(!Ut)throw new Error("please take full snapshot after start recording");jt(e)},record.mirror=qt;var $t,Bt=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Bt||{}),zt=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(zt||{}),Wt={DEBUG:!1,LIB_VERSION:"2.55.1"};if("undefined"==typeof window){var Vt={hostname:""};$t={navigator:{userAgent:"",onLine:!0},document:{location:Vt,referrer:""},screen:{width:0,height:0},location:Vt}}else $t=window;var Kt,Ht,Gt,Yt,Jt,Xt,Qt,er,tr,rr,nr=864e5,ir=8e3,or=Array.prototype,sr=Function.prototype,ar=Object.prototype,cr=or.slice,dr=ar.toString,ur=ar.hasOwnProperty,lr=$t.console,pr=$t.navigator,hr=$t.document,fr=$t.opera,mr=$t.screen,_r=pr.userAgent,gr=sr.bind,yr=or.forEach,vr=or.indexOf,br=or.map,Sr=Array.isArray,kr={},wr={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},Ir={log:function(){if(Wt.DEBUG&&!wr.isUndefined(lr)&&lr)try{lr.log.apply(lr,arguments)}catch(e){wr.each(arguments,(function(e){lr.log(e)}))}},warn:function(){if(Wt.DEBUG&&!wr.isUndefined(lr)&&lr){var e=["Mixpanel warning:"].concat(wr.toArray(arguments));try{lr.warn.apply(lr,e)}catch(t){wr.each(e,(function(e){lr.warn(e)}))}}},error:function(){if(Wt.DEBUG&&!wr.isUndefined(lr)&&lr){var e=["Mixpanel error:"].concat(wr.toArray(arguments));try{lr.error.apply(lr,e)}catch(t){wr.each(e,(function(e){lr.error(e)}))}}},critical:function(){if(!wr.isUndefined(lr)&&lr){var e=["Mixpanel error:"].concat(wr.toArray(arguments));try{lr.error.apply(lr,e)}catch(t){wr.each(e,(function(e){lr.error(e)}))}}}},log_func_with_prefix=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(Ir,arguments)}},console_with_prefix=function(e){return{log:log_func_with_prefix(Ir.log,e),error:log_func_with_prefix(Ir.error,e),critical:log_func_with_prefix(Ir.critical,e)}};wr.bind=function(e,t){var n,i;if(gr&&e.bind===gr)return gr.apply(e,cr.call(arguments,1));if(!wr.isFunction(e))throw new TypeError;return n=cr.call(arguments,2),i=function(){if(!(this instanceof i))return e.apply(t,n.concat(cr.call(arguments)));var s={};s.prototype=e.prototype;var a=new s;s.prototype=null;var c=e.apply(a,n.concat(cr.call(arguments)));return Object(c)===c?c:a},i},wr.each=function(e,t,n){if(null!=e)if(yr&&e.forEach===yr)e.forEach(t,n);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(i in e&&t.call(n,e[i],i,e)===kr)return}else for(var a in e)if(ur.call(e,a)&&t.call(n,e[a],a,e)===kr)return},wr.extend=function(e){return wr.each(cr.call(arguments,1),(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},wr.isArray=Sr||function(e){return"[object Array]"===dr.call(e)},wr.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(t){return!1}},wr.isArguments=function(e){return!(!e||!ur.call(e,"callee"))},wr.toArray=function(e){return e?e.toArray?e.toArray():wr.isArray(e)||wr.isArguments(e)?cr.call(e):wr.values(e):[]},wr.map=function(e,t,n){if(br&&e.map===br)return e.map(t,n);var i=[];return wr.each(e,(function(e){i.push(t.call(n,e))})),i},wr.keys=function(e){var t=[];return null===e||wr.each(e,(function(e,n){t[t.length]=n})),t},wr.values=function(e){var t=[];return null===e||wr.each(e,(function(e){t[t.length]=e})),t},wr.include=function(e,t){var n=!1;return null===e?n:vr&&e.indexOf===vr?-1!=e.indexOf(t):(wr.each(e,(function(e){if(n||(n=e===t))return kr})),n)},wr.includes=function(e,t){return-1!==e.indexOf(t)},wr.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},wr.isObject=function(e){return e===Object(e)&&!wr.isArray(e)},wr.isEmptyObject=function(e){if(wr.isObject(e)){for(var t in e)if(ur.call(e,t))return!1;return!0}return!1},wr.isUndefined=function(e){return void 0===e},wr.isString=function(e){return"[object String]"==dr.call(e)},wr.isDate=function(e){return"[object Date]"==dr.call(e)},wr.isNumber=function(e){return"[object Number]"==dr.call(e)},wr.isElement=function(e){return!(!e||1!==e.nodeType)},wr.encodeDates=function(e){return wr.each(e,(function(t,n){wr.isDate(t)?e[n]=wr.formatDate(t):wr.isObject(t)&&(e[n]=wr.encodeDates(t))})),e},wr.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},wr.formatDate=function(e){function pad(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+pad(e.getUTCMonth()+1)+"-"+pad(e.getUTCDate())+"T"+pad(e.getUTCHours())+":"+pad(e.getUTCMinutes())+":"+pad(e.getUTCSeconds())},wr.strip_empty_properties=function(e){var t={};return wr.each(e,(function(e,n){wr.isString(e)&&e.length>0&&(t[n]=e)})),t},wr.truncate=function(e,t){var n;return"string"==typeof e?n=e.slice(0,t):wr.isArray(e)?(n=[],wr.each(e,(function(e){n.push(wr.truncate(e,t))}))):wr.isObject(e)?(n={},wr.each(e,(function(e,i){n[i]=wr.truncate(e,t)}))):n=e,n},wr.JSONEncode=function(){return function(e){var quote=function(e){var t=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return t.lastIndex=0,t.test(e)?'"'+e.replace(t,(function(e){var t=n[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'},str=function(e,t){var n="",i=0,s="",a="",c=0,d=n,u=[],l=t[e];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(e)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(n+=" ",u=[],"[object Array]"===dr.apply(l)){for(c=l.length,i=0;i<c;i+=1)u[i]=str(i,l)||"null";return a=0===u.length?"[]":n?"[\n"+n+u.join(",\n"+n)+"\n"+d+"]":"["+u.join(",")+"]",n=d,a}for(s in l)ur.call(l,s)&&(a=str(s,l))&&u.push(quote(s)+(n?": ":":")+a);return a=0===u.length?"{}":n?"{"+u.join(",")+d+"}":"{"+u.join(",")+"}",n=d,a}};return str("",{"":e})}}(),wr.JSONDecode=(Jt={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},Xt=function(e){var t=new SyntaxError(e);throw t.at=Kt,t.text=Gt,t},Qt=function(e){return e&&e!==Ht&&Xt("Expected '"+e+"' instead of '"+Ht+"'"),Ht=Gt.charAt(Kt),Kt+=1,Ht},er=function(){var e,t="";for("-"===Ht&&(t="-",Qt("-"));Ht>="0"&&Ht<="9";)t+=Ht,Qt();if("."===Ht)for(t+=".";Qt()&&Ht>="0"&&Ht<="9";)t+=Ht;if("e"===Ht||"E"===Ht)for(t+=Ht,Qt(),"-"!==Ht&&"+"!==Ht||(t+=Ht,Qt());Ht>="0"&&Ht<="9";)t+=Ht,Qt();if(e=+t,isFinite(e))return e;Xt("Bad number")},tr=function(){var e,t,n,i="";if('"'===Ht)for(;Qt();){if('"'===Ht)return Qt(),i;if("\\"===Ht)if(Qt(),"u"===Ht){for(n=0,t=0;t<4&&(e=parseInt(Qt(),16),isFinite(e));t+=1)n=16*n+e;i+=String.fromCharCode(n)}else{if("string"!=typeof Jt[Ht])break;i+=Jt[Ht]}else i+=Ht}Xt("Bad string")},rr=function(){for(;Ht&&Ht<=" ";)Qt()},Yt=function(){switch(rr(),Ht){case"{":return function(){var e,t={};if("{"===Ht){if(Qt("{"),rr(),"}"===Ht)return Qt("}"),t;for(;Ht;){if(e=tr(),rr(),Qt(":"),Object.hasOwnProperty.call(t,e)&&Xt('Duplicate key "'+e+'"'),t[e]=Yt(),rr(),"}"===Ht)return Qt("}"),t;Qt(","),rr()}}Xt("Bad object")}();case"[":return function(){var e=[];if("["===Ht){if(Qt("["),rr(),"]"===Ht)return Qt("]"),e;for(;Ht;){if(e.push(Yt()),rr(),"]"===Ht)return Qt("]"),e;Qt(","),rr()}}Xt("Bad array")}();case'"':return tr();case"-":return er();default:return Ht>="0"&&Ht<="9"?er():function(){switch(Ht){case"t":return Qt("t"),Qt("r"),Qt("u"),Qt("e"),!0;case"f":return Qt("f"),Qt("a"),Qt("l"),Qt("s"),Qt("e"),!1;case"n":return Qt("n"),Qt("u"),Qt("l"),Qt("l"),null}Xt('Unexpected "'+Ht+'"')}()}},function(e){var t;return Gt=e,Kt=0,Ht=" ",t=Yt(),rr(),Ht&&Xt("Syntax error"),t}),wr.base64Encode=function(e){var t,n,i,s,a,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=0,u=0,l="",p=[];if(!e)return e;e=wr.utf8Encode(e);do{t=(a=e.charCodeAt(d++)<<16|e.charCodeAt(d++)<<8|e.charCodeAt(d++))>>18&63,n=a>>12&63,i=a>>6&63,s=63&a,p[u++]=c.charAt(t)+c.charAt(n)+c.charAt(i)+c.charAt(s)}while(d<e.length);switch(l=p.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l},wr.utf8Encode=function(e){var t,n,i,s,a="";for(t=n=0,i=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,s=0;s<i;s++){var c=e.charCodeAt(s),d=null;c<128?n++:d=c>127&&c<2048?String.fromCharCode(c>>6|192,63&c|128):String.fromCharCode(c>>12|224,c>>6&63|128,63&c|128),null!==d&&(n>t&&(a+=e.substring(t,n)),a+=d,t=n=s+1)}return n>t&&(a+=e.substring(t,e.length)),a},wr.UUID=function(){var T2=function(){var e,t=1*new Date;if($t.performance&&$t.performance.now)e=$t.performance.now();else for(e=0;t==1*new Date;)e++;return t.toString(16)+Math.floor(e).toString(16)};return function(){var e=(mr.height*mr.width).toString(16);return T2()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,n=_r,i=[],s=0;function xor(e,t){var n,s=0;for(n=0;n<t.length;n++)s|=i[n]<<8*n;return e^s}for(e=0;e<n.length;e++)t=n.charCodeAt(e),i.unshift(255&t),i.length>=4&&(s=xor(s,i),i=[]);return i.length>0&&(s=xor(s,i)),s.toString(16)}()+"-"+e+"-"+T2()}}();var xr=["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"];wr.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<xr.length;t++)if(-1!==e.indexOf(xr[t]))return!0;return!1},wr.HTTPBuildQuery=function(e,t){var n,i,s=[];return wr.isUndefined(t)&&(t="&"),wr.each(e,(function(e,t){n=encodeURIComponent(e.toString()),i=encodeURIComponent(t),s[s.length]=i+"="+n})),s.join(t)},wr.getQueryParam=function(e,t){t=t.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var n=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);if(null===n||n&&"string"!=typeof n[1]&&n[1].length)return"";var i=n[1];try{i=decodeURIComponent(i)}catch(s){Ir.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},wr.cookie={get:function(e){for(var t=e+"=",n=hr.cookie.split(";"),i=0;i<n.length;i++){for(var s=n[i];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}return null},parse:function(e){var t;try{t=wr.JSONDecode(wr.cookie.get(e))||{}}catch(n){}return t},set_seconds:function(e,t,n,i,s,a,c){var d="",u="",l="";if(c)d="; domain="+c;else if(i){var p=extract_domain(hr.location.hostname);d=p?"; domain=."+p:""}if(n){var h=new Date;h.setTime(h.getTime()+1e3*n),u="; expires="+h.toGMTString()}a&&(s=!0,l="; SameSite=None"),s&&(l+="; secure"),hr.cookie=e+"="+encodeURIComponent(t)+u+"; path=/"+d+l},set:function(e,t,n,i,s,a,c){var d="",u="",l="";if(c)d="; domain="+c;else if(i){var p=extract_domain(hr.location.hostname);d=p?"; domain=."+p:""}if(n){var h=new Date;h.setTime(h.getTime()+24*n*60*60*1e3),u="; expires="+h.toGMTString()}a&&(s=!0,l="; SameSite=None"),s&&(l+="; secure");var f=e+"="+encodeURIComponent(t)+u+"; path=/"+d+l;return hr.cookie=f,f},remove:function(e,t,n){wr.cookie.set(e,"",-1,t,!1,!1,n)}};var Er=null,localStorageSupported=function(e,t){if(null!==Er&&!t)return Er;var n=!0;try{e=e||window.localStorage;var i="__mplss_"+cheap_guid(8);e.setItem(i,"xyz"),"xyz"!==e.getItem(i)&&(n=!1),e.removeItem(i)}catch(s){n=!1}return Er=n,n};wr.localStorage={is_supported:function(e){var t=localStorageSupported(null,e);return t||Ir.error("localStorage unsupported; falling back to cookie store"),t},error:function(e){Ir.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(t){wr.localStorage.error(t)}return null},parse:function(e){try{return wr.JSONDecode(wr.localStorage.get(e))||{}}catch(t){}return null},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(n){wr.localStorage.error(n)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(t){wr.localStorage.error(t)}}},wr.register_event=function(){function fixEvent(e){return e&&(e.preventDefault=fixEvent.preventDefault,e.stopPropagation=fixEvent.stopPropagation),e}return fixEvent.preventDefault=function(){this.returnValue=!1},fixEvent.stopPropagation=function(){this.cancelBubble=!0},function(e,t,n,i,s){if(e)if(e.addEventListener&&!i)e.addEventListener(t,n,!!s);else{var a="on"+t,c=e[a];e[a]=function makeHandler(e,t,n){var handler=function(i){if(i=i||fixEvent(window.event)){var s,a,c=!0;return wr.isFunction(n)&&(s=n(i)),a=t.call(e,i),!1!==s&&!1!==a||(c=!1),c}};return handler}(e,n,c)}else Ir.error("No valid element provided to register_event")}}();var Cr=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');wr.dom_query=function(){function getAllChildren(e){return e.all?e.all:e.getElementsByTagName("*")}var e=/[\t\r\n]/g;function hasClass(t,n){var i=" "+n+" ";return(" "+t.className+" ").replace(e," ").indexOf(i)>=0}function getElementsBySelector(e){if(!hr.getElementsByTagName)return[];var t,n,i,s,a,c,d,u,l,p,h=e.split(" "),f=[hr];for(c=0;c<h.length;c++)if((t=h[c].replace(/^\s+/,"").replace(/\s+$/,"")).indexOf("#")>-1){i=(n=t.split("#"))[0];var m=n[1],_=hr.getElementById(m);if(!_||i&&_.nodeName.toLowerCase()!=i)return[];f=[_]}else if(t.indexOf(".")>-1){i=(n=t.split("."))[0];var g=n[1];for(i||(i="*"),s=[],a=0,d=0;d<f.length;d++)for(l="*"==i?getAllChildren(f[d]):f[d].getElementsByTagName(i),u=0;u<l.length;u++)s[a++]=l[u];for(f=[],p=0,d=0;d<s.length;d++)s[d].className&&wr.isString(s[d].className)&&hasClass(s[d],g)&&(f[p++]=s[d])}else{var y=t.match(Cr);if(y){i=y[1];var v,b=y[2],S=y[3],w=y[4];for(i||(i="*"),s=[],a=0,d=0;d<f.length;d++)for(l="*"==i?getAllChildren(f[d]):f[d].getElementsByTagName(i),u=0;u<l.length;u++)s[a++]=l[u];switch(f=[],p=0,S){case"=":v=function(e){return e.getAttribute(b)==w};break;case"~":v=function(e){return e.getAttribute(b).match(new RegExp("\\b"+w+"\\b"))};break;case"|":v=function(e){return e.getAttribute(b).match(new RegExp("^"+w+"-?"))};break;case"^":v=function(e){return 0===e.getAttribute(b).indexOf(w)};break;case"$":v=function(e){return e.getAttribute(b).lastIndexOf(w)==e.getAttribute(b).length-w.length};break;case"*":v=function(e){return e.getAttribute(b).indexOf(w)>-1};break;default:v=function(e){return e.getAttribute(b)}}for(f=[],p=0,d=0;d<s.length;d++)v(s[d])&&(f[p++]=s[d])}else{for(i=t,s=[],a=0,d=0;d<f.length;d++)for(l=f[d].getElementsByTagName(i),u=0;u<l.length;u++)s[a++]=l[u];f=s}}return f}return function(e){return wr.isElement(e)?[e]:wr.isObject(e)&&!wr.isUndefined(e.length)?e:getElementsBySelector.call(this,e)}}();var Or=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],Tr=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];wr.info={campaignParams:function(e){var t="",n={};return wr.each(Or,(function(i){(t=wr.getQueryParam(hr.URL,i)).length?n[i]=t:void 0!==e&&(n[i]=e)})),n},clickParams:function(){var e="",t={};return wr.each(Tr,(function(n){(e=wr.getQueryParam(hr.URL,n)).length&&(t[n]=e)})),t},marketingParams:function(){return wr.extend(wr.info.campaignParams(),wr.info.clickParams())},searchEngine:function(e){return 0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(e){var t=wr.info.searchEngine(e),n="yahoo"!=t?"q":"p",i={};if(null!==t){i.$search_engine=t;var s=wr.getQueryParam(e,n);s.length&&(i.mp_keyword=s)}return i},browser:function(e,t,n){return t=t||"",n||wr.includes(e," OPR/")?wr.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":wr.includes(e,"IEMobile")||wr.includes(e,"WPDesktop")?"Internet Explorer Mobile":wr.includes(e,"SamsungBrowser/")?"Samsung Internet":wr.includes(e,"Edge")||wr.includes(e,"Edg/")?"Microsoft Edge":wr.includes(e,"FBIOS")?"Facebook Mobile":wr.includes(e,"Chrome")?"Chrome":wr.includes(e,"CriOS")?"Chrome iOS":wr.includes(e,"UCWEB")||wr.includes(e,"UCBrowser")?"UC Browser":wr.includes(e,"FxiOS")?"Firefox iOS":wr.includes(t,"Apple")?wr.includes(e,"Mobile")?"Mobile Safari":"Safari":wr.includes(e,"Android")?"Android Mobile":wr.includes(e,"Konqueror")?"Konqueror":wr.includes(e,"Firefox")?"Firefox":wr.includes(e,"MSIE")||wr.includes(e,"Trident/")?"Internet Explorer":wr.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var i={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[wr.info.browser(e,t,n)];if(void 0===i)return null;var s=e.match(i);return s?parseFloat(s[s.length-2]):null},os:function(){var e=_r;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},currentUrl:function(){return $t.location.href},properties:function(e){return"object"!=typeof e&&(e={}),wr.extend(wr.strip_empty_properties({$os:wr.info.os(),$browser:wr.info.browser(_r,pr.vendor,fr),$referrer:hr.referrer,$referring_domain:wr.info.referringDomain(hr.referrer),$device:wr.info.device(_r)}),{$current_url:wr.info.currentUrl(),$browser_version:wr.info.browserVersion(_r,pr.vendor,fr),$screen_height:mr.height,$screen_width:mr.width,mp_lib:"web",$lib_version:Wt.LIB_VERSION,$insert_id:cheap_guid(),time:wr.timestamp()/1e3},wr.strip_empty_properties(e))},people_properties:function(){return wr.extend(wr.strip_empty_properties({$os:wr.info.os(),$browser:wr.info.browser(_r,pr.vendor,fr)}),{$browser_version:wr.info.browserVersion(_r,pr.vendor,fr)})},mpPageViewProperties:function(){return wr.strip_empty_properties({current_page_title:hr.title,current_domain:$t.location.hostname,current_url_path:$t.location.pathname,current_url_protocol:$t.location.protocol,current_url_search:$t.location.search})}};var cheap_guid=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},Rr=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,Mr=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,extract_domain=function(e){var t=Mr,n=e.split("."),i=n[n.length-1];(i.length>4||"com"===i||"org"===i)&&(t=Rr);var s=e.match(t);return s?s[0]:""},Nr=null,Zr=null;"undefined"!=typeof JSON&&(Nr=JSON.stringify,Zr=JSON.parse),Nr=Nr||wr.JSONEncode,Zr=Zr||wr.JSONDecode,wr.toArray=wr.toArray,wr.isObject=wr.isObject,wr.JSONEncode=wr.JSONEncode,wr.JSONDecode=wr.JSONDecode,wr.isBlockedUA=wr.isBlockedUA,wr.isEmptyObject=wr.isEmptyObject,wr.info=wr.info,wr.info.device=wr.info.device,wr.info.browser=wr.info.browser,wr.info.browserVersion=wr.info.browserVersion,wr.info.properties=wr.info.properties;var Pr="__mp_opt_in_out_";function optIn(e,t){_optInOut(!0,e,t)}function optOut(e,t){_optInOut(!1,e,t)}function hasOptedIn(e,t){return"1"===_getStorageValue(e,t)}function hasOptedOut(e,t){if(function _hasDoNotTrackFlagOn(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||$t,n=t.navigator||{},i=!1;return wr.each([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){wr.includes([!0,1,"1","yes"],e)&&(i=!0)})),i}(t))return Ir.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 n="0"===_getStorageValue(e,t);return n&&Ir.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),n}function addOptOutCheckMixpanelLib(e){return _addOptOutCheck(e,(function(e){return this.get_config(e)}))}function addOptOutCheckMixpanelPeople(e){return _addOptOutCheck(e,(function(e){return this._get_config(e)}))}function addOptOutCheckMixpanelGroup(e){return _addOptOutCheck(e,(function(e){return this._get_config(e)}))}function clearOptInOut(e,t){_getStorage(t=t||{}).remove(_getStorageKey(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function _getStorage(e){return"localStorage"===(e=e||{}).persistenceType?wr.localStorage:wr.cookie}function _getStorageKey(e,t){return((t=t||{}).persistencePrefix||Pr)+e}function _getStorageValue(e,t){return _getStorage(t).get(_getStorageKey(e,t))}function _optInOut(e,t,n){wr.isString(t)&&t.length?(_getStorage(n=n||{}).set(_getStorageKey(t,n),e?1:0,wr.isNumber(n.cookieExpiration)?n.cookieExpiration:null,!!n.crossSubdomainCookie,!!n.secureCookie,!!n.crossSiteCookie,n.cookieDomain),n.track&&e&&n.track(n.trackEventName||"$opt_in",n.trackProperties,{send_immediately:!0})):Ir.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function _addOptOutCheck(e,t){return function(){var n=!1;try{var i=t.call(this,"token"),s=t.call(this,"ignore_dnt"),a=t.call(this,"opt_out_tracking_persistence_type"),c=t.call(this,"opt_out_tracking_cookie_prefix"),d=t.call(this,"window");i&&(n=hasOptedOut(i,{ignoreDnt:s,persistenceType:a,persistencePrefix:c,window:d}))}catch(l){Ir.error("Unexpected error when checking tracking opt-out status: "+l)}if(!n)return e.apply(this,arguments);var u=arguments[arguments.length-1];"function"==typeof u&&u(0)}}var Dr=console_with_prefix("lock"),SharedLock=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3};SharedLock.prototype.withLock=function(e,t,n){n||"function"==typeof t||(n=t,t=null);var i=n||(new Date).getTime()+"|"+Math.random(),s=(new Date).getTime(),a=this.storageKey,c=this.pollIntervalMS,d=this.timeoutMS,u=this.storage,l=a+":X",p=a+":Y",h=a+":Z",reportError=function(e){t&&t(e)},delay=function(e){if((new Date).getTime()-s>d)return Dr.error("Timeout waiting for mutex on "+a+"; clearing lock. ["+i+"]"),u.removeItem(h),u.removeItem(p),void loop();setTimeout((function(){try{e()}catch(t){reportError(t)}}),c*(Math.random()+.1))},waitFor=function(e,t){e()?t():delay((function(){waitFor(e,t)}))},getSetY=function(){var e=u.getItem(p);if(e&&e!==i)return!1;if(u.setItem(p,i),u.getItem(p)===i)return!0;if(!localStorageSupported(u,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},loop=function(){u.setItem(l,i),waitFor(getSetY,(function(){u.getItem(l)!==i?delay((function(){u.getItem(p)===i?waitFor((function(){return!u.getItem(h)}),criticalSection):loop()})):criticalSection()}))},criticalSection=function(){u.setItem(h,"1");try{e()}finally{u.removeItem(h),u.getItem(p)===i&&u.removeItem(p),u.getItem(l)===i&&u.removeItem(l)}};try{if(!localStorageSupported(u,!0))throw new Error("localStorage support check failed");loop()}catch(f){reportError(f)}};var Ar=console_with_prefix("batch"),RequestQueue=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.reportError=t.errorReporter||wr.bind(Ar.error,Ar),this.lock=new SharedLock(e,{storage:this.storage}),this.usePersistence=t.usePersistence,this.pid=t.pid||null,this.memQueue=[]};RequestQueue.prototype.enqueue=function(e,t,n){var i={id:cheap_guid(),flushAfter:(new Date).getTime()+2*t,payload:e};this.usePersistence?this.lock.withLock(wr.bind((function lockAcquired(){var t;try{var s=this.readFromStorage();s.push(i),(t=this.saveToStorage(s))&&this.memQueue.push(i)}catch(a){this.reportError("Error enqueueing item",e),t=!1}n&&n(t)}),this),wr.bind((function lockFailure(e){this.reportError("Error acquiring storage lock",e),n&&n(!1)}),this),this.pid):(this.memQueue.push(i),n&&n(!0))},RequestQueue.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);if(this.usePersistence&&t.length<e){var n=this.readFromStorage();if(n.length){var i={};wr.each(t,(function(e){i[e.id]=!0}));for(var s=0;s<n.length;s++){var a=n[s];if((new Date).getTime()>a.flushAfter&&!i[a.id]&&(a.orphaned=!0,t.push(a),t.length>=e))break}}}return t};var filterOutIDsAndInvalid=function(e,t){var n=[];return wr.each(e,(function(e){e.id&&!t[e.id]&&n.push(e)})),n};RequestQueue.prototype.removeItemsByID=function(e,t){var n={};if(wr.each(e,(function(e){n[e]=!0})),this.memQueue=filterOutIDsAndInvalid(this.memQueue,n),this.usePersistence){var i=wr.bind((function(){var t;try{var i=this.readFromStorage();if(i=filterOutIDsAndInvalid(i,n),t=this.saveToStorage(i)){i=this.readFromStorage();for(var s=0;s<i.length;s++){var a=i[s];if(a.id&&n[a.id])return this.reportError("Item not removed from storage"),!1}}}catch(c){this.reportError("Error removing items",e),t=!1}return t}),this);this.lock.withLock((function lockAcquired(){var e=i();t&&t(e)}),wr.bind((function lockFailure(e){var n=!1;if(this.reportError("Error acquiring storage lock",e),!localStorageSupported(this.storage,!0)&&!(n=i()))try{this.storage.removeItem(this.storageKey)}catch(s){this.reportError("Error clearing queue",s)}t&&t(n)}),this),this.pid)}else t&&t(!0)};var updatePayloads=function(e,t){var n=[];return wr.each(e,(function(e){var i=e.id;if(i in t){var s=t[i];null!==s&&(e.payload=s,n.push(e))}else n.push(e)})),n};RequestQueue.prototype.updatePayloads=function(e,t){this.memQueue=updatePayloads(this.memQueue,e),this.usePersistence?this.lock.withLock(wr.bind((function lockAcquired(){var n;try{var i=this.readFromStorage();i=updatePayloads(i,e),n=this.saveToStorage(i)}catch(s){this.reportError("Error updating items",e),n=!1}t&&t(n)}),this),wr.bind((function lockFailure(e){this.reportError("Error acquiring storage lock",e),t&&t(!1)}),this),this.pid):t&&t(!0)},RequestQueue.prototype.readFromStorage=function(){var e;try{(e=this.storage.getItem(this.storageKey))&&(e=Zr(e),wr.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null))}catch(t){this.reportError("Error retrieving queue",t),e=null}return e||[]},RequestQueue.prototype.saveToStorage=function(e){try{return this.storage.setItem(this.storageKey,Nr(e)),!0}catch(t){return this.reportError("Error saving queue",t),!1}},RequestQueue.prototype.clear=function(){this.memQueue=[],this.usePersistence&&this.storage.removeItem(this.storageKey)};var Lr=console_with_prefix("batch"),RequestBatcher=function(e,t){this.errorReporter=t.errorReporter,this.queue=new RequestQueue(e,{errorReporter:wr.bind(this.reportError,this),storage:t.storage,usePersistence:t.usePersistence}),this.libConfig=t.libConfig,this.sendRequest=t.sendRequestFunc,this.beforeSendHook=t.beforeSendHook,this.stopAllBatching=t.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=t.flushOnlyOnInterval||!1};RequestBatcher.prototype.enqueue=function(e,t){this.queue.enqueue(e,this.flushInterval,t)},RequestBatcher.prototype.start=function(){this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},RequestBatcher.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},RequestBatcher.prototype.clear=function(){this.queue.clear()},RequestBatcher.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},RequestBatcher.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},RequestBatcher.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(wr.bind((function(){this.stopped||this.flush()}),this),this.flushInterval))},RequestBatcher.prototype.flush=function(e){try{if(this.requestInProgress)return void Lr.log("Flush: Request already in progress");e=e||{};var t=this.libConfig.batch_request_timeout_ms,n=(new Date).getTime(),i=this.batchSize,s=this.queue.fillBatch(i),a=s.length===i,c=[],d={};if(wr.each(s,(function(e){var t=e.payload;if(this.beforeSendHook&&!e.orphaned&&(t=this.beforeSendHook(t)),t){t.event&&t.properties&&(t.properties=wr.extend({},t.properties,{mp_sent_by_lib_version:Wt.LIB_VERSION}));var n=!0,i=e.id;i?(this.itemIdsSentSuccessfully[i]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:e,batchSize:s.length,timesSent:this.itemIdsSentSuccessfully[i]}),n=!1):this.reportError("[dupe] found item with no ID",{item:e}),n&&c.push(t)}d[e.id]=t}),this),c.length<1)return void this.resetFlush();this.requestInProgress=!0;var u=wr.bind((function(c){this.requestInProgress=!1;try{var u=!1;if(e.unloading)this.queue.updatePayloads(d);else if(wr.isObject(c)&&"timeout"===c.error&&(new Date).getTime()-n>=t)this.reportError("Network timeout; retrying"),this.flush();else if(wr.isObject(c)&&(c.httpStatusCode>=500||429===c.httpStatusCode||c.httpStatusCode<=0&&(h=$t.navigator.onLine,!wr.isUndefined(h)&&!h)||"timeout"===c.error)){var l=2*this.flushInterval;c.retryAfter&&(l=1e3*parseInt(c.retryAfter,10)||l),l=Math.min(6e5,l),this.reportError("Error; retry in "+l+" ms"),this.scheduleFlush(l)}else if(wr.isObject(c)&&413===c.httpStatusCode)if(s.length>1){var p=Math.max(1,Math.floor(i/2));this.batchSize=Math.min(this.batchSize,p,s.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",s),this.resetBatchSize(),u=!0;else u=!0;u&&(this.queue.removeItemsByID(wr.map(s,(function(e){return e.id})),wr.bind((function(e){e?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!a?this.resetFlush():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)),wr.each(s,wr.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:s.length,timesSent:this.itemIdsSentSuccessfully[t]})):this.reportError("[dupe] found item with no ID while removing",{item:e})}),this)))}catch(f){this.reportError("Error handling API response",f),this.resetFlush()}var h}),this),l={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};e.unloading&&(l.transport="sendBeacon"),Lr.log("MIXPANEL REQUEST:",c),this.sendRequest(c,l,u)}catch(p){this.reportError("Error flushing request queue",p),this.resetFlush()}},RequestBatcher.prototype.reportError=function(e,t){if(Lr.error.apply(Lr.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(n){Lr.error(n)}};var jr=console_with_prefix("recorder"),Fr=$t.CompressionStream,Ur={batch_size:1e3,batch_flush_interval_ms:1e4,batch_request_timeout_ms:9e4,batch_autostart:!0},qr=new Set([zt.MouseMove,zt.MouseInteraction,zt.Scroll,zt.ViewportResize,zt.Input,zt.TouchMove,zt.MediaInteraction,zt.Drag,zt.Selection]);var MixpanelRecorder=function(e){this._mixpanel=e,this._stopRecording=null,this.recEvents=[],this.seqNo=0,this.replayId=null,this.replayStartTime=null,this.sendBatchId=null,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=nr,this.recordMinMs=0,this._initBatcher()};MixpanelRecorder.prototype._initBatcher=function(){this.batcher=new RequestBatcher("__mprec",{libConfig:Ur,sendRequestFunc:wr.bind(this.flushEventsWithOptOut,this),errorReporter:wr.bind(this.reportError,this),flushOnlyOnInterval:!0,usePersistence:!1})},MixpanelRecorder.prototype.get_config=function(e){return this._mixpanel.get_config(e)},MixpanelRecorder.prototype.startRecording=function(e){if(null===this._stopRecording){this.recordMaxMs=this.get_config("record_max_ms"),this.recordMaxMs>nr&&(this.recordMaxMs=nr,jr.critical("record_max_ms cannot be greater than "+nr+"ms. Capping value.")),this.recordMinMs=this.get_config("record_min_ms"),this.recordMinMs>ir&&(this.recordMinMs=ir,jr.critical("record_min_ms cannot be greater than 8000ms. Capping value.")),this.recEvents=[],this.seqNo=0,this.replayStartTime=(new Date).getTime(),this.replayId=wr.UUID(),e||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var t=wr.bind((function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(wr.bind((function(){jr.log("Idle timeout reached, restarting recording."),this.resetRecording()}),this),this.get_config("record_idle_timeout_ms"))}),this),n=this.get_config("record_block_selector");""!==n&&null!==n||(n=void 0),this._stopRecording=record({emit:wr.bind((function(e){this.batcher.enqueue(e),function isUserEvent(e){return e.type===Bt.IncrementalSnapshot&&qr.has(e.data.source)}(e)&&(this.batcher.stopped&&(new Date).getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),t())}),this),blockClass:this.get_config("record_block_class"),blockSelector:n,collectFonts:this.get_config("record_collect_fonts"),inlineImages:this.get_config("record_inline_images"),maskAllInputs:!0,maskTextClass:this.get_config("record_mask_text_class"),maskTextSelector:this.get_config("record_mask_text_selector")}),t(),this.maxTimeoutId=setTimeout(wr.bind(this.resetRecording,this),this.recordMaxMs)}else jr.log("Recording already in progress, skipping startRecording.")},MixpanelRecorder.prototype.resetRecording=function(){this.stopRecording(),this.startRecording(!0)},MixpanelRecorder.prototype.stopRecording=function(){null!==this._stopRecording&&(this._stopRecording(),this._stopRecording=null),this.batcher.stopped?this.batcher.clear():(this.batcher.flush(),this.batcher.stop()),this.replayId=null,clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId)},MixpanelRecorder.prototype.flushEventsWithOptOut=function(e,t,n){this._flushEvents(e,t,n,wr.bind(this._onOptOut,this))},MixpanelRecorder.prototype._onOptOut=function(e){0===e&&(this.recEvents=[],this.stopRecording())},MixpanelRecorder.prototype._sendRequest=function(e,t,n,i){var s=wr.bind((function(t,n){200===t.status&&this.replayId===e&&this.seqNo++,i({status:0,httpStatusCode:t.status,responseBody:n,retryAfter:t.headers.get("Retry-After")})}),this);$t.fetch(this.get_config("api_host")+"/"+this.get_config("api_routes").record+"?"+new URLSearchParams(t),{method:"POST",headers:{Authorization:"Basic "+btoa(this.get_config("token")+":"),"Content-Type":"application/octet-stream"},body:n}).then((function(e){e.json().then((function(t){s(e,t)})).catch((function(e){i({error:e})}))})).catch((function(e){i({error:e,httpStatusCode:0})}))},MixpanelRecorder.prototype._flushEvents=addOptOutCheckMixpanelLib((function(e,t,n){const i=e.length;if(i>0){var s=this.replayId,a=e[0].timestamp;0!==this.seqNo&&this.replayStartTime||(0!==this.seqNo&&this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=a);var c=e[i-1].timestamp-this.replayStartTime,d={distinct_id:String(this._mixpanel.get_distinct_id()),seq:this.seqNo,batch_start_time:a/1e3,replay_id:s,replay_length_ms:c,replay_start_time:this.replayStartTime/1e3},u=wr.JSONEncode(e),l=this._mixpanel.get_property("$device_id");l&&(d.$device_id=l);var p=this._mixpanel.get_property("$user_id");if(p&&(d.$user_id=p),Fr){var h=new Blob([u],{type:"application/json"}).stream().pipeThrough(new Fr("gzip"));new Response(h).blob().then(wr.bind((function(e){d.format="gzip",this._sendRequest(s,d,e,n)}),this))}else d.format="body",this._sendRequest(s,d,u,n)}})),MixpanelRecorder.prototype.reportError=function(e,t){jr.error.apply(jr.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(n){jr.error(n)}},$t.__mp_recorder=MixpanelRecorder;var DomTracker=function(){};DomTracker.prototype.create_properties=function(){},DomTracker.prototype.event_handler=function(){},DomTracker.prototype.after_track_handler=function(){},DomTracker.prototype.init=function(e){return this.mp=e,this},DomTracker.prototype.track=function(e,t,n,i){var s=this,a=wr.dom_query(e);if(0!==a.length)return wr.each(a,(function(e){wr.register_event(e,this.override_event,(function(e){var a={},c=s.create_properties(n,this),d=s.mp.get_config("track_links_timeout");s.event_handler(e,this,a),window.setTimeout(s.track_callback(i,c,a,!0),d),s.mp.track(t,c,s.track_callback(i,c,a))}))}),this),!0;Ir.error("The DOM query ("+e+") returned 0 elements")},DomTracker.prototype.track_callback=function(e,t,n,i){i=i||!1;var s=this;return function(){n.callback_fired||(n.callback_fired=!0,e&&!1===e(i,t)||s.after_track_handler(t,n,i))}},DomTracker.prototype.create_properties=function(e,t){return"function"==typeof e?e(t):wr.extend({},e)};var LinkTracker=function(){this.override_event="click"};wr.inherit(LinkTracker,DomTracker),LinkTracker.prototype.create_properties=function(e,t){var n=LinkTracker.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n},LinkTracker.prototype.event_handler=function(e,t,n){n.new_tab=2===e.which||e.metaKey||e.ctrlKey||"_blank"===t.target,n.href=t.href,n.new_tab||e.preventDefault()},LinkTracker.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout((function(){window.location=t.href}),0)};var FormTracker=function(){this.override_event="submit"};wr.inherit(FormTracker,DomTracker),FormTracker.prototype.event_handler=function(e,t,n){n.element=t,e.preventDefault()},FormTracker.prototype.after_track_handler=function(e,t){setTimeout((function(){t.element.submit()}),0)};var $r="$set",Br="$set_once",zr="$unset",Wr="$add",Vr="$append",Kr="$union",Hr="$remove",Gr={set_action:function(e,t){var n={},i={};return wr.isObject(e)?wr.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,n[$r]=i,n},unset_action:function(e){var t={},n=[];return wr.isArray(e)||(e=[e]),wr.each(e,(function(e){this._is_reserved_property(e)||n.push(e)}),this),t[zr]=n,t},set_once_action:function(e,t){var n={},i={};return wr.isObject(e)?wr.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,n[Br]=i,n},union_action:function(e,t){var n={},i={};return wr.isObject(e)?wr.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=wr.isArray(e)?e:[e])}),this):i[e]=wr.isArray(t)?t:[t],n[Kr]=i,n},append_action:function(e,t){var n={},i={};return wr.isObject(e)?wr.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,n[Vr]=i,n},remove_action:function(e,t){var n={},i={};return wr.isObject(e)?wr.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,n[Hr]=i,n},delete_action:function(){var e={$delete:""};return e}},MixpanelGroup=function(){};wr.extend(MixpanelGroup.prototype,Gr),MixpanelGroup.prototype._init=function(e,t,n){this._mixpanel=e,this._group_key=t,this._group_id=n},MixpanelGroup.prototype.set=addOptOutCheckMixpanelGroup((function(e,t,n){var i=this.set_action(e,t);return wr.isObject(e)&&(n=t),this._send_request(i,n)})),MixpanelGroup.prototype.set_once=addOptOutCheckMixpanelGroup((function(e,t,n){var i=this.set_once_action(e,t);return wr.isObject(e)&&(n=t),this._send_request(i,n)})),MixpanelGroup.prototype.unset=addOptOutCheckMixpanelGroup((function(e,t){var n=this.unset_action(e);return this._send_request(n,t)})),MixpanelGroup.prototype.union=addOptOutCheckMixpanelGroup((function(e,t,n){wr.isObject(e)&&(n=t);var i=this.union_action(e,t);return this._send_request(i,n)})),MixpanelGroup.prototype.delete=addOptOutCheckMixpanelGroup((function(e){var t=this.delete_action();return this._send_request(t,e)})),MixpanelGroup.prototype.remove=addOptOutCheckMixpanelGroup((function(e,t,n){var i=this.remove_action(e,t);return this._send_request(i,n)})),MixpanelGroup.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 n=wr.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:n,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},t)},MixpanelGroup.prototype._is_reserved_property=function(e){return"$group_key"===e||"$group_id"===e},MixpanelGroup.prototype._get_config=function(e){return this._mixpanel.get_config(e)},MixpanelGroup.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},MixpanelGroup.prototype.remove=MixpanelGroup.prototype.remove,MixpanelGroup.prototype.set=MixpanelGroup.prototype.set,MixpanelGroup.prototype.set_once=MixpanelGroup.prototype.set_once,MixpanelGroup.prototype.union=MixpanelGroup.prototype.union,MixpanelGroup.prototype.unset=MixpanelGroup.prototype.unset,MixpanelGroup.prototype.toString=MixpanelGroup.prototype.toString;var MixpanelPeople=function(){};wr.extend(MixpanelPeople.prototype,Gr),MixpanelPeople.prototype._init=function(e){this._mixpanel=e},MixpanelPeople.prototype.set=addOptOutCheckMixpanelPeople((function(e,t,n){var i=this.set_action(e,t);return wr.isObject(e)&&(n=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),i[$r]=wr.extend({},wr.info.people_properties(),i[$r]),this._send_request(i,n)})),MixpanelPeople.prototype.set_once=addOptOutCheckMixpanelPeople((function(e,t,n){var i=this.set_once_action(e,t);return wr.isObject(e)&&(n=t),this._send_request(i,n)})),MixpanelPeople.prototype.unset=addOptOutCheckMixpanelPeople((function(e,t){var n=this.unset_action(e);return this._send_request(n,t)})),MixpanelPeople.prototype.increment=addOptOutCheckMixpanelPeople((function(e,t,n){var i={},s={};return wr.isObject(e)?(wr.each(e,(function(e,t){if(!this._is_reserved_property(t)){if(isNaN(parseFloat(e)))return void Ir.error("Invalid increment value passed to mixpanel.people.increment - must be a number");s[t]=e}}),this),n=t):(wr.isUndefined(t)&&(t=1),s[e]=t),i[Wr]=s,this._send_request(i,n)})),MixpanelPeople.prototype.append=addOptOutCheckMixpanelPeople((function(e,t,n){wr.isObject(e)&&(n=t);var i=this.append_action(e,t);return this._send_request(i,n)})),MixpanelPeople.prototype.remove=addOptOutCheckMixpanelPeople((function(e,t,n){wr.isObject(e)&&(n=t);var i=this.remove_action(e,t);return this._send_request(i,n)})),MixpanelPeople.prototype.union=addOptOutCheckMixpanelPeople((function(e,t,n){wr.isObject(e)&&(n=t);var i=this.union_action(e,t);return this._send_request(i,n)})),MixpanelPeople.prototype.track_charge=addOptOutCheckMixpanelPeople((function(e,t,n){if(wr.isNumber(e)||(e=parseFloat(e),!isNaN(e)))return this.append("$transactions",wr.extend({$amount:e},t),n);Ir.error("Invalid value passed to mixpanel.people.track_charge - must be a number")})),MixpanelPeople.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},MixpanelPeople.prototype.delete_user=function(){if(this._identify_called()){var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)}Ir.error("mixpanel.people.delete_user() requires you to call identify() first")},MixpanelPeople.prototype.toString=function(){return this._mixpanel.toString()+".people"},MixpanelPeople.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var n=this._mixpanel.get_property("$device_id"),i=this._mixpanel.get_property("$user_id"),s=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),i&&(e.$user_id=i),s&&(e.$had_persisted_distinct_id=s);var a=wr.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:a,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),wr.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),wr.truncate(a,255))},MixpanelPeople.prototype._get_config=function(e){return this._mixpanel.get_config(e)},MixpanelPeople.prototype._identify_called=function(){return!0===this._mixpanel._flags.identify_called},MixpanelPeople.prototype._enqueue=function(e){$r in e?this._mixpanel.persistence._add_to_people_queue($r,e):Br in e?this._mixpanel.persistence._add_to_people_queue(Br,e):zr in e?this._mixpanel.persistence._add_to_people_queue(zr,e):Wr in e?this._mixpanel.persistence._add_to_people_queue(Wr,e):Vr in e?this._mixpanel.persistence._add_to_people_queue(Vr,e):Hr in e?this._mixpanel.persistence._add_to_people_queue(Hr,e):Kr in e?this._mixpanel.persistence._add_to_people_queue(Kr,e):Ir.error("Invalid call to _enqueue():",e)},MixpanelPeople.prototype._flush_one_queue=function(e,t,n,i){var s=this,a=wr.extend({},this._mixpanel.persistence.load_queue(e)),c=a;wr.isUndefined(a)||!wr.isObject(a)||wr.isEmptyObject(a)||(s._mixpanel.persistence._pop_from_people_queue(e,a),s._mixpanel.persistence.save(),i&&(c=i(a)),t.call(s,c,(function(t,i){0===t&&s._mixpanel.persistence._add_to_people_queue(e,a),wr.isUndefined(n)||n(t,i)})))},MixpanelPeople.prototype._flush=function(e,t,n,i,s,a,c){var d=this;this._flush_one_queue($r,this.set,e),this._flush_one_queue(Br,this.set_once,i),this._flush_one_queue(zr,this.unset,a,(function(e){return wr.keys(e)})),this._flush_one_queue(Wr,this.increment,t),this._flush_one_queue(Kr,this.union,s);var u=this._mixpanel.persistence.load_queue(Vr);if(!wr.isUndefined(u)&&wr.isArray(u)&&u.length)for(var l,append_callback=function(e,t){0===e&&d._mixpanel.persistence._add_to_people_queue(Vr,l),wr.isUndefined(n)||n(e,t)},p=u.length-1;p>=0;p--)u=this._mixpanel.persistence.load_queue(Vr),l=u.pop(),d._mixpanel.persistence.save(),wr.isEmptyObject(l)||d.append(l,append_callback);var h=this._mixpanel.persistence.load_queue(Hr);if(!wr.isUndefined(h)&&wr.isArray(h)&&h.length)for(var f,remove_callback=function(e,t){0===e&&d._mixpanel.persistence._add_to_people_queue(Hr,f),wr.isUndefined(c)||c(e,t)},m=h.length-1;m>=0;m--)h=this._mixpanel.persistence.load_queue(Hr),f=h.pop(),d._mixpanel.persistence.save(),wr.isEmptyObject(f)||d.remove(f,remove_callback)},MixpanelPeople.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e},MixpanelPeople.prototype.set=MixpanelPeople.prototype.set,MixpanelPeople.prototype.set_once=MixpanelPeople.prototype.set_once,MixpanelPeople.prototype.unset=MixpanelPeople.prototype.unset,MixpanelPeople.prototype.increment=MixpanelPeople.prototype.increment,MixpanelPeople.prototype.append=MixpanelPeople.prototype.append,MixpanelPeople.prototype.remove=MixpanelPeople.prototype.remove,MixpanelPeople.prototype.union=MixpanelPeople.prototype.union,MixpanelPeople.prototype.track_charge=MixpanelPeople.prototype.track_charge,MixpanelPeople.prototype.clear_charges=MixpanelPeople.prototype.clear_charges,MixpanelPeople.prototype.delete_user=MixpanelPeople.prototype.delete_user,MixpanelPeople.prototype.toString=MixpanelPeople.prototype.toString;var Yr,Jr="__mps",Xr="__mpso",Qr="__mpus",en="__mpa",tn="__mpap",rn="__mpr",nn="__mpu",sn="$people_distinct_id",an="__alias",cn="__timers",dn=[Jr,Xr,Qr,en,tn,rn,nn,sn,an,cn],MixpanelPersistence=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&&(Ir.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),"localStorage"===t&&wr.localStorage.is_supported()?this.storage=wr.localStorage:this.storage=wr.cookie,this.load(),this.update_config(e),this.upgrade(),this.save()};MixpanelPersistence.prototype.properties=function(){var e={};return this.load(),wr.each(this.props,(function(t,n){wr.include(dn,n)||(e[n]=t)})),e},MixpanelPersistence.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=wr.extend({},e))}},MixpanelPersistence.prototype.upgrade=function(){var e,t;this.storage===wr.localStorage?(e=wr.cookie.parse(this.name),wr.cookie.remove(this.name),wr.cookie.remove(this.name,!0),e&&this.register_once(e)):this.storage===wr.cookie&&(t=wr.localStorage.parse(this.name),wr.localStorage.remove(this.name),t&&this.register_once(t))},MixpanelPersistence.prototype.save=function(){this.disabled||this.storage.set(this.name,wr.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},MixpanelPersistence.prototype.load_prop=function(e){return this.load(),this.props[e]},MixpanelPersistence.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},MixpanelPersistence.prototype.clear=function(){this.remove(),this.props={}},MixpanelPersistence.prototype.register_once=function(e,t,n){return!!wr.isObject(e)&&(void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n,this.load(),wr.each(e,(function(e,n){this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e)}),this),this.save(),!0)},MixpanelPersistence.prototype.register=function(e,t){return!!wr.isObject(e)&&(this.expire_days=void 0===t?this.default_expiry:t,this.load(),wr.extend(this.props,e),this.save(),!0)},MixpanelPersistence.prototype.unregister=function(e){this.load(),e in this.props&&(delete this.props[e],this.save())},MixpanelPersistence.prototype.update_search_keyword=function(e){this.register(wr.info.searchInfo(e))},MixpanelPersistence.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:wr.info.referringDomain(e)||"$direct"},"")},MixpanelPersistence.prototype.get_referrer_info=function(){return wr.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},MixpanelPersistence.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)},MixpanelPersistence.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},MixpanelPersistence.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())},MixpanelPersistence.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())},MixpanelPersistence.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},MixpanelPersistence.prototype.get_cross_subdomain=function(){return this.cross_subdomain},MixpanelPersistence.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},MixpanelPersistence.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),i=t[e],s=this._get_or_create_queue($r),a=this._get_or_create_queue(Br),c=this._get_or_create_queue(zr),d=this._get_or_create_queue(Wr),u=this._get_or_create_queue(Kr),l=this._get_or_create_queue(Hr,[]),p=this._get_or_create_queue(Vr,[]);n===Jr?(wr.extend(s,i),this._pop_from_people_queue(Wr,i),this._pop_from_people_queue(Kr,i),this._pop_from_people_queue(zr,i)):n===Xr?(wr.each(i,(function(e,t){t in a||(a[t]=e)})),this._pop_from_people_queue(zr,i)):n===Qr?wr.each(i,(function(e){wr.each([s,a,d,u],(function(t){e in t&&delete t[e]})),wr.each(p,(function(t){e in t&&delete t[e]})),c[e]=!0})):n===en?(wr.each(i,(function(e,t){t in s?s[t]+=e:(t in d||(d[t]=0),d[t]+=e)}),this),this._pop_from_people_queue(zr,i)):n===nn?(wr.each(i,(function(e,t){wr.isArray(e)&&(t in u||(u[t]=[]),u[t]=u[t].concat(e))})),this._pop_from_people_queue(zr,i)):n===rn?(l.push(i),this._pop_from_people_queue(Vr,i)):n===tn&&(p.push(i),this._pop_from_people_queue(zr,i)),Ir.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),Ir.log(t),this.save()},MixpanelPersistence.prototype._pop_from_people_queue=function(e,t){var n=this.props[this._get_queue_key(e)];wr.isUndefined(n)||wr.each(t,(function(t,i){e===Vr||e===Hr?wr.each(n,(function(e){e[i]===t&&delete e[i]})):delete n[i]}),this)},MixpanelPersistence.prototype.load_queue=function(e){return this.load_prop(this._get_queue_key(e))},MixpanelPersistence.prototype._get_queue_key=function(e){return e===$r?Jr:e===Br?Xr:e===zr?Qr:e===Wr?en:e===Vr?tn:e===Hr?rn:e===Kr?nn:void Ir.error("Invalid queue:",e)},MixpanelPersistence.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=wr.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)},MixpanelPersistence.prototype.set_event_timer=function(e,t){var n=this.load_prop(cn)||{};n[e]=t,this.props[cn]=n,this.save()},MixpanelPersistence.prototype.remove_event_timer=function(e){var t=(this.load_prop(cn)||{})[e];return wr.isUndefined(t)||(delete this.props[cn][e],this.save()),t};var un,load_extra_bundle=function(e,t){throw new Error(e+" not available in this build.")},IDENTITY_FUNC=function(e){return e},NOOP_FUNC=function(){},ln="mixpanel",pn="base64",hn="$device:",fn=$t.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,mn=!fn&&-1===_r.indexOf("MSIE")&&-1===_r.indexOf("Mozilla"),_n=null;pr.sendBeacon&&(_n=function(){return pr.sendBeacon.apply(pr,arguments)});var gn={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},yn={api_host:"https://api-js.mixpanel.com",api_routes:gn,api_method:"POST",api_transport:"XHR",api_payload_format:pn,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:NOOP_FUNC,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:NOOP_FUNC,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:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video",record_collect_fonts:!1,record_idle_timeout_ms:18e5,record_inline_images:!1,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:nr,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},vn=!1,MixpanelLib=function(){},create_mplib=function(e,t,n){var i,s=n===ln?un:un[n];if(s&&0===Yr)i=s;else{if(s&&!wr.isArray(s))return void Ir.error("You have already initialized "+n);i=new MixpanelLib}if(i._cached_groups={},i._init(e,t,n),i.people=new MixpanelPeople,i.people._init(i),!i.get_config("skip_first_touch_marketing")){var a=wr.info.campaignParams(null),c={},d=!1;wr.each(a,(function(e,t){c["initial_"+t]=e,e&&(d=!0)})),d&&i.people.set_once(c)}return Wt.DEBUG=Wt.DEBUG||i.get_config("debug"),!wr.isUndefined(s)&&wr.isArray(s)&&(i._execute_array.call(i.people,s.people),i._execute_array(s)),i};MixpanelLib.prototype.init=function(e,t,n){if(wr.isUndefined(n))this.report_error("You must name your new library: init(token, config, name)");else{if(n!==ln){var i=create_mplib(e,t,n);return un[n]=i,i._loaded(),i}this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet")}},MixpanelLib.prototype._init=function(e,t,n){t=t||{},this.__loaded=!0,this.config={};var i={};"api_payload_format"in t||(t.api_host||yn.api_host).match(/\.mixpanel\.com/)&&(i.api_payload_format="json");if(this.set_config(wr.extend({},yn,i,t,{name:n,token:e,callback_fn:(n===ln?n:ln+"."+n)+"._jsc"})),this._jsc=NOOP_FUNC,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(wr.localStorage.is_supported(!0)&&fn){if(this.init_batchers(),_n&&$t.addEventListener){var s=wr.bind((function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})}),this);$t.addEventListener("pagehide",(function(e){e.persisted&&s()})),$t.addEventListener("visibilitychange",(function(){"hidden"===hr.visibilityState&&s()}))}}else this._batch_requests=!1,Ir.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),wr.each(this.get_batcher_configs(),(function(e){Ir.log("Clearing batch queue "+e.queue_key),wr.localStorage.remove(e.queue_key)}));this.persistence=this.cookie=new MixpanelPersistence(this.config),this.unpersisted_superprops={},this._gdpr_init();var a=wr.UUID();this.get_distinct_id()||this.register_once({distinct_id:hn+a,$device_id:a},"");var c=this.get_config("track_pageview");c&&this._init_url_change_tracking(c),this.get_config("record_sessions_percent")>0&&100*Math.random()<=this.get_config("record_sessions_percent")&&this.start_session_recording()},MixpanelLib.prototype.start_session_recording=addOptOutCheckMixpanelLib((function(){if($t.MutationObserver){var e=wr.bind((function(){this._recorder=this._recorder||new $t.__mp_recorder(this),this._recorder.startRecording()}),this);wr.isUndefined($t.__mp_recorder)?load_extra_bundle(this.get_config("recorder_src"),e):e()}else Ir.critical("Browser does not support MutationObserver; skipping session recording")})),MixpanelLib.prototype.stop_session_recording=function(){this._recorder?this._recorder.stopRecording():Ir.critical("Session recorder module not loaded")},MixpanelLib.prototype.get_session_recording_properties=function(){var e={};if(this._recorder){var t=this._recorder.replayId;t&&(e.$mp_replay_id=t)}return e},MixpanelLib.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=wr.info.campaignParams(null);wr.each(e,function(e,t){this.unregister(t)}.bind(this))}},MixpanelLib.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(hr.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(wr.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(hr.referrer)},MixpanelLib.prototype._dom_loaded=function(){wr.each(this.__dom_loaded_queue,(function(e){this._track_dom.apply(this,e)}),this),this.has_opted_out_tracking()||wr.each(this.__request_queue,(function(e){this._send_request.apply(this,e)}),this),delete this.__dom_loaded_queue,delete this.__request_queue},MixpanelLib.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(!vn)return this.__dom_loaded_queue.push([e,t]),!1;var n=(new e).init(this);return n.track.apply(n,t)},MixpanelLib.prototype._init_url_change_tracking=function(e){var t="";if(this.track_pageview()&&(t=wr.info.currentUrl()),wr.include(["full-url","url-with-path-and-query-string","url-with-path"],e)){$t.addEventListener("popstate",(function(){$t.dispatchEvent(new Event("mp_locationchange"))})),$t.addEventListener("hashchange",(function(){$t.dispatchEvent(new Event("mp_locationchange"))}));var n=$t.history.pushState;"function"==typeof n&&($t.history.pushState=function(e,t,i){n.call($t.history,e,t,i),$t.dispatchEvent(new Event("mp_locationchange"))});var i=$t.history.replaceState;"function"==typeof i&&($t.history.replaceState=function(e,t,n){i.call($t.history,e,t,n),$t.dispatchEvent(new Event("mp_locationchange"))}),$t.addEventListener("mp_locationchange",function(){var n=wr.info.currentUrl(),i=!1;("full-url"===e?i=n!==t:"url-with-path-and-query-string"===e?i=n.split("#")[0]!==t.split("#")[0]:"url-with-path"===e&&(i=n.split("#")[0].split("?")[0]!==t.split("#")[0].split("?")[0]),i)&&(this.track_pageview()&&(t=n))}.bind(this))}},MixpanelLib.prototype._prepare_callback=function(e,t){if(wr.isUndefined(e))return null;if(fn){return function(n){e(n,t)}}var n=this._jsc,i=""+Math.floor(1e8*Math.random()),s=this.get_config("callback_fn")+"["+i+"]";return n[i]=function(s){delete n[i],e(s,t)},s},MixpanelLib.prototype._send_request=function(e,t,n,i){var s=!0;if(mn)return this.__request_queue.push(arguments),s;var a={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},c=null;i||!wr.isFunction(n)&&"string"!=typeof n||(i=n,n=null),n=wr.extend(a,n||{}),fn||(n.method="GET");var d="POST"===n.method,u=_n&&d&&"sendbeacon"===n.transport.toLowerCase(),l=n.verbose;t.verbose&&(l=!0),this.get_config("test")&&(t.test=1),l&&(t.verbose=1),this.get_config("img")&&(t.img=1),fn||(i?t.callback=i:(l||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=(new Date).getTime().toString(),d&&(c="data="+encodeURIComponent(t.data),delete t.data),e+="?"+wr.HTTPBuildQuery(t);var p=this;if("img"in t){var h=hr.createElement("img");h.src=e,hr.body.appendChild(h)}else if(u){try{s=_n(e,c)}catch(v){p.report_error(v),s=!1}try{i&&i(s?1:0)}catch(v){p.report_error(v)}}else if(fn)try{var f=new XMLHttpRequest;f.open(n.method,e,!0);var m=this.get_config("xhr_headers");if(d&&(m["Content-Type"]="application/x-www-form-urlencoded"),wr.each(m,(function(e,t){f.setRequestHeader(t,e)})),n.timeout_ms&&void 0!==f.timeout){f.timeout=n.timeout_ms;var _=(new Date).getTime()}f.withCredentials=!0,f.onreadystatechange=function(){var e;if(4===f.readyState)if(200===f.status){if(i)if(l){var t;try{t=wr.JSONDecode(f.responseText)}catch(v){if(p.report_error(v),!n.ignore_json_errors)return;t=f.responseText}i(t)}else i(Number(f.responseText))}else if(e=f.timeout&&!f.status&&(new Date).getTime()-_>=f.timeout?"timeout":"Bad HTTP status: "+f.status+" "+f.statusText,p.report_error(e),i)if(l){var s=f.responseHeaders||{};i({status:0,httpStatusCode:f.status,error:e,retryAfter:s["Retry-After"]})}else i(0)},f.send(c)}catch(v){p.report_error(v),s=!1}else{var g=hr.createElement("script");g.type="text/javascript",g.async=!0,g.defer=!0,g.src=e;var y=hr.getElementsByTagName("script")[0];y.parentNode.insertBefore(g,y)}return s},MixpanelLib.prototype._execute_array=function(e){var t,n=[],i=[],s=[];wr.each(e,(function(e){e&&(t=e[0],wr.isArray(t)?s.push(e):"function"==typeof e?e.call(this):wr.isArray(e)&&"alias"===t?n.push(e):wr.isArray(e)&&-1!==t.indexOf("track")&&"function"==typeof this[t]?s.push(e):i.push(e))}),this);var execute=function(e,t){wr.each(e,(function(e){if(wr.isArray(e[0])){var n=t;wr.each(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};execute(n,this),execute(i,this),execute(s,this)},MixpanelLib.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},MixpanelLib.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},MixpanelLib.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var e=wr.bind((function(e){return new RequestBatcher(e.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:wr.bind((function(t,n,i){this._send_request(this.get_config("api_host")+e.endpoint,this._encode_data_for_request(t),n,this._prepare_callback(i,t))}),this),beforeSendHook:wr.bind((function(t){return this._run_hook("before_send_"+e.type,t)}),this),stopAllBatchingFunc:wr.bind(this.stop_batch_senders,this),usePersistence:!0})}),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()},MixpanelLib.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,wr.each(this.request_batchers,(function(e){e.start()})))},MixpanelLib.prototype.stop_batch_senders=function(){this._batch_requests=!1,wr.each(this.request_batchers,(function(e){e.stop(),e.clear()}))},MixpanelLib.prototype.push=function(e){this._execute_array([e])},MixpanelLib.prototype.disable=function(e){void 0===e?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},MixpanelLib.prototype._encode_data_for_request=function(e){var t=wr.JSONEncode(e);return this.get_config("api_payload_format")===pn&&(t=wr.base64Encode(t)),{data:t}},MixpanelLib.prototype._track_or_batch=function(e,t){var n=wr.truncate(e.data,255),i=e.endpoint,s=e.batcher,a=e.should_send_immediately,c=e.send_request_options||{};t=t||NOOP_FUNC;var d=!0,u=wr.bind((function(){return c.skip_hooks||(n=this._run_hook("before_send_"+e.type,n)),n?(Ir.log("MIXPANEL REQUEST:"),Ir.log(n),this._send_request(i,this._encode_data_for_request(n),c,this._prepare_callback(t,n))):null}),this);return this._batch_requests&&!a?s.enqueue(n,(function(e){e?t(1,n):u()})):d=u(),d&&n},MixpanelLib.prototype.track=addOptOutCheckMixpanelLib((function(e,t,n,i){i||"function"!=typeof n||(i=n,n=null);var s=(n=n||{}).transport;s&&(n.transport=s);var a=n.send_immediately;if("function"!=typeof i&&(i=NOOP_FUNC),wr.isUndefined(e))this.report_error("No event name provided to mixpanel.track");else{if(!this._event_is_disabled(e)){(t=wr.extend({},t)).token=this.get_config("token");var c=this.persistence.remove_event_timer(e);if(!wr.isUndefined(c)){var d=(new Date).getTime()-c;t.$duration=parseFloat((d/1e3).toFixed(3))}this._set_default_superprops();var u=this.get_config("track_marketing")?wr.info.marketingParams():{};t=wr.extend({},wr.info.properties({mp_loader:this.get_config("mp_loader")}),u,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),t);var l=this.get_config("property_blacklist");wr.isArray(l)?wr.each(l,(function(e){delete t[e]})):this.report_error("Invalid value for property_blacklist config: "+l);var p={event:e,properties:t};return this._track_or_batch({type:"events",data:p,endpoint:this.get_config("api_host")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:a,send_request_options:n},i)}i(0)}})),MixpanelLib.prototype.set_group=addOptOutCheckMixpanelLib((function(e,t,n){wr.isArray(t)||(t=[t]);var i={};return i[e]=t,this.register(i),this.people.set(e,t,n)})),MixpanelLib.prototype.add_group=addOptOutCheckMixpanelLib((function(e,t,n){var i=this.get_property(e),s={};return void 0===i?(s[e]=[t],this.register(s)):-1===i.indexOf(t)&&(i.push(t),s[e]=i,this.register(s)),this.people.union(e,t,n)})),MixpanelLib.prototype.remove_group=addOptOutCheckMixpanelLib((function(e,t,n){var i=this.get_property(e);if(void 0!==i){var s=i.indexOf(t);s>-1&&(i.splice(s,1),this.register({group_key:i})),0===i.length&&this.unregister(e)}return this.people.remove(e,t,n)})),MixpanelLib.prototype.track_with_groups=addOptOutCheckMixpanelLib((function(e,t,n,i){var s=wr.extend({},t||{});return wr.each(n,(function(e,t){null!=e&&(s[t]=e)})),this.track(e,s,i)})),MixpanelLib.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},MixpanelLib.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},MixpanelLib.prototype.get_group=function(e,t){var n=this._create_map_key(e,t),i=this._cached_groups[n];return void 0!==i&&i._group_key===e&&i._group_id===t||((i=new MixpanelGroup)._init(this,e,t),this._cached_groups[n]=i),i},MixpanelLib.prototype.track_pageview=addOptOutCheckMixpanelLib((function(e,t){"object"!=typeof e&&(e={});var n=(t=t||{}).event_name||"$mp_web_page_view",i=wr.extend(wr.info.mpPageViewProperties(),wr.info.campaignParams(),wr.info.clickParams()),s=wr.extend({},i,e);return this.track(n,s)})),MixpanelLib.prototype.track_links=function(){return this._track_dom.call(this,LinkTracker,arguments)},MixpanelLib.prototype.track_forms=function(){return this._track_dom.call(this,FormTracker,arguments)},MixpanelLib.prototype.time_event=function(e){wr.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 bn={persistent:!0},options_for_register=function(e){var t;return t=wr.isObject(e)?e:wr.isUndefined(e)?{}:{days:e},wr.extend({},bn,t)};MixpanelLib.prototype.register=function(e,t){var n=options_for_register(t);n.persistent?this.persistence.register(e,n.days):wr.extend(this.unpersisted_superprops,e)},MixpanelLib.prototype.register_once=function(e,t,n){var i=options_for_register(n);i.persistent?this.persistence.register_once(e,t,i.days):(void 0===t&&(t="None"),wr.each(e,(function(e,n){this.unpersisted_superprops.hasOwnProperty(n)&&this.unpersisted_superprops[n]!==t||(this.unpersisted_superprops[n]=e)}),this))},MixpanelLib.prototype.unregister=function(e,t){(t=options_for_register(t)).persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]},MixpanelLib.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)},MixpanelLib.prototype.identify=function(e,t,n,i,s,a,c,d){var u=this.get_distinct_id();if(e&&u!==e){if("string"==typeof e&&0===e.indexOf(hn))return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var l=u;this.register_once({$had_persisted_distinct_id:!0,$device_id:l},"")}e!==u&&e!==this.get_property(an)&&(this.unregister(an),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,n,i,s,a,c,d),e!==u&&this.track("$identify",{distinct_id:e,$anon_distinct_id:u},{skip_hooks:!0})},MixpanelLib.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=wr.UUID();this.register_once({distinct_id:hn+e,$device_id:e},"")},MixpanelLib.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},MixpanelLib.prototype.alias=function(e,t){if(e===this.get_property(sn))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return wr.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(an,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},(function(){n.identify(e)}))):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},MixpanelLib.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},MixpanelLib.prototype.set_config=function(e){wr.isObject(e)&&(wr.extend(this.config,e),e.batch_size&&wr.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),Wt.DEBUG=Wt.DEBUG||this.get_config("debug"))},MixpanelLib.prototype.get_config=function(e){return this.config[e]},MixpanelLib.prototype._run_hook=function(e){var t=(this.config.hooks[e]||IDENTITY_FUNC).apply(this,cr.call(arguments,1));return void 0===t&&(this.report_error(e+" hook did not return a value"),t=null),t},MixpanelLib.prototype.get_property=function(e){return this.persistence.load_prop([e])},MixpanelLib.prototype.toString=function(){var e=this.get_config("name");return e!==ln&&(e=ln+"."+e),e},MixpanelLib.prototype._event_is_disabled=function(e){return wr.isBlockedUA(_r)||this._flags.disable_all_events||wr.include(this.__disabled_events,e)},MixpanelLib.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_tracking_persistence_type")&&wr.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")&&!wr.cookie.get("mp_optout")||(wr.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},MixpanelLib.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()},MixpanelLib.prototype._gdpr_call_func=function(e,t){return t=wr.extend({track:wr.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),wr.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})},MixpanelLib.prototype.opt_in_tracking=function(e){e=wr.extend({enable_persistence:!0},e),this._gdpr_call_func(optIn,e),this._gdpr_update_persistence(e)},MixpanelLib.prototype.opt_out_tracking=function(e){(e=wr.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(optOut,e),this._gdpr_update_persistence(e)},MixpanelLib.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(hasOptedIn,e)},MixpanelLib.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(hasOptedOut,e)},MixpanelLib.prototype.clear_opt_in_out_tracking=function(e){e=wr.extend({enable_persistence:!0},e),this._gdpr_call_func(clearOptInOut,e),this._gdpr_update_persistence(e)},MixpanelLib.prototype.report_error=function(e,t){Ir.error.apply(Ir.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(n){Ir.error(n)}},MixpanelLib.prototype.init=MixpanelLib.prototype.init,MixpanelLib.prototype.reset=MixpanelLib.prototype.reset,MixpanelLib.prototype.disable=MixpanelLib.prototype.disable,MixpanelLib.prototype.time_event=MixpanelLib.prototype.time_event,MixpanelLib.prototype.track=MixpanelLib.prototype.track,MixpanelLib.prototype.track_links=MixpanelLib.prototype.track_links,MixpanelLib.prototype.track_forms=MixpanelLib.prototype.track_forms,MixpanelLib.prototype.track_pageview=MixpanelLib.prototype.track_pageview,MixpanelLib.prototype.register=MixpanelLib.prototype.register,MixpanelLib.prototype.register_once=MixpanelLib.prototype.register_once,MixpanelLib.prototype.unregister=MixpanelLib.prototype.unregister,MixpanelLib.prototype.identify=MixpanelLib.prototype.identify,MixpanelLib.prototype.alias=MixpanelLib.prototype.alias,MixpanelLib.prototype.name_tag=MixpanelLib.prototype.name_tag,MixpanelLib.prototype.set_config=MixpanelLib.prototype.set_config,MixpanelLib.prototype.get_config=MixpanelLib.prototype.get_config,MixpanelLib.prototype.get_property=MixpanelLib.prototype.get_property,MixpanelLib.prototype.get_distinct_id=MixpanelLib.prototype.get_distinct_id,MixpanelLib.prototype.toString=MixpanelLib.prototype.toString,MixpanelLib.prototype.opt_out_tracking=MixpanelLib.prototype.opt_out_tracking,MixpanelLib.prototype.opt_in_tracking=MixpanelLib.prototype.opt_in_tracking,MixpanelLib.prototype.has_opted_out_tracking=MixpanelLib.prototype.has_opted_out_tracking,MixpanelLib.prototype.has_opted_in_tracking=MixpanelLib.prototype.has_opted_in_tracking,MixpanelLib.prototype.clear_opt_in_out_tracking=MixpanelLib.prototype.clear_opt_in_out_tracking,MixpanelLib.prototype.get_group=MixpanelLib.prototype.get_group,MixpanelLib.prototype.set_group=MixpanelLib.prototype.set_group,MixpanelLib.prototype.add_group=MixpanelLib.prototype.add_group,MixpanelLib.prototype.remove_group=MixpanelLib.prototype.remove_group,MixpanelLib.prototype.track_with_groups=MixpanelLib.prototype.track_with_groups,MixpanelLib.prototype.start_batch_senders=MixpanelLib.prototype.start_batch_senders,MixpanelLib.prototype.stop_batch_senders=MixpanelLib.prototype.stop_batch_senders,MixpanelLib.prototype.start_session_recording=MixpanelLib.prototype.start_session_recording,MixpanelLib.prototype.stop_session_recording=MixpanelLib.prototype.stop_session_recording,MixpanelLib.prototype.get_session_recording_properties=MixpanelLib.prototype.get_session_recording_properties,MixpanelLib.prototype.DEFAULT_API_ROUTES=gn,MixpanelPersistence.prototype.properties=MixpanelPersistence.prototype.properties,MixpanelPersistence.prototype.update_search_keyword=MixpanelPersistence.prototype.update_search_keyword,MixpanelPersistence.prototype.update_referrer_info=MixpanelPersistence.prototype.update_referrer_info,MixpanelPersistence.prototype.get_cross_subdomain=MixpanelPersistence.prototype.get_cross_subdomain,MixpanelPersistence.prototype.clear=MixpanelPersistence.prototype.clear;var Sn={},override_mp_init_func=function(){un.init=function(e,t,n){if(n)return un[n]||(un[n]=Sn[n]=create_mplib(e,t,n),un[n]._loaded()),un[n];var i=un;Sn[ln]?i=Sn[ln]:e&&((i=create_mplib(e,t,ln))._loaded(),Sn[ln]=i),un=i,1===Yr&&($t[ln]=un),wr.each(Sn,(function(e,t){t!==ln&&(un[t]=e)})),un._=wr}};var kn=function init_as_module(e){return load_extra_bundle=e,Yr=0,un=new MixpanelLib,override_mp_init_func(),un.init(),function(){function dom_loaded_handler(){dom_loaded_handler.done||(dom_loaded_handler.done=!0,vn=!0,mn=!1,wr.each(Sn,(function(e){e._dom_loaded()})))}if(hr.addEventListener)"complete"===hr.readyState?dom_loaded_handler():hr.addEventListener("DOMContentLoaded",dom_loaded_handler,!1);else if(hr.attachEvent){hr.attachEvent("onreadystatechange",dom_loaded_handler);var e=!1;try{e=null===$t.frameElement}catch(t){}hr.documentElement.doScroll&&e&&function do_scroll_check(){try{hr.documentElement.doScroll("left")}catch(t){return void setTimeout(do_scroll_check,1)}dom_loaded_handler()}()}wr.register_event($t,"load",dom_loaded_handler,!0)}(),un}((function loadNoop(e,t){t()}));function isReady(){return void 0!==window.mixpanel}const wn={init:function init$1(e,t=!1){return new Promise((n=>{kn.init(e,{debug:t,loaded:()=>{window.mixpanel=kn,n()}})}))},isReady:isReady,track:function track(e,t){isReady()&&kn.track(e,t)},identify:function identify$1(e,t){isReady()&&(kn.identify(e),kn.people.set(t))},attachProperty:function attachProperty(e,t){isReady()&&kn.people.union(e,[t])}},In=["Track Test"];async function trackEvent(e,t){if(!wn.isReady())throw new Error("Mixpanel is not initialized.");try{Tn.parseEventProps(e,t);const n=!In.includes(e),i=await ot.getFingerprint(n),s={...{"User Fingerprint":i},...t};wn.track(e,s)}catch(Xt){throw console.error("Error tracking event:",Xt),Xt}}const xn=ge.object({Arrival:ge.string().refine(dateValidation,{message:"Invalid arrival date or datetime format. Must include at least YYYY-MM-DD"}),Departure:ge.string().refine(dateValidation,{message:"Invalid departure date or datetime format. Must include at least YYYY-MM-DD"}),Destination:ge.string().min(1,"Destination is required"),"Destination Terminal":ge.string().min(1,"Destination Terminal is required"),Line:ge.string().min(1,"Line is required").optional(),Origin:ge.string().min(1,"Origin is required"),"Origin Terminal":ge.string().min(1,"Origin Terminal is required"),Price:ge.number().positive("Price must be a positive number"),Route:ge.string().min(1,"Route is required"),Stops:ge.number().int("Stops must be an integer").nonnegative().optional(),Tickets:ge.number().int("Tickets must be an integer").positive(),Transporter:ge.string().min(1,"Transporter is required"),"User Fingerprint":ge.string().or(ge.null()).refine(userFingerPrintValidation,{message:"User fingerprint must be a string or null"}).optional(),Way:ge.enum(["Departure","Return"],{description:"Way must be either 'Departure' or 'Return'"}),product:ge.enum(ve).refine((e=>ve.includes(e)),{message:`Product must be one of: ${ve.join(", ")}`})}),En=ge.object({}),Cn=ge.object({mixpanelToken:ge.string().min(1,"Mixpanel token is required"),debug:ge.boolean().optional(),identificationKey:ge.string().min(1,"Identification key is required")}),SchemaErrorFormatter=e=>e.issues.map((e=>{let t="INVALID_FIELD",n="",i="",s="";return"invalid_type"===e.code?(t="TYPE_MISMATCH",n=e.expected,i=e.received,s=`Expected ${n} but received ${i}. Please provide a value of type ${n}.`):"too_small"===e.code?(t="VALUE_TOO_SMALL",s=`Increase the value to at least ${e.minimum}.`):"too_big"===e.code?(t="VALUE_TOO_BIG",s=`Reduce the value to no more than ${e.maximum}.`):(t="INVALID_FIELD",s="Ensure the field matches the expected format and value type."),{field:e.path.join("."),error_type:t,expected:n,received:i,message:e.message,suggestion:s}})),On={"Track Test":En,Search:be,"Seat Change":xn};function validateProps(e,t){try{t.parse(e)}catch(Xt){if(Xt instanceof ZodError){throw{message:"Schema validation failed",errors:SchemaErrorFormatter(Xt)}}throw{message:"Unknown validation error"}}}const Tn={parseEventProps:function parseEventProps(e,t){const n=On[e];if(!n)throw{message:`Event ${e} not found`};try{n.parse(t)}catch(Xt){if(Xt instanceof ZodError){throw{message:"Schema validation failed",errors:SchemaErrorFormatter(Xt)}}throw{message:"Unknown validation error"}}},parseInitProps:function parseInitProps(e){validateProps(e,Cn)},parseIdentifyProps:function parseIdentifyProps(e){validateProps(e,ye)}},Rn=["firstName","lastName","email","phone"];ge.object({product:ge.enum(ve).refine((e=>ve.includes(e)),{message:`Product must be one of: ${ve.join(", ")}`}),"User Fingerprint":ge.string().or(ge.null()).refine(userFingerPrintValidation,{message:"User fingerprint must be a string or null"}).optional()});const Mn={init:async function init(e){Tn.parseInitProps(e);const{mixpanelToken:t,debug:n=!1,identificationKey:i}=e;await wn.init(t,n);try{await ot.initFingerprint(i)}catch(Xt){console.error("Error initializing identification service:",Xt)}!function onLoaded(){window.dispatchEvent(new CustomEvent("Tracker Ready"))}()},identify:async function identify(e,t={}){if(!wn.isReady())throw new Error("Analytics service is not initialized");try{if(Tn.parseIdentifyProps(t),!e)throw new Error("User ID is required");const n=function mapProperties(e){return{$first_name:null==e?void 0:e.firstName,$last_name:null==e?void 0:e.lastName,$email:null==e?void 0:e.email,$phone:null==e?void 0:e.phone,...Object.keys(e).reduce(((t,n)=>(Rn.includes(n)||(t[n]=e[n]),t)),{})}}(t);wn.identify(e,n);const i=await ot.getFingerprint();i&&wn.attachProperty("Known Fingerprints",i)}catch(Xt){console.error("Error attaching fingerprint:",Xt)}},track:{test:function trackTest(){trackEvent("Track Test",{})},search:function trackSearch(e){trackEvent("Search",e)},seatChange:async e=>{trackEvent("Seat Change",e)},interestInHome:function trackInterestInSearch(e){trackEvent("Interest In Home",e)}}};module.exports=Mn;
@@ -135,6 +135,27 @@ export type DefaultProperties = z.infer<typeof IdentifySchema>;
135
135
  export interface UserProperties extends DefaultProperties, Record<string, string | number | boolean | undefined> {
136
136
  }
137
137
  declare function identify(userId: string, properties?: UserProperties): Promise<void>;
138
+ declare const interestInHomeSchema: z.ZodObject<{
139
+ product: z.ZodEffects<z.ZodEnum<[
140
+ "web",
141
+ "web-mobile",
142
+ "ios",
143
+ "android",
144
+ "app"
145
+ ]>, "web" | "web-mobile" | "ios" | "android" | "app", "web" | "web-mobile" | "ios" | "android" | "app">;
146
+ "User Fingerprint": z.ZodOptional<z.ZodEffects<z.ZodUnion<[
147
+ z.ZodString,
148
+ z.ZodNull
149
+ ]>, string | null, string | null>>;
150
+ }, "strip", z.ZodTypeAny, {
151
+ product: "web" | "web-mobile" | "ios" | "android" | "app";
152
+ "User Fingerprint"?: string | null | undefined;
153
+ }, {
154
+ product: "web" | "web-mobile" | "ios" | "android" | "app";
155
+ "User Fingerprint"?: string | null | undefined;
156
+ }>;
157
+ export type InterestInHomeProps = z.infer<typeof interestInHomeSchema>;
158
+ declare function trackInterestInSearch(eventData: InterestInHomeProps): void;
138
159
  declare function trackTest(): void;
139
160
  declare const InitConfigSchema: z.ZodObject<{
140
161
  /**
@@ -171,6 +192,7 @@ declare const analytics: {
171
192
  test: typeof trackTest;
172
193
  search: typeof trackSearch;
173
194
  seatChange: (eventProps: SeatChangeProps) => Promise<void>;
195
+ interestInHome: typeof trackInterestInSearch;
174
196
  };
175
197
  };
176
198