mixpanel-browser 2.51.0 → 2.52.0

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.
@@ -4479,7 +4479,7 @@
4479
4479
 
4480
4480
  var Config = {
4481
4481
  DEBUG: false,
4482
- LIB_VERSION: '2.51.0'
4482
+ LIB_VERSION: '2.52.0'
4483
4483
  };
4484
4484
 
4485
4485
  /* 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(c,u,p,m){function f(g){return g instanceof p?g:new p(function(h){h(g)})}return new(p||(p=Promise))(function(g,h){function y(S){try{v(m.next(S))}catch(b){h(b)}}function w(S){try{v(m.throw(S))}catch(b){h(b)}}function v(S){S.done?g(S.value):f(S.value).then(y,w)}v((m=m.apply(c,u||[])).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(c){var u=new Uint8Array(c),p,m=u.length,f="";for(p=0;p<m;p+=3)f+=t[u[p]>>2],f+=t[(u[p]&3)<<4|u[p+1]>>4],f+=t[(u[p+1]&15)<<2|u[p+2]>>6],f+=t[u[p+2]&63];return m%3===2?f=f.substring(0,f.length-1)+"=":m%3===1&&(f=f.substring(0,f.length-2)+"=="),f};const o=new Map,a=new Map;function l(c,u,p){return e(this,void 0,void 0,function*(){const m=`${c}-${u}`;if("OffscreenCanvas"in globalThis){if(a.has(m))return a.get(m);const f=new OffscreenCanvas(c,u);f.getContext("2d");const h=yield(yield f.convertToBlob(p)).arrayBuffer(),y=i(h);return a.set(m,y),y}else return""})}const s=self;s.onmessage=function(c){return e(this,void 0,void 0,function*(){if("OffscreenCanvas"in globalThis){const{id:u,bitmap:p,width:m,height:f,dataURLOptions:g}=c.data,h=l(m,f,g),y=new OffscreenCanvas(m,f);y.getContext("2d").drawImage(p,0,0),p.close();const v=yield y.convertToBlob(g),S=v.type,b=yield v.arrayBuffer(),M=i(b);if(!o.has(u)&&(yield h)===M)return o.set(u,M),s.postMessage({id:u});if(o.get(u)===M)return s.postMessage({id:u});s.postMessage({id:u,type:S,base64:M,width:m,height:f}),o.set(u,M)}else return s.postMessage({id:c.data.id})})}})()},null);class Sn{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=(s,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(s)||this.pendingCanvasMutations.set(s,[]),this.pendingCanvasMutations.get(s).push(c)};const{sampling:r="all",win:n,blockClass:i,blockSelector:o,recordCanvas:a,dataURLOptions:l}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(n,i,o),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,i,o,{dataURLOptions:l})}initCanvasFPSObserver(t,r,n,i,o){const a=Vt(r,n,i,!0),l=new Map,s=new yn;s.onmessage=g=>{const{id:h}=g.data;if(l.set(h,!1),!("base64"in g.data))return;const{base64:y,type:w,width:v,height:S}=g.data;this.mutationCb({id:h,type:pe["2D"],commands:[{property:"clearRect",args:[0,0,v,S]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:w}]},0,0]}]})};const c=1e3/t;let u=0,p;const m=()=>{const g=[];return r.document.querySelectorAll("canvas").forEach(h=>{U(h,n,i,!0)||g.push(h)}),g},f=g=>{if(u&&g-u<c){p=requestAnimationFrame(f);return}u=g,m().forEach(h=>an(this,void 0,void 0,function*(){var y;const w=this.mirror.getId(h);if(l.get(w)||h.width===0||h.height===0)return;if(l.set(w,!0),["webgl","webgl2"].includes(h.__context)){const S=h.getContext(h.__context);((y=S?.getContextAttributes())===null||y===void 0?void 0:y.preserveDrawingBuffer)===!1&&S.clear(S.COLOR_BUFFER_BIT)}const v=yield createImageBitmap(h);s.postMessage({id:w,bitmap:v,width:h.width,height:h.height,dataURLOptions:o.dataURLOptions},[v])})),p=requestAnimationFrame(f)};p=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(p)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=Vt(t,r,n,!1),o=dn(this.processMutation.bind(this),t,r,n),a=hn(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{i(),o(),a()}}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(a=>sn(a,["type"])),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}}class vn{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Fr,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 a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),i.push({styleId:a,rules:Array.from(o.rules||CSSRule,(l,s)=>({rule:ft(l),index:s}))})),n.styleIds.push(a)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class bn{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 L(e){return Object.assign(Object.assign({},e),{timestamp:Te()})}let D,Pe,Ze,Fe=!1;const q=fr();function Me(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:s="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:p,maskInputOptions:m,slimDOMOptions:f,maskInputFn:g,maskTextFn:h,hooks:y,packFn:w,sampling:v={},dataURLOptions:S={},mousemoveWait:b,recordDOM:M=!0,recordCanvas:F=!1,recordCrossOriginIframes:P=!1,recordAfter:k=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:T=!1,collectFonts:j=!1,inlineImages:V=!1,plugins:x,keepIframeSrcFn:oe=()=>!1,ignoreCSSAttributes:H=new Set([]),errorHandler:ee}=e;zr(ee);const K=P?window.parent===window:!0;let $e=!1;if(!K)try{window.parent.document&&($e=!1)}catch{$e=!0}if(K&&!t)throw new Error("emit function is required");b!==void 0&&v.mousemove===void 0&&(v.mousemove=b),q.reset();const at=p===!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}:m!==void 0?m:{password:!0},lt=f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:f==="all",headMetaDescKeywords:f==="all"}:f||{};Pr();let rr,ct=0;const nr=I=>{for(const X of x||[])X.eventProcessor&&(I=X.eventProcessor(I));return w&&!$e&&(I=w(I)),I};D=(I,X)=>{var N;if(!((N=re[0])===null||N===void 0)&&N.isFrozen()&&I.type!==_.FullSnapshot&&!(I.type===_.IncrementalSnapshot&&I.data.source===C.Mutation)&&re.forEach(z=>z.unfreeze()),K)t?.(nr(I),X);else if($e){const z={type:"rrweb",event:nr(I),origin:window.location.origin,isCheckout:X};window.parent.postMessage(z,"*")}if(I.type===_.FullSnapshot)rr=I,ct=0;else if(I.type===_.IncrementalSnapshot){if(I.data.source===C.Mutation&&I.data.isAttachIframe)return;ct++;const z=n&&ct>=n,le=r&&I.timestamp-rr.timestamp>r;(z||le)&&Pe(!0)}};const Ge=I=>{D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.Mutation},I)}))},ir=I=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.Scroll},I)})),or=I=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.CanvasMutation},I)})),Wn=I=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.AdoptedStyleSheet},I)})),se=new vn({mutationCb:Ge,adoptedStyleSheetCb:Wn}),ae=new nn({mirror:q,mutationCb:Ge,stylesheetManager:se,recordCrossOriginIframes:P,wrappedEmit:D});for(const I of x||[])I.getMirror&&I.getMirror({nodeMirror:q,crossOriginIframeMirror:ae.crossOriginIframeMirror,crossOriginIframeStyleMirror:ae.crossOriginIframeStyleMirror});const ut=new bn;Ze=new Sn({recordCanvas:F,mutationCb:or,win:window,blockClass:i,blockSelector:o,mirror:q,sampling:v.canvas,dataURLOptions:S});const je=new on({mutationCb:Ge,scrollCb:ir,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:at,dataURLOptions:S,maskTextFn:h,maskInputFn:g,recordCanvas:F,inlineImages:V,sampling:v,slimDOMOptions:lt,iframeManager:ae,stylesheetManager:se,canvasManager:Ze,keepIframeSrcFn:oe,processedNodeManager:ut},mirror:q});Pe=(I=!1)=>{if(!M)return;D(L({type:_.Meta,data:{href:window.location.href,width:Ct(),height:It()}}),I),se.reset(),je.init(),re.forEach(N=>N.lock());const X=Ar(document,{mirror:q,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:at,maskTextFn:h,slimDOM:lt,dataURLOptions:S,recordCanvas:F,inlineImages:V,onSerialize:N=>{xt(N,q)&&ae.addIframe(N),Et(N,q)&&se.trackLinkElement(N),Ye(N)&&je.addShadowRoot(N.shadowRoot,document)},onIframeLoad:(N,z)=>{ae.attachIframe(N,z),je.observeAttachShadow(N)},onStylesheetLoad:(N,z)=>{se.attachLinkElement(N,z)},keepIframeSrcFn:oe});if(!X)return console.warn("Failed to snapshot the document");D(L({type:_.FullSnapshot,data:{node:X,initialOffset:Mt(window)}}),I),re.forEach(N=>N.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&se.adoptStyleSheets(document.adoptedStyleSheets,q.getId(document))};try{const I=[],X=z=>{var le;return O(rn)({mutationCb:Ge,mousemoveCb:(R,dt)=>D(L({type:_.IncrementalSnapshot,data:{source:dt,positions:R}})),mouseInteractionCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.MouseInteraction},R)})),scrollCb:ir,viewportResizeCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.ViewportResize},R)})),inputCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.Input},R)})),mediaInteractionCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.MediaInteraction},R)})),styleSheetRuleCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.StyleSheetRule},R)})),styleDeclarationCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.StyleDeclaration},R)})),canvasMutationCb:or,fontCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.Font},R)})),selectionCb:R=>{D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.Selection},R)}))},customElementCb:R=>{D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.CustomElement},R)}))},blockClass:i,ignoreClass:a,ignoreSelector:l,maskTextClass:s,maskTextSelector:c,maskInputOptions:at,inlineStylesheet:u,sampling:v,recordDOM:M,recordCanvas:F,inlineImages:V,userTriggeredOnInput:T,collectFonts:j,doc:z,maskInputFn:g,maskTextFn:h,keepIframeSrcFn:oe,blockSelector:o,slimDOMOptions:lt,dataURLOptions:S,mirror:q,iframeManager:ae,stylesheetManager:se,shadowDomManager:je,processedNodeManager:ut,canvasManager:Ze,ignoreCSSAttributes:H,plugins:((le=x?.filter(R=>R.observer))===null||le===void 0?void 0:le.map(R=>({observer:R.observer,options:R.options,callback:dt=>D(L({type:_.Plugin,data:{plugin:R.name,payload:dt}}))})))||[]},y)};ae.addLoadListener(z=>{try{I.push(X(z.contentDocument))}catch(le){console.warn(le)}});const N=()=>{Pe(),I.push(X(document)),Fe=!0};return document.readyState==="interactive"||document.readyState==="complete"?N():(I.push(W("DOMContentLoaded",()=>{D(L({type:_.DomContentLoaded,data:{}})),k==="DOMContentLoaded"&&N()})),I.push(W("load",()=>{D(L({type:_.Load,data:{}})),k==="load"&&N()},window))),()=>{I.forEach(z=>z()),ut.destroy(),Fe=!1,$r()}}catch(I){console.warn(I)}}Me.addCustomEvent=(e,t)=>{if(!Fe)throw new Error("please add custom event after start recording");D(L({type:_.Custom,data:{tag:e,payload:t}}))},Me.freezePage=()=>{re.forEach(e=>e.freeze())},Me.takeFullSnapshot=e=>{if(!Fe)throw new Error("please take full snapshot after start recording");Pe(e)},Me.mirror=q;var wn={DEBUG:!1,LIB_VERSION:"2.51.0"},B;if(typeof window>"u"){var Jt={hostname:""};B={navigator:{userAgent:""},document:{location:Jt,referrer:""},screen:{width:0,height:0},location:Jt}}else B=window;var Be=24*60*60*1e3,We=Array.prototype,Mn=Function.prototype,Xt=Object.prototype,ne=We.slice,Ie=Xt.toString,Ue=Xt.hasOwnProperty,Ce=B.console,Oe=B.navigator,G=B.document,He=B.opera,ze=B.screen,ie=Oe.userAgent,et=Mn.bind,Kt=We.forEach,Yt=We.indexOf,Qt=We.map,In=Array.isArray,tt={},d={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},J={log:function(){},warn:function(){},error:function(){},critical:function(){if(!d.isUndefined(Ce)&&Ce){var e=["Mixpanel error:"].concat(d.toArray(arguments));try{Ce.error.apply(Ce,e)}catch{d.each(e,function(r){Ce.error(r)})}}}},rt=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(J,arguments)}},Cn=function(e){return{log:rt(J.log,e),error:rt(J.error,e),critical:rt(J.critical,e)}};d.bind=function(e,t){var r,n;if(et&&e.bind===et)return et.apply(e,ne.call(arguments,1));if(!d.isFunction(e))throw new TypeError;return r=ne.call(arguments,2),n=function(){if(!(this instanceof n))return e.apply(t,r.concat(ne.call(arguments)));var i={};i.prototype=e.prototype;var o=new i;i.prototype=null;var a=e.apply(o,r.concat(ne.call(arguments)));return Object(a)===a?a:o},n},d.each=function(e,t,r){if(e!=null){if(Kt&&e.forEach===Kt)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)===tt)return}else for(var o in e)if(Ue.call(e,o)&&t.call(r,e[o],o,e)===tt)return}},d.extend=function(e){return d.each(ne.call(arguments,1),function(t){for(var r in t)t[r]!==void 0&&(e[r]=t[r])}),e},d.isArray=In||function(e){return Ie.call(e)==="[object Array]"},d.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch{return!1}},d.isArguments=function(e){return!!(e&&Ue.call(e,"callee"))},d.toArray=function(e){return e?e.toArray?e.toArray():d.isArray(e)||d.isArguments(e)?ne.call(e):d.values(e):[]},d.map=function(e,t,r){if(Qt&&e.map===Qt)return e.map(t,r);var n=[];return d.each(e,function(i){n.push(t.call(r,i))}),n},d.keys=function(e){var t=[];return e===null||d.each(e,function(r,n){t[t.length]=n}),t},d.values=function(e){var t=[];return e===null||d.each(e,function(r){t[t.length]=r}),t},d.include=function(e,t){var r=!1;return e===null?r:Yt&&e.indexOf===Yt?e.indexOf(t)!=-1:(d.each(e,function(n){if(r||(r=n===t))return tt}),r)},d.includes=function(e,t){return e.indexOf(t)!==-1},d.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},d.isObject=function(e){return e===Object(e)&&!d.isArray(e)},d.isEmptyObject=function(e){if(d.isObject(e)){for(var t in e)if(Ue.call(e,t))return!1;return!0}return!1},d.isUndefined=function(e){return e===void 0},d.isString=function(e){return Ie.call(e)=="[object String]"},d.isDate=function(e){return Ie.call(e)=="[object Date]"},d.isNumber=function(e){return Ie.call(e)=="[object Number]"},d.isElement=function(e){return!!(e&&e.nodeType===1)},d.encodeDates=function(e){return d.each(e,function(t,r){d.isDate(t)?e[r]=d.formatDate(t):d.isObject(t)&&(e[r]=d.encodeDates(t))}),e},d.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},d.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())},d.strip_empty_properties=function(e){var t={};return d.each(e,function(r,n){d.isString(r)&&r.length>0&&(t[n]=r)}),t},d.truncate=function(e,t){var r;return typeof e=="string"?r=e.slice(0,t):d.isArray(e)?(r=[],d.each(e,function(n){r.push(d.truncate(n,t))})):d.isObject(e)?(r={},d.each(e,function(n,i){r[i]=d.truncate(n,t)})):r=e,r},d.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,a={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return o.lastIndex=0,o.test(i)?'"'+i.replace(o,function(l){var s=a[l];return typeof s=="string"?s:"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},n=function(i,o){var a="",l=" ",s=0,c="",u="",p=0,m=a,f=[],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(a+=l,f=[],Ie.apply(g)==="[object Array]"){for(p=g.length,s=0;s<p;s+=1)f[s]=n(s,g)||"null";return u=f.length===0?"[]":a?`[
32
+ ***************************************************************************** */function e(c,u,p,m){function f(g){return g instanceof p?g:new p(function(h){h(g)})}return new(p||(p=Promise))(function(g,h){function y(S){try{v(m.next(S))}catch(b){h(b)}}function w(S){try{v(m.throw(S))}catch(b){h(b)}}function v(S){S.done?g(S.value):f(S.value).then(y,w)}v((m=m.apply(c,u||[])).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(c){var u=new Uint8Array(c),p,m=u.length,f="";for(p=0;p<m;p+=3)f+=t[u[p]>>2],f+=t[(u[p]&3)<<4|u[p+1]>>4],f+=t[(u[p+1]&15)<<2|u[p+2]>>6],f+=t[u[p+2]&63];return m%3===2?f=f.substring(0,f.length-1)+"=":m%3===1&&(f=f.substring(0,f.length-2)+"=="),f};const o=new Map,a=new Map;function l(c,u,p){return e(this,void 0,void 0,function*(){const m=`${c}-${u}`;if("OffscreenCanvas"in globalThis){if(a.has(m))return a.get(m);const f=new OffscreenCanvas(c,u);f.getContext("2d");const h=yield(yield f.convertToBlob(p)).arrayBuffer(),y=i(h);return a.set(m,y),y}else return""})}const s=self;s.onmessage=function(c){return e(this,void 0,void 0,function*(){if("OffscreenCanvas"in globalThis){const{id:u,bitmap:p,width:m,height:f,dataURLOptions:g}=c.data,h=l(m,f,g),y=new OffscreenCanvas(m,f);y.getContext("2d").drawImage(p,0,0),p.close();const v=yield y.convertToBlob(g),S=v.type,b=yield v.arrayBuffer(),M=i(b);if(!o.has(u)&&(yield h)===M)return o.set(u,M),s.postMessage({id:u});if(o.get(u)===M)return s.postMessage({id:u});s.postMessage({id:u,type:S,base64:M,width:m,height:f}),o.set(u,M)}else return s.postMessage({id:c.data.id})})}})()},null);class Sn{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=(s,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(s)||this.pendingCanvasMutations.set(s,[]),this.pendingCanvasMutations.get(s).push(c)};const{sampling:r="all",win:n,blockClass:i,blockSelector:o,recordCanvas:a,dataURLOptions:l}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(n,i,o),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,i,o,{dataURLOptions:l})}initCanvasFPSObserver(t,r,n,i,o){const a=Vt(r,n,i,!0),l=new Map,s=new yn;s.onmessage=g=>{const{id:h}=g.data;if(l.set(h,!1),!("base64"in g.data))return;const{base64:y,type:w,width:v,height:S}=g.data;this.mutationCb({id:h,type:pe["2D"],commands:[{property:"clearRect",args:[0,0,v,S]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:w}]},0,0]}]})};const c=1e3/t;let u=0,p;const m=()=>{const g=[];return r.document.querySelectorAll("canvas").forEach(h=>{U(h,n,i,!0)||g.push(h)}),g},f=g=>{if(u&&g-u<c){p=requestAnimationFrame(f);return}u=g,m().forEach(h=>an(this,void 0,void 0,function*(){var y;const w=this.mirror.getId(h);if(l.get(w)||h.width===0||h.height===0)return;if(l.set(w,!0),["webgl","webgl2"].includes(h.__context)){const S=h.getContext(h.__context);((y=S?.getContextAttributes())===null||y===void 0?void 0:y.preserveDrawingBuffer)===!1&&S.clear(S.COLOR_BUFFER_BIT)}const v=yield createImageBitmap(h);s.postMessage({id:w,bitmap:v,width:h.width,height:h.height,dataURLOptions:o.dataURLOptions},[v])})),p=requestAnimationFrame(f)};p=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(p)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=Vt(t,r,n,!1),o=dn(this.processMutation.bind(this),t,r,n),a=hn(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{i(),o(),a()}}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(a=>sn(a,["type"])),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}}class vn{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Fr,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 a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),i.push({styleId:a,rules:Array.from(o.rules||CSSRule,(l,s)=>({rule:ft(l),index:s}))})),n.styleIds.push(a)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class bn{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 L(e){return Object.assign(Object.assign({},e),{timestamp:Te()})}let D,Pe,Ze,Fe=!1;const q=fr();function Me(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:s="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:p,maskInputOptions:m,slimDOMOptions:f,maskInputFn:g,maskTextFn:h,hooks:y,packFn:w,sampling:v={},dataURLOptions:S={},mousemoveWait:b,recordDOM:M=!0,recordCanvas:F=!1,recordCrossOriginIframes:P=!1,recordAfter:k=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:T=!1,collectFonts:j=!1,inlineImages:V=!1,plugins:x,keepIframeSrcFn:oe=()=>!1,ignoreCSSAttributes:H=new Set([]),errorHandler:ee}=e;zr(ee);const K=P?window.parent===window:!0;let $e=!1;if(!K)try{window.parent.document&&($e=!1)}catch{$e=!0}if(K&&!t)throw new Error("emit function is required");b!==void 0&&v.mousemove===void 0&&(v.mousemove=b),q.reset();const at=p===!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}:m!==void 0?m:{password:!0},lt=f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:f==="all",headMetaDescKeywords:f==="all"}:f||{};Pr();let rr,ct=0;const nr=I=>{for(const X of x||[])X.eventProcessor&&(I=X.eventProcessor(I));return w&&!$e&&(I=w(I)),I};D=(I,X)=>{var N;if(!((N=re[0])===null||N===void 0)&&N.isFrozen()&&I.type!==_.FullSnapshot&&!(I.type===_.IncrementalSnapshot&&I.data.source===C.Mutation)&&re.forEach(z=>z.unfreeze()),K)t?.(nr(I),X);else if($e){const z={type:"rrweb",event:nr(I),origin:window.location.origin,isCheckout:X};window.parent.postMessage(z,"*")}if(I.type===_.FullSnapshot)rr=I,ct=0;else if(I.type===_.IncrementalSnapshot){if(I.data.source===C.Mutation&&I.data.isAttachIframe)return;ct++;const z=n&&ct>=n,le=r&&I.timestamp-rr.timestamp>r;(z||le)&&Pe(!0)}};const Ge=I=>{D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.Mutation},I)}))},ir=I=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.Scroll},I)})),or=I=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.CanvasMutation},I)})),Wn=I=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.AdoptedStyleSheet},I)})),se=new vn({mutationCb:Ge,adoptedStyleSheetCb:Wn}),ae=new nn({mirror:q,mutationCb:Ge,stylesheetManager:se,recordCrossOriginIframes:P,wrappedEmit:D});for(const I of x||[])I.getMirror&&I.getMirror({nodeMirror:q,crossOriginIframeMirror:ae.crossOriginIframeMirror,crossOriginIframeStyleMirror:ae.crossOriginIframeStyleMirror});const ut=new bn;Ze=new Sn({recordCanvas:F,mutationCb:or,win:window,blockClass:i,blockSelector:o,mirror:q,sampling:v.canvas,dataURLOptions:S});const je=new on({mutationCb:Ge,scrollCb:ir,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:at,dataURLOptions:S,maskTextFn:h,maskInputFn:g,recordCanvas:F,inlineImages:V,sampling:v,slimDOMOptions:lt,iframeManager:ae,stylesheetManager:se,canvasManager:Ze,keepIframeSrcFn:oe,processedNodeManager:ut},mirror:q});Pe=(I=!1)=>{if(!M)return;D(L({type:_.Meta,data:{href:window.location.href,width:Ct(),height:It()}}),I),se.reset(),je.init(),re.forEach(N=>N.lock());const X=Ar(document,{mirror:q,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:at,maskTextFn:h,slimDOM:lt,dataURLOptions:S,recordCanvas:F,inlineImages:V,onSerialize:N=>{xt(N,q)&&ae.addIframe(N),Et(N,q)&&se.trackLinkElement(N),Ye(N)&&je.addShadowRoot(N.shadowRoot,document)},onIframeLoad:(N,z)=>{ae.attachIframe(N,z),je.observeAttachShadow(N)},onStylesheetLoad:(N,z)=>{se.attachLinkElement(N,z)},keepIframeSrcFn:oe});if(!X)return console.warn("Failed to snapshot the document");D(L({type:_.FullSnapshot,data:{node:X,initialOffset:Mt(window)}}),I),re.forEach(N=>N.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&se.adoptStyleSheets(document.adoptedStyleSheets,q.getId(document))};try{const I=[],X=z=>{var le;return O(rn)({mutationCb:Ge,mousemoveCb:(R,dt)=>D(L({type:_.IncrementalSnapshot,data:{source:dt,positions:R}})),mouseInteractionCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.MouseInteraction},R)})),scrollCb:ir,viewportResizeCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.ViewportResize},R)})),inputCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.Input},R)})),mediaInteractionCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.MediaInteraction},R)})),styleSheetRuleCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.StyleSheetRule},R)})),styleDeclarationCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.StyleDeclaration},R)})),canvasMutationCb:or,fontCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.Font},R)})),selectionCb:R=>{D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.Selection},R)}))},customElementCb:R=>{D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.CustomElement},R)}))},blockClass:i,ignoreClass:a,ignoreSelector:l,maskTextClass:s,maskTextSelector:c,maskInputOptions:at,inlineStylesheet:u,sampling:v,recordDOM:M,recordCanvas:F,inlineImages:V,userTriggeredOnInput:T,collectFonts:j,doc:z,maskInputFn:g,maskTextFn:h,keepIframeSrcFn:oe,blockSelector:o,slimDOMOptions:lt,dataURLOptions:S,mirror:q,iframeManager:ae,stylesheetManager:se,shadowDomManager:je,processedNodeManager:ut,canvasManager:Ze,ignoreCSSAttributes:H,plugins:((le=x?.filter(R=>R.observer))===null||le===void 0?void 0:le.map(R=>({observer:R.observer,options:R.options,callback:dt=>D(L({type:_.Plugin,data:{plugin:R.name,payload:dt}}))})))||[]},y)};ae.addLoadListener(z=>{try{I.push(X(z.contentDocument))}catch(le){console.warn(le)}});const N=()=>{Pe(),I.push(X(document)),Fe=!0};return document.readyState==="interactive"||document.readyState==="complete"?N():(I.push(W("DOMContentLoaded",()=>{D(L({type:_.DomContentLoaded,data:{}})),k==="DOMContentLoaded"&&N()})),I.push(W("load",()=>{D(L({type:_.Load,data:{}})),k==="load"&&N()},window))),()=>{I.forEach(z=>z()),ut.destroy(),Fe=!1,$r()}}catch(I){console.warn(I)}}Me.addCustomEvent=(e,t)=>{if(!Fe)throw new Error("please add custom event after start recording");D(L({type:_.Custom,data:{tag:e,payload:t}}))},Me.freezePage=()=>{re.forEach(e=>e.freeze())},Me.takeFullSnapshot=e=>{if(!Fe)throw new Error("please take full snapshot after start recording");Pe(e)},Me.mirror=q;var wn={DEBUG:!1,LIB_VERSION:"2.52.0"},B;if(typeof window>"u"){var Jt={hostname:""};B={navigator:{userAgent:""},document:{location:Jt,referrer:""},screen:{width:0,height:0},location:Jt}}else B=window;var Be=24*60*60*1e3,We=Array.prototype,Mn=Function.prototype,Xt=Object.prototype,ne=We.slice,Ie=Xt.toString,Ue=Xt.hasOwnProperty,Ce=B.console,Oe=B.navigator,G=B.document,He=B.opera,ze=B.screen,ie=Oe.userAgent,et=Mn.bind,Kt=We.forEach,Yt=We.indexOf,Qt=We.map,In=Array.isArray,tt={},d={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},J={log:function(){},warn:function(){},error:function(){},critical:function(){if(!d.isUndefined(Ce)&&Ce){var e=["Mixpanel error:"].concat(d.toArray(arguments));try{Ce.error.apply(Ce,e)}catch{d.each(e,function(r){Ce.error(r)})}}}},rt=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(J,arguments)}},Cn=function(e){return{log:rt(J.log,e),error:rt(J.error,e),critical:rt(J.critical,e)}};d.bind=function(e,t){var r,n;if(et&&e.bind===et)return et.apply(e,ne.call(arguments,1));if(!d.isFunction(e))throw new TypeError;return r=ne.call(arguments,2),n=function(){if(!(this instanceof n))return e.apply(t,r.concat(ne.call(arguments)));var i={};i.prototype=e.prototype;var o=new i;i.prototype=null;var a=e.apply(o,r.concat(ne.call(arguments)));return Object(a)===a?a:o},n},d.each=function(e,t,r){if(e!=null){if(Kt&&e.forEach===Kt)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)===tt)return}else for(var o in e)if(Ue.call(e,o)&&t.call(r,e[o],o,e)===tt)return}},d.extend=function(e){return d.each(ne.call(arguments,1),function(t){for(var r in t)t[r]!==void 0&&(e[r]=t[r])}),e},d.isArray=In||function(e){return Ie.call(e)==="[object Array]"},d.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch{return!1}},d.isArguments=function(e){return!!(e&&Ue.call(e,"callee"))},d.toArray=function(e){return e?e.toArray?e.toArray():d.isArray(e)||d.isArguments(e)?ne.call(e):d.values(e):[]},d.map=function(e,t,r){if(Qt&&e.map===Qt)return e.map(t,r);var n=[];return d.each(e,function(i){n.push(t.call(r,i))}),n},d.keys=function(e){var t=[];return e===null||d.each(e,function(r,n){t[t.length]=n}),t},d.values=function(e){var t=[];return e===null||d.each(e,function(r){t[t.length]=r}),t},d.include=function(e,t){var r=!1;return e===null?r:Yt&&e.indexOf===Yt?e.indexOf(t)!=-1:(d.each(e,function(n){if(r||(r=n===t))return tt}),r)},d.includes=function(e,t){return e.indexOf(t)!==-1},d.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},d.isObject=function(e){return e===Object(e)&&!d.isArray(e)},d.isEmptyObject=function(e){if(d.isObject(e)){for(var t in e)if(Ue.call(e,t))return!1;return!0}return!1},d.isUndefined=function(e){return e===void 0},d.isString=function(e){return Ie.call(e)=="[object String]"},d.isDate=function(e){return Ie.call(e)=="[object Date]"},d.isNumber=function(e){return Ie.call(e)=="[object Number]"},d.isElement=function(e){return!!(e&&e.nodeType===1)},d.encodeDates=function(e){return d.each(e,function(t,r){d.isDate(t)?e[r]=d.formatDate(t):d.isObject(t)&&(e[r]=d.encodeDates(t))}),e},d.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},d.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())},d.strip_empty_properties=function(e){var t={};return d.each(e,function(r,n){d.isString(r)&&r.length>0&&(t[n]=r)}),t},d.truncate=function(e,t){var r;return typeof e=="string"?r=e.slice(0,t):d.isArray(e)?(r=[],d.each(e,function(n){r.push(d.truncate(n,t))})):d.isObject(e)?(r={},d.each(e,function(n,i){r[i]=d.truncate(n,t)})):r=e,r},d.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,a={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return o.lastIndex=0,o.test(i)?'"'+i.replace(o,function(l){var s=a[l];return typeof s=="string"?s:"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},n=function(i,o){var a="",l=" ",s=0,c="",u="",p=0,m=a,f=[],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(a+=l,f=[],Ie.apply(g)==="[object Array]"){for(p=g.length,s=0;s<p;s+=1)f[s]=n(s,g)||"null";return u=f.length===0?"[]":a?`[
33
33
  `+a+f.join(`,
34
34
  `+a)+`
35
35
  `+m+"]":"["+f.join(",")+"]",a=m,u}for(c in g)Ue.call(g,c)&&(u=n(c,g),u&&f.push(r(c)+(a?": ":":")+u));return u=f.length===0?"{}":a?"{"+f.join(",")+m+"}":"{"+f.join(",")+"}",a=m,u}};return n("",{"":t})}}(),d.JSONDecode=function(){var e,t,r={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
@@ -2,7 +2,7 @@ define((function () { 'use strict';
2
2
 
3
3
  var Config = {
4
4
  DEBUG: false,
5
- LIB_VERSION: '2.51.0'
5
+ LIB_VERSION: '2.52.0'
6
6
  };
7
7
 
8
8
  /* eslint camelcase: "off", eqeqeq: "off" */
@@ -4172,7 +4172,7 @@ define((function () { 'use strict';
4172
4172
  'track_pageview': false,
4173
4173
  'skip_first_touch_marketing': false,
4174
4174
  'store_google': true,
4175
- 'stop_utm_persistence': true,
4175
+ 'stop_utm_persistence': false,
4176
4176
  'save_referrer': true,
4177
4177
  'test': false,
4178
4178
  'verbose': false,
@@ -2,7 +2,7 @@
2
2
 
3
3
  var Config = {
4
4
  DEBUG: false,
5
- LIB_VERSION: '2.51.0'
5
+ LIB_VERSION: '2.52.0'
6
6
  };
7
7
 
8
8
  /* eslint camelcase: "off", eqeqeq: "off" */
@@ -4172,7 +4172,7 @@ var DEFAULT_CONFIG = {
4172
4172
  'track_pageview': false,
4173
4173
  'skip_first_touch_marketing': false,
4174
4174
  'store_google': true,
4175
- 'stop_utm_persistence': true,
4175
+ 'stop_utm_persistence': false,
4176
4176
  'save_referrer': true,
4177
4177
  'test': false,
4178
4178
  'verbose': false,
@@ -3,7 +3,7 @@
3
3
 
4
4
  var Config = {
5
5
  DEBUG: false,
6
- LIB_VERSION: '2.51.0'
6
+ LIB_VERSION: '2.52.0'
7
7
  };
8
8
 
9
9
  /* eslint camelcase: "off", eqeqeq: "off" */
@@ -4173,7 +4173,7 @@
4173
4173
  'track_pageview': false,
4174
4174
  'skip_first_touch_marketing': false,
4175
4175
  'store_google': true,
4176
- 'stop_utm_persistence': true,
4176
+ 'stop_utm_persistence': false,
4177
4177
  'save_referrer': true,
4178
4178
  'test': false,
4179
4179
  'verbose': false,
@@ -39,7 +39,7 @@ ma:function(a,b,d){return d||c.i(a," OPR/")?c.i(a,"Mini")?"Opera Mini":"Opera":/
39
39
  c.i(a,"Android")?"Android Mobile":c.i(a,"Konqueror")?"Konqueror":c.i(a,"Firefox")?"Firefox":c.i(a,"MSIE")||c.i(a,"Trident/")?"Internet Explorer":c.i(a,"Gecko")?"Mozilla":""},Ia:function(a,b,d){b={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,
40
40
  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+)?)/}[c.info.ma(a,b,d)];if(b===l)return r;a=a.match(b);return!a?r:parseFloat(a[a.length-2])},Nb:function(){return/Windows/i.test(z)?/Phone/.test(z)||/WPDesktop/.test(z)?"Windows Phone":"Windows":
41
41
  /(iPhone|iPad|iPod)/.test(z)?"iOS":/Android/.test(z)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(z)?"BlackBerry":/Mac/i.test(z)?"Mac OS X":/Linux/.test(z)?"Linux":/CrOS/.test(z)?"Chrome OS":""},Bb:function(a){return/Windows Phone/i.test(a)||/WPDesktop/.test(a)?"Windows Phone":/iPad/.test(a)?"iPad":/iPod/.test(a)?"iPod Touch":/iPhone/.test(a)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(a)?"BlackBerry":/Android/.test(a)?"Android":""},Sb:function(a){a=a.split("/");return 3<=a.length?a[2]:""},La:function(){return n.location.href},
42
- aa:function(a){"object"!==typeof a&&(a={});return c.extend(c.fa({$os:c.info.Nb(),$browser:c.info.ma(z,I.vendor,Y),$referrer:t.referrer,$referring_domain:c.info.Sb(t.referrer),$device:c.info.Bb(z)}),{$current_url:c.info.La(),$browser_version:c.info.Ia(z,I.vendor,Y),$screen_height:Z.height,$screen_width:Z.width,mp_lib:"web",$lib_version:"2.51.0",$insert_id:ea(),time:c.timestamp()/1E3},c.fa(a))},Sc:function(){return c.extend(c.fa({$os:c.info.Nb(),$browser:c.info.ma(z,I.vendor,Y)}),{$browser_version:c.info.Ia(z,
42
+ aa:function(a){"object"!==typeof a&&(a={});return c.extend(c.fa({$os:c.info.Nb(),$browser:c.info.ma(z,I.vendor,Y),$referrer:t.referrer,$referring_domain:c.info.Sb(t.referrer),$device:c.info.Bb(z)}),{$current_url:c.info.La(),$browser_version:c.info.Ia(z,I.vendor,Y),$screen_height:Z.height,$screen_width:Z.width,mp_lib:"web",$lib_version:"2.52.0",$insert_id:ea(),time:c.timestamp()/1E3},c.fa(a))},Sc:function(){return c.extend(c.fa({$os:c.info.Nb(),$browser:c.info.ma(z,I.vendor,Y)}),{$browser_version:c.info.Ia(z,
43
43
  I.vendor,Y)})},Pc:function(){return c.fa({current_page_title:t.title,current_domain:n.location.hostname,current_url_path:n.location.pathname,current_url_protocol:n.location.protocol,current_url_search:n.location.search})}};var Ga=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,Fa=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,$=r,aa=r;if("undefined"!==typeof JSON)$=JSON.stringify,aa=JSON.parse;$=$||c.ha;aa=aa||c.S;c.toArray=c.O;c.isObject=c.e;c.JSONEncode=c.ha;c.JSONDecode=c.S;c.isBlockedUA=c.Ib;c.isEmptyObject=c.ra;c.info=
44
44
  c.info;c.info.device=c.info.Bb;c.info.browser=c.info.ma;c.info.browserVersion=c.info.Ia;c.info.properties=c.info.aa;E.prototype.oa=function(){};E.prototype.Oa=function(){};E.prototype.Ga=function(){};E.prototype.Ua=function(a){this.Kb=a;return this};E.prototype.o=function(a,b,d,f){var h=this,g=c.Cc(a);if(0===g.length)o.error("The DOM query ("+a+") returned 0 elements");else return c.a(g,function(a){c.Tb(a,this.Ob,function(a){var c={},g=h.oa(d,this),e=h.Kb.c("track_links_timeout");h.Oa(a,this,c);window.setTimeout(h.gc(f,
45
45
  g,c,m),e);h.Kb.o(b,g,h.gc(f,g,c))})},this),m};E.prototype.gc=function(a,b,c,f){var f=f||D,h=this;return function(){if(!c.zc)c.zc=m,a&&a(f,b)===D||h.Ga(b,c,f)}};E.prototype.oa=function(a,b){return"function"===typeof a?a(b):c.extend({},a)};c.Hb(M,E);M.prototype.oa=function(a,b){var c=M.md.oa.apply(this,arguments);if(b.href)c.url=b.href;return c};M.prototype.Oa=function(a,b,c){c.Lb=2===a.which||a.metaKey||a.ctrlKey||"_blank"===b.target;c.href=b.href;c.Lb||a.preventDefault()};M.prototype.Ga=function(a,
@@ -50,7 +50,7 @@ a);d&&d(D)},this),this.ua)};G.prototype.Ec=function(a){var b=this.H.slice(0,a);i
50
50
  c[f];if(e.id&&d[e.id])return this.h("Item not removed from storage"),D}}catch(k){this.h("Error removing items",a),b=D}return b},this);this.Xa.hb(function(){var a=f();b&&b(a)},c.bind(function(a){var c=D;this.h("Error acquiring storage lock",a);if(!U(this.j,m)&&(c=f(),!c))try{this.j.removeItem(this.N)}catch(d){this.h("Error clearing queue",d)}b&&b(c)},this),this.ua)};G.prototype.vd=function(a){this.H=na(this.H,a);this.Xa.hb(c.bind(function(){try{var b=this.da(),b=na(b,a);this.$a(b)}catch(c){this.h("Error updating items",
51
51
  a)}},this),c.bind(function(a){this.h("Error acquiring storage lock",a)},this),this.ua)};G.prototype.da=function(){var a;try{if(a=this.j.getItem(this.N))a=aa(a),c.isArray(a)||(this.h("Invalid storage entry:",a),a=r)}catch(b){this.h("Error retrieving queue",b),a=r}return a||[]};G.prototype.$a=function(a){try{return this.j.setItem(this.N,$(a)),m}catch(b){return this.h("Error saving queue",b),D}};G.prototype.clear=function(){this.H=[];this.j.removeItem(this.N)};var R=ga("batch");C.prototype.Na=function(a,
52
52
  b){this.ba.Na(a,this.pa,b)};C.prototype.start=function(){this.va=D;this.Ja=0;this.flush()};C.prototype.stop=function(){this.va=m;if(this.cb)clearTimeout(this.cb),this.cb=r};C.prototype.clear=function(){this.ba.clear()};C.prototype.Wb=function(){this.D=this.B.batch_size};C.prototype.ea=function(){this.Xb(this.B.batch_flush_interval_ms)};C.prototype.Xb=function(a){this.pa=a;if(!this.va)this.cb=setTimeout(c.bind(this.flush,this),this.pa)};C.prototype.flush=function(a){try{if(this.Vb)R.log("Flush: Request already in progress");
53
- else{var a=a||{},b=this.B.batch_request_timeout_ms,d=(new Date).getTime(),f=this.D,h=this.ba.Ec(f),e=[],v={};c.a(h,function(a){var b=a.payload;this.la&&!a.Rc&&(b=this.la(b));if(b){b.event&&b.properties&&(b.properties=c.extend({},b.properties,{mp_sent_by_lib_version:"2.51.0"}));var d=m,f=a.id;if(f){if(5<(this.G[f]||0))this.h("[dupe] item ID sent too many times, not sending",{item:a,D:h.length,od:this.G[f]}),d=D}else this.h("[dupe] found item with no ID",{item:a});d&&e.push(b)}v[a.id]=b},this);if(1>
53
+ else{var a=a||{},b=this.B.batch_request_timeout_ms,d=(new Date).getTime(),f=this.D,h=this.ba.Ec(f),e=[],v={};c.a(h,function(a){var b=a.payload;this.la&&!a.Rc&&(b=this.la(b));if(b){b.event&&b.properties&&(b.properties=c.extend({},b.properties,{mp_sent_by_lib_version:"2.52.0"}));var d=m,f=a.id;if(f){if(5<(this.G[f]||0))this.h("[dupe] item ID sent too many times, not sending",{item:a,D:h.length,od:this.G[f]}),d=D}else this.h("[dupe] found item with no ID",{item:a});d&&e.push(b)}v[a.id]=b},this);if(1>
54
54
  e.length)this.ea();else{this.Vb=m;var i=c.bind(function(e){this.Vb=D;try{var g=D;if(a.ic)this.ba.vd(v);else if(c.e(e)&&"timeout"===e.error&&(new Date).getTime()-d>=b)this.h("Network timeout; retrying"),this.flush();else if(c.e(e)&&e.R&&(500<=e.R.status||429===e.R.status||"timeout"===e.error)){var i=2*this.pa,k=e.R.responseHeaders;if(k){var j=k["Retry-After"];j&&(i=1E3*parseInt(j,10)||i)}i=Math.min(6E5,i);this.h("Error; retry in "+i+" ms");this.Xb(i)}else if(c.e(e)&&e.R&&413===e.R.status)if(1<h.length){var p=
55
55
  Math.max(1,Math.floor(f/2));this.D=Math.min(this.D,p,h.length-1);this.h("413 response; reducing batch size to "+this.D);this.ea()}else this.h("Single-event request too large; dropping",h),this.Wb(),g=m;else g=m;g&&(this.ba.Tc(c.map(h,function(a){return a.id}),c.bind(function(a){a?(this.Ja=0,this.flush()):(this.h("Failed to remove items from queue"),5<++this.Ja?(this.h("Too many queue failures; disabling batching system."),this.jd()):this.ea())},this)),c.a(h,c.bind(function(a){var b=a.id;b?(this.G[b]=
56
56
  this.G[b]||0,this.G[b]++,5<this.G[b]&&this.h("[dupe] item ID sent too many times",{item:a,D:h.length,od:this.G[b]})):this.h("[dupe] found item with no ID while removing",{item:a})},this)))}catch(n){this.h("Error handling API response",n),this.ea()}},this),k={method:"POST",mc:m,Jc:m,fc:b};if(a.ic)k.fb="sendBeacon";R.log("MIXPANEL REQUEST:",e);this.Zc(e,k,i)}}}catch(j){this.h("Error flushing request queue",j),this.ea()}};C.prototype.h=function(a,b){R.error.apply(R.error,arguments);if(this.J)try{b instanceof
@@ -74,7 +74,7 @@ a?m:D,this.remove(),this.save()};q.prototype.q=function(a,b){var d=this.ja(a),f=
74
74
  m}):"__mpa"===d?(c.a(f,function(a,b){b in e?e[b]+=a:(b in i||(i[b]=0),i[b]+=a)},this),this.v("$unset",f)):"__mpu"===d?(c.a(f,function(a,b){c.isArray(a)&&(b in k||(k[b]=[]),k[b]=k[b].concat(a))}),this.v("$unset",f)):"__mpr"===d?(p.push(f),this.v("$append",f)):"__mpap"===d&&(n.push(f),this.v("$unset",f));o.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):");o.log(b);this.save()};q.prototype.v=function(a,b){var d=this.props[this.ja(a)];c.g(d)||c.a(b,function(b,e){"$append"===a||"$remove"===a?
75
75
  c.a(d,function(a){a[e]===b&&delete a[e]}):delete d[e]},this)};q.prototype.$=function(a){return this.ta(this.ja(a))};q.prototype.ja=function(a){if("$set"===a)return"__mps";if("$set_once"===a)return"__mpso";if("$unset"===a)return"__mpus";if("$add"===a)return"__mpa";if("$append"===a)return"__mpap";if("$remove"===a)return"__mpr";if("$union"===a)return"__mpu";o.error("Invalid queue:",a)};q.prototype.C=function(a,b){var d=this.ja(a),b=c.g(b)?{}:b;return this.props[d]||(this.props[d]=b)};q.prototype.ed=
76
76
  function(a){var b=(new Date).getTime(),c=this.ta("__timers")||{};c[a]=b;this.props.__timers=c;this.save()};q.prototype.Uc=function(a){var b=(this.ta("__timers")||{})[a];c.g(b)||(delete this.props.__timers[a],this.save());return b};var ca,x,O=n.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,ma=!O&&-1===z.indexOf("MSIE")&&-1===z.indexOf("Mozilla"),ba=r;I.sendBeacon&&(ba=function(){return I.sendBeacon.apply(I,arguments)});var A={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},
77
- za={api_host:"https://api-js.mixpanel.com",api_routes:A,api_method:"POST",api_transport:"XHR",api_payload_format:"base64",app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:D,cross_subdomain_cookie:m,error_reporter:P,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:P,mp_loader:r,track_marketing:m,track_pageview:D,skip_first_touch_marketing:D,store_google:m,stop_utm_persistence:m,save_referrer:m,test:D,verbose:D,img:D,debug:D,track_links_timeout:300,
77
+ za={api_host:"https://api-js.mixpanel.com",api_routes:A,api_method:"POST",api_transport:"XHR",api_payload_format:"base64",app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:D,cross_subdomain_cookie:m,error_reporter:P,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:P,mp_loader:r,track_marketing:m,track_pageview:D,skip_first_touch_marketing:D,store_google:m,stop_utm_persistence:D,save_referrer:m,test:D,verbose:D,img:D,debug:D,track_links_timeout:300,
78
78
  cookie_expiration:365,upgrade:D,disable_persistence:D,disable_cookie:D,secure_cookie:D,ip:m,opt_out_tracking_by_default:D,opt_out_persistence_by_default:D,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:r,property_blacklist:[],xhr_headers:{},ignore_dnt:D,batch_requests:m,batch_size:50,batch_flush_interval_ms:5E3,batch_request_timeout_ms:9E4,batch_autostart:m,hooks:{},record_block_class:/^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$/,record_block_selector:"img, video",
79
79
  record_idle_timeout_ms:18E5,record_mask_text_class:/^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$/,record_mask_text_selector:"*",record_max_ms:864E5,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},la=D;e.prototype.Ua=function(a,b,d){if(c.g(d))this.l("You must name your new library: init(token, config, name)");else if("mixpanel"===d)this.l("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");else return a=S(a,b,
80
80
  d),x[d]=a,a.ka(),a};e.prototype.X=function(a,b,d){b=b||{};this.__loaded=m;this.config={};var f={};"api_payload_format"in b||(b.api_host||za.api_host).match(/\.mixpanel\.com/)&&(f.api_payload_format="json");this.$b(c.extend({},za,f,b,{name:d,token:a,callback_fn:("mixpanel"===d?d:"mixpanel."+d)+"._jsc"}));this._jsc=P;this.ya=[];this.za=[];this.xa=[];this.U={disable_all_events:D,identify_called:D};this.u={};if(this.T=this.c("batch_requests"))if(!c.localStorage.sa(m)||!O)this.T=D,o.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),
@@ -6,7 +6,7 @@
6
6
 
7
7
  var Config = {
8
8
  DEBUG: false,
9
- LIB_VERSION: '2.51.0'
9
+ LIB_VERSION: '2.52.0'
10
10
  };
11
11
 
12
12
  /* eslint camelcase: "off", eqeqeq: "off" */
@@ -4176,7 +4176,7 @@
4176
4176
  'track_pageview': false,
4177
4177
  'skip_first_touch_marketing': false,
4178
4178
  'store_google': true,
4179
- 'stop_utm_persistence': true,
4179
+ 'stop_utm_persistence': false,
4180
4180
  'save_referrer': true,
4181
4181
  'test': false,
4182
4182
  'verbose': false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mixpanel-browser",
3
- "version": "2.51.0",
3
+ "version": "2.52.0",
4
4
  "description": "The official Mixpanel JavaScript browser client library",
5
5
  "main": "dist/mixpanel.cjs.js",
6
6
  "directories": {
package/src/config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var Config = {
2
2
  DEBUG: false,
3
- LIB_VERSION: '2.51.0'
3
+ LIB_VERSION: '2.52.0'
4
4
  };
5
5
 
6
6
  export default Config;
@@ -112,7 +112,7 @@ var DEFAULT_CONFIG = {
112
112
  'track_pageview': false,
113
113
  'skip_first_touch_marketing': false,
114
114
  'store_google': true,
115
- 'stop_utm_persistence': true,
115
+ 'stop_utm_persistence': false,
116
116
  'save_referrer': true,
117
117
  'test': false,
118
118
  'verbose': false,