mixpanel-browser 2.61.1 → 2.61.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ **2.61.2** (14 Mar 2025)
2
+ - Revert 10ms throttle on enqueueing events to improve tracking reliability on page unload
3
+
1
4
  **2.61.1** (11 Mar 2025)
2
5
  - Session recording stops if initial DOM snapshot fails
3
6
  - Errors triggered by rrweb's record function are now caught
@@ -2,7 +2,7 @@
2
2
 
3
3
  var Config = {
4
4
  DEBUG: false,
5
- LIB_VERSION: '2.61.1'
5
+ LIB_VERSION: '2.61.2'
6
6
  };
7
7
 
8
8
  // since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file
@@ -6506,7 +6506,6 @@ MixpanelLib.prototype.init_batchers = function() {
6506
6506
  }, this),
6507
6507
  stopAllBatchingFunc: _.bind(this.stop_batch_senders, this),
6508
6508
  usePersistence: true,
6509
- enqueueThrottleMs: 10,
6510
6509
  }
6511
6510
  );
6512
6511
  }, this);
@@ -4894,7 +4894,7 @@
4894
4894
 
4895
4895
  var Config = {
4896
4896
  DEBUG: false,
4897
- LIB_VERSION: '2.61.1'
4897
+ LIB_VERSION: '2.61.2'
4898
4898
  };
4899
4899
 
4900
4900
  /* eslint camelcase: "off", eqeqeq: "off" */
@@ -29,7 +29,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
29
29
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
30
30
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
31
31
  PERFORMANCE OF THIS SOFTWARE.
