@posthog/rrweb 0.0.43 → 0.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/image-bitmap-data-url-worker-ChEIhO0o.js.map +1 -0
- package/dist/rrweb.cjs +7 -2
- package/dist/rrweb.cjs.map +1 -1
- package/dist/rrweb.js +7 -2
- package/dist/rrweb.js.map +1 -1
- package/dist/rrweb.umd.cjs +7 -2
- package/dist/rrweb.umd.cjs.map +2 -2
- package/dist/rrweb.umd.min.cjs +11 -6
- package/dist/rrweb.umd.min.cjs.map +2 -2
- package/package.json +5 -5
- package/dist/image-bitmap-data-url-worker-DqRH07Di.js.map +0 -1
package/dist/rrweb.umd.min.cjs
CHANGED
|
@@ -96,6 +96,8 @@ or you can use record.mirror to access the mirror instance during recording.`;ex
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
const worker = self;
|
|
99
|
+
let reusableCanvas = null;
|
|
100
|
+
let reusableCtx = null;
|
|
99
101
|
worker.onmessage = async function(e) {
|
|
100
102
|
if ("OffscreenCanvas" in globalThis) {
|
|
101
103
|
const { id, bitmap, width, height, dataURLOptions } = e.data;
|
|
@@ -104,11 +106,14 @@ or you can use record.mirror to access the mirror instance during recording.`;ex
|
|
|
104
106
|
height,
|
|
105
107
|
dataURLOptions
|
|
106
108
|
);
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {
|
|
110
|
+
reusableCanvas = new OffscreenCanvas(width, height);
|
|
111
|
+
reusableCtx = reusableCanvas.getContext("2d");
|
|
112
|
+
}
|
|
113
|
+
reusableCtx.clearRect(0, 0, width, height);
|
|
114
|
+
reusableCtx.drawImage(bitmap, 0, 0);
|
|
110
115
|
bitmap.close();
|
|
111
|
-
const blob = await
|
|
116
|
+
const blob = await reusableCanvas.convertToBlob(dataURLOptions);
|
|
112
117
|
const type = blob.type;
|
|
113
118
|
const arrayBuffer = await blob.arrayBuffer();
|
|
114
119
|
const base64 = encode(arrayBuffer);
|
|
@@ -131,8 +136,8 @@ or you can use record.mirror to access the mirror instance during recording.`;ex
|
|
|
131
136
|
}
|
|
132
137
|
};
|
|
133
138
|
})();
|
|
134
|
-
//# sourceMappingURL=image-bitmap-data-url-worker-
|
|
135
|
-
`,Bn=typeof self!="undefined"&&self.Blob&&new Blob([Xo],{type:"text/javascript;charset=utf-8"});function yc(e){let t;try{if(t=Bn&&(self.URL||self.webkitURL).createObjectURL(Bn),!t)throw"";const r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch(r){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Xo),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class wc{constructor(t){R(this,"pendingCanvasMutations",new Map),R(this,"rafStamps",{latestId:0,invokeId:null}),R(this,"mirror"),R(this,"mutationCb"),R(this,"resetObservers"),R(this,"frozen",!1),R(this,"locked",!1),R(this,"rafIdTimestamp",null),R(this,"rafIdFlush",null),R(this,"processMutation",(f,l)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(f)||this.pendingCanvasMutations.set(f,[]),this.pendingCanvasMutations.get(f).push(l)});const{sampling:r="all",win:s,blockClass:i,blockSelector:o,recordCanvas:a,dataURLOptions:u}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(s,i,o,u),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,s,i,o,{dataURLOptions:u})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),this.rafIdTimestamp!==null&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),this.rafIdFlush!==null&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null)}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,s,i,o){const a=Ln(r,s,i,!0),u=new Map,f=new yc;f.onmessage=p=>{const{id:m}=p.data;if(u.set(m,!1),!("base64"in p.data))return;const{base64:g,type:w,width:y,height:S}=p.data;this.mutationCb({id:m,type:Me["2D"],commands:[{property:"clearRect",args:[0,0,y,S]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:g}],type:w}]},0,0]}]})};const l=1e3/t;let n=0,c;const d=()=>{const p=[],m=g=>{g.querySelectorAll("canvas").forEach(w=>{le(w,s,i,!0)||p.push(w)}),g.querySelectorAll("*").forEach(w=>{w.shadowRoot&&m(w.shadowRoot)})};return m(r.document),p},h=p=>{if(n&&p-n<l){c=requestAnimationFrame(h);return}n=p,d().forEach(async m=>{var g;const w=this.mirror.getId(m);if(u.get(w)||m.width===0||m.height===0)return;if(u.set(w,!0),["webgl","webgl2"].includes(m.__context)){const v=m.getContext(m.__context);((g=v==null?void 0:v.getContextAttributes())==null?void 0:g.preserveDrawingBuffer)===!1&&v.clear(v.COLOR_BUFFER_BIT)}const y=m.clientWidth||m.width,S=m.clientHeight||m.height,E=await createImageBitmap(m,{resizeWidth:y,resizeHeight:S});f.postMessage({id:w,bitmap:E,width:y,height:S,dataURLOptions:o.dataURLOptions},[E])}),c=requestAnimationFrame(h)};c=requestAnimationFrame(h),this.resetObservers=()=>{a(),cancelAnimationFrame(c)}}initCanvasMutationObserver(t,r,s,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const o=Ln(t,r,s,!1),a=pc(this.processMutation.bind(this),t,r,s,i),u=gc(this.processMutation.bind(this),t,r,s,i);this.resetObservers=()=>{o(),a(),u()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const s=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,s)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const s=this.pendingCanvasMutations.get(t);if(!s||r===-1)return;const i=s.map(a=>{const l=a,{type:u}=l;return ze(l,["type"])}),{type:o}=s[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}}class vc{constructor(t){R(this,"trackedLinkElements",new WeakSet),R(this,"mutationCb"),R(this,"adoptedStyleSheetCb"),R(this,"styleMirror",new Js),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 s={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,(u,f)=>({rule:Jn(u,o.href),index:f}))})),s.styleIds.push(a)}i.length>0&&(s.styles=i),this.adoptedStyleSheetCb(s)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class bc{constructor(){R(this,"nodeMap",new WeakMap),R(this,"active",!1)}inOtherBuffer(t,r){const s=this.nodeMap.get(t);return s&&Array.from(s).some(i=>i!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}}let K,Nt,os,Lt=!1;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((ri=e.contentWindow)==null?void 0:ri.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const de=Zn();function ke(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:s,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:u=null,maskTextClass:f="rr-mask",maskTextSelector:l=null,inlineStylesheet:n=!0,maskAllInputs:c,maskInputOptions:d,slimDOMOptions:h,maskInputFn:p,maskTextFn:m,hooks:g,packFn:w,sampling:y={},dataURLOptions:S={},mousemoveWait:E,recordDOM:v=!0,recordCanvas:b=!1,recordCrossOriginIframes:C=!1,recordAfter:x=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:N=!1,collectFonts:M=!1,inlineImages:P=!1,plugins:D,keepIframeSrcFn:ee=()=>!1,ignoreCSSAttributes:U=new Set([]),errorHandler:I}=e;Yu(I);const oe=L({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},S),_=C?window.parent===window:!0;let z=!1;if(!_)try{window.parent.document&&(z=!1)}catch(F){z=!0}if(_&&!t)throw new Error("emit function is required");if(!_&&!z)return()=>{};E!==void 0&&y.mousemove===void 0&&(y.mousemove=E),de.reset();const Z=c===!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}:d!==void 0?d:{password:!0},H=h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:h==="all",headMetaDescKeywords:h==="all",headTitleMutations:h==="all"}:h||{};Hs();let Re,be=0;const O=F=>{for(const te of D||[])te.eventProcessor&&(F=te.eventProcessor(F));return w&&!z&&(F=w(F)),F};K=(F,te)=>{var Y;const re=F;if(re.timestamp=at(),(Y=xe[0])!=null&&Y.isFrozen()&&re.type!==k.FullSnapshot&&!(re.type===k.IncrementalSnapshot&&re.data.source===T.Mutation)&&xe.forEach(me=>me.unfreeze()),_)t==null||t(O(re),te);else if(z){const me={type:"rrweb",event:O(re),origin:window.location.origin,isCheckout:te};window.parent.postMessage(me,"*")}if(re.type===k.FullSnapshot)Re=re,be=0;else if(re.type===k.IncrementalSnapshot){if(re.data.source===T.Mutation&&re.data.isAttachIframe)return;be++;const me=s&&be>=s,We=r&&re.timestamp-Re.timestamp>r;(me||We)&&Nt(!0)}};const he=F=>{if(C&&F.removes&&F.removes.length>0){const te=F.adds.length>0?new Set(F.adds.map(Y=>Y.node.id)):null;F.removes.forEach(({id:Y})=>{(!te||!te.has(Y))&&ue.removeIframeById(Y)})}K({type:k.IncrementalSnapshot,data:L({source:T.Mutation},F)})},fe=F=>K({type:k.IncrementalSnapshot,data:L({source:T.Scroll},F)}),$e=F=>K({type:k.IncrementalSnapshot,data:L({source:T.CanvasMutation},F)}),Se=F=>K({type:k.IncrementalSnapshot,data:L({source:T.AdoptedStyleSheet},F)}),pe=new vc({mutationCb:he,adoptedStyleSheetCb:Se}),ue=new uc({mirror:de,mutationCb:he,stylesheetManager:pe,recordCrossOriginIframes:C,wrappedEmit:K});for(const F of D||[])F.getMirror&&F.getMirror({nodeMirror:de,crossOriginIframeMirror:ue.crossOriginIframeMirror,crossOriginIframeStyleMirror:ue.crossOriginIframeStyleMirror});const Le=new bc;os=new wc({recordCanvas:b,mutationCb:$e,win:window,blockClass:i,blockSelector:o,mirror:de,sampling:y.canvas,dataURLOptions:oe});const se=new cc({mutationCb:he,scrollCb:fe,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:f,maskTextSelector:l,inlineStylesheet:n,maskInputOptions:Z,dataURLOptions:oe,maskTextFn:m,maskInputFn:p,recordCanvas:b,inlineImages:P,sampling:y,slimDOMOptions:H,iframeManager:ue,stylesheetManager:pe,canvasManager:os,keepIframeSrcFn:ee,processedNodeManager:Le},mirror:de});Nt=(F=!1)=>{if(!v)return;K({type:k.Meta,data:{href:window.location.href,width:qs(),height:zs()}},F),pe.reset(),se.init(),xe.forEach(Y=>Y.lock());const te=sl(document,{mirror:de,blockClass:i,blockSelector:o,maskTextClass:f,maskTextSelector:l,inlineStylesheet:n,maskAllInputs:Z,maskTextFn:m,maskInputFn:p,slimDOM:H,dataURLOptions:oe,recordCanvas:b,inlineImages:P,onSerialize:Y=>{Qe(Y,de)&&ue.addIframe(Y),Ys(Y,de)&&pe.trackLinkElement(Y),Oe(Y)&&se.addShadowRoot($.shadowRoot(Y),document)},onIframeLoad:(Y,re)=>{ue.attachIframe(Y,re),se.observeAttachShadow(Y)},onStylesheetLoad:(Y,re)=>{pe.attachLinkElement(Y,re)},keepIframeSrcFn:ee});if(!te)return console.warn("Failed to snapshot the document");K({type:k.FullSnapshot,data:{node:te,initialOffset:Ws(window)}},F),xe.forEach(Y=>Y.unlock()),C&&ue.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&pe.adoptStyleSheets(document.adoptedStyleSheets,de.getId(document))};try{const F=[],te=me=>{var We;return q(lc)({mutationCb:he,mousemoveCb:(X,Xt)=>K({type:k.IncrementalSnapshot,data:{source:Xt,positions:X}}),mouseInteractionCb:X=>K({type:k.IncrementalSnapshot,data:L({source:T.MouseInteraction},X)}),scrollCb:fe,viewportResizeCb:X=>K({type:k.IncrementalSnapshot,data:L({source:T.ViewportResize},X)}),inputCb:X=>K({type:k.IncrementalSnapshot,data:L({source:T.Input},X)}),mediaInteractionCb:X=>K({type:k.IncrementalSnapshot,data:L({source:T.MediaInteraction},X)}),styleSheetRuleCb:X=>K({type:k.IncrementalSnapshot,data:L({source:T.StyleSheetRule},X)}),styleDeclarationCb:X=>K({type:k.IncrementalSnapshot,data:L({source:T.StyleDeclaration},X)}),canvasMutationCb:$e,fontCb:X=>K({type:k.IncrementalSnapshot,data:L({source:T.Font},X)}),selectionCb:X=>{K({type:k.IncrementalSnapshot,data:L({source:T.Selection},X)})},customElementCb:X=>{K({type:k.IncrementalSnapshot,data:L({source:T.CustomElement},X)})},blockClass:i,ignoreClass:a,ignoreSelector:u,maskTextClass:f,maskTextSelector:l,maskInputOptions:Z,inlineStylesheet:n,sampling:y,recordDOM:v,recordCanvas:b,inlineImages:P,userTriggeredOnInput:N,collectFonts:M,doc:me,maskInputFn:p,maskTextFn:m,keepIframeSrcFn:ee,blockSelector:o,slimDOMOptions:H,dataURLOptions:oe,mirror:de,iframeManager:ue,stylesheetManager:pe,shadowDomManager:se,processedNodeManager:Le,canvasManager:os,ignoreCSSAttributes:U,plugins:((We=D==null?void 0:D.filter(X=>X.observer))==null?void 0:We.map(X=>({observer:X.observer,options:X.options,callback:Xt=>K({type:k.Plugin,data:{plugin:X.name,payload:Xt}})})))||[]},g)},Y=me=>{try{F.push(te(me.contentDocument))}catch(We){console.warn(We)}};ue.addLoadListener(Y);const re=()=>{Nt(),F.push(te(document)),Lt=!0};return document.readyState==="interactive"||document.readyState==="complete"?re():(F.push(ae("DOMContentLoaded",()=>{K({type:k.DomContentLoaded,data:{}}),x==="DOMContentLoaded"&&re()})),F.push(ae("load",()=>{K({type:k.Load,data:{}}),x==="load"&&re()},window))),()=>{F.forEach(me=>me()),Le.destroy(),ue.removeLoadListener(),ue.destroy(),de.reset(),Lt=!1,Xu()}}catch(F){console.warn(F)}}ke.addCustomEvent=(e,t)=>{if(!Lt)throw new Error("please add custom event after start recording");K({type:k.Custom,data:{tag:e,payload:t}})};ke.freezePage=()=>{xe.forEach(e=>e.freeze())};ke.takeFullSnapshot=e=>{if(!Lt)throw new Error("please take full snapshot after start recording");Nt(e)};ke.mirror=de;function Jo(e){return{all:e=e||new Map,on:function(t,r){var s=e.get(t);s?s.push(r):e.set(t,[r])},off:function(t,r){var s=e.get(t);s&&(r?s.splice(s.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var s=e.get(t);s&&s.slice().map(function(i){i(r)}),(s=e.get("*"))&&s.slice().map(function(i){i(t,r)})}}}const Sc=Object.freeze(Object.defineProperty({__proto__:null,default:Jo},Symbol.toStringTag,{value:"Module"}));function Cc(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const r=e.HTMLElement||e.Element,s=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||f,scrollIntoView:r.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function a(w){const y=["MSIE ","Trident/","Edge/"];return new RegExp(y.join("|")).test(w)}const u=a(e.navigator.userAgent)?1:0;function f(w,y){this.scrollLeft=w,this.scrollTop=y}function l(w){return .5*(1-Math.cos(Math.PI*w))}function n(w){if(w===null||typeof w!="object"||w.behavior===void 0||w.behavior==="auto"||w.behavior==="instant")return!0;if(typeof w=="object"&&w.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+w.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(w,y){if(y==="Y")return w.clientHeight+u<w.scrollHeight;if(y==="X")return w.clientWidth+u<w.scrollWidth}function d(w,y){const S=e.getComputedStyle(w,null)["overflow"+y];return S==="auto"||S==="scroll"}function h(w){const y=c(w,"Y")&&d(w,"Y"),S=c(w,"X")&&d(w,"X");return y||S}function p(w){for(;w!==t.body&&h(w)===!1;)w=w.parentNode||w.host;return w}function m(w){const y=o();let S,E,v,b=(y-w.startTime)/s;b=b>1?1:b,S=l(b),E=w.startX+(w.x-w.startX)*S,v=w.startY+(w.y-w.startY)*S,w.method.call(w.scrollable,E,v),(E!==w.x||v!==w.y)&&e.requestAnimationFrame(m.bind(e,w))}function g(w,y,S){let E,v,b,C;const x=o();w===t.body?(E=e,v=e.scrollX||e.pageXOffset,b=e.scrollY||e.pageYOffset,C=i.scroll):(E=w,v=w.scrollLeft,b=w.scrollTop,C=f),m({scrollable:E,method:C,startTime:x,startX:v,startY:b,x:y,y:S})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(n(arguments[0])===!0){i.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}g.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(n(arguments[0])){i.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}g.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(n(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const w=arguments[0].left,y=arguments[0].top;g.call(this,this,typeof w=="undefined"?this.scrollLeft:~~w,typeof y=="undefined"?this.scrollTop:~~y)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(n(arguments[0])===!0){i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},r.prototype.scrollIntoView=function(){if(n(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const w=p(this),y=w.getBoundingClientRect(),S=this.getBoundingClientRect();w!==t.body?(g.call(this,w,w.scrollLeft+S.left-y.left,w.scrollTop+S.top-y.top),e.getComputedStyle(w).position!=="fixed"&&e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})):e.scrollBy({left:S.left,top:S.top,behavior:"smooth"})}}class Ec{constructor(t=[],r){R(this,"timeOffset",0),R(this,"speed"),R(this,"actions"),R(this,"raf",null),R(this,"lastTimestamp"),this.actions=t,this.speed=r.speed}addAction(t){const r=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=t.delay)this.actions.push(t);else{const s=this.findActionIndex(t);this.actions.splice(s,0,t)}r&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const t=performance.now();for(this.timeOffset+=(t-this.lastTimestamp)*this.speed,this.lastTimestamp=t;this.actions.length;){const r=this.actions[0];if(this.timeOffset>=r.delay)this.actions.shift(),r.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}isActive(){return this.raf!==null}findActionIndex(t){let r=0,s=this.actions.length-1;for(;r<=s;){const i=Math.floor((r+s)/2);if(this.actions[i].delay<t.delay)r=i+1;else if(this.actions[i].delay>t.delay)s=i-1;else return i+1}return r}}function Un(e,t){if(e.type===k.IncrementalSnapshot&&e.data.source===T.MouseMove&&e.data.positions&&e.data.positions.length){const r=e.data.positions[0].timeOffset,s=e.timestamp+r;return e.delay=s-t,s-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
|
|
139
|
+
//# sourceMappingURL=image-bitmap-data-url-worker-ChEIhO0o.js.map
|
|
140
|
+
`,Bn=typeof self!="undefined"&&self.Blob&&new Blob([Xo],{type:"text/javascript;charset=utf-8"});function yc(e){let t;try{if(t=Bn&&(self.URL||self.webkitURL).createObjectURL(Bn),!t)throw"";const r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch(r){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Xo),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class wc{constructor(t){R(this,"pendingCanvasMutations",new Map),R(this,"rafStamps",{latestId:0,invokeId:null}),R(this,"mirror"),R(this,"mutationCb"),R(this,"resetObservers"),R(this,"frozen",!1),R(this,"locked",!1),R(this,"rafIdTimestamp",null),R(this,"rafIdFlush",null),R(this,"processMutation",(f,l)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(f)||this.pendingCanvasMutations.set(f,[]),this.pendingCanvasMutations.get(f).push(l)});const{sampling:r="all",win:s,blockClass:i,blockSelector:o,recordCanvas:a,dataURLOptions:u}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(s,i,o,u),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,s,i,o,{dataURLOptions:u})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),this.rafIdTimestamp!==null&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),this.rafIdFlush!==null&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null)}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,s,i,o){if(!("OffscreenCanvas"in r))return;const a=Ln(r,s,i,!0),u=new Map,f=new yc;f.onmessage=p=>{const{id:m}=p.data;if(u.set(m,!1),!("base64"in p.data))return;const{base64:g,type:w,width:y,height:S}=p.data;this.mutationCb({id:m,type:Me["2D"],commands:[{property:"clearRect",args:[0,0,y,S]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:g}],type:w}]},0,0]}],displayWidth:y,displayHeight:S})};const l=1e3/t;let n=0,c;const d=()=>{const p=[],m=g=>{g.querySelectorAll("canvas").forEach(w=>{le(w,s,i,!0)||p.push(w)}),g.querySelectorAll("*").forEach(w=>{w.shadowRoot&&m(w.shadowRoot)})};return m(r.document),p},h=p=>{if(n&&p-n<l){c=requestAnimationFrame(h);return}n=p,d().forEach(async m=>{var g;const w=this.mirror.getId(m);if(u.get(w)||m.width===0||m.height===0)return;if(u.set(w,!0),["webgl","webgl2"].includes(m.__context)){const v=m.getContext(m.__context);((g=v==null?void 0:v.getContextAttributes())==null?void 0:g.preserveDrawingBuffer)===!1&&v.clear(v.COLOR_BUFFER_BIT)}const y=m.clientWidth||m.width,S=m.clientHeight||m.height,E=await createImageBitmap(m,{resizeWidth:y,resizeHeight:S});f.postMessage({id:w,bitmap:E,width:y,height:S,dataURLOptions:o.dataURLOptions},[E])}),c=requestAnimationFrame(h)};c=requestAnimationFrame(h),this.resetObservers=()=>{a(),cancelAnimationFrame(c)}}initCanvasMutationObserver(t,r,s,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const o=Ln(t,r,s,!1),a=pc(this.processMutation.bind(this),t,r,s,i),u=gc(this.processMutation.bind(this),t,r,s,i);this.resetObservers=()=>{o(),a(),u()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const s=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,s)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const s=this.pendingCanvasMutations.get(t);if(!s||r===-1)return;const i=s.map(a=>{const l=a,{type:u}=l;return ze(l,["type"])}),{type:o}=s[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}}class vc{constructor(t){R(this,"trackedLinkElements",new WeakSet),R(this,"mutationCb"),R(this,"adoptedStyleSheetCb"),R(this,"styleMirror",new Js),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 s={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,(u,f)=>({rule:Jn(u,o.href),index:f}))})),s.styleIds.push(a)}i.length>0&&(s.styles=i),this.adoptedStyleSheetCb(s)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class bc{constructor(){R(this,"nodeMap",new WeakMap),R(this,"active",!1)}inOtherBuffer(t,r){const s=this.nodeMap.get(t);return s&&Array.from(s).some(i=>i!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}}let K,Nt,os,Lt=!1;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((ri=e.contentWindow)==null?void 0:ri.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const de=Zn();function ke(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:s,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:u=null,maskTextClass:f="rr-mask",maskTextSelector:l=null,inlineStylesheet:n=!0,maskAllInputs:c,maskInputOptions:d,slimDOMOptions:h,maskInputFn:p,maskTextFn:m,hooks:g,packFn:w,sampling:y={},dataURLOptions:S={},mousemoveWait:E,recordDOM:v=!0,recordCanvas:b=!1,recordCrossOriginIframes:C=!1,recordAfter:x=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:N=!1,collectFonts:M=!1,inlineImages:P=!1,plugins:D,keepIframeSrcFn:ee=()=>!1,ignoreCSSAttributes:U=new Set([]),errorHandler:I}=e;Yu(I);const oe=L({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},S),_=C?window.parent===window:!0;let z=!1;if(!_)try{window.parent.document&&(z=!1)}catch(F){z=!0}if(_&&!t)throw new Error("emit function is required");if(!_&&!z)return()=>{};E!==void 0&&y.mousemove===void 0&&(y.mousemove=E),de.reset();const Z=c===!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}:d!==void 0?d:{password:!0},H=h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:h==="all",headMetaDescKeywords:h==="all",headTitleMutations:h==="all"}:h||{};Hs();let Re,be=0;const O=F=>{for(const te of D||[])te.eventProcessor&&(F=te.eventProcessor(F));return w&&!z&&(F=w(F)),F};K=(F,te)=>{var Y;const re=F;if(re.timestamp=at(),(Y=xe[0])!=null&&Y.isFrozen()&&re.type!==k.FullSnapshot&&!(re.type===k.IncrementalSnapshot&&re.data.source===T.Mutation)&&xe.forEach(me=>me.unfreeze()),_)t==null||t(O(re),te);else if(z){const me={type:"rrweb",event:O(re),origin:window.location.origin,isCheckout:te};window.parent.postMessage(me,"*")}if(re.type===k.FullSnapshot)Re=re,be=0;else if(re.type===k.IncrementalSnapshot){if(re.data.source===T.Mutation&&re.data.isAttachIframe)return;be++;const me=s&&be>=s,We=r&&re.timestamp-Re.timestamp>r;(me||We)&&Nt(!0)}};const he=F=>{if(C&&F.removes&&F.removes.length>0){const te=F.adds.length>0?new Set(F.adds.map(Y=>Y.node.id)):null;F.removes.forEach(({id:Y})=>{(!te||!te.has(Y))&&ue.removeIframeById(Y)})}K({type:k.IncrementalSnapshot,data:L({source:T.Mutation},F)})},fe=F=>K({type:k.IncrementalSnapshot,data:L({source:T.Scroll},F)}),$e=F=>K({type:k.IncrementalSnapshot,data:L({source:T.CanvasMutation},F)}),Se=F=>K({type:k.IncrementalSnapshot,data:L({source:T.AdoptedStyleSheet},F)}),pe=new vc({mutationCb:he,adoptedStyleSheetCb:Se}),ue=new uc({mirror:de,mutationCb:he,stylesheetManager:pe,recordCrossOriginIframes:C,wrappedEmit:K});for(const F of D||[])F.getMirror&&F.getMirror({nodeMirror:de,crossOriginIframeMirror:ue.crossOriginIframeMirror,crossOriginIframeStyleMirror:ue.crossOriginIframeStyleMirror});const Le=new bc;os=new wc({recordCanvas:b,mutationCb:$e,win:window,blockClass:i,blockSelector:o,mirror:de,sampling:y.canvas,dataURLOptions:oe});const se=new cc({mutationCb:he,scrollCb:fe,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:f,maskTextSelector:l,inlineStylesheet:n,maskInputOptions:Z,dataURLOptions:oe,maskTextFn:m,maskInputFn:p,recordCanvas:b,inlineImages:P,sampling:y,slimDOMOptions:H,iframeManager:ue,stylesheetManager:pe,canvasManager:os,keepIframeSrcFn:ee,processedNodeManager:Le},mirror:de});Nt=(F=!1)=>{if(!v)return;K({type:k.Meta,data:{href:window.location.href,width:qs(),height:zs()}},F),pe.reset(),se.init(),xe.forEach(Y=>Y.lock());const te=sl(document,{mirror:de,blockClass:i,blockSelector:o,maskTextClass:f,maskTextSelector:l,inlineStylesheet:n,maskAllInputs:Z,maskTextFn:m,maskInputFn:p,slimDOM:H,dataURLOptions:oe,recordCanvas:b,inlineImages:P,onSerialize:Y=>{Qe(Y,de)&&ue.addIframe(Y),Ys(Y,de)&&pe.trackLinkElement(Y),Oe(Y)&&se.addShadowRoot($.shadowRoot(Y),document)},onIframeLoad:(Y,re)=>{ue.attachIframe(Y,re),se.observeAttachShadow(Y)},onStylesheetLoad:(Y,re)=>{pe.attachLinkElement(Y,re)},keepIframeSrcFn:ee});if(!te)return console.warn("Failed to snapshot the document");K({type:k.FullSnapshot,data:{node:te,initialOffset:Ws(window)}},F),xe.forEach(Y=>Y.unlock()),C&&ue.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&pe.adoptStyleSheets(document.adoptedStyleSheets,de.getId(document))};try{const F=[],te=me=>{var We;return q(lc)({mutationCb:he,mousemoveCb:(X,Xt)=>K({type:k.IncrementalSnapshot,data:{source:Xt,positions:X}}),mouseInteractionCb:X=>K({type:k.IncrementalSnapshot,data:L({source:T.MouseInteraction},X)}),scrollCb:fe,viewportResizeCb:X=>K({type:k.IncrementalSnapshot,data:L({source:T.ViewportResize},X)}),inputCb:X=>K({type:k.IncrementalSnapshot,data:L({source:T.Input},X)}),mediaInteractionCb:X=>K({type:k.IncrementalSnapshot,data:L({source:T.MediaInteraction},X)}),styleSheetRuleCb:X=>K({type:k.IncrementalSnapshot,data:L({source:T.StyleSheetRule},X)}),styleDeclarationCb:X=>K({type:k.IncrementalSnapshot,data:L({source:T.StyleDeclaration},X)}),canvasMutationCb:$e,fontCb:X=>K({type:k.IncrementalSnapshot,data:L({source:T.Font},X)}),selectionCb:X=>{K({type:k.IncrementalSnapshot,data:L({source:T.Selection},X)})},customElementCb:X=>{K({type:k.IncrementalSnapshot,data:L({source:T.CustomElement},X)})},blockClass:i,ignoreClass:a,ignoreSelector:u,maskTextClass:f,maskTextSelector:l,maskInputOptions:Z,inlineStylesheet:n,sampling:y,recordDOM:v,recordCanvas:b,inlineImages:P,userTriggeredOnInput:N,collectFonts:M,doc:me,maskInputFn:p,maskTextFn:m,keepIframeSrcFn:ee,blockSelector:o,slimDOMOptions:H,dataURLOptions:oe,mirror:de,iframeManager:ue,stylesheetManager:pe,shadowDomManager:se,processedNodeManager:Le,canvasManager:os,ignoreCSSAttributes:U,plugins:((We=D==null?void 0:D.filter(X=>X.observer))==null?void 0:We.map(X=>({observer:X.observer,options:X.options,callback:Xt=>K({type:k.Plugin,data:{plugin:X.name,payload:Xt}})})))||[]},g)},Y=me=>{try{F.push(te(me.contentDocument))}catch(We){console.warn(We)}};ue.addLoadListener(Y);const re=()=>{Nt(),F.push(te(document)),Lt=!0};return document.readyState==="interactive"||document.readyState==="complete"?re():(F.push(ae("DOMContentLoaded",()=>{K({type:k.DomContentLoaded,data:{}}),x==="DOMContentLoaded"&&re()})),F.push(ae("load",()=>{K({type:k.Load,data:{}}),x==="load"&&re()},window))),()=>{F.forEach(me=>me()),Le.destroy(),ue.removeLoadListener(),ue.destroy(),de.reset(),Lt=!1,Xu()}}catch(F){console.warn(F)}}ke.addCustomEvent=(e,t)=>{if(!Lt)throw new Error("please add custom event after start recording");K({type:k.Custom,data:{tag:e,payload:t}})};ke.freezePage=()=>{xe.forEach(e=>e.freeze())};ke.takeFullSnapshot=e=>{if(!Lt)throw new Error("please take full snapshot after start recording");Nt(e)};ke.mirror=de;function Jo(e){return{all:e=e||new Map,on:function(t,r){var s=e.get(t);s?s.push(r):e.set(t,[r])},off:function(t,r){var s=e.get(t);s&&(r?s.splice(s.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var s=e.get(t);s&&s.slice().map(function(i){i(r)}),(s=e.get("*"))&&s.slice().map(function(i){i(t,r)})}}}const Sc=Object.freeze(Object.defineProperty({__proto__:null,default:Jo},Symbol.toStringTag,{value:"Module"}));function Cc(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const r=e.HTMLElement||e.Element,s=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||f,scrollIntoView:r.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function a(w){const y=["MSIE ","Trident/","Edge/"];return new RegExp(y.join("|")).test(w)}const u=a(e.navigator.userAgent)?1:0;function f(w,y){this.scrollLeft=w,this.scrollTop=y}function l(w){return .5*(1-Math.cos(Math.PI*w))}function n(w){if(w===null||typeof w!="object"||w.behavior===void 0||w.behavior==="auto"||w.behavior==="instant")return!0;if(typeof w=="object"&&w.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+w.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(w,y){if(y==="Y")return w.clientHeight+u<w.scrollHeight;if(y==="X")return w.clientWidth+u<w.scrollWidth}function d(w,y){const S=e.getComputedStyle(w,null)["overflow"+y];return S==="auto"||S==="scroll"}function h(w){const y=c(w,"Y")&&d(w,"Y"),S=c(w,"X")&&d(w,"X");return y||S}function p(w){for(;w!==t.body&&h(w)===!1;)w=w.parentNode||w.host;return w}function m(w){const y=o();let S,E,v,b=(y-w.startTime)/s;b=b>1?1:b,S=l(b),E=w.startX+(w.x-w.startX)*S,v=w.startY+(w.y-w.startY)*S,w.method.call(w.scrollable,E,v),(E!==w.x||v!==w.y)&&e.requestAnimationFrame(m.bind(e,w))}function g(w,y,S){let E,v,b,C;const x=o();w===t.body?(E=e,v=e.scrollX||e.pageXOffset,b=e.scrollY||e.pageYOffset,C=i.scroll):(E=w,v=w.scrollLeft,b=w.scrollTop,C=f),m({scrollable:E,method:C,startTime:x,startX:v,startY:b,x:y,y:S})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(n(arguments[0])===!0){i.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}g.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(n(arguments[0])){i.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}g.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(n(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const w=arguments[0].left,y=arguments[0].top;g.call(this,this,typeof w=="undefined"?this.scrollLeft:~~w,typeof y=="undefined"?this.scrollTop:~~y)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(n(arguments[0])===!0){i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},r.prototype.scrollIntoView=function(){if(n(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const w=p(this),y=w.getBoundingClientRect(),S=this.getBoundingClientRect();w!==t.body?(g.call(this,w,w.scrollLeft+S.left-y.left,w.scrollTop+S.top-y.top),e.getComputedStyle(w).position!=="fixed"&&e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})):e.scrollBy({left:S.left,top:S.top,behavior:"smooth"})}}class Ec{constructor(t=[],r){R(this,"timeOffset",0),R(this,"speed"),R(this,"actions"),R(this,"raf",null),R(this,"lastTimestamp"),this.actions=t,this.speed=r.speed}addAction(t){const r=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=t.delay)this.actions.push(t);else{const s=this.findActionIndex(t);this.actions.splice(s,0,t)}r&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const t=performance.now();for(this.timeOffset+=(t-this.lastTimestamp)*this.speed,this.lastTimestamp=t;this.actions.length;){const r=this.actions[0];if(this.timeOffset>=r.delay)this.actions.shift(),r.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}isActive(){return this.raf!==null}findActionIndex(t){let r=0,s=this.actions.length-1;for(;r<=s;){const i=Math.floor((r+s)/2);if(this.actions[i].delay<t.delay)r=i+1;else if(this.actions[i].delay>t.delay)s=i-1;else return i+1}return r}}function Un(e,t){if(e.type===k.IncrementalSnapshot&&e.data.source===T.MouseMove&&e.data.positions&&e.data.positions.length){const r=e.data.positions[0].timeOffset,s=e.timestamp+r;return e.delay=s-t,s-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
|
|
136
141
|
Copyright (c) Microsoft Corporation.
|
|
137
142
|
|
|
138
143
|
Permission to use, copy, modify, and/or distribute this software for any
|