@openreplay/tracker
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -19,3 +19,3 @@ "use strict"; | ||
this.isActive = false; | ||
this.version = '3.1.0'; | ||
this.version = '3.2.0'; | ||
this.projectKey = projectKey; | ||
@@ -42,3 +42,3 @@ this.options = Object.assign({ | ||
try { | ||
this.worker = new Worker(URL.createObjectURL(new Blob([`"use strict";function t(t){function s(...s){return new t(...s)}return s.prototype=t.prototype,s}const s=new Map;const i=t(class{constructor(t,s,i){this.pageNo=t,this.firstIndex=s,this.timestamp=i,this._id=80}encode(t){return t.uint(80)&&t.uint(this.pageNo)&&t.uint(this.firstIndex)&&t.int(this.timestamp)}});s.set(80,i);const n=t(class{constructor(t){this.timestamp=t,this._id=0}encode(t){return t.uint(0)&&t.uint(this.timestamp)}});s.set(0,n);const e=t(class{constructor(t,s,i){this.url=t,this.referrer=s,this.navigationStart=i,this._id=4}encode(t){return t.uint(4)&&t.string(this.url)&&t.string(this.referrer)&&t.uint(this.navigationStart)}});s.set(4,e);const r=t(class{constructor(t,s){this.width=t,this.height=s,this._id=5}encode(t){return t.uint(5)&&t.uint(this.width)&&t.uint(this.height)}});s.set(5,r);const o=t(class{constructor(t,s){this.x=t,this.y=s,this._id=6}encode(t){return t.uint(6)&&t.int(this.x)&&t.int(this.y)}});s.set(6,o);const h=t(class{constructor(){this._id=7}encode(t){return t.uint(7)}});s.set(7,h);const c=t(class{constructor(t,s,i,n,e){this.id=t,this.parentID=s,this.index=i,this.tag=n,this.svg=e,this._id=8}encode(t){return t.uint(8)&&t.uint(this.id)&&t.uint(this.parentID)&&t.uint(this.index)&&t.string(this.tag)&&t.boolean(this.svg)}});s.set(8,c);const u=t(class{constructor(t,s,i){this.id=t,this.parentID=s,this.index=i,this._id=9}encode(t){return t.uint(9)&&t.uint(this.id)&&t.uint(this.parentID)&&t.uint(this.index)}});s.set(9,u);const a=t(class{constructor(t,s,i){this.id=t,this.parentID=s,this.index=i,this._id=10}encode(t){return t.uint(10)&&t.uint(this.id)&&t.uint(this.parentID)&&t.uint(this.index)}});s.set(10,a);const d=t(class{constructor(t){this.id=t,this._id=11}encode(t){return t.uint(11)&&t.uint(this.id)}});s.set(11,d);const l=t(class{constructor(t,s,i){this.id=t,this.name=s,this.value=i,this._id=12}encode(t){return t.uint(12)&&t.uint(this.id)&&t.string(this.name)&&t.string(this.value)}});s.set(12,l);const g=t(class{constructor(t,s){this.id=t,this.name=s,this._id=13}encode(t){return t.uint(13)&&t.uint(this.id)&&t.string(this.name)}});s.set(13,g);const f=t(class{constructor(t,s){this.id=t,this.data=s,this._id=14}encode(t){return t.uint(14)&&t.uint(this.id)&&t.string(this.data)}});s.set(14,f);const p=t(class{constructor(t,s,i){this.id=t,this.x=s,this.y=i,this._id=16}encode(t){return t.uint(16)&&t.uint(this.id)&&t.int(this.x)&&t.int(this.y)}});s.set(16,p);const m=t(class{constructor(t,s){this.id=t,this.label=s,this._id=17}encode(t){return t.uint(17)&&t.uint(this.id)&&t.string(this.label)}});s.set(17,m);const _=t(class{constructor(t,s,i){this.id=t,this.value=s,this.mask=i,this._id=18}encode(t){return t.uint(18)&&t.uint(this.id)&&t.string(this.value)&&t.int(this.mask)}});s.set(18,_);const y=t(class{constructor(t,s){this.id=t,this.checked=s,this._id=19}encode(t){return t.uint(19)&&t.uint(this.id)&&t.boolean(this.checked)}});s.set(19,y);const v=t(class{constructor(t,s){this.x=t,this.y=s,this._id=20}encode(t){return t.uint(20)&&t.uint(this.x)&&t.uint(this.y)}});s.set(20,v);const S=t(class{constructor(t,s,i){this.id=t,this.hesitationTime=s,this.label=i,this._id=21}encode(t){return t.uint(21)&&t.uint(this.id)&&t.uint(this.hesitationTime)&&t.string(this.label)}});s.set(21,S);const b=t(class{constructor(t,s){this.level=t,this.value=s,this._id=22}encode(t){return t.uint(22)&&t.string(this.level)&&t.string(this.value)}});s.set(22,b);const x=t(class{constructor(t,s,i,n,e,r,o,h,c){this.requestStart=t,this.responseStart=s,this.responseEnd=i,this.domContentLoadedEventStart=n,this.domContentLoadedEventEnd=e,this.loadEventStart=r,this.loadEventEnd=o,this.firstPaint=h,this.firstContentfulPaint=c,this._id=23}encode(t){return t.uint(23)&&t.uint(this.requestStart)&&t.uint(this.responseStart)&&t.uint(this.responseEnd)&&t.uint(this.domContentLoadedEventStart)&&t.uint(this.domContentLoadedEventEnd)&&t.uint(this.loadEventStart)&&t.uint(this.loadEventEnd)&&t.uint(this.firstPaint)&&t.uint(this.firstContentfulPaint)}});s.set(23,x);const k=t(class{constructor(t,s,i){this.speedIndex=t,this.visuallyComplete=s,this.timeToInteractive=i,this._id=24}encode(t){return t.uint(24)&&t.uint(this.speedIndex)&&t.uint(this.visuallyComplete)&&t.uint(this.timeToInteractive)}});s.set(24,k);const E=t(class{constructor(t,s,i){this.name=t,this.message=s,this.payload=i,this._id=25}encode(t){return t.uint(25)&&t.string(this.name)&&t.string(this.message)&&t.string(this.payload)}});s.set(25,E);const w=t(class{constructor(t,s){this.name=t,this.payload=s,this._id=27}encode(t){return t.uint(27)&&t.string(this.name)&&t.string(this.payload)}});s.set(27,w);const z=t(class{constructor(t){this.id=t,this._id=28}encode(t){return t.uint(28)&&t.string(this.id)}});s.set(28,z);const I=t(class{constructor(t){this.id=t,this._id=29}encode(t){return t.uint(29)&&t.string(this.id)}});s.set(29,I);const T=t(class{constructor(t,s){this.key=t,this.value=s,this._id=30}encode(t){return t.uint(30)&&t.string(this.key)&&t.string(this.value)}});s.set(30,T);const L=t(class{constructor(t,s,i){this.id=t,this.rule=s,this.index=i,this._id=37}encode(t){return t.uint(37)&&t.uint(this.id)&&t.string(this.rule)&&t.uint(this.index)}});s.set(37,L);const C=t(class{constructor(t,s){this.id=t,this.index=s,this._id=38}encode(t){return t.uint(38)&&t.uint(this.id)&&t.uint(this.index)}});s.set(38,C);const A=t(class{constructor(t,s,i,n,e,r,o){this.method=t,this.url=s,this.request=i,this.response=n,this.status=e,this.timestamp=r,this.duration=o,this._id=39}encode(t){return t.uint(39)&&t.string(this.method)&&t.string(this.url)&&t.string(this.request)&&t.string(this.response)&&t.uint(this.status)&&t.uint(this.timestamp)&&t.uint(this.duration)}});s.set(39,A);const M=t(class{constructor(t,s,i,n){this.name=t,this.duration=s,this.args=i,this.result=n,this._id=40}encode(t){return t.uint(40)&&t.string(this.name)&&t.uint(this.duration)&&t.string(this.args)&&t.string(this.result)}});s.set(40,M);const R=t(class{constructor(t,s){this.key=t,this.value=s,this._id=41}encode(t){return t.uint(41)&&t.string(this.key)&&t.string(this.value)}});s.set(41,R);const U=t(class{constructor(t){this.type=t,this._id=42}encode(t){return t.uint(42)&&t.string(this.type)}});s.set(42,U);const N=t(class{constructor(t,s,i){this.action=t,this.state=s,this.duration=i,this._id=44}encode(t){return t.uint(44)&&t.string(this.action)&&t.string(this.state)&&t.uint(this.duration)}});s.set(44,N);const O=t(class{constructor(t,s){this.mutation=t,this.state=s,this._id=45}encode(t){return t.uint(45)&&t.string(this.mutation)&&t.string(this.state)}});s.set(45,O);const q=t(class{constructor(t,s){this.type=t,this.payload=s,this._id=46}encode(t){return t.uint(46)&&t.string(this.type)&&t.string(this.payload)}});s.set(46,q);const D=t(class{constructor(t,s,i){this.action=t,this.state=s,this.duration=i,this._id=47}encode(t){return t.uint(47)&&t.string(this.action)&&t.string(this.state)&&t.uint(this.duration)}});s.set(47,D);const H=t(class{constructor(t,s,i,n){this.operationKind=t,this.operationName=s,this.variables=i,this.response=n,this._id=48}encode(t){return t.uint(48)&&t.string(this.operationKind)&&t.string(this.operationName)&&t.string(this.variables)&&t.string(this.response)}});s.set(48,H);const P=t(class{constructor(t,s,i,n){this.frames=t,this.ticks=s,this.totalJSHeapSize=i,this.usedJSHeapSize=n,this._id=49}encode(t){return t.uint(49)&&t.int(this.frames)&&t.int(this.ticks)&&t.uint(this.totalJSHeapSize)&&t.uint(this.usedJSHeapSize)}});s.set(49,P);const B=t(class{constructor(t,s,i,n,e,r,o,h){this.timestamp=t,this.duration=s,this.ttfb=i,this.headerSize=n,this.encodedBodySize=e,this.decodedBodySize=r,this.url=o,this.initiator=h,this._id=53}encode(t){return t.uint(53)&&t.uint(this.timestamp)&&t.uint(this.duration)&&t.uint(this.ttfb)&&t.uint(this.headerSize)&&t.uint(this.encodedBodySize)&&t.uint(this.decodedBodySize)&&t.string(this.url)&&t.string(this.initiator)}});s.set(53,B);const J=t(class{constructor(t,s){this.downlink=t,this.type=s,this._id=54}encode(t){return t.uint(54)&&t.uint(this.downlink)&&t.string(this.type)}});s.set(54,J);const j=t(class{constructor(t){this.hidden=t,this._id=55}encode(t){return t.uint(55)&&t.boolean(this.hidden)}});s.set(55,j);const K=t(class{constructor(t,s,i,n,e,r,o){this.timestamp=t,this.duration=s,this.context=i,this.containerType=n,this.containerSrc=e,this.containerId=r,this.containerName=o,this._id=59}encode(t){return t.uint(59)&&t.uint(this.timestamp)&&t.uint(this.duration)&&t.uint(this.context)&&t.uint(this.containerType)&&t.string(this.containerSrc)&&t.string(this.containerId)&&t.string(this.containerName)}});s.set(59,K);const G=t(class{constructor(t,s,i,n){this.id=t,this.name=s,this.value=i,this.baseURL=n,this._id=60}encode(t){return t.uint(60)&&t.uint(this.id)&&t.string(this.name)&&t.string(this.value)&&t.string(this.baseURL)}});s.set(60,G);const X=t(class{constructor(t,s,i){this.id=t,this.data=s,this.baseURL=i,this._id=61}encode(t){return t.uint(61)&&t.uint(this.id)&&t.string(this.data)&&t.string(this.baseURL)}});s.set(61,X);const F=t(class{constructor(t,s){this.type=t,this.value=s,this._id=63}encode(t){return t.uint(63)&&t.string(this.type)&&t.string(this.value)}});s.set(63,F);const Q=t(class{constructor(t,s){this.name=t,this.payload=s,this._id=64}encode(t){return t.uint(64)&&t.string(this.name)&&t.string(this.payload)}});s.set(64,Q);const V=t(class{constructor(){this._id=65}encode(t){return t.uint(65)}});s.set(65,V);const W=t(class{constructor(t,s,i,n){this.id=t,this.rule=s,this.index=i,this.baseURL=n,this._id=67}encode(t){return t.uint(67)&&t.uint(this.id)&&t.string(this.rule)&&t.uint(this.index)&&t.string(this.baseURL)}});s.set(67,W);const Y="function"==typeof TextEncoder?new TextEncoder:{encode(t){const s=t.length,i=new Uint8Array(3*s);let n=-1;for(var e=0,r=0,o=0;o!==s;){if(e=t.charCodeAt(o),o+=1,e>=55296&&e<=56319){if(o===s){i[n+=1]=239,i[n+=1]=191,i[n+=1]=189;break}if(!((r=t.charCodeAt(o))>=56320&&r<=57343)){i[n+=1]=239,i[n+=1]=191,i[n+=1]=189;continue}if(o+=1,(e=1024*(e-55296)+r-56320+65536)>65535){i[n+=1]=240|e>>>18,i[n+=1]=128|e>>>12&63,i[n+=1]=128|e>>>6&63,i[n+=1]=128|63&e;continue}}e<=127?i[n+=1]=0|e:e<=2047?(i[n+=1]=192|e>>>6,i[n+=1]=128|63&e):(i[n+=1]=224|e>>>12,i[n+=1]=128|e>>>6&63,i[n+=1]=128|63&e)}return i.subarray(0,n+1)}};class Z{constructor(t){this.size=t,this.offset=0,this.checkpontOffset=0,this.data=new Uint8Array(t)}checkpoint(){this.checkpontOffset=this.offset}isEmpty(){return 0===this.offset}boolean(t){return this.data[this.offset++]=+t,this.offset<=this.size}uint(t){for(;t>=128;)this.data[this.offset++]=t%256|128,t=Math.floor(t/128);return this.data[this.offset++]=t,this.offset<=this.size}int(t){return t=Math.round(t),this.uint(t>=0?2*t:-2*t-1)}string(t){const s=Y.encode(t),i=s.byteLength;return!(!this.uint(i)||this.offset+i>this.size)&&(this.data.set(s,this.offset),this.offset+=i,!0)}reset(){this.offset=0,this.checkpontOffset=0}flush(){const t=this.data.slice(0,this.checkpontOffset);return this.reset(),t}}let $,tt=4e5,st=new Z(tt),it="",nt="",et=0,rt=0,ot=0,ht=0,ct=!0;function ut(){return new i(et,ht,rt).encode(st)}const at=[];let dt,lt=!1,gt=0,ft=8e3,pt=10;function mt(){if(ct||""===nt||""===it)return;const t=st.flush();lt?at.push(t):(lt=!0,function t(s){const i=new XMLHttpRequest;i.open("POST",it+"/v1/web/i",!1),i.setRequestHeader("Authorization","Bearer "+nt),i.onreadystatechange=function(){if(4===this.readyState){if(0==this.status)return;if(this.status>=400)return _t(),at.length=0,403===this.status?void self.postMessage("restart"):void self.postMessage(null);const s=at.shift();s?t(s):lt=!1}},i.onerror=function(i){if(gt>=pt)return _t(),void self.postMessage(null);gt++,setTimeout(()=>t(s),ft)},i.send(s.buffer)}(t)),ct=!0,ut()}function _t(){it="",nt="",clearInterval($),st.reset()}self.onmessage=({data:t})=>{if(null!==t)return"stop"===t?(mt(),void _t()):Array.isArray(t)?void t.forEach(t=>{const i=new(s.get(t._id));if(Object.assign(i,t),i instanceof n?rt=i.timestamp:i instanceof j&&(i.hidden?dt=setTimeout(()=>self.postMessage("restart"),3e5):clearTimeout(dt)),st.checkpoint(),!i.encode(st)&&(mt(),!i.encode(st)))for(;!i.encode(st);){if(1e6===tt)return console.warn("OpenReplay: beacon size overflow."),st.reset(),void ut();tt=Math.min(2*tt,1e6),st=new Z(tt),ut()}ht++,ct=!1}):(it=t.ingestPoint||it,nt=t.token||nt,et=t.pageNo||et,rt=t.startTimestamp||rt,ot=t.timeAdjustment||ot,pt=t.connAttemptCount||pt,ft=t.connAttemptGap||ft,tt=Math.min(1e6,t.beaconSize||tt),st.isEmpty()&&ut(),void(null==$&&($=setInterval(mt,2e4))));mt()}; | ||
this.worker = new Worker(URL.createObjectURL(new Blob([`"use strict";function t(t){function s(...s){return new t(...s)}return s.prototype=t.prototype,s}const s=new Map;const i=t(class{constructor(t,s,i){this.pageNo=t,this.firstIndex=s,this.timestamp=i,this._id=80}encode(t){return t.uint(80)&&t.uint(this.pageNo)&&t.uint(this.firstIndex)&&t.int(this.timestamp)}});s.set(80,i);const n=t(class{constructor(t){this.timestamp=t,this._id=0}encode(t){return t.uint(0)&&t.uint(this.timestamp)}});s.set(0,n);const e=t(class{constructor(t,s,i){this.url=t,this.referrer=s,this.navigationStart=i,this._id=4}encode(t){return t.uint(4)&&t.string(this.url)&&t.string(this.referrer)&&t.uint(this.navigationStart)}});s.set(4,e);const r=t(class{constructor(t,s){this.width=t,this.height=s,this._id=5}encode(t){return t.uint(5)&&t.uint(this.width)&&t.uint(this.height)}});s.set(5,r);const o=t(class{constructor(t,s){this.x=t,this.y=s,this._id=6}encode(t){return t.uint(6)&&t.int(this.x)&&t.int(this.y)}});s.set(6,o);const h=t(class{constructor(){this._id=7}encode(t){return t.uint(7)}});s.set(7,h);const c=t(class{constructor(t,s,i,n,e){this.id=t,this.parentID=s,this.index=i,this.tag=n,this.svg=e,this._id=8}encode(t){return t.uint(8)&&t.uint(this.id)&&t.uint(this.parentID)&&t.uint(this.index)&&t.string(this.tag)&&t.boolean(this.svg)}});s.set(8,c);const u=t(class{constructor(t,s,i){this.id=t,this.parentID=s,this.index=i,this._id=9}encode(t){return t.uint(9)&&t.uint(this.id)&&t.uint(this.parentID)&&t.uint(this.index)}});s.set(9,u);const a=t(class{constructor(t,s,i){this.id=t,this.parentID=s,this.index=i,this._id=10}encode(t){return t.uint(10)&&t.uint(this.id)&&t.uint(this.parentID)&&t.uint(this.index)}});s.set(10,a);const d=t(class{constructor(t){this.id=t,this._id=11}encode(t){return t.uint(11)&&t.uint(this.id)}});s.set(11,d);const l=t(class{constructor(t,s,i){this.id=t,this.name=s,this.value=i,this._id=12}encode(t){return t.uint(12)&&t.uint(this.id)&&t.string(this.name)&&t.string(this.value)}});s.set(12,l);const g=t(class{constructor(t,s){this.id=t,this.name=s,this._id=13}encode(t){return t.uint(13)&&t.uint(this.id)&&t.string(this.name)}});s.set(13,g);const f=t(class{constructor(t,s){this.id=t,this.data=s,this._id=14}encode(t){return t.uint(14)&&t.uint(this.id)&&t.string(this.data)}});s.set(14,f);const p=t(class{constructor(t,s,i){this.id=t,this.x=s,this.y=i,this._id=16}encode(t){return t.uint(16)&&t.uint(this.id)&&t.int(this.x)&&t.int(this.y)}});s.set(16,p);const m=t(class{constructor(t,s){this.id=t,this.label=s,this._id=17}encode(t){return t.uint(17)&&t.uint(this.id)&&t.string(this.label)}});s.set(17,m);const _=t(class{constructor(t,s,i){this.id=t,this.value=s,this.mask=i,this._id=18}encode(t){return t.uint(18)&&t.uint(this.id)&&t.string(this.value)&&t.int(this.mask)}});s.set(18,_);const y=t(class{constructor(t,s){this.id=t,this.checked=s,this._id=19}encode(t){return t.uint(19)&&t.uint(this.id)&&t.boolean(this.checked)}});s.set(19,y);const v=t(class{constructor(t,s){this.x=t,this.y=s,this._id=20}encode(t){return t.uint(20)&&t.uint(this.x)&&t.uint(this.y)}});s.set(20,v);const S=t(class{constructor(t,s){this.level=t,this.value=s,this._id=22}encode(t){return t.uint(22)&&t.string(this.level)&&t.string(this.value)}});s.set(22,S);const b=t(class{constructor(t,s,i,n,e,r,o,h,c){this.requestStart=t,this.responseStart=s,this.responseEnd=i,this.domContentLoadedEventStart=n,this.domContentLoadedEventEnd=e,this.loadEventStart=r,this.loadEventEnd=o,this.firstPaint=h,this.firstContentfulPaint=c,this._id=23}encode(t){return t.uint(23)&&t.uint(this.requestStart)&&t.uint(this.responseStart)&&t.uint(this.responseEnd)&&t.uint(this.domContentLoadedEventStart)&&t.uint(this.domContentLoadedEventEnd)&&t.uint(this.loadEventStart)&&t.uint(this.loadEventEnd)&&t.uint(this.firstPaint)&&t.uint(this.firstContentfulPaint)}});s.set(23,b);const x=t(class{constructor(t,s,i){this.speedIndex=t,this.visuallyComplete=s,this.timeToInteractive=i,this._id=24}encode(t){return t.uint(24)&&t.uint(this.speedIndex)&&t.uint(this.visuallyComplete)&&t.uint(this.timeToInteractive)}});s.set(24,x);const k=t(class{constructor(t,s,i){this.name=t,this.message=s,this.payload=i,this._id=25}encode(t){return t.uint(25)&&t.string(this.name)&&t.string(this.message)&&t.string(this.payload)}});s.set(25,k);const E=t(class{constructor(t,s){this.name=t,this.payload=s,this._id=27}encode(t){return t.uint(27)&&t.string(this.name)&&t.string(this.payload)}});s.set(27,E);const w=t(class{constructor(t){this.id=t,this._id=28}encode(t){return t.uint(28)&&t.string(this.id)}});s.set(28,w);const z=t(class{constructor(t){this.id=t,this._id=29}encode(t){return t.uint(29)&&t.string(this.id)}});s.set(29,z);const I=t(class{constructor(t,s){this.key=t,this.value=s,this._id=30}encode(t){return t.uint(30)&&t.string(this.key)&&t.string(this.value)}});s.set(30,I);const T=t(class{constructor(t,s,i){this.id=t,this.rule=s,this.index=i,this._id=37}encode(t){return t.uint(37)&&t.uint(this.id)&&t.string(this.rule)&&t.uint(this.index)}});s.set(37,T);const L=t(class{constructor(t,s){this.id=t,this.index=s,this._id=38}encode(t){return t.uint(38)&&t.uint(this.id)&&t.uint(this.index)}});s.set(38,L);const C=t(class{constructor(t,s,i,n,e,r,o){this.method=t,this.url=s,this.request=i,this.response=n,this.status=e,this.timestamp=r,this.duration=o,this._id=39}encode(t){return t.uint(39)&&t.string(this.method)&&t.string(this.url)&&t.string(this.request)&&t.string(this.response)&&t.uint(this.status)&&t.uint(this.timestamp)&&t.uint(this.duration)}});s.set(39,C);const A=t(class{constructor(t,s,i,n){this.name=t,this.duration=s,this.args=i,this.result=n,this._id=40}encode(t){return t.uint(40)&&t.string(this.name)&&t.uint(this.duration)&&t.string(this.args)&&t.string(this.result)}});s.set(40,A);const M=t(class{constructor(t,s){this.key=t,this.value=s,this._id=41}encode(t){return t.uint(41)&&t.string(this.key)&&t.string(this.value)}});s.set(41,M);const R=t(class{constructor(t){this.type=t,this._id=42}encode(t){return t.uint(42)&&t.string(this.type)}});s.set(42,R);const U=t(class{constructor(t,s,i){this.action=t,this.state=s,this.duration=i,this._id=44}encode(t){return t.uint(44)&&t.string(this.action)&&t.string(this.state)&&t.uint(this.duration)}});s.set(44,U);const N=t(class{constructor(t,s){this.mutation=t,this.state=s,this._id=45}encode(t){return t.uint(45)&&t.string(this.mutation)&&t.string(this.state)}});s.set(45,N);const O=t(class{constructor(t,s){this.type=t,this.payload=s,this._id=46}encode(t){return t.uint(46)&&t.string(this.type)&&t.string(this.payload)}});s.set(46,O);const q=t(class{constructor(t,s,i){this.action=t,this.state=s,this.duration=i,this._id=47}encode(t){return t.uint(47)&&t.string(this.action)&&t.string(this.state)&&t.uint(this.duration)}});s.set(47,q);const D=t(class{constructor(t,s,i,n){this.operationKind=t,this.operationName=s,this.variables=i,this.response=n,this._id=48}encode(t){return t.uint(48)&&t.string(this.operationKind)&&t.string(this.operationName)&&t.string(this.variables)&&t.string(this.response)}});s.set(48,D);const H=t(class{constructor(t,s,i,n){this.frames=t,this.ticks=s,this.totalJSHeapSize=i,this.usedJSHeapSize=n,this._id=49}encode(t){return t.uint(49)&&t.int(this.frames)&&t.int(this.ticks)&&t.uint(this.totalJSHeapSize)&&t.uint(this.usedJSHeapSize)}});s.set(49,H);const P=t(class{constructor(t,s,i,n,e,r,o,h){this.timestamp=t,this.duration=s,this.ttfb=i,this.headerSize=n,this.encodedBodySize=e,this.decodedBodySize=r,this.url=o,this.initiator=h,this._id=53}encode(t){return t.uint(53)&&t.uint(this.timestamp)&&t.uint(this.duration)&&t.uint(this.ttfb)&&t.uint(this.headerSize)&&t.uint(this.encodedBodySize)&&t.uint(this.decodedBodySize)&&t.string(this.url)&&t.string(this.initiator)}});s.set(53,P);const B=t(class{constructor(t,s){this.downlink=t,this.type=s,this._id=54}encode(t){return t.uint(54)&&t.uint(this.downlink)&&t.string(this.type)}});s.set(54,B);const J=t(class{constructor(t){this.hidden=t,this._id=55}encode(t){return t.uint(55)&&t.boolean(this.hidden)}});s.set(55,J);const j=t(class{constructor(t,s,i,n,e,r,o){this.timestamp=t,this.duration=s,this.context=i,this.containerType=n,this.containerSrc=e,this.containerId=r,this.containerName=o,this._id=59}encode(t){return t.uint(59)&&t.uint(this.timestamp)&&t.uint(this.duration)&&t.uint(this.context)&&t.uint(this.containerType)&&t.string(this.containerSrc)&&t.string(this.containerId)&&t.string(this.containerName)}});s.set(59,j);const K=t(class{constructor(t,s,i,n){this.id=t,this.name=s,this.value=i,this.baseURL=n,this._id=60}encode(t){return t.uint(60)&&t.uint(this.id)&&t.string(this.name)&&t.string(this.value)&&t.string(this.baseURL)}});s.set(60,K);const G=t(class{constructor(t,s,i){this.id=t,this.data=s,this.baseURL=i,this._id=61}encode(t){return t.uint(61)&&t.uint(this.id)&&t.string(this.data)&&t.string(this.baseURL)}});s.set(61,G);const X=t(class{constructor(t,s){this.type=t,this.value=s,this._id=63}encode(t){return t.uint(63)&&t.string(this.type)&&t.string(this.value)}});s.set(63,X);const F=t(class{constructor(t,s){this.name=t,this.payload=s,this._id=64}encode(t){return t.uint(64)&&t.string(this.name)&&t.string(this.payload)}});s.set(64,F);const Q=t(class{constructor(){this._id=65}encode(t){return t.uint(65)}});s.set(65,Q);const V=t(class{constructor(t,s,i,n){this.id=t,this.rule=s,this.index=i,this.baseURL=n,this._id=67}encode(t){return t.uint(67)&&t.uint(this.id)&&t.string(this.rule)&&t.uint(this.index)&&t.string(this.baseURL)}});s.set(67,V);const W=t(class{constructor(t,s,i,n){this.id=t,this.hesitationTime=s,this.label=i,this.selector=n,this._id=69}encode(t){return t.uint(69)&&t.uint(this.id)&&t.uint(this.hesitationTime)&&t.string(this.label)&&t.string(this.selector)}});s.set(69,W);const Y="function"==typeof TextEncoder?new TextEncoder:{encode(t){const s=t.length,i=new Uint8Array(3*s);let n=-1;for(var e=0,r=0,o=0;o!==s;){if(e=t.charCodeAt(o),o+=1,e>=55296&&e<=56319){if(o===s){i[n+=1]=239,i[n+=1]=191,i[n+=1]=189;break}if(!((r=t.charCodeAt(o))>=56320&&r<=57343)){i[n+=1]=239,i[n+=1]=191,i[n+=1]=189;continue}if(o+=1,(e=1024*(e-55296)+r-56320+65536)>65535){i[n+=1]=240|e>>>18,i[n+=1]=128|e>>>12&63,i[n+=1]=128|e>>>6&63,i[n+=1]=128|63&e;continue}}e<=127?i[n+=1]=0|e:e<=2047?(i[n+=1]=192|e>>>6,i[n+=1]=128|63&e):(i[n+=1]=224|e>>>12,i[n+=1]=128|e>>>6&63,i[n+=1]=128|63&e)}return i.subarray(0,n+1)}};class Z{constructor(t){this.size=t,this.offset=0,this.checkpointOffset=0,this.data=new Uint8Array(t)}checkpoint(){this.checkpointOffset=this.offset}isEmpty(){return 0===this.offset}boolean(t){return this.data[this.offset++]=+t,this.offset<=this.size}uint(t){for(;t>=128;)this.data[this.offset++]=t%256|128,t=Math.floor(t/128);return this.data[this.offset++]=t,this.offset<=this.size}int(t){return t=Math.round(t),this.uint(t>=0?2*t:-2*t-1)}string(t){const s=Y.encode(t),i=s.byteLength;return!(!this.uint(i)||this.offset+i>this.size)&&(this.data.set(s,this.offset),this.offset+=i,!0)}reset(){this.offset=0,this.checkpointOffset=0}flush(){const t=this.data.slice(0,this.checkpointOffset);return this.reset(),t}}let $,tt=4e5,st=new Z(tt),it="",nt="",et=0,rt=0,ot=0,ht=0,ct=!0;function ut(){return new i(et,ht,rt).encode(st)}const at=[];let dt,lt=!1,gt=0,ft=8e3,pt=10;function mt(){if(ct||""===nt||""===it)return;const t=st.flush();lt?at.push(t):(lt=!0,function t(s){const i=new XMLHttpRequest;i.open("POST",it+"/v1/web/i",!1),i.setRequestHeader("Authorization","Bearer "+nt),i.onreadystatechange=function(){if(4===this.readyState){if(0==this.status)return;if(this.status>=400)return _t(),at.length=0,403===this.status?void self.postMessage("restart"):void self.postMessage(null);const s=at.shift();s?t(s):lt=!1}},i.onerror=function(i){if(gt>=pt)return _t(),void self.postMessage(null);gt++,setTimeout(()=>t(s),ft)},i.send(s.buffer)}(t)),ct=!0,ut()}function _t(){it="",nt="",clearInterval($),st.reset()}self.onmessage=({data:t})=>{if(null!==t)return"stop"===t?(mt(),void _t()):Array.isArray(t)?void t.forEach(t=>{const i=new(s.get(t._id));if(Object.assign(i,t),i instanceof n?rt=i.timestamp:i instanceof J&&(i.hidden?dt=setTimeout(()=>self.postMessage("restart"),3e5):clearTimeout(dt)),st.checkpoint(),!i.encode(st)&&(mt(),!i.encode(st)))for(;!i.encode(st);){if(1e6===tt)return console.warn("OpenReplay: beacon size overflow."),st.reset(),void ut();tt=Math.min(2*tt,1e6),st=new Z(tt),ut()}ht++,ct=!1}):(it=t.ingestPoint||it,nt=t.token||nt,et=t.pageNo||et,rt=t.startTimestamp||rt,ot=t.timeAdjustment||ot,pt=t.connAttemptCount||pt,ft=t.connAttemptGap||ft,tt=Math.min(1e6,t.beaconSize||tt),st.isEmpty()&&ut(),void(null==$&&($=setInterval(mt,2e4))));mt()}; | ||
`], { type: 'text/javascript' }))); | ||
@@ -160,3 +160,3 @@ // this.worker.onerror = e => { | ||
}; | ||
this.worker.postMessage(messageData); // brings delay of 10th ms? | ||
this.worker.postMessage(messageData); // brings delay of 10th ms? | ||
window.fetch(this.options.ingestPoint + '/v1/web/start', { | ||
@@ -192,3 +192,3 @@ method: 'POST', | ||
typeof userUUID !== 'string') { | ||
throw new Error("Incorrect server responce"); | ||
throw new Error("Incorrect server response"); | ||
} | ||
@@ -204,4 +204,4 @@ sessionStorage.setItem(this.options.session_token_key, token); | ||
this.worker.postMessage({ token }); | ||
this.startCallbacks.forEach((cb) => cb()); | ||
this.observer.observe(); | ||
this.startCallbacks.forEach((cb) => cb()); | ||
this.ticker.start(); | ||
@@ -208,0 +208,0 @@ utils_1.log("OpenReplay tracking started."); |
@@ -37,3 +37,3 @@ "use strict"; | ||
obj.projectKey = obj.projectID.toString(); | ||
utils_1.depricationWarn("`projectID` option", "`projectKey` option", DOCS_SETUP); | ||
utils_1.deprecationWarn("`projectID` option", "`projectKey` option", DOCS_SETUP); | ||
} | ||
@@ -105,3 +105,3 @@ } | ||
else { | ||
console.log("OpenReplay: broeser doesn't support API required for tracking."); | ||
console.log("OpenReplay: browser doesn't support API required for tracking."); | ||
const req = new XMLHttpRequest(); | ||
@@ -113,3 +113,3 @@ const orig = options.ingestPoint || app_1.DEFAULT_INGEST_POINT; | ||
req.send(JSON.stringify({ | ||
trackerVersion: '3.1.0', | ||
trackerVersion: '3.2.0', | ||
projectKey: options.projectKey, | ||
@@ -131,3 +131,3 @@ doNotTrack, | ||
active() { | ||
utils_1.depricationWarn("'active' method", "'isActive' method", "/"); | ||
utils_1.deprecationWarn("'active' method", "'isActive' method", "/"); | ||
return this.isActive(); | ||
@@ -164,3 +164,3 @@ } | ||
sessionID() { | ||
utils_1.depricationWarn("'sessionID' method", "'getSessionID' method", "/"); | ||
utils_1.deprecationWarn("'sessionID' method", "'getSessionID' method", "/"); | ||
return this.getSessionID(); | ||
@@ -174,3 +174,3 @@ } | ||
userID(id) { | ||
utils_1.depricationWarn("'userID' method", "'setUserID' method", "/"); | ||
utils_1.deprecationWarn("'userID' method", "'setUserID' method", "/"); | ||
this.setUserID(id); | ||
@@ -184,3 +184,3 @@ } | ||
userAnonymousID(id) { | ||
utils_1.depricationWarn("'userAnonymousID' method", "'setUserAnonymousID' method", "/"); | ||
utils_1.deprecationWarn("'userAnonymousID' method", "'setUserAnonymousID' method", "/"); | ||
this.setUserAnonymousID(id); | ||
@@ -196,3 +196,3 @@ } | ||
metadata(key, value) { | ||
utils_1.depricationWarn("'metadata' method", "'setMetadata' method", "/"); | ||
utils_1.deprecationWarn("'metadata' method", "'setMetadata' method", "/"); | ||
this.setMetadata(key, value); | ||
@@ -199,0 +199,0 @@ } |
@@ -154,11 +154,2 @@ import Message from './message'; | ||
export declare const MouseMove: typeof _MouseMove & ((x: number, y: number) => _MouseMove); | ||
declare class _MouseClick implements Message { | ||
id: number; | ||
hesitationTime: number; | ||
label: string; | ||
readonly _id: number; | ||
constructor(id: number, hesitationTime: number, label: string); | ||
encode(writer: Writer): boolean; | ||
} | ||
export declare const MouseClick: typeof _MouseClick & ((id: number, hesitationTime: number, label: string) => _MouseClick); | ||
declare class _ConsoleLog implements Message { | ||
@@ -437,2 +428,12 @@ level: string; | ||
export declare const CSSInsertRuleURLBased: typeof _CSSInsertRuleURLBased & ((id: number, rule: string, index: number, baseURL: string) => _CSSInsertRuleURLBased); | ||
declare class _MouseClick implements Message { | ||
id: number; | ||
hesitationTime: number; | ||
label: string; | ||
selector: string; | ||
readonly _id: number; | ||
constructor(id: number, hesitationTime: number, label: string, selector: string); | ||
encode(writer: Writer): boolean; | ||
} | ||
export declare const MouseClick: typeof _MouseClick & ((id: number, hesitationTime: number, label: string, selector: string) => _MouseClick); | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CSSInsertRuleURLBased = exports.PageClose = exports.CustomIssue = exports.TechnicalInfo = exports.SetCSSDataURLBased = exports.SetNodeAttributeURLBased = exports.LongTask = exports.SetPageVisibility = exports.ConnectionInformation = exports.ResourceTiming = exports.PerformanceTrack = exports.GraphQL = exports.NgRx = exports.MobX = exports.Vuex = exports.Redux = exports.StateAction = exports.OTable = exports.Profiler = exports.Fetch = exports.CSSDeleteRule = exports.CSSInsertRule = exports.Metadata = exports.UserAnonymousID = exports.UserID = exports.RawCustomEvent = exports.JSException = exports.PageRenderTiming = exports.PageLoadTiming = exports.ConsoleLog = exports.MouseClick = exports.MouseMove = exports.SetInputChecked = exports.SetInputValue = exports.SetInputTarget = exports.SetNodeScroll = exports.SetNodeData = exports.RemoveNodeAttribute = exports.SetNodeAttribute = exports.RemoveNode = exports.MoveNode = exports.CreateTextNode = exports.CreateElementNode = exports.CreateDocument = exports.SetViewportScroll = exports.SetViewportSize = exports.SetPageLocation = exports.Timestamp = exports.BatchMeta = exports.classes = void 0; | ||
exports.MouseClick = exports.CSSInsertRuleURLBased = exports.PageClose = exports.CustomIssue = exports.TechnicalInfo = exports.SetCSSDataURLBased = exports.SetNodeAttributeURLBased = exports.LongTask = exports.SetPageVisibility = exports.ConnectionInformation = exports.ResourceTiming = exports.PerformanceTrack = exports.GraphQL = exports.NgRx = exports.MobX = exports.Vuex = exports.Redux = exports.StateAction = exports.OTable = exports.Profiler = exports.Fetch = exports.CSSDeleteRule = exports.CSSInsertRule = exports.Metadata = exports.UserAnonymousID = exports.UserID = exports.RawCustomEvent = exports.JSException = exports.PageRenderTiming = exports.PageLoadTiming = exports.ConsoleLog = exports.MouseMove = exports.SetInputChecked = exports.SetInputValue = exports.SetInputTarget = exports.SetNodeScroll = exports.SetNodeData = exports.RemoveNodeAttribute = exports.SetNodeAttribute = exports.RemoveNode = exports.MoveNode = exports.CreateTextNode = exports.CreateElementNode = exports.CreateDocument = exports.SetViewportScroll = exports.SetViewportSize = exports.SetPageLocation = exports.Timestamp = exports.BatchMeta = exports.classes = void 0; | ||
function bindNew(Class) { | ||
@@ -276,18 +276,2 @@ function _Class(...args) { | ||
exports.classes.set(20, exports.MouseMove); | ||
class _MouseClick { | ||
constructor(id, hesitationTime, label) { | ||
this.id = id; | ||
this.hesitationTime = hesitationTime; | ||
this.label = label; | ||
this._id = 21; | ||
} | ||
encode(writer) { | ||
return writer.uint(21) && | ||
writer.uint(this.id) && | ||
writer.uint(this.hesitationTime) && | ||
writer.string(this.label); | ||
} | ||
} | ||
exports.MouseClick = bindNew(_MouseClick); | ||
exports.classes.set(21, exports.MouseClick); | ||
class _ConsoleLog { | ||
@@ -779,1 +763,19 @@ constructor(level, value) { | ||
exports.classes.set(67, exports.CSSInsertRuleURLBased); | ||
class _MouseClick { | ||
constructor(id, hesitationTime, label, selector) { | ||
this.id = id; | ||
this.hesitationTime = hesitationTime; | ||
this.label = label; | ||
this.selector = selector; | ||
this._id = 69; | ||
} | ||
encode(writer) { | ||
return writer.uint(69) && | ||
writer.uint(this.id) && | ||
writer.uint(this.hesitationTime) && | ||
writer.string(this.label) && | ||
writer.string(this.selector); | ||
} | ||
} | ||
exports.MouseClick = bindNew(_MouseClick); | ||
exports.classes.set(69, exports.MouseClick); |
export default class Writer { | ||
private readonly size; | ||
private offset; | ||
private checkpontOffset; | ||
private checkpointOffset; | ||
private readonly data; | ||
@@ -6,0 +6,0 @@ constructor(size: number); |
@@ -67,7 +67,7 @@ "use strict"; | ||
this.offset = 0; | ||
this.checkpontOffset = 0; | ||
this.checkpointOffset = 0; | ||
this.data = new Uint8Array(size); | ||
} | ||
checkpoint() { | ||
this.checkpontOffset = this.offset; | ||
this.checkpointOffset = this.offset; | ||
} | ||
@@ -105,6 +105,6 @@ isEmpty() { | ||
this.offset = 0; | ||
this.checkpontOffset = 0; | ||
this.checkpointOffset = 0; | ||
} | ||
flush() { | ||
const data = this.data.slice(0, this.checkpontOffset); | ||
const data = this.data.slice(0, this.checkpointOffset); | ||
this.reset(); | ||
@@ -111,0 +111,0 @@ return data; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const finder_1 = require("@medv/finder"); | ||
const utils_1 = require("../utils"); | ||
const messages_1 = require("../messages"); | ||
const input_1 = require("./input"); | ||
const selectorMap = {}; | ||
function getSelector(id, target) { | ||
return selectorMap[id] = selectorMap[id] || finder_1.finder(target); | ||
} | ||
function getTarget(target) { | ||
@@ -107,3 +112,3 @@ if (target instanceof Element) { | ||
? Math.round(performance.now() - mouseTargetTime) | ||
: 0, getTargetLabel(target)), true); | ||
: 0, getTargetLabel(target), getSelector(id, target)), true); | ||
} | ||
@@ -110,0 +115,0 @@ mouseTarget = null; |
@@ -15,4 +15,4 @@ export declare function timestamp(): number; | ||
}; | ||
export declare function depricationWarn(nameOfFeature: string, useInstead: string, docsPath?: string): void; | ||
export declare function deprecationWarn(nameOfFeature: string, useInstead: string, docsPath?: string): void; | ||
export declare function getLabelAttribute(e: Element): string | null; | ||
export declare function hasOpenreplayAttribute(e: Element, name: string): boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.hasOpenreplayAttribute = exports.getLabelAttribute = exports.depricationWarn = exports.warn = exports.log = exports.IN_BROWSER = exports.getBaseURI = exports.isURL = exports.normSpaces = exports.stars = exports.timestamp = void 0; | ||
exports.hasOpenreplayAttribute = exports.getLabelAttribute = exports.deprecationWarn = exports.warn = exports.log = exports.IN_BROWSER = exports.getBaseURI = exports.isURL = exports.normSpaces = exports.stars = exports.timestamp = void 0; | ||
function timestamp() { | ||
@@ -34,10 +34,10 @@ return Math.round(performance.now()) + performance.timing.navigationStart; | ||
const warnedFeatures = {}; | ||
function depricationWarn(nameOfFeature, useInstead, docsPath = "/") { | ||
function deprecationWarn(nameOfFeature, useInstead, docsPath = "/") { | ||
if (warnedFeatures[nameOfFeature]) { | ||
return; | ||
} | ||
exports.warn(`OpenReplay: ${nameOfFeature} is depricated. ${useInstead ? `Please, use ${useInstead} instead.` : ""} Visit ${DOCS_HOST}${docsPath} for more information.`); | ||
exports.warn(`OpenReplay: ${nameOfFeature} is deprecated. ${useInstead ? `Please, use ${useInstead} instead.` : ""} Visit ${DOCS_HOST}${docsPath} for more information.`); | ||
warnedFeatures[nameOfFeature] = true; | ||
} | ||
exports.depricationWarn = depricationWarn; | ||
exports.deprecationWarn = deprecationWarn; | ||
function getLabelAttribute(e) { | ||
@@ -50,3 +50,3 @@ let value = e.getAttribute("data-openreplay-label"); | ||
if (value !== null) { | ||
depricationWarn(`"data-asayer-label" attribute`, `"data-openreplay-label" attribute`, "/"); | ||
deprecationWarn(`"data-asayer-label" attribute`, `"data-openreplay-label" attribute`, "/"); | ||
} | ||
@@ -63,3 +63,3 @@ return value; | ||
if (e.hasAttribute(oldName)) { | ||
depricationWarn(`"${oldName}" attribute`, `"${newName}" attribute`, "/installation/sanitize-data"); | ||
deprecationWarn(`"${oldName}" attribute`, `"${newName}" attribute`, "/installation/sanitize-data"); | ||
return true; | ||
@@ -66,0 +66,0 @@ } |
@@ -16,3 +16,3 @@ import { timestamp, log } from '../utils'; | ||
this.isActive = false; | ||
this.version = '3.1.0'; | ||
this.version = '3.2.0'; | ||
this.projectKey = projectKey; | ||
@@ -39,3 +39,3 @@ this.options = Object.assign({ | ||
try { | ||
this.worker = new Worker(URL.createObjectURL(new Blob([`"use strict";function t(t){function s(...s){return new t(...s)}return s.prototype=t.prototype,s}const s=new Map;const i=t(class{constructor(t,s,i){this.pageNo=t,this.firstIndex=s,this.timestamp=i,this._id=80}encode(t){return t.uint(80)&&t.uint(this.pageNo)&&t.uint(this.firstIndex)&&t.int(this.timestamp)}});s.set(80,i);const n=t(class{constructor(t){this.timestamp=t,this._id=0}encode(t){return t.uint(0)&&t.uint(this.timestamp)}});s.set(0,n);const e=t(class{constructor(t,s,i){this.url=t,this.referrer=s,this.navigationStart=i,this._id=4}encode(t){return t.uint(4)&&t.string(this.url)&&t.string(this.referrer)&&t.uint(this.navigationStart)}});s.set(4,e);const r=t(class{constructor(t,s){this.width=t,this.height=s,this._id=5}encode(t){return t.uint(5)&&t.uint(this.width)&&t.uint(this.height)}});s.set(5,r);const o=t(class{constructor(t,s){this.x=t,this.y=s,this._id=6}encode(t){return t.uint(6)&&t.int(this.x)&&t.int(this.y)}});s.set(6,o);const h=t(class{constructor(){this._id=7}encode(t){return t.uint(7)}});s.set(7,h);const c=t(class{constructor(t,s,i,n,e){this.id=t,this.parentID=s,this.index=i,this.tag=n,this.svg=e,this._id=8}encode(t){return t.uint(8)&&t.uint(this.id)&&t.uint(this.parentID)&&t.uint(this.index)&&t.string(this.tag)&&t.boolean(this.svg)}});s.set(8,c);const u=t(class{constructor(t,s,i){this.id=t,this.parentID=s,this.index=i,this._id=9}encode(t){return t.uint(9)&&t.uint(this.id)&&t.uint(this.parentID)&&t.uint(this.index)}});s.set(9,u);const a=t(class{constructor(t,s,i){this.id=t,this.parentID=s,this.index=i,this._id=10}encode(t){return t.uint(10)&&t.uint(this.id)&&t.uint(this.parentID)&&t.uint(this.index)}});s.set(10,a);const d=t(class{constructor(t){this.id=t,this._id=11}encode(t){return t.uint(11)&&t.uint(this.id)}});s.set(11,d);const l=t(class{constructor(t,s,i){this.id=t,this.name=s,this.value=i,this._id=12}encode(t){return t.uint(12)&&t.uint(this.id)&&t.string(this.name)&&t.string(this.value)}});s.set(12,l);const g=t(class{constructor(t,s){this.id=t,this.name=s,this._id=13}encode(t){return t.uint(13)&&t.uint(this.id)&&t.string(this.name)}});s.set(13,g);const f=t(class{constructor(t,s){this.id=t,this.data=s,this._id=14}encode(t){return t.uint(14)&&t.uint(this.id)&&t.string(this.data)}});s.set(14,f);const p=t(class{constructor(t,s,i){this.id=t,this.x=s,this.y=i,this._id=16}encode(t){return t.uint(16)&&t.uint(this.id)&&t.int(this.x)&&t.int(this.y)}});s.set(16,p);const m=t(class{constructor(t,s){this.id=t,this.label=s,this._id=17}encode(t){return t.uint(17)&&t.uint(this.id)&&t.string(this.label)}});s.set(17,m);const _=t(class{constructor(t,s,i){this.id=t,this.value=s,this.mask=i,this._id=18}encode(t){return t.uint(18)&&t.uint(this.id)&&t.string(this.value)&&t.int(this.mask)}});s.set(18,_);const y=t(class{constructor(t,s){this.id=t,this.checked=s,this._id=19}encode(t){return t.uint(19)&&t.uint(this.id)&&t.boolean(this.checked)}});s.set(19,y);const v=t(class{constructor(t,s){this.x=t,this.y=s,this._id=20}encode(t){return t.uint(20)&&t.uint(this.x)&&t.uint(this.y)}});s.set(20,v);const S=t(class{constructor(t,s,i){this.id=t,this.hesitationTime=s,this.label=i,this._id=21}encode(t){return t.uint(21)&&t.uint(this.id)&&t.uint(this.hesitationTime)&&t.string(this.label)}});s.set(21,S);const b=t(class{constructor(t,s){this.level=t,this.value=s,this._id=22}encode(t){return t.uint(22)&&t.string(this.level)&&t.string(this.value)}});s.set(22,b);const x=t(class{constructor(t,s,i,n,e,r,o,h,c){this.requestStart=t,this.responseStart=s,this.responseEnd=i,this.domContentLoadedEventStart=n,this.domContentLoadedEventEnd=e,this.loadEventStart=r,this.loadEventEnd=o,this.firstPaint=h,this.firstContentfulPaint=c,this._id=23}encode(t){return t.uint(23)&&t.uint(this.requestStart)&&t.uint(this.responseStart)&&t.uint(this.responseEnd)&&t.uint(this.domContentLoadedEventStart)&&t.uint(this.domContentLoadedEventEnd)&&t.uint(this.loadEventStart)&&t.uint(this.loadEventEnd)&&t.uint(this.firstPaint)&&t.uint(this.firstContentfulPaint)}});s.set(23,x);const k=t(class{constructor(t,s,i){this.speedIndex=t,this.visuallyComplete=s,this.timeToInteractive=i,this._id=24}encode(t){return t.uint(24)&&t.uint(this.speedIndex)&&t.uint(this.visuallyComplete)&&t.uint(this.timeToInteractive)}});s.set(24,k);const E=t(class{constructor(t,s,i){this.name=t,this.message=s,this.payload=i,this._id=25}encode(t){return t.uint(25)&&t.string(this.name)&&t.string(this.message)&&t.string(this.payload)}});s.set(25,E);const w=t(class{constructor(t,s){this.name=t,this.payload=s,this._id=27}encode(t){return t.uint(27)&&t.string(this.name)&&t.string(this.payload)}});s.set(27,w);const z=t(class{constructor(t){this.id=t,this._id=28}encode(t){return t.uint(28)&&t.string(this.id)}});s.set(28,z);const I=t(class{constructor(t){this.id=t,this._id=29}encode(t){return t.uint(29)&&t.string(this.id)}});s.set(29,I);const T=t(class{constructor(t,s){this.key=t,this.value=s,this._id=30}encode(t){return t.uint(30)&&t.string(this.key)&&t.string(this.value)}});s.set(30,T);const L=t(class{constructor(t,s,i){this.id=t,this.rule=s,this.index=i,this._id=37}encode(t){return t.uint(37)&&t.uint(this.id)&&t.string(this.rule)&&t.uint(this.index)}});s.set(37,L);const C=t(class{constructor(t,s){this.id=t,this.index=s,this._id=38}encode(t){return t.uint(38)&&t.uint(this.id)&&t.uint(this.index)}});s.set(38,C);const A=t(class{constructor(t,s,i,n,e,r,o){this.method=t,this.url=s,this.request=i,this.response=n,this.status=e,this.timestamp=r,this.duration=o,this._id=39}encode(t){return t.uint(39)&&t.string(this.method)&&t.string(this.url)&&t.string(this.request)&&t.string(this.response)&&t.uint(this.status)&&t.uint(this.timestamp)&&t.uint(this.duration)}});s.set(39,A);const M=t(class{constructor(t,s,i,n){this.name=t,this.duration=s,this.args=i,this.result=n,this._id=40}encode(t){return t.uint(40)&&t.string(this.name)&&t.uint(this.duration)&&t.string(this.args)&&t.string(this.result)}});s.set(40,M);const R=t(class{constructor(t,s){this.key=t,this.value=s,this._id=41}encode(t){return t.uint(41)&&t.string(this.key)&&t.string(this.value)}});s.set(41,R);const U=t(class{constructor(t){this.type=t,this._id=42}encode(t){return t.uint(42)&&t.string(this.type)}});s.set(42,U);const N=t(class{constructor(t,s,i){this.action=t,this.state=s,this.duration=i,this._id=44}encode(t){return t.uint(44)&&t.string(this.action)&&t.string(this.state)&&t.uint(this.duration)}});s.set(44,N);const O=t(class{constructor(t,s){this.mutation=t,this.state=s,this._id=45}encode(t){return t.uint(45)&&t.string(this.mutation)&&t.string(this.state)}});s.set(45,O);const q=t(class{constructor(t,s){this.type=t,this.payload=s,this._id=46}encode(t){return t.uint(46)&&t.string(this.type)&&t.string(this.payload)}});s.set(46,q);const D=t(class{constructor(t,s,i){this.action=t,this.state=s,this.duration=i,this._id=47}encode(t){return t.uint(47)&&t.string(this.action)&&t.string(this.state)&&t.uint(this.duration)}});s.set(47,D);const H=t(class{constructor(t,s,i,n){this.operationKind=t,this.operationName=s,this.variables=i,this.response=n,this._id=48}encode(t){return t.uint(48)&&t.string(this.operationKind)&&t.string(this.operationName)&&t.string(this.variables)&&t.string(this.response)}});s.set(48,H);const P=t(class{constructor(t,s,i,n){this.frames=t,this.ticks=s,this.totalJSHeapSize=i,this.usedJSHeapSize=n,this._id=49}encode(t){return t.uint(49)&&t.int(this.frames)&&t.int(this.ticks)&&t.uint(this.totalJSHeapSize)&&t.uint(this.usedJSHeapSize)}});s.set(49,P);const B=t(class{constructor(t,s,i,n,e,r,o,h){this.timestamp=t,this.duration=s,this.ttfb=i,this.headerSize=n,this.encodedBodySize=e,this.decodedBodySize=r,this.url=o,this.initiator=h,this._id=53}encode(t){return t.uint(53)&&t.uint(this.timestamp)&&t.uint(this.duration)&&t.uint(this.ttfb)&&t.uint(this.headerSize)&&t.uint(this.encodedBodySize)&&t.uint(this.decodedBodySize)&&t.string(this.url)&&t.string(this.initiator)}});s.set(53,B);const J=t(class{constructor(t,s){this.downlink=t,this.type=s,this._id=54}encode(t){return t.uint(54)&&t.uint(this.downlink)&&t.string(this.type)}});s.set(54,J);const j=t(class{constructor(t){this.hidden=t,this._id=55}encode(t){return t.uint(55)&&t.boolean(this.hidden)}});s.set(55,j);const K=t(class{constructor(t,s,i,n,e,r,o){this.timestamp=t,this.duration=s,this.context=i,this.containerType=n,this.containerSrc=e,this.containerId=r,this.containerName=o,this._id=59}encode(t){return t.uint(59)&&t.uint(this.timestamp)&&t.uint(this.duration)&&t.uint(this.context)&&t.uint(this.containerType)&&t.string(this.containerSrc)&&t.string(this.containerId)&&t.string(this.containerName)}});s.set(59,K);const G=t(class{constructor(t,s,i,n){this.id=t,this.name=s,this.value=i,this.baseURL=n,this._id=60}encode(t){return t.uint(60)&&t.uint(this.id)&&t.string(this.name)&&t.string(this.value)&&t.string(this.baseURL)}});s.set(60,G);const X=t(class{constructor(t,s,i){this.id=t,this.data=s,this.baseURL=i,this._id=61}encode(t){return t.uint(61)&&t.uint(this.id)&&t.string(this.data)&&t.string(this.baseURL)}});s.set(61,X);const F=t(class{constructor(t,s){this.type=t,this.value=s,this._id=63}encode(t){return t.uint(63)&&t.string(this.type)&&t.string(this.value)}});s.set(63,F);const Q=t(class{constructor(t,s){this.name=t,this.payload=s,this._id=64}encode(t){return t.uint(64)&&t.string(this.name)&&t.string(this.payload)}});s.set(64,Q);const V=t(class{constructor(){this._id=65}encode(t){return t.uint(65)}});s.set(65,V);const W=t(class{constructor(t,s,i,n){this.id=t,this.rule=s,this.index=i,this.baseURL=n,this._id=67}encode(t){return t.uint(67)&&t.uint(this.id)&&t.string(this.rule)&&t.uint(this.index)&&t.string(this.baseURL)}});s.set(67,W);const Y="function"==typeof TextEncoder?new TextEncoder:{encode(t){const s=t.length,i=new Uint8Array(3*s);let n=-1;for(var e=0,r=0,o=0;o!==s;){if(e=t.charCodeAt(o),o+=1,e>=55296&&e<=56319){if(o===s){i[n+=1]=239,i[n+=1]=191,i[n+=1]=189;break}if(!((r=t.charCodeAt(o))>=56320&&r<=57343)){i[n+=1]=239,i[n+=1]=191,i[n+=1]=189;continue}if(o+=1,(e=1024*(e-55296)+r-56320+65536)>65535){i[n+=1]=240|e>>>18,i[n+=1]=128|e>>>12&63,i[n+=1]=128|e>>>6&63,i[n+=1]=128|63&e;continue}}e<=127?i[n+=1]=0|e:e<=2047?(i[n+=1]=192|e>>>6,i[n+=1]=128|63&e):(i[n+=1]=224|e>>>12,i[n+=1]=128|e>>>6&63,i[n+=1]=128|63&e)}return i.subarray(0,n+1)}};class Z{constructor(t){this.size=t,this.offset=0,this.checkpontOffset=0,this.data=new Uint8Array(t)}checkpoint(){this.checkpontOffset=this.offset}isEmpty(){return 0===this.offset}boolean(t){return this.data[this.offset++]=+t,this.offset<=this.size}uint(t){for(;t>=128;)this.data[this.offset++]=t%256|128,t=Math.floor(t/128);return this.data[this.offset++]=t,this.offset<=this.size}int(t){return t=Math.round(t),this.uint(t>=0?2*t:-2*t-1)}string(t){const s=Y.encode(t),i=s.byteLength;return!(!this.uint(i)||this.offset+i>this.size)&&(this.data.set(s,this.offset),this.offset+=i,!0)}reset(){this.offset=0,this.checkpontOffset=0}flush(){const t=this.data.slice(0,this.checkpontOffset);return this.reset(),t}}let $,tt=4e5,st=new Z(tt),it="",nt="",et=0,rt=0,ot=0,ht=0,ct=!0;function ut(){return new i(et,ht,rt).encode(st)}const at=[];let dt,lt=!1,gt=0,ft=8e3,pt=10;function mt(){if(ct||""===nt||""===it)return;const t=st.flush();lt?at.push(t):(lt=!0,function t(s){const i=new XMLHttpRequest;i.open("POST",it+"/v1/web/i",!1),i.setRequestHeader("Authorization","Bearer "+nt),i.onreadystatechange=function(){if(4===this.readyState){if(0==this.status)return;if(this.status>=400)return _t(),at.length=0,403===this.status?void self.postMessage("restart"):void self.postMessage(null);const s=at.shift();s?t(s):lt=!1}},i.onerror=function(i){if(gt>=pt)return _t(),void self.postMessage(null);gt++,setTimeout(()=>t(s),ft)},i.send(s.buffer)}(t)),ct=!0,ut()}function _t(){it="",nt="",clearInterval($),st.reset()}self.onmessage=({data:t})=>{if(null!==t)return"stop"===t?(mt(),void _t()):Array.isArray(t)?void t.forEach(t=>{const i=new(s.get(t._id));if(Object.assign(i,t),i instanceof n?rt=i.timestamp:i instanceof j&&(i.hidden?dt=setTimeout(()=>self.postMessage("restart"),3e5):clearTimeout(dt)),st.checkpoint(),!i.encode(st)&&(mt(),!i.encode(st)))for(;!i.encode(st);){if(1e6===tt)return console.warn("OpenReplay: beacon size overflow."),st.reset(),void ut();tt=Math.min(2*tt,1e6),st=new Z(tt),ut()}ht++,ct=!1}):(it=t.ingestPoint||it,nt=t.token||nt,et=t.pageNo||et,rt=t.startTimestamp||rt,ot=t.timeAdjustment||ot,pt=t.connAttemptCount||pt,ft=t.connAttemptGap||ft,tt=Math.min(1e6,t.beaconSize||tt),st.isEmpty()&&ut(),void(null==$&&($=setInterval(mt,2e4))));mt()}; | ||
this.worker = new Worker(URL.createObjectURL(new Blob([`"use strict";function t(t){function s(...s){return new t(...s)}return s.prototype=t.prototype,s}const s=new Map;const i=t(class{constructor(t,s,i){this.pageNo=t,this.firstIndex=s,this.timestamp=i,this._id=80}encode(t){return t.uint(80)&&t.uint(this.pageNo)&&t.uint(this.firstIndex)&&t.int(this.timestamp)}});s.set(80,i);const n=t(class{constructor(t){this.timestamp=t,this._id=0}encode(t){return t.uint(0)&&t.uint(this.timestamp)}});s.set(0,n);const e=t(class{constructor(t,s,i){this.url=t,this.referrer=s,this.navigationStart=i,this._id=4}encode(t){return t.uint(4)&&t.string(this.url)&&t.string(this.referrer)&&t.uint(this.navigationStart)}});s.set(4,e);const r=t(class{constructor(t,s){this.width=t,this.height=s,this._id=5}encode(t){return t.uint(5)&&t.uint(this.width)&&t.uint(this.height)}});s.set(5,r);const o=t(class{constructor(t,s){this.x=t,this.y=s,this._id=6}encode(t){return t.uint(6)&&t.int(this.x)&&t.int(this.y)}});s.set(6,o);const h=t(class{constructor(){this._id=7}encode(t){return t.uint(7)}});s.set(7,h);const c=t(class{constructor(t,s,i,n,e){this.id=t,this.parentID=s,this.index=i,this.tag=n,this.svg=e,this._id=8}encode(t){return t.uint(8)&&t.uint(this.id)&&t.uint(this.parentID)&&t.uint(this.index)&&t.string(this.tag)&&t.boolean(this.svg)}});s.set(8,c);const u=t(class{constructor(t,s,i){this.id=t,this.parentID=s,this.index=i,this._id=9}encode(t){return t.uint(9)&&t.uint(this.id)&&t.uint(this.parentID)&&t.uint(this.index)}});s.set(9,u);const a=t(class{constructor(t,s,i){this.id=t,this.parentID=s,this.index=i,this._id=10}encode(t){return t.uint(10)&&t.uint(this.id)&&t.uint(this.parentID)&&t.uint(this.index)}});s.set(10,a);const d=t(class{constructor(t){this.id=t,this._id=11}encode(t){return t.uint(11)&&t.uint(this.id)}});s.set(11,d);const l=t(class{constructor(t,s,i){this.id=t,this.name=s,this.value=i,this._id=12}encode(t){return t.uint(12)&&t.uint(this.id)&&t.string(this.name)&&t.string(this.value)}});s.set(12,l);const g=t(class{constructor(t,s){this.id=t,this.name=s,this._id=13}encode(t){return t.uint(13)&&t.uint(this.id)&&t.string(this.name)}});s.set(13,g);const f=t(class{constructor(t,s){this.id=t,this.data=s,this._id=14}encode(t){return t.uint(14)&&t.uint(this.id)&&t.string(this.data)}});s.set(14,f);const p=t(class{constructor(t,s,i){this.id=t,this.x=s,this.y=i,this._id=16}encode(t){return t.uint(16)&&t.uint(this.id)&&t.int(this.x)&&t.int(this.y)}});s.set(16,p);const m=t(class{constructor(t,s){this.id=t,this.label=s,this._id=17}encode(t){return t.uint(17)&&t.uint(this.id)&&t.string(this.label)}});s.set(17,m);const _=t(class{constructor(t,s,i){this.id=t,this.value=s,this.mask=i,this._id=18}encode(t){return t.uint(18)&&t.uint(this.id)&&t.string(this.value)&&t.int(this.mask)}});s.set(18,_);const y=t(class{constructor(t,s){this.id=t,this.checked=s,this._id=19}encode(t){return t.uint(19)&&t.uint(this.id)&&t.boolean(this.checked)}});s.set(19,y);const v=t(class{constructor(t,s){this.x=t,this.y=s,this._id=20}encode(t){return t.uint(20)&&t.uint(this.x)&&t.uint(this.y)}});s.set(20,v);const S=t(class{constructor(t,s){this.level=t,this.value=s,this._id=22}encode(t){return t.uint(22)&&t.string(this.level)&&t.string(this.value)}});s.set(22,S);const b=t(class{constructor(t,s,i,n,e,r,o,h,c){this.requestStart=t,this.responseStart=s,this.responseEnd=i,this.domContentLoadedEventStart=n,this.domContentLoadedEventEnd=e,this.loadEventStart=r,this.loadEventEnd=o,this.firstPaint=h,this.firstContentfulPaint=c,this._id=23}encode(t){return t.uint(23)&&t.uint(this.requestStart)&&t.uint(this.responseStart)&&t.uint(this.responseEnd)&&t.uint(this.domContentLoadedEventStart)&&t.uint(this.domContentLoadedEventEnd)&&t.uint(this.loadEventStart)&&t.uint(this.loadEventEnd)&&t.uint(this.firstPaint)&&t.uint(this.firstContentfulPaint)}});s.set(23,b);const x=t(class{constructor(t,s,i){this.speedIndex=t,this.visuallyComplete=s,this.timeToInteractive=i,this._id=24}encode(t){return t.uint(24)&&t.uint(this.speedIndex)&&t.uint(this.visuallyComplete)&&t.uint(this.timeToInteractive)}});s.set(24,x);const k=t(class{constructor(t,s,i){this.name=t,this.message=s,this.payload=i,this._id=25}encode(t){return t.uint(25)&&t.string(this.name)&&t.string(this.message)&&t.string(this.payload)}});s.set(25,k);const E=t(class{constructor(t,s){this.name=t,this.payload=s,this._id=27}encode(t){return t.uint(27)&&t.string(this.name)&&t.string(this.payload)}});s.set(27,E);const w=t(class{constructor(t){this.id=t,this._id=28}encode(t){return t.uint(28)&&t.string(this.id)}});s.set(28,w);const z=t(class{constructor(t){this.id=t,this._id=29}encode(t){return t.uint(29)&&t.string(this.id)}});s.set(29,z);const I=t(class{constructor(t,s){this.key=t,this.value=s,this._id=30}encode(t){return t.uint(30)&&t.string(this.key)&&t.string(this.value)}});s.set(30,I);const T=t(class{constructor(t,s,i){this.id=t,this.rule=s,this.index=i,this._id=37}encode(t){return t.uint(37)&&t.uint(this.id)&&t.string(this.rule)&&t.uint(this.index)}});s.set(37,T);const L=t(class{constructor(t,s){this.id=t,this.index=s,this._id=38}encode(t){return t.uint(38)&&t.uint(this.id)&&t.uint(this.index)}});s.set(38,L);const C=t(class{constructor(t,s,i,n,e,r,o){this.method=t,this.url=s,this.request=i,this.response=n,this.status=e,this.timestamp=r,this.duration=o,this._id=39}encode(t){return t.uint(39)&&t.string(this.method)&&t.string(this.url)&&t.string(this.request)&&t.string(this.response)&&t.uint(this.status)&&t.uint(this.timestamp)&&t.uint(this.duration)}});s.set(39,C);const A=t(class{constructor(t,s,i,n){this.name=t,this.duration=s,this.args=i,this.result=n,this._id=40}encode(t){return t.uint(40)&&t.string(this.name)&&t.uint(this.duration)&&t.string(this.args)&&t.string(this.result)}});s.set(40,A);const M=t(class{constructor(t,s){this.key=t,this.value=s,this._id=41}encode(t){return t.uint(41)&&t.string(this.key)&&t.string(this.value)}});s.set(41,M);const R=t(class{constructor(t){this.type=t,this._id=42}encode(t){return t.uint(42)&&t.string(this.type)}});s.set(42,R);const U=t(class{constructor(t,s,i){this.action=t,this.state=s,this.duration=i,this._id=44}encode(t){return t.uint(44)&&t.string(this.action)&&t.string(this.state)&&t.uint(this.duration)}});s.set(44,U);const N=t(class{constructor(t,s){this.mutation=t,this.state=s,this._id=45}encode(t){return t.uint(45)&&t.string(this.mutation)&&t.string(this.state)}});s.set(45,N);const O=t(class{constructor(t,s){this.type=t,this.payload=s,this._id=46}encode(t){return t.uint(46)&&t.string(this.type)&&t.string(this.payload)}});s.set(46,O);const q=t(class{constructor(t,s,i){this.action=t,this.state=s,this.duration=i,this._id=47}encode(t){return t.uint(47)&&t.string(this.action)&&t.string(this.state)&&t.uint(this.duration)}});s.set(47,q);const D=t(class{constructor(t,s,i,n){this.operationKind=t,this.operationName=s,this.variables=i,this.response=n,this._id=48}encode(t){return t.uint(48)&&t.string(this.operationKind)&&t.string(this.operationName)&&t.string(this.variables)&&t.string(this.response)}});s.set(48,D);const H=t(class{constructor(t,s,i,n){this.frames=t,this.ticks=s,this.totalJSHeapSize=i,this.usedJSHeapSize=n,this._id=49}encode(t){return t.uint(49)&&t.int(this.frames)&&t.int(this.ticks)&&t.uint(this.totalJSHeapSize)&&t.uint(this.usedJSHeapSize)}});s.set(49,H);const P=t(class{constructor(t,s,i,n,e,r,o,h){this.timestamp=t,this.duration=s,this.ttfb=i,this.headerSize=n,this.encodedBodySize=e,this.decodedBodySize=r,this.url=o,this.initiator=h,this._id=53}encode(t){return t.uint(53)&&t.uint(this.timestamp)&&t.uint(this.duration)&&t.uint(this.ttfb)&&t.uint(this.headerSize)&&t.uint(this.encodedBodySize)&&t.uint(this.decodedBodySize)&&t.string(this.url)&&t.string(this.initiator)}});s.set(53,P);const B=t(class{constructor(t,s){this.downlink=t,this.type=s,this._id=54}encode(t){return t.uint(54)&&t.uint(this.downlink)&&t.string(this.type)}});s.set(54,B);const J=t(class{constructor(t){this.hidden=t,this._id=55}encode(t){return t.uint(55)&&t.boolean(this.hidden)}});s.set(55,J);const j=t(class{constructor(t,s,i,n,e,r,o){this.timestamp=t,this.duration=s,this.context=i,this.containerType=n,this.containerSrc=e,this.containerId=r,this.containerName=o,this._id=59}encode(t){return t.uint(59)&&t.uint(this.timestamp)&&t.uint(this.duration)&&t.uint(this.context)&&t.uint(this.containerType)&&t.string(this.containerSrc)&&t.string(this.containerId)&&t.string(this.containerName)}});s.set(59,j);const K=t(class{constructor(t,s,i,n){this.id=t,this.name=s,this.value=i,this.baseURL=n,this._id=60}encode(t){return t.uint(60)&&t.uint(this.id)&&t.string(this.name)&&t.string(this.value)&&t.string(this.baseURL)}});s.set(60,K);const G=t(class{constructor(t,s,i){this.id=t,this.data=s,this.baseURL=i,this._id=61}encode(t){return t.uint(61)&&t.uint(this.id)&&t.string(this.data)&&t.string(this.baseURL)}});s.set(61,G);const X=t(class{constructor(t,s){this.type=t,this.value=s,this._id=63}encode(t){return t.uint(63)&&t.string(this.type)&&t.string(this.value)}});s.set(63,X);const F=t(class{constructor(t,s){this.name=t,this.payload=s,this._id=64}encode(t){return t.uint(64)&&t.string(this.name)&&t.string(this.payload)}});s.set(64,F);const Q=t(class{constructor(){this._id=65}encode(t){return t.uint(65)}});s.set(65,Q);const V=t(class{constructor(t,s,i,n){this.id=t,this.rule=s,this.index=i,this.baseURL=n,this._id=67}encode(t){return t.uint(67)&&t.uint(this.id)&&t.string(this.rule)&&t.uint(this.index)&&t.string(this.baseURL)}});s.set(67,V);const W=t(class{constructor(t,s,i,n){this.id=t,this.hesitationTime=s,this.label=i,this.selector=n,this._id=69}encode(t){return t.uint(69)&&t.uint(this.id)&&t.uint(this.hesitationTime)&&t.string(this.label)&&t.string(this.selector)}});s.set(69,W);const Y="function"==typeof TextEncoder?new TextEncoder:{encode(t){const s=t.length,i=new Uint8Array(3*s);let n=-1;for(var e=0,r=0,o=0;o!==s;){if(e=t.charCodeAt(o),o+=1,e>=55296&&e<=56319){if(o===s){i[n+=1]=239,i[n+=1]=191,i[n+=1]=189;break}if(!((r=t.charCodeAt(o))>=56320&&r<=57343)){i[n+=1]=239,i[n+=1]=191,i[n+=1]=189;continue}if(o+=1,(e=1024*(e-55296)+r-56320+65536)>65535){i[n+=1]=240|e>>>18,i[n+=1]=128|e>>>12&63,i[n+=1]=128|e>>>6&63,i[n+=1]=128|63&e;continue}}e<=127?i[n+=1]=0|e:e<=2047?(i[n+=1]=192|e>>>6,i[n+=1]=128|63&e):(i[n+=1]=224|e>>>12,i[n+=1]=128|e>>>6&63,i[n+=1]=128|63&e)}return i.subarray(0,n+1)}};class Z{constructor(t){this.size=t,this.offset=0,this.checkpointOffset=0,this.data=new Uint8Array(t)}checkpoint(){this.checkpointOffset=this.offset}isEmpty(){return 0===this.offset}boolean(t){return this.data[this.offset++]=+t,this.offset<=this.size}uint(t){for(;t>=128;)this.data[this.offset++]=t%256|128,t=Math.floor(t/128);return this.data[this.offset++]=t,this.offset<=this.size}int(t){return t=Math.round(t),this.uint(t>=0?2*t:-2*t-1)}string(t){const s=Y.encode(t),i=s.byteLength;return!(!this.uint(i)||this.offset+i>this.size)&&(this.data.set(s,this.offset),this.offset+=i,!0)}reset(){this.offset=0,this.checkpointOffset=0}flush(){const t=this.data.slice(0,this.checkpointOffset);return this.reset(),t}}let $,tt=4e5,st=new Z(tt),it="",nt="",et=0,rt=0,ot=0,ht=0,ct=!0;function ut(){return new i(et,ht,rt).encode(st)}const at=[];let dt,lt=!1,gt=0,ft=8e3,pt=10;function mt(){if(ct||""===nt||""===it)return;const t=st.flush();lt?at.push(t):(lt=!0,function t(s){const i=new XMLHttpRequest;i.open("POST",it+"/v1/web/i",!1),i.setRequestHeader("Authorization","Bearer "+nt),i.onreadystatechange=function(){if(4===this.readyState){if(0==this.status)return;if(this.status>=400)return _t(),at.length=0,403===this.status?void self.postMessage("restart"):void self.postMessage(null);const s=at.shift();s?t(s):lt=!1}},i.onerror=function(i){if(gt>=pt)return _t(),void self.postMessage(null);gt++,setTimeout(()=>t(s),ft)},i.send(s.buffer)}(t)),ct=!0,ut()}function _t(){it="",nt="",clearInterval($),st.reset()}self.onmessage=({data:t})=>{if(null!==t)return"stop"===t?(mt(),void _t()):Array.isArray(t)?void t.forEach(t=>{const i=new(s.get(t._id));if(Object.assign(i,t),i instanceof n?rt=i.timestamp:i instanceof J&&(i.hidden?dt=setTimeout(()=>self.postMessage("restart"),3e5):clearTimeout(dt)),st.checkpoint(),!i.encode(st)&&(mt(),!i.encode(st)))for(;!i.encode(st);){if(1e6===tt)return console.warn("OpenReplay: beacon size overflow."),st.reset(),void ut();tt=Math.min(2*tt,1e6),st=new Z(tt),ut()}ht++,ct=!1}):(it=t.ingestPoint||it,nt=t.token||nt,et=t.pageNo||et,rt=t.startTimestamp||rt,ot=t.timeAdjustment||ot,pt=t.connAttemptCount||pt,ft=t.connAttemptGap||ft,tt=Math.min(1e6,t.beaconSize||tt),st.isEmpty()&&ut(),void(null==$&&($=setInterval(mt,2e4))));mt()}; | ||
`], { type: 'text/javascript' }))); | ||
@@ -157,3 +157,3 @@ // this.worker.onerror = e => { | ||
}; | ||
this.worker.postMessage(messageData); // brings delay of 10th ms? | ||
this.worker.postMessage(messageData); // brings delay of 10th ms? | ||
window.fetch(this.options.ingestPoint + '/v1/web/start', { | ||
@@ -189,3 +189,3 @@ method: 'POST', | ||
typeof userUUID !== 'string') { | ||
throw new Error("Incorrect server responce"); | ||
throw new Error("Incorrect server response"); | ||
} | ||
@@ -201,4 +201,4 @@ sessionStorage.setItem(this.options.session_token_key, token); | ||
this.worker.postMessage({ token }); | ||
this.startCallbacks.forEach((cb) => cb()); | ||
this.observer.observe(); | ||
this.startCallbacks.forEach((cb) => cb()); | ||
this.ticker.start(); | ||
@@ -205,0 +205,0 @@ log("OpenReplay tracking started."); |
@@ -18,3 +18,3 @@ import App, { DEFAULT_INGEST_POINT } from './app'; | ||
import CSSRules from './modules/cssrules'; | ||
import { IN_BROWSER, depricationWarn } from './utils'; | ||
import { IN_BROWSER, deprecationWarn } from './utils'; | ||
const DOCS_SETUP = '/installation/setup-or'; | ||
@@ -34,3 +34,3 @@ function processOptions(obj) { | ||
obj.projectKey = obj.projectID.toString(); | ||
depricationWarn("`projectID` option", "`projectKey` option", DOCS_SETUP); | ||
deprecationWarn("`projectID` option", "`projectKey` option", DOCS_SETUP); | ||
} | ||
@@ -102,3 +102,3 @@ } | ||
else { | ||
console.log("OpenReplay: broeser doesn't support API required for tracking."); | ||
console.log("OpenReplay: browser doesn't support API required for tracking."); | ||
const req = new XMLHttpRequest(); | ||
@@ -110,3 +110,3 @@ const orig = options.ingestPoint || DEFAULT_INGEST_POINT; | ||
req.send(JSON.stringify({ | ||
trackerVersion: '3.1.0', | ||
trackerVersion: '3.2.0', | ||
projectKey: options.projectKey, | ||
@@ -128,3 +128,3 @@ doNotTrack, | ||
active() { | ||
depricationWarn("'active' method", "'isActive' method", "/"); | ||
deprecationWarn("'active' method", "'isActive' method", "/"); | ||
return this.isActive(); | ||
@@ -161,3 +161,3 @@ } | ||
sessionID() { | ||
depricationWarn("'sessionID' method", "'getSessionID' method", "/"); | ||
deprecationWarn("'sessionID' method", "'getSessionID' method", "/"); | ||
return this.getSessionID(); | ||
@@ -171,3 +171,3 @@ } | ||
userID(id) { | ||
depricationWarn("'userID' method", "'setUserID' method", "/"); | ||
deprecationWarn("'userID' method", "'setUserID' method", "/"); | ||
this.setUserID(id); | ||
@@ -181,3 +181,3 @@ } | ||
userAnonymousID(id) { | ||
depricationWarn("'userAnonymousID' method", "'setUserAnonymousID' method", "/"); | ||
deprecationWarn("'userAnonymousID' method", "'setUserAnonymousID' method", "/"); | ||
this.setUserAnonymousID(id); | ||
@@ -193,3 +193,3 @@ } | ||
metadata(key, value) { | ||
depricationWarn("'metadata' method", "'setMetadata' method", "/"); | ||
deprecationWarn("'metadata' method", "'setMetadata' method", "/"); | ||
this.setMetadata(key, value); | ||
@@ -196,0 +196,0 @@ } |
@@ -154,11 +154,2 @@ import Message from './message'; | ||
export declare const MouseMove: typeof _MouseMove & ((x: number, y: number) => _MouseMove); | ||
declare class _MouseClick implements Message { | ||
id: number; | ||
hesitationTime: number; | ||
label: string; | ||
readonly _id: number; | ||
constructor(id: number, hesitationTime: number, label: string); | ||
encode(writer: Writer): boolean; | ||
} | ||
export declare const MouseClick: typeof _MouseClick & ((id: number, hesitationTime: number, label: string) => _MouseClick); | ||
declare class _ConsoleLog implements Message { | ||
@@ -437,2 +428,12 @@ level: string; | ||
export declare const CSSInsertRuleURLBased: typeof _CSSInsertRuleURLBased & ((id: number, rule: string, index: number, baseURL: string) => _CSSInsertRuleURLBased); | ||
declare class _MouseClick implements Message { | ||
id: number; | ||
hesitationTime: number; | ||
label: string; | ||
selector: string; | ||
readonly _id: number; | ||
constructor(id: number, hesitationTime: number, label: string, selector: string); | ||
encode(writer: Writer): boolean; | ||
} | ||
export declare const MouseClick: typeof _MouseClick & ((id: number, hesitationTime: number, label: string, selector: string) => _MouseClick); | ||
export {}; |
@@ -273,18 +273,2 @@ function bindNew(Class) { | ||
classes.set(20, MouseMove); | ||
class _MouseClick { | ||
constructor(id, hesitationTime, label) { | ||
this.id = id; | ||
this.hesitationTime = hesitationTime; | ||
this.label = label; | ||
this._id = 21; | ||
} | ||
encode(writer) { | ||
return writer.uint(21) && | ||
writer.uint(this.id) && | ||
writer.uint(this.hesitationTime) && | ||
writer.string(this.label); | ||
} | ||
} | ||
export const MouseClick = bindNew(_MouseClick); | ||
classes.set(21, MouseClick); | ||
class _ConsoleLog { | ||
@@ -776,1 +760,19 @@ constructor(level, value) { | ||
classes.set(67, CSSInsertRuleURLBased); | ||
class _MouseClick { | ||
constructor(id, hesitationTime, label, selector) { | ||
this.id = id; | ||
this.hesitationTime = hesitationTime; | ||
this.label = label; | ||
this.selector = selector; | ||
this._id = 69; | ||
} | ||
encode(writer) { | ||
return writer.uint(69) && | ||
writer.uint(this.id) && | ||
writer.uint(this.hesitationTime) && | ||
writer.string(this.label) && | ||
writer.string(this.selector); | ||
} | ||
} | ||
export const MouseClick = bindNew(_MouseClick); | ||
classes.set(69, MouseClick); |
export default class Writer { | ||
private readonly size; | ||
private offset; | ||
private checkpontOffset; | ||
private checkpointOffset; | ||
private readonly data; | ||
@@ -6,0 +6,0 @@ constructor(size: number); |
@@ -65,7 +65,7 @@ const textEncoder = typeof TextEncoder === 'function' | ||
this.offset = 0; | ||
this.checkpontOffset = 0; | ||
this.checkpointOffset = 0; | ||
this.data = new Uint8Array(size); | ||
} | ||
checkpoint() { | ||
this.checkpontOffset = this.offset; | ||
this.checkpointOffset = this.offset; | ||
} | ||
@@ -103,6 +103,6 @@ isEmpty() { | ||
this.offset = 0; | ||
this.checkpontOffset = 0; | ||
this.checkpointOffset = 0; | ||
} | ||
flush() { | ||
const data = this.data.slice(0, this.checkpontOffset); | ||
const data = this.data.slice(0, this.checkpointOffset); | ||
this.reset(); | ||
@@ -109,0 +109,0 @@ return data; |
@@ -0,4 +1,9 @@ | ||
import { finder } from '@medv/finder'; | ||
import { normSpaces, hasOpenreplayAttribute, getLabelAttribute } from '../utils'; | ||
import { MouseMove, MouseClick } from '../messages'; | ||
import { getInputLabel } from './input'; | ||
const selectorMap = {}; | ||
function getSelector(id, target) { | ||
return selectorMap[id] = selectorMap[id] || finder(target); | ||
} | ||
function getTarget(target) { | ||
@@ -105,3 +110,3 @@ if (target instanceof Element) { | ||
? Math.round(performance.now() - mouseTargetTime) | ||
: 0, getTargetLabel(target)), true); | ||
: 0, getTargetLabel(target), getSelector(id, target)), true); | ||
} | ||
@@ -108,0 +113,0 @@ mouseTarget = null; |
@@ -15,4 +15,4 @@ export declare function timestamp(): number; | ||
}; | ||
export declare function depricationWarn(nameOfFeature: string, useInstead: string, docsPath?: string): void; | ||
export declare function deprecationWarn(nameOfFeature: string, useInstead: string, docsPath?: string): void; | ||
export declare function getLabelAttribute(e: Element): string | null; | ||
export declare function hasOpenreplayAttribute(e: Element, name: string): boolean; |
@@ -27,7 +27,7 @@ export function timestamp() { | ||
const warnedFeatures = {}; | ||
export function depricationWarn(nameOfFeature, useInstead, docsPath = "/") { | ||
export function deprecationWarn(nameOfFeature, useInstead, docsPath = "/") { | ||
if (warnedFeatures[nameOfFeature]) { | ||
return; | ||
} | ||
warn(`OpenReplay: ${nameOfFeature} is depricated. ${useInstead ? `Please, use ${useInstead} instead.` : ""} Visit ${DOCS_HOST}${docsPath} for more information.`); | ||
warn(`OpenReplay: ${nameOfFeature} is deprecated. ${useInstead ? `Please, use ${useInstead} instead.` : ""} Visit ${DOCS_HOST}${docsPath} for more information.`); | ||
warnedFeatures[nameOfFeature] = true; | ||
@@ -42,3 +42,3 @@ } | ||
if (value !== null) { | ||
depricationWarn(`"data-asayer-label" attribute`, `"data-openreplay-label" attribute`, "/"); | ||
deprecationWarn(`"data-asayer-label" attribute`, `"data-openreplay-label" attribute`, "/"); | ||
} | ||
@@ -54,3 +54,3 @@ return value; | ||
if (e.hasAttribute(oldName)) { | ||
depricationWarn(`"${oldName}" attribute`, `"${newName}" attribute`, "/installation/sanitize-data"); | ||
deprecationWarn(`"${oldName}" attribute`, `"${newName}" attribute`, "/installation/sanitize-data"); | ||
return true; | ||
@@ -57,0 +57,0 @@ } |
{ | ||
"name": "@openreplay/tracker", | ||
"description": "The OpenReplay tracker main package", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"keywords": [ | ||
@@ -44,2 +44,3 @@ "logging", | ||
"dependencies": { | ||
"@medv/finder": "^2.0.0", | ||
"error-stack-parser": "^2.0.6" | ||
@@ -46,0 +47,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
282778
6914
2
218
9
0
60
+ Added@medv/finder@^2.0.0
+ Added@medv/finder@2.1.0(transitive)