32
- ***************************************************************************** */function e(d,l,f,p){function h(g){return g instanceof f?g:new f(function(m){m(g)})}return new(f||(f=Promise))(function(g,m){function v(y){try{b(p.next(y))}catch(S){m(S)}}function w(y){try{b(p.throw(y))}catch(S){m(S)}}function b(y){y.done?g(y.value):h(y.value).then(v,w)}b((p=p.apply(d,l||[])).next())})}for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=typeof Uint8Array>"u"?[]:new Uint8Array(256),n=0;n<t.length;n++)r[t.charCodeAt(n)]=n;var i=function(d){var l=new Uint8Array(d),f,p=l.length,h="";for(f=0;f<p;f+=3)h+=t[l[f]>>2],h+=t[(l[f]&3)<<4|l[f+1]>>4],h+=t[(l[f+1]&15)<<2|l[f+2]>>6],h+=t[l[f+2]&63];return p%3===2?h=h.substring(0,h.length-1)+"=":p%3===1&&(h=h.substring(0,h.length-2)+"=="),h};const o=new Map,s=new Map;function u(d,l,f){return e(this,void 0,void 0,function*(){const p=`${d}-${l}`;if("OffscreenCanvas"in globalThis){if(s.has(p))return s.get(p);const h=new OffscreenCanvas(d,l);h.getContext("2d");const m=yield(yield h.convertToBlob(f)).arrayBuffer(),v=i(m);return s.set(p,v),v}else return""})}const a=self;a.onmessage=function(d){return e(this,void 0,void 0,function*(){if("OffscreenCanvas"in globalThis){const{id:l,bitmap:f,width:p,height:h,dataURLOptions:g}=d.data,m=u(p,h,g),v=new OffscreenCanvas(p,h);v.getContext("2d").drawImage(f,0,0),f.close();const b=yield v.convertToBlob(g),y=b.type,S=yield b.arrayBuffer(),I=i(S);if(!o.has(l)&&(yield m)===I)return o.set(l,I),a.postMessage({id:l});if(o.get(l)===I)return a.postMessage({id:l});a.postMessage({id:l,type:y,base64:I,width:p,height:h}),o.set(l,I)}else return a.postMessage({id:d.data.id})})}})()},null);class oi{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(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(a,d)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(d)};const{sampling:r="all",win:n,blockClass:i,blockSelector:o,recordCanvas:s,dataURLOptions:u}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,i,o),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,i,o,{dataURLOptions:u})}initCanvasFPSObserver(t,r,n,i,o){const s=vr(r,n,i,!0),u=new Map,a=new ii;a.onmessage=g=>{const{id:m}=g.data;if(u.set(m,!1),!("base64"in g.data))return;const{base64:v,type:w,width:b,height:y}=g.data;this.mutationCb({id:m,type:Ie["2D"],commands:[{property:"clearRect",args:[0,0,b,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:v}],type:w}]},0,0]}]})};const d=1e3/t;let l=0,f;const p=()=>{const g=[];return r.document.querySelectorAll("canvas").forEach(m=>{z(m,n,i,!0)||g.push(m)}),g},h=g=>{if(l&&g-l<d){f=requestAnimationFrame(h);return}l=g,p().forEach(m=>Jn(this,void 0,void 0,function*(){var v;const w=this.mirror.getId(m);if(u.get(w)||m.width===0||m.height===0)return;if(u.set(w,!0),["webgl","webgl2"].includes(m.__context)){const y=m.getContext(m.__context);((v=y?.getContextAttributes())===null||v===void 0?void 0:v.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}const b=yield createImageBitmap(m);a.postMessage({id:w,bitmap:b,width:m.width,height:m.height,dataURLOptions:o.dataURLOptions},[b])})),f=requestAnimationFrame(h)};f=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(f)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=vr(t,r,n,!1),o=Yn(this.processMutation.bind(this),t,r,n),s=ei(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{i(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const i=n.map(s=>Vn(s,["type"])),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}}class si{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Cn,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;const n={id:r,styleIds:[]},i=[];for(const o of t){let s;this.styleMirror.has(o)?s=this.styleMirror.getId(o):(s=this.styleMirror.add(o),i.push({styleId:s,rules:Array.from(o.rules||CSSRule,(u,a)=>({rule:Bt(u),index:a}))})),n.styleIds.push(s)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class ai{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(t,r){const n=this.nodeMap.get(t);return n&&Array.from(n).some(i=>i!==r)}add(t,r){this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function F(e){return Object.assign(Object.assign({},e),{timestamp:Ge()})}let L,Ye,vt,Ze=!1;const X=Zr();function Ne(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:u=null,maskTextClass:a="rr-mask",maskTextSelector:d=null,inlineStylesheet:l=!0,maskAllInputs:f,maskInputOptions:p,slimDOMOptions:h,maskInputFn:g,maskTextFn:m,hooks:v,packFn:w,sampling:b={},dataURLOptions:y={},mousemoveWait:S,recordDOM:I=!0,recordCanvas:U=!1,recordCrossOriginIframes:B=!1,recordAfter:k=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:N=!1,collectFonts:V=!1,inlineImages:J=!1,plugins:x,keepIframeSrcFn:he=()=>!1,ignoreCSSAttributes:$=new Set([]),errorHandler:ue}=e;Tn(ue);const te=B?window.parent===window:!0;let ut=!1;if(!te)try{window.parent.document&&(ut=!1)}catch{ut=!0}if(te&&!t)throw new Error("emit function is required");S!==void 0&&b.mousemove===void 0&&(b.mousemove=S),X.reset();const Nt=f===!0?{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}:p!==void 0?p:{password:!0},Dt=h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:h==="all",headMetaDescKeywords:h==="all"}:h||{};_n();let $r,At=0;const Hr=M=>{for(const Y of x||[])Y.eventProcessor&&(M=Y.eventProcessor(M));return w&&!ut&&(M=w(M)),M};L=(M,Y)=>{var A;if(!((A=le[0])===null||A===void 0)&&A.isFrozen()&&M.type!==E.FullSnapshot&&!(M.type===E.IncrementalSnapshot&&M.data.source===_.Mutation)&&le.forEach(H=>H.unfreeze()),te)t?.(Hr(M),Y);else if(ut){const H={type:"rrweb",event:Hr(M),origin:window.location.origin,isCheckout:Y};window.parent.postMessage(H,"*")}if(M.type===E.FullSnapshot)$r=M,At=0;else if(M.type===E.IncrementalSnapshot){if(M.data.source===_.Mutation&&M.data.isAttachIframe)return;At++;const H=n&&At>=n,ge=r&&M.timestamp-$r.timestamp>r;(H||ge)&&Ye(!0)}};const ct=M=>{L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.Mutation},M)}))},jr=M=>L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.Scroll},M)})),Gr=M=>L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.CanvasMutation},M)})),Bi=M=>L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.AdoptedStyleSheet},M)})),pe=new si({mutationCb:ct,adoptedStyleSheetCb:Bi}),me=new jn({mirror:X,mutationCb:ct,stylesheetManager:pe,recordCrossOriginIframes:B,wrappedEmit:L});for(const M of x||[])M.getMirror&&M.getMirror({nodeMirror:X,crossOriginIframeMirror:me.crossOriginIframeMirror,crossOriginIframeStyleMirror:me.crossOriginIframeStyleMirror});const Lt=new ai;vt=new oi({recordCanvas:U,mutationCb:Gr,win:window,blockClass:i,blockSelector:o,mirror:X,sampling:b.canvas,dataURLOptions:y});const lt=new Gn({mutationCb:ct,scrollCb:jr,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:d,inlineStylesheet:l,maskInputOptions:Nt,dataURLOptions:y,maskTextFn:m,maskInputFn:g,recordCanvas:U,inlineImages:J,sampling:b,slimDOMOptions:Dt,iframeManager:me,stylesheetManager:pe,canvasManager:vt,keepIframeSrcFn:he,processedNodeManager:Lt},mirror:X});Ye=(M=!1)=>{if(!I)return;L(F({type:E.Meta,data:{href:window.location.href,width:Kt(),height:Xt()}}),M),pe.reset(),lt.init(),le.forEach(A=>A.lock());const Y=In(document,{mirror:X,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:d,inlineStylesheet:l,maskAllInputs:Nt,maskTextFn:m,slimDOM:Dt,dataURLOptions:y,recordCanvas:U,inlineImages:J,onSerialize:A=>{Zt(A,X)&&me.addIframe(A),er(A,X)&&pe.trackLinkElement(A),gt(A)&&lt.addShadowRoot(A.shadowRoot,document)},onIframeLoad:(A,H)=>{me.attachIframe(A,H),lt.observeAttachShadow(A)},onStylesheetLoad:(A,H)=>{pe.attachLinkElement(A,H)},keepIframeSrcFn:he});if(!Y)return console.warn("Failed to snapshot the document");L(F({type:E.FullSnapshot,data:{node:Y,initialOffset:Jt(window)}}),M),le.forEach(A=>A.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&pe.adoptStyleSheets(document.adoptedStyleSheets,X.getId(document))};try{const M=[],Y=H=>{var ge;return C(Hn)({mutationCb:ct,mousemoveCb:(D,Pt)=>L(F({type:E.IncrementalSnapshot,data:{source:Pt,positions:D}})),mouseInteractionCb:D=>L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.MouseInteraction},D)})),scrollCb:jr,viewportResizeCb:D=>L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.ViewportResize},D)})),inputCb:D=>L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.Input},D)})),mediaInteractionCb:D=>L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.MediaInteraction},D)})),styleSheetRuleCb:D=>L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.StyleSheetRule},D)})),styleDeclarationCb:D=>L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.StyleDeclaration},D)})),canvasMutationCb:Gr,fontCb:D=>L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.Font},D)})),selectionCb:D=>{L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.Selection},D)}))},customElementCb:D=>{L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.CustomElement},D)}))},blockClass:i,ignoreClass:s,ignoreSelector:u,maskTextClass:a,maskTextSelector:d,maskInputOptions:Nt,inlineStylesheet:l,sampling:b,recordDOM:I,recordCanvas:U,inlineImages:J,userTriggeredOnInput:N,collectFonts:V,doc:H,maskInputFn:g,maskTextFn:m,keepIframeSrcFn:he,blockSelector:o,slimDOMOptions:Dt,dataURLOptions:y,mirror:X,iframeManager:me,stylesheetManager:pe,shadowDomManager:lt,processedNodeManager:Lt,canvasManager:vt,ignoreCSSAttributes:$,plugins:((ge=x?.filter(D=>D.observer))===null||ge===void 0?void 0:ge.map(D=>({observer:D.observer,options:D.options,callback:Pt=>L(F({type:E.Plugin,data:{plugin:D.name,payload:Pt}}))})))||[]},v)};me.addLoadListener(H=>{try{M.push(Y(H.contentDocument))}catch(ge){console.warn(ge)}});const A=()=>{Ye(),M.push(Y(document)),Ze=!0};return document.readyState==="interactive"||document.readyState==="complete"?A():(M.push(q("DOMContentLoaded",()=>{L(F({type:E.DomContentLoaded,data:{}})),k==="DOMContentLoaded"&&A()})),M.push(q("load",()=>{L(F({type:E.Load,data:{}})),k==="load"&&A()},window))),()=>{M.forEach(H=>H()),Lt.destroy(),Ze=!1,kn()}}catch(M){console.warn(M)}}Ne.addCustomEvent=(e,t)=>{if(!Ze)throw new Error("please add custom event after start recording");L(F({type:E.Custom,data:{tag:e,payload:t}}))},Ne.freezePage=()=>{le.forEach(e=>e.freeze())},Ne.takeFullSnapshot=e=>{if(!Ze)throw new Error("please take full snapshot after start recording");Ye(e)},Ne.mirror=X;var br=R.setImmediate,se,St,bt,wr=Object.prototype.toString,ui=typeof br<"u"?function(t){return br(t)}:setTimeout;try{Object.defineProperty({},"x",{}),se=function(t,r,n,i){return Object.defineProperty(t,r,{value:n,writable:!0,configurable:i!==!1})}}catch{se=function(r,n,i){return r[n]=i,r}}bt=function(){var t,r,n;function i(o,s){this.fn=o,this.self=s,this.next=void 0}return{add:function(s,u){n=new i(s,u),r?r.next=n:t=n,r=n,n=void 0},drain:function(){var s=t;for(t=r=St=void 0;s;)s.fn.call(s.self),s=s.next}}}();function et(e,t){bt.add(e,t),St||(St=ui(bt.drain))}function Ir(e){var t,r=typeof e;return e!==null&&(r==="object"||r==="function")&&(t=e.then),typeof t=="function"?t:!1}function wt(){for(var e=0;e<this.chain.length;e++)ci(this,this.state===1?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function ci(e,t,r){var n,i;try{t===!1?r.reject(e.msg):(t===!0?n=e.msg:n=t.call(void 0,e.msg),n===r.promise?r.reject(TypeError("Promise-chain cycle")):(i=Ir(n))?i.call(n,r.resolve,r.reject):r.resolve(n))}catch(o){r.reject(o)}}function Mr(e){var t,r=this;if(!r.triggered){r.triggered=!0,r.def&&(r=r.def);try{(t=Ir(e))?et(function(){var n=new Cr(r);try{t.call(e,function(){Mr.apply(n,arguments)},function(){De.apply(n,arguments)})}catch(i){De.call(n,i)}}):(r.msg=e,r.state=1,r.chain.length>0&&et(wt,r))}catch(n){De.call(new Cr(r),n)}}}function De(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&et(wt,t))}function _r(e,t,r,n){for(var i=0;i<t.length;i++)(function(s){e.resolve(t[s]).then(function(a){r(s,a)},n)})(i)}function Cr(e){this.def=e,this.triggered=!1}function li(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function ae(e){if(typeof e!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var t=new li(this);this.then=function(n,i){var o={success:typeof n=="function"?n:!0,failure:typeof i=="function"?i:!1};return o.promise=new this.constructor(function(u,a){if(typeof u!="function"||typeof a!="function")throw TypeError("Not a function");o.resolve=u,o.reject=a}),t.chain.push(o),t.state!==0&&et(wt,t),o.promise},this.catch=function(n){return this.then(void 0,n)};try{e.call(void 0,function(n){Mr.call(t,n)},function(n){De.call(t,n)})}catch(r){De.call(t,r)}}var Er=se({},"constructor",ae,!1);ae.prototype=Er,se(Er,"__NPO__",0,!1),se(ae,"resolve",function(t){var r=this;return t&&typeof t=="object"&&t.__NPO__===1?t:new r(function(i,o){if(typeof i!="function"||typeof o!="function")throw TypeError("Not a function");i(t)})}),se(ae,"reject",function(t){return new this(function(n,i){if(typeof n!="function"||typeof i!="function")throw TypeError("Not a function");i(t)})}),se(ae,"all",function(t){var r=this;return wr.call(t)!=="[object Array]"?r.reject(TypeError("Not an array")):t.length===0?r.resolve([]):new r(function(i,o){if(typeof i!="function"||typeof o!="function")throw TypeError("Not a function");var s=t.length,u=Array(s),a=0;_r(r,t,function(l,f){u[l]=f,++a===s&&i(u)},o)})}),se(ae,"race",function(t){var r=this;return wr.call(t)!=="[object Array]"?r.reject(TypeError("Not an array")):new r(function(i,o){if(typeof i!="function"||typeof o!="function")throw TypeError("Not a function");_r(r,t,function(u,a){i(a)},o)})});var O;typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1?O=Promise:O=ae;var It=(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))(It||{}),Z=(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))(Z||{}),Mt={DEBUG:!1,LIB_VERSION:"2.61.1"},tt=24*60*60*1e3,_t=8*1e3,rt=Array.prototype,di=Function.prototype,Rr=Object.prototype,de=rt.slice,Ae=Rr.toString,nt=Rr.hasOwnProperty,Le=R.console,Pe=R.navigator,G=R.document,it=R.opera,ot=R.screen,fe=Pe.userAgent,Ct=di.bind,Or=rt.forEach,xr=rt.indexOf,Tr=rt.map,fi=Array.isArray,Et={},c={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},K={log:function(){},warn:function(){},error:function(){},critical:function(){if(!c.isUndefined(Le)&&Le){var e=["Mixpanel error:"].concat(c.toArray(arguments));try{Le.error.apply(Le,e)}catch{c.each(e,function(r){Le.error(r)})}}}},Rt=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(K,arguments)}},Fe=function(e){return{log:Rt(K.log,e),error:Rt(K.error,e),critical:Rt(K.critical,e)}};c.bind=function(e,t){var r,n;if(Ct&&e.bind===Ct)return Ct.apply(e,de.call(arguments,1));if(!c.isFunction(e))throw new TypeError;return r=de.call(arguments,2),n=function(){if(!(this instanceof n))return e.apply(t,r.concat(de.call(arguments)));var i={};i.prototype=e.prototype;var o=new i;i.prototype=null;var s=e.apply(o,r.concat(de.call(arguments)));return Object(s)===s?s:o},n},c.each=function(e,t,r){if(e!=null){if(Or&&e.forEach===Or)e.forEach(t,r);else if(e.length===+e.length){for(var n=0,i=e.length;n<i;n++)if(n in e&&t.call(r,e[n],n,e)===Et)return}else for(var o in e)if(nt.call(e,o)&&t.call(r,e[o],o,e)===Et)return}},c.extend=function(e){return c.each(de.call(arguments,1),function(t){for(var r in t)t[r]!==void 0&&(e[r]=t[r])}),e},c.isArray=fi||function(e){return Ae.call(e)==="[object Array]"},c.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch{return!1}},c.isArguments=function(e){return!!(e&&nt.call(e,"callee"))},c.toArray=function(e){return e?e.toArray?e.toArray():c.isArray(e)||c.isArguments(e)?de.call(e):c.values(e):[]},c.map=function(e,t,r){if(Tr&&e.map===Tr)return e.map(t,r);var n=[];return c.each(e,function(i){n.push(t.call(r,i))}),n},c.keys=function(e){var t=[];return e===null||c.each(e,function(r,n){t[t.length]=n}),t},c.values=function(e){var t=[];return e===null||c.each(e,function(r){t[t.length]=r}),t},c.include=function(e,t){var r=!1;return e===null?r:xr&&e.indexOf===xr?e.indexOf(t)!=-1:(c.each(e,function(n){if(r||(r=n===t))return Et}),r)},c.includes=function(e,t){return e.indexOf(t)!==-1},c.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},c.isObject=function(e){return e===Object(e)&&!c.isArray(e)},c.isEmptyObject=function(e){if(c.isObject(e)){for(var t in e)if(nt.call(e,t))return!1;return!0}return!1},c.isUndefined=function(e){return e===void 0},c.isString=function(e){return Ae.call(e)=="[object String]"},c.isDate=function(e){return Ae.call(e)=="[object Date]"},c.isNumber=function(e){return Ae.call(e)=="[object Number]"},c.isElement=function(e){return!!(e&&e.nodeType===1)},c.encodeDates=function(e){return c.each(e,function(t,r){c.isDate(t)?e[r]=c.formatDate(t):c.isObject(t)&&(e[r]=c.encodeDates(t))}),e},c.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},c.formatDate=function(e){function t(r){return r<10?"0"+r:r}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},c.strip_empty_properties=function(e){var t={};return c.each(e,function(r,n){c.isString(r)&&r.length>0&&(t[n]=r)}),t},c.truncate=function(e,t){var r;return typeof e=="string"?r=e.slice(0,t):c.isArray(e)?(r=[],c.each(e,function(n){r.push(c.truncate(n,t))})):c.isObject(e)?(r={},c.each(e,function(n,i){r[i]=c.truncate(n,t)})):r=e,r},c.JSONEncode=function(){return function(e){var t=e,r=function(i){var o=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return o.lastIndex=0,o.test(i)?'"'+i.replace(o,function(u){var a=s[u];return typeof a=="string"?a:"\\u"+("0000"+u.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},n=function(i,o){var s="",u=" ",a=0,d="",l="",f=0,p=s,h=[],g=o[i];switch(g&&typeof g=="object"&&typeof g.toJSON=="function"&&(g=g.toJSON(i)),typeof g){case"string":return r(g);case"number":return isFinite(g)?String(g):"null";case"boolean":case"null":return String(g);case"object":if(!g)return"null";if(s+=u,h=[],Ae.apply(g)==="[object Array]"){for(f=g.length,a=0;a<f;a+=1)h[a]=n(a,g)||"null";return l=h.length===0?"[]":s?`[
32
+ ***************************************************************************** */function e(d,l,f,p){function h(g){return g instanceof f?g:new f(function(m){m(g)})}return new(f||(f=Promise))(function(g,m){function v(y){try{b(p.next(y))}catch(S){m(S)}}function w(y){try{b(p.throw(y))}catch(S){m(S)}}function b(y){y.done?g(y.value):h(y.value).then(v,w)}b((p=p.apply(d,l||[])).next())})}for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=typeof Uint8Array>"u"?[]:new Uint8Array(256),n=0;n<t.length;n++)r[t.charCodeAt(n)]=n;var i=function(d){var l=new Uint8Array(d),f,p=l.length,h="";for(f=0;f<p;f+=3)h+=t[l[f]>>2],h+=t[(l[f]&3)<<4|l[f+1]>>4],h+=t[(l[f+1]&15)<<2|l[f+2]>>6],h+=t[l[f+2]&63];return p%3===2?h=h.substring(0,h.length-1)+"=":p%3===1&&(h=h.substring(0,h.length-2)+"=="),h};const o=new Map,s=new Map;function u(d,l,f){return e(this,void 0,void 0,function*(){const p=`${d}-${l}`;if("OffscreenCanvas"in globalThis){if(s.has(p))return s.get(p);const h=new OffscreenCanvas(d,l);h.getContext("2d");const m=yield(yield h.convertToBlob(f)).arrayBuffer(),v=i(m);return s.set(p,v),v}else return""})}const a=self;a.onmessage=function(d){return e(this,void 0,void 0,function*(){if("OffscreenCanvas"in globalThis){const{id:l,bitmap:f,width:p,height:h,dataURLOptions:g}=d.data,m=u(p,h,g),v=new OffscreenCanvas(p,h);v.getContext("2d").drawImage(f,0,0),f.close();const b=yield v.convertToBlob(g),y=b.type,S=yield b.arrayBuffer(),I=i(S);if(!o.has(l)&&(yield m)===I)return o.set(l,I),a.postMessage({id:l});if(o.get(l)===I)return a.postMessage({id:l});a.postMessage({id:l,type:y,base64:I,width:p,height:h}),o.set(l,I)}else return a.postMessage({id:d.data.id})})}})()},null);class oi{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(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(a,d)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(d)};const{sampling:r="all",win:n,blockClass:i,blockSelector:o,recordCanvas:s,dataURLOptions:u}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,i,o),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,i,o,{dataURLOptions:u})}initCanvasFPSObserver(t,r,n,i,o){const s=vr(r,n,i,!0),u=new Map,a=new ii;a.onmessage=g=>{const{id:m}=g.data;if(u.set(m,!1),!("base64"in g.data))return;const{base64:v,type:w,width:b,height:y}=g.data;this.mutationCb({id:m,type:Ie["2D"],commands:[{property:"clearRect",args:[0,0,b,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:v}],type:w}]},0,0]}]})};const d=1e3/t;let l=0,f;const p=()=>{const g=[];return r.document.querySelectorAll("canvas").forEach(m=>{z(m,n,i,!0)||g.push(m)}),g},h=g=>{if(l&&g-l<d){f=requestAnimationFrame(h);return}l=g,p().forEach(m=>Jn(this,void 0,void 0,function*(){var v;const w=this.mirror.getId(m);if(u.get(w)||m.width===0||m.height===0)return;if(u.set(w,!0),["webgl","webgl2"].includes(m.__context)){const y=m.getContext(m.__context);((v=y?.getContextAttributes())===null||v===void 0?void 0:v.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}const b=yield createImageBitmap(m);a.postMessage({id:w,bitmap:b,width:m.width,height:m.height,dataURLOptions:o.dataURLOptions},[b])})),f=requestAnimationFrame(h)};f=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(f)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=vr(t,r,n,!1),o=Yn(this.processMutation.bind(this),t,r,n),s=ei(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{i(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const i=n.map(s=>Vn(s,["type"])),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}}class si{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Cn,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;const n={id:r,styleIds:[]},i=[];for(const o of t){let s;this.styleMirror.has(o)?s=this.styleMirror.getId(o):(s=this.styleMirror.add(o),i.push({styleId:s,rules:Array.from(o.rules||CSSRule,(u,a)=>({rule:Bt(u),index:a}))})),n.styleIds.push(s)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class ai{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(t,r){const n=this.nodeMap.get(t);return n&&Array.from(n).some(i=>i!==r)}add(t,r){this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function F(e){return Object.assign(Object.assign({},e),{timestamp:Ge()})}let L,Ye,vt,Ze=!1;const X=Zr();function Ne(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:u=null,maskTextClass:a="rr-mask",maskTextSelector:d=null,inlineStylesheet:l=!0,maskAllInputs:f,maskInputOptions:p,slimDOMOptions:h,maskInputFn:g,maskTextFn:m,hooks:v,packFn:w,sampling:b={},dataURLOptions:y={},mousemoveWait:S,recordDOM:I=!0,recordCanvas:U=!1,recordCrossOriginIframes:B=!1,recordAfter:k=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:N=!1,collectFonts:V=!1,inlineImages:J=!1,plugins:x,keepIframeSrcFn:he=()=>!1,ignoreCSSAttributes:$=new Set([]),errorHandler:ue}=e;Tn(ue);const te=B?window.parent===window:!0;let ut=!1;if(!te)try{window.parent.document&&(ut=!1)}catch{ut=!0}if(te&&!t)throw new Error("emit function is required");S!==void 0&&b.mousemove===void 0&&(b.mousemove=S),X.reset();const Nt=f===!0?{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}:p!==void 0?p:{password:!0},Dt=h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:h==="all",headMetaDescKeywords:h==="all"}:h||{};_n();let $r,At=0;const Hr=M=>{for(const Y of x||[])Y.eventProcessor&&(M=Y.eventProcessor(M));return w&&!ut&&(M=w(M)),M};L=(M,Y)=>{var A;if(!((A=le[0])===null||A===void 0)&&A.isFrozen()&&M.type!==E.FullSnapshot&&!(M.type===E.IncrementalSnapshot&&M.data.source===_.Mutation)&&le.forEach(H=>H.unfreeze()),te)t?.(Hr(M),Y);else if(ut){const H={type:"rrweb",event:Hr(M),origin:window.location.origin,isCheckout:Y};window.parent.postMessage(H,"*")}if(M.type===E.FullSnapshot)$r=M,At=0;else if(M.type===E.IncrementalSnapshot){if(M.data.source===_.Mutation&&M.data.isAttachIframe)return;At++;const H=n&&At>=n,ge=r&&M.timestamp-$r.timestamp>r;(H||ge)&&Ye(!0)}};const ct=M=>{L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.Mutation},M)}))},jr=M=>L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.Scroll},M)})),Gr=M=>L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.CanvasMutation},M)})),Bi=M=>L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.AdoptedStyleSheet},M)})),pe=new si({mutationCb:ct,adoptedStyleSheetCb:Bi}),me=new jn({mirror:X,mutationCb:ct,stylesheetManager:pe,recordCrossOriginIframes:B,wrappedEmit:L});for(const M of x||[])M.getMirror&&M.getMirror({nodeMirror:X,crossOriginIframeMirror:me.crossOriginIframeMirror,crossOriginIframeStyleMirror:me.crossOriginIframeStyleMirror});const Lt=new ai;vt=new oi({recordCanvas:U,mutationCb:Gr,win:window,blockClass:i,blockSelector:o,mirror:X,sampling:b.canvas,dataURLOptions:y});const lt=new Gn({mutationCb:ct,scrollCb:jr,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:d,inlineStylesheet:l,maskInputOptions:Nt,dataURLOptions:y,maskTextFn:m,maskInputFn:g,recordCanvas:U,inlineImages:J,sampling:b,slimDOMOptions:Dt,iframeManager:me,stylesheetManager:pe,canvasManager:vt,keepIframeSrcFn:he,processedNodeManager:Lt},mirror:X});Ye=(M=!1)=>{if(!I)return;L(F({type:E.Meta,data:{href:window.location.href,width:Kt(),height:Xt()}}),M),pe.reset(),lt.init(),le.forEach(A=>A.lock());const Y=In(document,{mirror:X,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:d,inlineStylesheet:l,maskAllInputs:Nt,maskTextFn:m,slimDOM:Dt,dataURLOptions:y,recordCanvas:U,inlineImages:J,onSerialize:A=>{Zt(A,X)&&me.addIframe(A),er(A,X)&&pe.trackLinkElement(A),gt(A)&&lt.addShadowRoot(A.shadowRoot,document)},onIframeLoad:(A,H)=>{me.attachIframe(A,H),lt.observeAttachShadow(A)},onStylesheetLoad:(A,H)=>{pe.attachLinkElement(A,H)},keepIframeSrcFn:he});if(!Y)return console.warn("Failed to snapshot the document");L(F({type:E.FullSnapshot,data:{node:Y,initialOffset:Jt(window)}}),M),le.forEach(A=>A.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&pe.adoptStyleSheets(document.adoptedStyleSheets,X.getId(document))};try{const M=[],Y=H=>{var ge;return C(Hn)({mutationCb:ct,mousemoveCb:(D,Pt)=>L(F({type:E.IncrementalSnapshot,data:{source:Pt,positions:D}})),mouseInteractionCb:D=>L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.MouseInteraction},D)})),scrollCb:jr,viewportResizeCb:D=>L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.ViewportResize},D)})),inputCb:D=>L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.Input},D)})),mediaInteractionCb:D=>L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.MediaInteraction},D)})),styleSheetRuleCb:D=>L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.StyleSheetRule},D)})),styleDeclarationCb:D=>L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.StyleDeclaration},D)})),canvasMutationCb:Gr,fontCb:D=>L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.Font},D)})),selectionCb:D=>{L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.Selection},D)}))},customElementCb:D=>{L(F({type:E.IncrementalSnapshot,data:Object.assign({source:_.CustomElement},D)}))},blockClass:i,ignoreClass:s,ignoreSelector:u,maskTextClass:a,maskTextSelector:d,maskInputOptions:Nt,inlineStylesheet:l,sampling:b,recordDOM:I,recordCanvas:U,inlineImages:J,userTriggeredOnInput:N,collectFonts:V,doc:H,maskInputFn:g,maskTextFn:m,keepIframeSrcFn:he,blockSelector:o,slimDOMOptions:Dt,dataURLOptions:y,mirror:X,iframeManager:me,stylesheetManager:pe,shadowDomManager:lt,processedNodeManager:Lt,canvasManager:vt,ignoreCSSAttributes:$,plugins:((ge=x?.filter(D=>D.observer))===null||ge===void 0?void 0:ge.map(D=>({observer:D.observer,options:D.options,callback:Pt=>L(F({type:E.Plugin,data:{plugin:D.name,payload:Pt}}))})))||[]},v)};me.addLoadListener(H=>{try{M.push(Y(H.contentDocument))}catch(ge){console.warn(ge)}});const A=()=>{Ye(),M.push(Y(document)),Ze=!0};return document.readyState==="interactive"||document.readyState==="complete"?A():(M.push(q("DOMContentLoaded",()=>{L(F({type:E.DomContentLoaded,data:{}})),k==="DOMContentLoaded"&&A()})),M.push(q("load",()=>{L(F({type:E.Load,data:{}})),k==="load"&&A()},window))),()=>{M.forEach(H=>H()),Lt.destroy(),Ze=!1,kn()}}catch(M){console.warn(M)}}Ne.addCustomEvent=(e,t)=>{if(!Ze)throw new Error("please add custom event after start recording");L(F({type:E.Custom,data:{tag:e,payload:t}}))},Ne.freezePage=()=>{le.forEach(e=>e.freeze())},Ne.takeFullSnapshot=e=>{if(!Ze)throw new Error("please take full snapshot after start recording");Ye(e)},Ne.mirror=X;var br=R.setImmediate,se,St,bt,wr=Object.prototype.toString,ui=typeof br<"u"?function(t){return br(t)}:setTimeout;try{Object.defineProperty({},"x",{}),se=function(t,r,n,i){return Object.defineProperty(t,r,{value:n,writable:!0,configurable:i!==!1})}}catch{se=function(r,n,i){return r[n]=i,r}}bt=function(){var t,r,n;function i(o,s){this.fn=o,this.self=s,this.next=void 0}return{add:function(s,u){n=new i(s,u),r?r.next=n:t=n,r=n,n=void 0},drain:function(){var s=t;for(t=r=St=void 0;s;)s.fn.call(s.self),s=s.next}}}();function et(e,t){bt.add(e,t),St||(St=ui(bt.drain))}function Ir(e){var t,r=typeof e;return e!==null&&(r==="object"||r==="function")&&(t=e.then),typeof t=="function"?t:!1}function wt(){for(var e=0;e<this.chain.length;e++)ci(this,this.state===1?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function ci(e,t,r){var n,i;try{t===!1?r.reject(e.msg):(t===!0?n=e.msg:n=t.call(void 0,e.msg),n===r.promise?r.reject(TypeError("Promise-chain cycle")):(i=Ir(n))?i.call(n,r.resolve,r.reject):r.resolve(n))}catch(o){r.reject(o)}}function Mr(e){var t,r=this;if(!r.triggered){r.triggered=!0,r.def&&(r=r.def);try{(t=Ir(e))?et(function(){var n=new Cr(r);try{t.call(e,function(){Mr.apply(n,arguments)},function(){De.apply(n,arguments)})}catch(i){De.call(n,i)}}):(r.msg=e,r.state=1,r.chain.length>0&&et(wt,r))}catch(n){De.call(new Cr(r),n)}}}function De(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&et(wt,t))}function _r(e,t,r,n){for(var i=0;i<t.length;i++)(function(s){e.resolve(t[s]).then(function(a){r(s,a)},n)})(i)}function Cr(e){this.def=e,this.triggered=!1}function li(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function ae(e){if(typeof e!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var t=new li(this);this.then=function(n,i){var o={success:typeof n=="function"?n:!0,failure:typeof i=="function"?i:!1};return o.promise=new this.constructor(function(u,a){if(typeof u!="function"||typeof a!="function")throw TypeError("Not a function");o.resolve=u,o.reject=a}),t.chain.push(o),t.state!==0&&et(wt,t),o.promise},this.catch=function(n){return this.then(void 0,n)};try{e.call(void 0,function(n){Mr.call(t,n)},function(n){De.call(t,n)})}catch(r){De.call(t,r)}}var Er=se({},"constructor",ae,!1);ae.prototype=Er,se(Er,"__NPO__",0,!1),se(ae,"resolve",function(t){var r=this;return t&&typeof t=="object"&&t.__NPO__===1?t:new r(function(i,o){if(typeof i!="function"||typeof o!="function")throw TypeError("Not a function");i(t)})}),se(ae,"reject",function(t){return new this(function(n,i){if(typeof n!="function"||typeof i!="function")throw TypeError("Not a function");i(t)})}),se(ae,"all",function(t){var r=this;return wr.call(t)!=="[object Array]"?r.reject(TypeError("Not an array")):t.length===0?r.resolve([]):new r(function(i,o){if(typeof i!="function"||typeof o!="function")throw TypeError("Not a function");var s=t.length,u=Array(s),a=0;_r(r,t,function(l,f){u[l]=f,++a===s&&i(u)},o)})}),se(ae,"race",function(t){var r=this;return wr.call(t)!=="[object Array]"?r.reject(TypeError("Not an array")):new r(function(i,o){if(typeof i!="function"||typeof o!="function")throw TypeError("Not a function");_r(r,t,function(u,a){i(a)},o)})});var O;typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1?O=Promise:O=ae;var It=(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))(It||{}),Z=(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))(Z||{}),Mt={DEBUG:!1,LIB_VERSION:"2.61.2"},tt=24*60*60*1e3,_t=8*1e3,rt=Array.prototype,di=Function.prototype,Rr=Object.prototype,de=rt.slice,Ae=Rr.toString,nt=Rr.hasOwnProperty,Le=R.console,Pe=R.navigator,G=R.document,it=R.opera,ot=R.screen,fe=Pe.userAgent,Ct=di.bind,Or=rt.forEach,xr=rt.indexOf,Tr=rt.map,fi=Array.isArray,Et={},c={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},K={log:function(){},warn:function(){},error:function(){},critical:function(){if(!c.isUndefined(Le)&&Le){var e=["Mixpanel error:"].concat(c.toArray(arguments));try{Le.error.apply(Le,e)}catch{c.each(e,function(r){Le.error(r)})}}}},Rt=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(K,arguments)}},Fe=function(e){return{log:Rt(K.log,e),error:Rt(K.error,e),critical:Rt(K.critical,e)}};c.bind=function(e,t){var r,n;if(Ct&&e.bind===Ct)return Ct.apply(e,de.call(arguments,1));if(!c.isFunction(e))throw new TypeError;return r=de.call(arguments,2),n=function(){if(!(this instanceof n))return e.apply(t,r.concat(de.call(arguments)));var i={};i.prototype=e.prototype;var o=new i;i.prototype=null;var s=e.apply(o,r.concat(de.call(arguments)));return Object(s)===s?s:o},n},c.each=function(e,t,r){if(e!=null){if(Or&&e.forEach===Or)e.forEach(t,r);else if(e.length===+e.length){for(var n=0,i=e.length;n<i;n++)if(n in e&&t.call(r,e[n],n,e)===Et)return}else for(var o in e)if(nt.call(e,o)&&t.call(r,e[o],o,e)===Et)return}},c.extend=function(e){return c.each(de.call(arguments,1),function(t){for(var r in t)t[r]!==void 0&&(e[r]=t[r])}),e},c.isArray=fi||function(e){return Ae.call(e)==="[object Array]"},c.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch{return!1}},c.isArguments=function(e){return!!(e&&nt.call(e,"callee"))},c.toArray=function(e){return e?e.toArray?e.toArray():c.isArray(e)||c.isArguments(e)?de.call(e):c.values(e):[]},c.map=function(e,t,r){if(Tr&&e.map===Tr)return e.map(t,r);var n=[];return c.each(e,function(i){n.push(t.call(r,i))}),n},c.keys=function(e){var t=[];return e===null||c.each(e,function(r,n){t[t.length]=n}),t},c.values=function(e){var t=[];return e===null||c.each(e,function(r){t[t.length]=r}),t},c.include=function(e,t){var r=!1;return e===null?r:xr&&e.indexOf===xr?e.indexOf(t)!=-1:(c.each(e,function(n){if(r||(r=n===t))return Et}),r)},c.includes=function(e,t){return e.indexOf(t)!==-1},c.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},c.isObject=function(e){return e===Object(e)&&!c.isArray(e)},c.isEmptyObject=function(e){if(c.isObject(e)){for(var t in e)if(nt.call(e,t))return!1;return!0}return!1},c.isUndefined=function(e){return e===void 0},c.isString=function(e){return Ae.call(e)=="[object String]"},c.isDate=function(e){return Ae.call(e)=="[object Date]"},c.isNumber=function(e){return Ae.call(e)=="[object Number]"},c.isElement=function(e){return!!(e&&e.nodeType===1)},c.encodeDates=function(e){return c.each(e,function(t,r){c.isDate(t)?e[r]=c.formatDate(t):c.isObject(t)&&(e[r]=c.encodeDates(t))}),e},c.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},c.formatDate=function(e){function t(r){return r<10?"0"+r:r}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},c.strip_empty_properties=function(e){var t={};return c.each(e,function(r,n){c.isString(r)&&r.length>0&&(t[n]=r)}),t},c.truncate=function(e,t){var r;return typeof e=="string"?r=e.slice(0,t):c.isArray(e)?(r=[],c.each(e,function(n){r.push(c.truncate(n,t))})):c.isObject(e)?(r={},c.each(e,function(n,i){r[i]=c.truncate(n,t)})):r=e,r},c.JSONEncode=function(){return function(e){var t=e,r=function(i){var o=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return o.lastIndex=0,o.test(i)?'"'+i.replace(o,function(u){var a=s[u];return typeof a=="string"?a:"\\u"+("0000"+u.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},n=function(i,o){var s="",u=" ",a=0,d="",l="",f=0,p=s,h=[],g=o[i];switch(g&&typeof g=="object"&&typeof g.toJSON=="function"&&(g=g.toJSON(i)),typeof g){case"string":return r(g);case"number":return isFinite(g)?String(g):"null";case"boolean":case"null":return String(g);case"object":if(!g)return"null";if(s+=u,h=[],Ae.apply(g)==="[object Array]"){for(f=g.length,a=0;a<f;a+=1)h[a]=n(a,g)||"null";return l=h.length===0?"[]":s?`[
33
33
  `+s+h.join(`,
34
34
  `+s)+`
35
35
  `+p+"]":"["+h.join(",")+"]",s=p,l}for(d in g)nt.call(g,d)&&(l=n(d,g),l&&h.push(r(d)+(s?": ":":")+l));return l=h.length===0?"{}":s?"{"+h.join(",")+p+"}":"{"+h.join(",")+"}",s=p,l}};return n("",{"":t})}}(),c.JSONDecode=function(){var e,t,r={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`