Socket
Socket
Sign inDemoInstall

rrweb

Package Overview
Dependencies
8
Maintainers
1
Versions
98
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0-alpha.11 to 2.0.0-alpha.12

es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createInlineWorkerFactory.js

3

dist/plugins/console-record.js

@@ -302,2 +302,5 @@ var rrwebConsoleRecord = (function (exports) {

}
if (typeof value === "bigint") {
return value.toString() + "n";
}
if (value instanceof Event) {

@@ -304,0 +307,0 @@ const eventResult = {};

2

dist/plugins/console-record.min.js

@@ -11,4 +11,4 @@ var rrwebConsoleRecord=function(O){"use strict";var L;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(L||(L={}));const g=`Please stop import mirror directly. Instead of that,\r

`),t=[];for(let i=0,s=n.length;i<s;i+=2){const a=r.exec(n[i]);a&&t.push(new N({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return t},parseOpera11:function(e){return e.stack.split(`
`).filter(function(r){return!!r.match(C)&&!r.match(/^Error created at/)},this).map(function(r){const n=r.split("@"),t=this.extractLocation(n.pop()),i=(n.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new N({functionName:i,fileName:t[0],lineNumber:t[1],columnNumber:t[2]})},this)}};function P(e){if(!e||!e.outerHTML)return"";let r="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();const t=e.parentElement,i=[];if(t.children&&t.children.length>0)for(let s=0;s<t.children.length;s++){const a=t.children[s];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&i.push(a)}i.length>1&&(n+=`:eq(${i.indexOf(e)})`),r=n+(r?">"+r:""),e=t}return r}function w(e){return Object.prototype.toString.call(e)==="[object Object]"}function x(e,r){if(r===0)return!0;const n=Object.keys(e);for(const t of n)if(w(e[t])&&x(e[t],r-1))return!0;return!1}function y(e,r){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,r);const t=[],i=[];return JSON.stringify(e,function(c,o){if(t.length>0){const p=t.indexOf(this);~p?t.splice(p+1):t.push(this),~p?i.splice(p,1/0,c):i.push(c),~t.indexOf(o)&&(t[0]===o?o="[Circular ~]":o="[Circular ~."+i.slice(0,t.indexOf(o)).join(".")+"]")}else t.push(o);if(o===null)return o;if(o===void 0)return"undefined";if(s(o))return a(o);if(o instanceof Event){const p={};for(const l in o){const u=o[l];Array.isArray(u)?p[l]=P(u.length?u[0]:null):p[l]=u}return p}else{if(o instanceof Node)return o instanceof HTMLElement?o?o.outerHTML:"":o.nodeName;if(o instanceof Error)return o.stack?o.stack+`
`).filter(function(r){return!!r.match(C)&&!r.match(/^Error created at/)},this).map(function(r){const n=r.split("@"),t=this.extractLocation(n.pop()),i=(n.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new N({functionName:i,fileName:t[0],lineNumber:t[1],columnNumber:t[2]})},this)}};function P(e){if(!e||!e.outerHTML)return"";let r="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();const t=e.parentElement,i=[];if(t.children&&t.children.length>0)for(let s=0;s<t.children.length;s++){const a=t.children[s];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&i.push(a)}i.length>1&&(n+=`:eq(${i.indexOf(e)})`),r=n+(r?">"+r:""),e=t}return r}function w(e){return Object.prototype.toString.call(e)==="[object Object]"}function x(e,r){if(r===0)return!0;const n=Object.keys(e);for(const t of n)if(w(e[t])&&x(e[t],r-1))return!0;return!1}function y(e,r){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,r);const t=[],i=[];return JSON.stringify(e,function(c,o){if(t.length>0){const p=t.indexOf(this);~p?t.splice(p+1):t.push(this),~p?i.splice(p,1/0,c):i.push(c),~t.indexOf(o)&&(t[0]===o?o="[Circular ~]":o="[Circular ~."+i.slice(0,t.indexOf(o)).join(".")+"]")}else t.push(o);if(o===null)return o;if(o===void 0)return"undefined";if(s(o))return a(o);if(typeof o=="bigint")return o.toString()+"n";if(o instanceof Event){const p={};for(const l in o){const u=o[l];Array.isArray(u)?p[l]=P(u.length?u[0]:null):p[l]=u}return p}else{if(o instanceof Node)return o instanceof HTMLElement?o?o.outerHTML:"":o.nodeName;if(o instanceof Error)return o.stack?o.stack+`
End of stack for Error object`:o.name+": "+o.message}return o});function s(c){return!!(w(c)&&Object.keys(c).length>n.numOfKeysLimit||typeof c=="function"||w(c)&&x(c,n.depthOfLimit))}function a(c){let o=c.toString();return n.stringLengthLimit&&o.length>n.stringLengthLimit&&(o=`${o.slice(0,n.stringLengthLimit)}...`),o}}const k={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function _(e,r,n){const t=n?Object.assign({},k,n):k,i=t.logger;if(!i)return()=>{};let s;typeof i=="string"?s=r[i]:s=i;let a=0,c=!1;const o=[];if(t.level.includes("error")){const l=m=>{const f=m.message,d=m.error,v=b.parse(d).map(A=>A.toString()),h=[y(f,t.stringifyOptions)];e({level:"error",trace:v,payload:h})};r.addEventListener("error",l),o.push(()=>{r.removeEventListener("error",l)});const u=m=>{let f,d;m.reason instanceof Error?(f=m.reason,d=[y(`Uncaught (in promise) ${f.name}: ${f.message}`,t.stringifyOptions)]):(f=new Error,d=[y("Uncaught (in promise)",t.stringifyOptions),y(m.reason,t.stringifyOptions)]);const v=b.parse(f).map(h=>h.toString());e({level:"error",trace:v,payload:d})};r.addEventListener("unhandledrejection",u),o.push(()=>{r.removeEventListener("unhandledrejection",u)})}for(const l of t.level)o.push(p(s,l));return()=>{o.forEach(l=>l())};function p(l,u){return l[u]?j(l,u,m=>(...f)=>{if(m.apply(this,f),!c){c=!0;try{const d=b.parse(new Error).map(h=>h.toString()).splice(1),v=f.map(h=>y(h,t.stringifyOptions));a++,a<t.lengthThreshold?e({level:u,trace:d,payload:v}):a===t.lengthThreshold&&e({level:"warn",trace:[],payload:[y("The number of log records reached the threshold.")]})}catch(d){m("rrweb logger error:",d,...f)}finally{c=!1}}}):()=>{}}}const S="rrweb/console@1",F=e=>({name:S,observer:_,options:e});return O.PLUGIN_NAME=S,O.getRecordConsolePlugin=F,Object.defineProperty(O,"__esModule",{value:!0}),O}({});
//# sourceMappingURL=console-record.min.js.map

@@ -77,2 +77,3 @@ var rrwebConsoleReplay = (function (exports) {

IncrementalSource2[IncrementalSource2["AdoptedStyleSheet"] = 15] = "AdoptedStyleSheet";
IncrementalSource2[IncrementalSource2["CustomElement"] = 16] = "CustomElement";
return IncrementalSource2;

@@ -79,0 +80,0 @@ })(IncrementalSource || {});

var rrwebConsoleReplay=function(u){"use strict";var i;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(i||(i={}));const r=`Please stop import mirror directly. Instead of that,\r
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
or you can use record.mirror to access the mirror instance during recording.`;let d={map:{},getId(){return console.error(r),-1},getNode(){return console.error(r),null},removeNodeFromMap(){console.error(r)},has(){return console.error(r),!1},reset(){console.error(r)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(d=new Proxy(d,{get(e,t,o){return t==="map"&&console.error(r),Reflect.get(e,t,o)}})),/[1-9][0-9]{12}/.test(Date.now().toString());const p="rrweb/console@1";var c=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(c||{}),g=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(g||{}),m=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(m||{}),y=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(y||{}),M=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(M||{}),S=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(S||{}),C=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(C||{});const s="__rrweb_original__",f={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0};class D{constructor(t){this.config=Object.assign(f,t)}getConsoleLogger(){const t={};for(const o of this.config.level)o==="trace"?t[o]=n=>{(console.log[s]?console.log[s]:console.log)(...n.payload.map(l=>JSON.parse(l)),this.formatMessage(n))}:t[o]=n=>{(console[o][s]?console[o][s]:console[o])(...n.payload.map(l=>JSON.parse(l)),this.formatMessage(n))};return t}formatMessage(t){if(t.trace.length===0)return"";const o=`
or you can use record.mirror to access the mirror instance during recording.`;let d={map:{},getId(){return console.error(r),-1},getNode(){return console.error(r),null},removeNodeFromMap(){console.error(r)},has(){return console.error(r),!1},reset(){console.error(r)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(d=new Proxy(d,{get(e,t,o){return t==="map"&&console.error(r),Reflect.get(e,t,o)}})),/[1-9][0-9]{12}/.test(Date.now().toString());const p="rrweb/console@1";var c=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(c||{}),g=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(g||{}),m=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(m||{}),y=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(y||{}),C=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(C||{}),M=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(M||{}),S=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(S||{});const s="__rrweb_original__",f={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0};class D{constructor(t){this.config=Object.assign(f,t)}getConsoleLogger(){const t={};for(const o of this.config.level)o==="trace"?t[o]=n=>{(console.log[s]?console.log[s]:console.log)(...n.payload.map(l=>JSON.parse(l)),this.formatMessage(n))}:t[o]=n=>{(console[o][s]?console[o][s]:console[o])(...n.payload.map(l=>JSON.parse(l)),this.formatMessage(n))};return t}formatMessage(t){if(t.trace.length===0)return"";const o=`
at `;let n=o;return n+=t.trace.join(o),n}}const v=e=>{const t=e?.replayLogger||new D(e).getConsoleLogger();return{handler(o,n,l){let a=null;if(o.type===c.IncrementalSnapshot&&o.data.source===g.Log?a=o.data:o.type===c.Plugin&&o.data.plugin===p&&(a=o.data.payload),a)try{typeof t[a.level]=="function"&&t[a.level](a)}catch(w){l.replayer.config.showWarning&&console.warn(w)}}}};return u.getReplayConsolePlugin=v,Object.defineProperty(u,"__esModule",{value:!0}),u}({});
//# sourceMappingURL=console-replay.min.js.map
var rrwebRecord=function(er){"use strict";var sr;(function(r){r[r.Document=0]="Document",r[r.DocumentType=1]="DocumentType",r[r.Element=2]="Element",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.Comment=5]="Comment"})(sr||(sr={}));const N=`Please stop import mirror directly. Instead of that,\r
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
or you can use record.mirror to access the mirror instance during recording.`;let cr={map:{},getId(){return console.error(N),-1},getNode(){return console.error(N),null},removeNodeFromMap(){console.error(N)},has(){return console.error(N),!1},reset(){console.error(N)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(cr=new Proxy(cr,{get(r,e,n){return e==="map"&&console.error(N),Reflect.get(r,e,n)}})),/[1-9][0-9]{12}/.test(Date.now().toString());for(var Lr=(r=>(r[r.DomContentLoaded=0]="DomContentLoaded",r[r.Load=1]="Load",r[r.FullSnapshot=2]="FullSnapshot",r[r.IncrementalSnapshot=3]="IncrementalSnapshot",r[r.Meta=4]="Meta",r[r.Custom=5]="Custom",r[r.Plugin=6]="Plugin",r))(Lr||{}),Rr=(r=>(r[r.Mutation=0]="Mutation",r[r.MouseMove=1]="MouseMove",r[r.MouseInteraction=2]="MouseInteraction",r[r.Scroll=3]="Scroll",r[r.ViewportResize=4]="ViewportResize",r[r.Input=5]="Input",r[r.TouchMove=6]="TouchMove",r[r.MediaInteraction=7]="MediaInteraction",r[r.StyleSheetRule=8]="StyleSheetRule",r[r.CanvasMutation=9]="CanvasMutation",r[r.Font=10]="Font",r[r.Log=11]="Log",r[r.Drag=12]="Drag",r[r.StyleDeclaration=13]="StyleDeclaration",r[r.Selection=14]="Selection",r[r.AdoptedStyleSheet=15]="AdoptedStyleSheet",r))(Rr||{}),xr=(r=>(r[r.MouseUp=0]="MouseUp",r[r.MouseDown=1]="MouseDown",r[r.Click=2]="Click",r[r.ContextMenu=3]="ContextMenu",r[r.DblClick=4]="DblClick",r[r.Focus=5]="Focus",r[r.Blur=6]="Blur",r[r.TouchStart=7]="TouchStart",r[r.TouchMove_Departed=8]="TouchMove_Departed",r[r.TouchEnd=9]="TouchEnd",r[r.TouchCancel=10]="TouchCancel",r))(xr||{}),Ir=(r=>(r[r.Mouse=0]="Mouse",r[r.Pen=1]="Pen",r[r.Touch=2]="Touch",r))(Ir||{}),Er=(r=>(r[r["2D"]=0]="2D",r[r.WebGL=1]="WebGL",r[r.WebGL2=2]="WebGL2",r))(Er||{}),Or=(r=>(r[r.Play=0]="Play",r[r.Pause=1]="Pause",r[r.Seeked=2]="Seeked",r[r.VolumeChange=3]="VolumeChange",r[r.RateChange=4]="RateChange",r))(Or||{}),pr=(r=>(r.Start="start",r.Pause="pause",r.Resume="resume",r.Resize="resize",r.Finish="finish",r.FullsnapshotRebuilded="fullsnapshot-rebuilded",r.LoadStylesheetStart="load-stylesheet-start",r.LoadStylesheetEnd="load-stylesheet-end",r.SkipStart="skip-start",r.SkipEnd="skip-end",r.MouseInteraction="mouse-interaction",r.EventCast="event-cast",r.CustomEvent="custom-event",r.Flush="flush",r.StateChange="state-change",r.PlayBack="play-back",r.Destroy="destroy",r))(pr||{}),wr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ur=typeof Uint8Array>"u"?[]:new Uint8Array(256),Z=0;Z<wr.length;Z++)Ur[wr.charCodeAt(Z)]=Z;var m=Uint8Array,g=Uint16Array,K=Uint32Array,ar=new m([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),nr=new m([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),gr=new m([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),yr=function(r,e){for(var n=new g(31),a=0;a<31;++a)n[a]=e+=1<<r[a-1];for(var o=new K(n[30]),a=1;a<30;++a)for(var t=n[a];t<n[a+1];++t)o[t]=t-n[a]<<5|a;return[n,o]},Mr=yr(ar,2),zr=Mr[0],or=Mr[1];zr[28]=258,or[258]=28;for(var jr=yr(nr,0),Cr=jr[1],tr=new g(32768),s=0;s<32768;++s){var U=(s&43690)>>>1|(s&21845)<<1;U=(U&52428)>>>2|(U&13107)<<2,U=(U&61680)>>>4|(U&3855)<<4,tr[s]=((U&65280)>>>8|(U&255)<<8)>>>1}for(var H=function(r,e,n){for(var a=r.length,o=0,t=new g(e);o<a;++o)++t[r[o]-1];var f=new g(e);for(o=0;o<e;++o)f[o]=f[o-1]+t[o-1]<<1;var i;if(n){i=new g(1<<e);var l=15-e;for(o=0;o<a;++o)if(r[o])for(var c=o<<4|r[o],v=e-r[o],y=f[r[o]-1]++<<v,D=y|(1<<v)-1;y<=D;++y)i[tr[y]>>>l]=c}else for(i=new g(a),o=0;o<a;++o)i[o]=tr[f[r[o]-1]++]>>>15-r[o];return i},V=new m(288),s=0;s<144;++s)V[s]=8;for(var s=144;s<256;++s)V[s]=9;for(var s=256;s<280;++s)V[s]=7;for(var s=280;s<288;++s)V[s]=8;for(var $=new m(32),s=0;s<32;++s)$[s]=5;var Gr=H(V,9,0),Vr=H($,5,0),Sr=function(r){return(r/8>>0)+(r&7&&1)},mr=function(r,e,n){(e==null||e<0)&&(e=0),(n==null||n>r.length)&&(n=r.length);var a=new(r instanceof g?g:r instanceof K?K:m)(n-e);return a.set(r.subarray(e,n)),a},p=function(r,e,n){n<<=e&7;var a=e/8>>0;r[a]|=n,r[a+1]|=n>>>8},Q=function(r,e,n){n<<=e&7;var a=e/8>>0;r[a]|=n,r[a+1]|=n>>>8,r[a+2]|=n>>>16},vr=function(r,e){for(var n=[],a=0;a<r.length;++a)r[a]&&n.push({s:a,f:r[a]});var o=n.length,t=n.slice();if(!o)return[new m(0),0];if(o==1){var f=new m(n[0].s+1);return f[n[0].s]=1,[f,1]}n.sort(function(x,k){return x.f-k.f}),n.push({s:-1,f:25001});var i=n[0],l=n[1],c=0,v=1,y=2;for(n[0]={s:-1,f:i.f+l.f,l:i,r:l};v!=o-1;)i=n[n[c].f<n[y].f?c++:y++],l=n[c!=v&&n[c].f<n[y].f?c++:y++],n[v++]={s:-1,f:i.f+l.f,l:i,r:l};for(var D=t[0].s,a=1;a<o;++a)t[a].s>D&&(D=t[a].s);var M=new g(D+1),L=fr(n[v-1],M,0);if(L>e){var a=0,S=0,z=L-e,W=1<<z;for(t.sort(function(k,C){return M[C.s]-M[k.s]||k.f-C.f});a<o;++a){var R=t[a].s;if(M[R]>e)S+=W-(1<<L-M[R]),M[R]=e;else break}for(S>>>=z;S>0;){var _=t[a].s;M[_]<e?S-=1<<e-M[_]++-1:++a}for(;a>=0&&S;--a){var j=t[a].s;M[j]==e&&(--M[j],++S)}L=e}return[new m(M),L]},fr=function(r,e,n){return r.s==-1?Math.max(fr(r.l,e,n+1),fr(r.r,e,n+1)):e[r.s]=n},Dr=function(r){for(var e=r.length;e&&!r[--e];);for(var n=new g(++e),a=0,o=r[0],t=1,f=function(l){n[a++]=l},i=1;i<=e;++i)if(r[i]==o&&i!=e)++t;else{if(!o&&t>2){for(;t>138;t-=138)f(32754);t>2&&(f(t>10?t-11<<5|28690:t-3<<5|12305),t=0)}else if(t>3){for(f(o),--t;t>6;t-=6)f(8304);t>2&&(f(t-3<<5|8208),t=0)}for(;t--;)f(o);t=1,o=r[i]}return[n.subarray(0,a),e]},X=function(r,e){for(var n=0,a=0;a<e.length;++a)n+=r[a]*e[a];return n},h=function(r,e,n){var a=n.length,o=Sr(e+2);r[o]=a&255,r[o+1]=a>>>8,r[o+2]=r[o]^255,r[o+3]=r[o+1]^255;for(var t=0;t<a;++t)r[o+t+4]=n[t];return(o+4+a)*8},Tr=function(r,e,n,a,o,t,f,i,l,c,v){p(e,v++,n),++o[256];for(var y=vr(o,15),D=y[0],M=y[1],L=vr(t,15),S=L[0],z=L[1],W=Dr(D),R=W[0],_=W[1],j=Dr(S),x=j[0],k=j[1],C=new g(19),u=0;u<R.length;++u)C[R[u]&31]++;for(var u=0;u<x.length;++u)C[x[u]&31]++;for(var B=vr(C,7),A=B[0],rr=B[1],T=19;T>4&&!A[gr[T-1]];--T);var q=c+5<<3,F=X(o,V)+X(t,$)+f,P=X(o,D)+X(t,S)+f+14+3*T+X(C,A)+(2*C[16]+3*C[17]+7*C[18]);if(q<=F&&q<=P)return h(e,v,r.subarray(l,l+c));var I,w,d,G;if(p(e,v,1+(P<F)),v+=2,P<F){I=H(D,M,0),w=D,d=H(S,z,0),G=S;var lr=H(A,rr,0);p(e,v,_-257),p(e,v+5,k-1),p(e,v+10,T-4),v+=14;for(var u=0;u<T;++u)p(e,v+3*u,A[gr[u]]);v+=3*T;for(var E=[R,x],Y=0;Y<2;++Y)for(var J=E[Y],u=0;u<J.length;++u){var O=J[u]&31;p(e,v,lr[O]),v+=A[O],O>15&&(p(e,v,J[u]>>>5&127),v+=J[u]>>>12)}}else I=Gr,w=V,d=Vr,G=$;for(var u=0;u<i;++u)if(a[u]>255){var O=a[u]>>>18&31;Q(e,v,I[O+257]),v+=w[O+257],O>7&&(p(e,v,a[u]>>>23&31),v+=ar[O]);var b=a[u]&31;Q(e,v,d[b]),v+=G[b],b>3&&(Q(e,v,a[u]>>>5&8191),v+=nr[b])}else Q(e,v,I[a[u]]),v+=w[a[u]];return Q(e,v,I[256]),v+w[256]},Wr=new K([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Br=new m(0),Nr=function(r,e,n,a,o,t){var f=r.length,i=new m(a+f+5*(1+Math.floor(f/7e3))+o),l=i.subarray(a,i.length-o),c=0;if(!e||f<8)for(var v=0;v<=f;v+=65535){var y=v+65535;y<f?c=h(l,c,r.subarray(v,y)):(l[v]=t,c=h(l,c,r.subarray(v,f)))}else{for(var D=Wr[e-1],M=D>>>13,L=D&8191,S=(1<<n)-1,z=new g(32768),W=new g(S+1),R=Math.ceil(n/3),_=2*R,j=function(ir){return(r[ir]^r[ir+1]<<R^r[ir+2]<<_)&S},x=new K(25e3),k=new g(288),C=new g(32),u=0,B=0,v=0,A=0,rr=0,T=0;v<f;++v){var q=j(v),F=v&32767,P=W[q];if(z[F]=P,W[q]=F,rr<=v){var I=f-v;if((u>7e3||A>24576)&&I>423){c=Tr(r,l,0,x,k,C,B,A,T,v-T,c),A=u=B=0,T=v;for(var w=0;w<286;++w)k[w]=0;for(var w=0;w<30;++w)C[w]=0}var d=2,G=0,lr=L,E=F-P&32767;if(I>2&&q==j(v-E))for(var Y=Math.min(M,I)-1,J=Math.min(32767,v),O=Math.min(258,I);E<=J&&--lr&&F!=P;){if(r[v+d]==r[v+d-E]){for(var b=0;b<O&&r[v+b]==r[v+b-E];++b);if(b>d){if(d=b,G=E,b>Y)break;for(var te=Math.min(E,b-2),Ar=0,w=0;w<te;++w){var ur=v-E+w+32768&32767,ve=z[ur],Fr=ur-ve+32768&32767;Fr>Ar&&(Ar=Fr,P=ur)}}}F=P,P=z[F],E+=F-P+32768&32767}if(G){x[A++]=268435456|or[d]<<18|Cr[G];var Pr=or[d]&31,dr=Cr[G]&31;B+=ar[Pr]+nr[dr],++k[257+Pr],++C[dr],rr=v+d,++u}else x[A++]=r[v],++k[r[v]]}}c=Tr(r,l,t,x,k,C,B,A,T,v-T,c),t||(c=h(l,c,Br))}return mr(i,0,a+Sr(c)+o)},_r=function(){var r=1,e=0;return{p:function(n){for(var a=r,o=e,t=n.length,f=0;f!=t;){for(var i=Math.min(f+5552,t);f<i;++f)a+=n[f],o+=a;a%=65521,o%=65521}r=a,e=o},d:function(){return(r>>>8<<16|(e&255)<<8|e>>>8)+((r&255)<<23)*2}}},qr=function(r,e,n,a,o){return Nr(r,e.level==null?6:e.level,e.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):12+e.mem,n,a,!o)},Jr=function(r,e,n){for(;n;++e)r[e]=n,n>>>=8},Kr=function(r,e){var n=e.level,a=n==0?0:n<6?1:n==9?3:2;r[0]=120,r[1]=a<<6|(a?32-2*a:1)};function Hr(r,e){e===void 0&&(e={});var n=_r();n.p(r);var a=qr(r,e,2,4);return Kr(a,e),Jr(a,a.length-4,n.d()),a}function Qr(r,e){var n=r.length;if(!e&&typeof TextEncoder<"u")return new TextEncoder().encode(r);for(var a=new m(r.length+(r.length>>>1)),o=0,t=function(c){a[o++]=c},f=0;f<n;++f){if(o+5>a.length){var i=new m(o+8+(n-f<<1));i.set(a),a=i}var l=r.charCodeAt(f);l<128||e?t(l):l<2048?(t(192|l>>>6),t(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|r.charCodeAt(++f)&1023,t(240|l>>>18),t(128|l>>>12&63),t(128|l>>>6&63),t(128|l&63)):(t(224|l>>>12),t(128|l>>>6&63),t(128|l&63))}return mr(a,0,o)}function Xr(r,e){var n="";if(!e&&typeof TextDecoder<"u")return new TextDecoder().decode(r);for(var a=0;a<r.length;){var o=r[a++];o<128||e?n+=String.fromCharCode(o):o<224?n+=String.fromCharCode((o&31)<<6|r[a++]&63):o<240?n+=String.fromCharCode((o&15)<<12|(r[a++]&63)<<6|r[a++]&63):(o=((o&15)<<18|(r[a++]&63)<<12|(r[a++]&63)<<6|r[a++]&63)-65536,n+=String.fromCharCode(55296|o>>10,56320|o&1023))}return n}const Yr="v1";var Zr=Object.defineProperty,$r=Object.defineProperties,hr=Object.getOwnPropertyDescriptors,br=Object.getOwnPropertySymbols,re=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,kr=(r,e,n)=>e in r?Zr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,ae=(r,e)=>{for(var n in e||(e={}))re.call(e,n)&&kr(r,n,e[n]);if(br)for(var n of br(e))ee.call(e,n)&&kr(r,n,e[n]);return r},ne=(r,e)=>$r(r,hr(e));const oe=r=>{const e=ne(ae({},r),{v:Yr});return Xr(Hr(Qr(JSON.stringify(e))),!0)};return er.pack=oe,Object.defineProperty(er,"__esModule",{value:!0}),er}({});
or you can use record.mirror to access the mirror instance during recording.`;let cr={map:{},getId(){return console.error(N),-1},getNode(){return console.error(N),null},removeNodeFromMap(){console.error(N)},has(){return console.error(N),!1},reset(){console.error(N)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(cr=new Proxy(cr,{get(r,e,n){return e==="map"&&console.error(N),Reflect.get(r,e,n)}})),/[1-9][0-9]{12}/.test(Date.now().toString());for(var Er=(r=>(r[r.DomContentLoaded=0]="DomContentLoaded",r[r.Load=1]="Load",r[r.FullSnapshot=2]="FullSnapshot",r[r.IncrementalSnapshot=3]="IncrementalSnapshot",r[r.Meta=4]="Meta",r[r.Custom=5]="Custom",r[r.Plugin=6]="Plugin",r))(Er||{}),Lr=(r=>(r[r.Mutation=0]="Mutation",r[r.MouseMove=1]="MouseMove",r[r.MouseInteraction=2]="MouseInteraction",r[r.Scroll=3]="Scroll",r[r.ViewportResize=4]="ViewportResize",r[r.Input=5]="Input",r[r.TouchMove=6]="TouchMove",r[r.MediaInteraction=7]="MediaInteraction",r[r.StyleSheetRule=8]="StyleSheetRule",r[r.CanvasMutation=9]="CanvasMutation",r[r.Font=10]="Font",r[r.Log=11]="Log",r[r.Drag=12]="Drag",r[r.StyleDeclaration=13]="StyleDeclaration",r[r.Selection=14]="Selection",r[r.AdoptedStyleSheet=15]="AdoptedStyleSheet",r[r.CustomElement=16]="CustomElement",r))(Lr||{}),Rr=(r=>(r[r.MouseUp=0]="MouseUp",r[r.MouseDown=1]="MouseDown",r[r.Click=2]="Click",r[r.ContextMenu=3]="ContextMenu",r[r.DblClick=4]="DblClick",r[r.Focus=5]="Focus",r[r.Blur=6]="Blur",r[r.TouchStart=7]="TouchStart",r[r.TouchMove_Departed=8]="TouchMove_Departed",r[r.TouchEnd=9]="TouchEnd",r[r.TouchCancel=10]="TouchCancel",r))(Rr||{}),xr=(r=>(r[r.Mouse=0]="Mouse",r[r.Pen=1]="Pen",r[r.Touch=2]="Touch",r))(xr||{}),Ir=(r=>(r[r["2D"]=0]="2D",r[r.WebGL=1]="WebGL",r[r.WebGL2=2]="WebGL2",r))(Ir||{}),Or=(r=>(r[r.Play=0]="Play",r[r.Pause=1]="Pause",r[r.Seeked=2]="Seeked",r[r.VolumeChange=3]="VolumeChange",r[r.RateChange=4]="RateChange",r))(Or||{}),pr=(r=>(r.Start="start",r.Pause="pause",r.Resume="resume",r.Resize="resize",r.Finish="finish",r.FullsnapshotRebuilded="fullsnapshot-rebuilded",r.LoadStylesheetStart="load-stylesheet-start",r.LoadStylesheetEnd="load-stylesheet-end",r.SkipStart="skip-start",r.SkipEnd="skip-end",r.MouseInteraction="mouse-interaction",r.EventCast="event-cast",r.CustomEvent="custom-event",r.Flush="flush",r.StateChange="state-change",r.PlayBack="play-back",r.Destroy="destroy",r))(pr||{}),wr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ur=typeof Uint8Array>"u"?[]:new Uint8Array(256),Z=0;Z<wr.length;Z++)Ur[wr.charCodeAt(Z)]=Z;var m=Uint8Array,g=Uint16Array,K=Uint32Array,ar=new m([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),nr=new m([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),gr=new m([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),yr=function(r,e){for(var n=new g(31),a=0;a<31;++a)n[a]=e+=1<<r[a-1];for(var t=new K(n[30]),a=1;a<30;++a)for(var o=n[a];o<n[a+1];++o)t[o]=o-n[a]<<5|a;return[n,t]},Mr=yr(ar,2),zr=Mr[0],tr=Mr[1];zr[28]=258,tr[258]=28;for(var jr=yr(nr,0),Cr=jr[1],or=new g(32768),s=0;s<32768;++s){var U=(s&43690)>>>1|(s&21845)<<1;U=(U&52428)>>>2|(U&13107)<<2,U=(U&61680)>>>4|(U&3855)<<4,or[s]=((U&65280)>>>8|(U&255)<<8)>>>1}for(var H=function(r,e,n){for(var a=r.length,t=0,o=new g(e);t<a;++t)++o[r[t]-1];var f=new g(e);for(t=0;t<e;++t)f[t]=f[t-1]+o[t-1]<<1;var i;if(n){i=new g(1<<e);var l=15-e;for(t=0;t<a;++t)if(r[t])for(var c=t<<4|r[t],v=e-r[t],y=f[r[t]-1]++<<v,D=y|(1<<v)-1;y<=D;++y)i[or[y]>>>l]=c}else for(i=new g(a),t=0;t<a;++t)i[t]=or[f[r[t]-1]++]>>>15-r[t];return i},V=new m(288),s=0;s<144;++s)V[s]=8;for(var s=144;s<256;++s)V[s]=9;for(var s=256;s<280;++s)V[s]=7;for(var s=280;s<288;++s)V[s]=8;for(var $=new m(32),s=0;s<32;++s)$[s]=5;var Gr=H(V,9,0),Vr=H($,5,0),Sr=function(r){return(r/8>>0)+(r&7&&1)},mr=function(r,e,n){(e==null||e<0)&&(e=0),(n==null||n>r.length)&&(n=r.length);var a=new(r instanceof g?g:r instanceof K?K:m)(n-e);return a.set(r.subarray(e,n)),a},p=function(r,e,n){n<<=e&7;var a=e/8>>0;r[a]|=n,r[a+1]|=n>>>8},Q=function(r,e,n){n<<=e&7;var a=e/8>>0;r[a]|=n,r[a+1]|=n>>>8,r[a+2]|=n>>>16},vr=function(r,e){for(var n=[],a=0;a<r.length;++a)r[a]&&n.push({s:a,f:r[a]});var t=n.length,o=n.slice();if(!t)return[new m(0),0];if(t==1){var f=new m(n[0].s+1);return f[n[0].s]=1,[f,1]}n.sort(function(R,k){return R.f-k.f}),n.push({s:-1,f:25001});var i=n[0],l=n[1],c=0,v=1,y=2;for(n[0]={s:-1,f:i.f+l.f,l:i,r:l};v!=t-1;)i=n[n[c].f<n[y].f?c++:y++],l=n[c!=v&&n[c].f<n[y].f?c++:y++],n[v++]={s:-1,f:i.f+l.f,l:i,r:l};for(var D=o[0].s,a=1;a<t;++a)o[a].s>D&&(D=o[a].s);var M=new g(D+1),E=fr(n[v-1],M,0);if(E>e){var a=0,S=0,z=E-e,W=1<<z;for(o.sort(function(k,C){return M[C.s]-M[k.s]||k.f-C.f});a<t;++a){var L=o[a].s;if(M[L]>e)S+=W-(1<<E-M[L]),M[L]=e;else break}for(S>>>=z;S>0;){var _=o[a].s;M[_]<e?S-=1<<e-M[_]++-1:++a}for(;a>=0&&S;--a){var j=o[a].s;M[j]==e&&(--M[j],++S)}E=e}return[new m(M),E]},fr=function(r,e,n){return r.s==-1?Math.max(fr(r.l,e,n+1),fr(r.r,e,n+1)):e[r.s]=n},Dr=function(r){for(var e=r.length;e&&!r[--e];);for(var n=new g(++e),a=0,t=r[0],o=1,f=function(l){n[a++]=l},i=1;i<=e;++i)if(r[i]==t&&i!=e)++o;else{if(!t&&o>2){for(;o>138;o-=138)f(32754);o>2&&(f(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(f(t),--o;o>6;o-=6)f(8304);o>2&&(f(o-3<<5|8208),o=0)}for(;o--;)f(t);o=1,t=r[i]}return[n.subarray(0,a),e]},X=function(r,e){for(var n=0,a=0;a<e.length;++a)n+=r[a]*e[a];return n},h=function(r,e,n){var a=n.length,t=Sr(e+2);r[t]=a&255,r[t+1]=a>>>8,r[t+2]=r[t]^255,r[t+3]=r[t+1]^255;for(var o=0;o<a;++o)r[t+o+4]=n[o];return(t+4+a)*8},Tr=function(r,e,n,a,t,o,f,i,l,c,v){p(e,v++,n),++t[256];for(var y=vr(t,15),D=y[0],M=y[1],E=vr(o,15),S=E[0],z=E[1],W=Dr(D),L=W[0],_=W[1],j=Dr(S),R=j[0],k=j[1],C=new g(19),u=0;u<L.length;++u)C[L[u]&31]++;for(var u=0;u<R.length;++u)C[R[u]&31]++;for(var B=vr(C,7),A=B[0],rr=B[1],T=19;T>4&&!A[gr[T-1]];--T);var q=c+5<<3,F=X(t,V)+X(o,$)+f,P=X(t,D)+X(o,S)+f+14+3*T+X(C,A)+(2*C[16]+3*C[17]+7*C[18]);if(q<=F&&q<=P)return h(e,v,r.subarray(l,l+c));var x,w,d,G;if(p(e,v,1+(P<F)),v+=2,P<F){x=H(D,M,0),w=D,d=H(S,z,0),G=S;var lr=H(A,rr,0);p(e,v,_-257),p(e,v+5,k-1),p(e,v+10,T-4),v+=14;for(var u=0;u<T;++u)p(e,v+3*u,A[gr[u]]);v+=3*T;for(var I=[L,R],Y=0;Y<2;++Y)for(var J=I[Y],u=0;u<J.length;++u){var O=J[u]&31;p(e,v,lr[O]),v+=A[O],O>15&&(p(e,v,J[u]>>>5&127),v+=J[u]>>>12)}}else x=Gr,w=V,d=Vr,G=$;for(var u=0;u<i;++u)if(a[u]>255){var O=a[u]>>>18&31;Q(e,v,x[O+257]),v+=w[O+257],O>7&&(p(e,v,a[u]>>>23&31),v+=ar[O]);var b=a[u]&31;Q(e,v,d[b]),v+=G[b],b>3&&(Q(e,v,a[u]>>>5&8191),v+=nr[b])}else Q(e,v,x[a[u]]),v+=w[a[u]];return Q(e,v,x[256]),v+w[256]},Wr=new K([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Br=new m(0),Nr=function(r,e,n,a,t,o){var f=r.length,i=new m(a+f+5*(1+Math.floor(f/7e3))+t),l=i.subarray(a,i.length-t),c=0;if(!e||f<8)for(var v=0;v<=f;v+=65535){var y=v+65535;y<f?c=h(l,c,r.subarray(v,y)):(l[v]=o,c=h(l,c,r.subarray(v,f)))}else{for(var D=Wr[e-1],M=D>>>13,E=D&8191,S=(1<<n)-1,z=new g(32768),W=new g(S+1),L=Math.ceil(n/3),_=2*L,j=function(ir){return(r[ir]^r[ir+1]<<L^r[ir+2]<<_)&S},R=new K(25e3),k=new g(288),C=new g(32),u=0,B=0,v=0,A=0,rr=0,T=0;v<f;++v){var q=j(v),F=v&32767,P=W[q];if(z[F]=P,W[q]=F,rr<=v){var x=f-v;if((u>7e3||A>24576)&&x>423){c=Tr(r,l,0,R,k,C,B,A,T,v-T,c),A=u=B=0,T=v;for(var w=0;w<286;++w)k[w]=0;for(var w=0;w<30;++w)C[w]=0}var d=2,G=0,lr=E,I=F-P&32767;if(x>2&&q==j(v-I))for(var Y=Math.min(M,x)-1,J=Math.min(32767,v),O=Math.min(258,x);I<=J&&--lr&&F!=P;){if(r[v+d]==r[v+d-I]){for(var b=0;b<O&&r[v+b]==r[v+b-I];++b);if(b>d){if(d=b,G=I,b>Y)break;for(var oe=Math.min(I,b-2),Ar=0,w=0;w<oe;++w){var ur=v-I+w+32768&32767,ve=z[ur],Fr=ur-ve+32768&32767;Fr>Ar&&(Ar=Fr,P=ur)}}}F=P,P=z[F],I+=F-P+32768&32767}if(G){R[A++]=268435456|tr[d]<<18|Cr[G];var Pr=tr[d]&31,dr=Cr[G]&31;B+=ar[Pr]+nr[dr],++k[257+Pr],++C[dr],rr=v+d,++u}else R[A++]=r[v],++k[r[v]]}}c=Tr(r,l,o,R,k,C,B,A,T,v-T,c),o||(c=h(l,c,Br))}return mr(i,0,a+Sr(c)+t)},_r=function(){var r=1,e=0;return{p:function(n){for(var a=r,t=e,o=n.length,f=0;f!=o;){for(var i=Math.min(f+5552,o);f<i;++f)a+=n[f],t+=a;a%=65521,t%=65521}r=a,e=t},d:function(){return(r>>>8<<16|(e&255)<<8|e>>>8)+((r&255)<<23)*2}}},qr=function(r,e,n,a,t){return Nr(r,e.level==null?6:e.level,e.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):12+e.mem,n,a,!t)},Jr=function(r,e,n){for(;n;++e)r[e]=n,n>>>=8},Kr=function(r,e){var n=e.level,a=n==0?0:n<6?1:n==9?3:2;r[0]=120,r[1]=a<<6|(a?32-2*a:1)};function Hr(r,e){e===void 0&&(e={});var n=_r();n.p(r);var a=qr(r,e,2,4);return Kr(a,e),Jr(a,a.length-4,n.d()),a}function Qr(r,e){var n=r.length;if(!e&&typeof TextEncoder<"u")return new TextEncoder().encode(r);for(var a=new m(r.length+(r.length>>>1)),t=0,o=function(c){a[t++]=c},f=0;f<n;++f){if(t+5>a.length){var i=new m(t+8+(n-f<<1));i.set(a),a=i}var l=r.charCodeAt(f);l<128||e?o(l):l<2048?(o(192|l>>>6),o(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|r.charCodeAt(++f)&1023,o(240|l>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|l&63)):(o(224|l>>>12),o(128|l>>>6&63),o(128|l&63))}return mr(a,0,t)}function Xr(r,e){var n="";if(!e&&typeof TextDecoder<"u")return new TextDecoder().decode(r);for(var a=0;a<r.length;){var t=r[a++];t<128||e?n+=String.fromCharCode(t):t<224?n+=String.fromCharCode((t&31)<<6|r[a++]&63):t<240?n+=String.fromCharCode((t&15)<<12|(r[a++]&63)<<6|r[a++]&63):(t=((t&15)<<18|(r[a++]&63)<<12|(r[a++]&63)<<6|r[a++]&63)-65536,n+=String.fromCharCode(55296|t>>10,56320|t&1023))}return n}const Yr="v1";var Zr=Object.defineProperty,$r=Object.defineProperties,hr=Object.getOwnPropertyDescriptors,br=Object.getOwnPropertySymbols,re=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,kr=(r,e,n)=>e in r?Zr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,ae=(r,e)=>{for(var n in e||(e={}))re.call(e,n)&&kr(r,n,e[n]);if(br)for(var n of br(e))ee.call(e,n)&&kr(r,n,e[n]);return r},ne=(r,e)=>$r(r,hr(e));const te=r=>{const e=ne(ae({},r),{v:Yr});return Xr(Hr(Qr(JSON.stringify(e))),!0)};return er.pack=te,Object.defineProperty(er,"__esModule",{value:!0}),er}({});
//# sourceMappingURL=rrweb-record-pack.min.js.map

@@ -1,6 +0,120 @@

import { createBase64WorkerFactory } from './_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js';
import { createInlineWorkerFactory } from './_rollup-plugin-web-worker-loader__helper__browser__createInlineWorkerFactory.js';
var WorkerFactory = createBase64WorkerFactory('Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSV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yZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=', null, false);
var WorkerFactory = createInlineWorkerFactory(/* rollup-plugin-web-worker-loader */function () {
(function () {
'__worker_loader_strict__';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
/*
* base64-arraybuffer 1.0.1 <https://github.com/niklasvh/base64-arraybuffer>
* Copyright (c) 2021 Niklas von Hertzen <https://hertzen.com>
* Released under MIT License
*/
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
// Use a lookup table to find the index.
var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);
for (var i = 0; i < chars.length; i++) {
lookup[chars.charCodeAt(i)] = i;
}
var encode = function (arraybuffer) {
var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';
for (i = 0; i < len; i += 3) {
base64 += chars[bytes[i] >> 2];
base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];
base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];
base64 += chars[bytes[i + 2] & 63];
}
if (len % 3 === 2) {
base64 = base64.substring(0, base64.length - 1) + '=';
}
else if (len % 3 === 1) {
base64 = base64.substring(0, base64.length - 2) + '==';
}
return base64;
};
const lastBlobMap = new Map();
const transparentBlobMap = new Map();
function getTransparentBlobFor(width, height, dataURLOptions) {
return __awaiter(this, void 0, void 0, function* () {
const id = `${width}-${height}`;
if ('OffscreenCanvas' in globalThis) {
if (transparentBlobMap.has(id))
return transparentBlobMap.get(id);
const offscreen = new OffscreenCanvas(width, height);
offscreen.getContext('2d');
const blob = yield offscreen.convertToBlob(dataURLOptions);
const arrayBuffer = yield blob.arrayBuffer();
const base64 = encode(arrayBuffer);
transparentBlobMap.set(id, base64);
return base64;
}
else {
return '';
}
});
}
const worker = self;
worker.onmessage = function (e) {
return __awaiter(this, void 0, void 0, function* () {
if ('OffscreenCanvas' in globalThis) {
const { id, bitmap, width, height, dataURLOptions } = e.data;
const transparentBase64 = getTransparentBlobFor(width, height, dataURLOptions);
const offscreen = new OffscreenCanvas(width, height);
const ctx = offscreen.getContext('2d');
ctx.drawImage(bitmap, 0, 0);
bitmap.close();
const blob = yield offscreen.convertToBlob(dataURLOptions);
const type = blob.type;
const arrayBuffer = yield blob.arrayBuffer();
const base64 = encode(arrayBuffer);
if (!lastBlobMap.has(id) && (yield transparentBase64) === base64) {
lastBlobMap.set(id, base64);
return worker.postMessage({ id });
}
if (lastBlobMap.get(id) === base64)
return worker.postMessage({ id });
worker.postMessage({
id,
type,
base64,
width,
height,
});
lastBlobMap.set(id, base64);
}
else {
return worker.postMessage({ id: e.data.id });
}
});
};
})();
}, null);
/* eslint-enable */
export { WorkerFactory as default };

@@ -10,48 +10,45 @@ var NodeType$1;

})(NodeType$1 || (NodeType$1 = {}));
var Mirror$1 = (function () {
function Mirror() {
class Mirror$1 {
constructor() {
this.idNodeMap = new Map();
this.nodeMetaMap = new WeakMap();
}
Mirror.prototype.getId = function (n) {
getId(n) {
var _a;
if (!n)
return -1;
var id = (_a = this.getMeta(n)) === null || _a === void 0 ? void 0 : _a.id;
const id = (_a = this.getMeta(n)) === null || _a === void 0 ? void 0 : _a.id;
return id !== null && id !== void 0 ? id : -1;
};
Mirror.prototype.getNode = function (id) {
}
getNode(id) {
return this.idNodeMap.get(id) || null;
};
Mirror.prototype.getIds = function () {
}
getIds() {
return Array.from(this.idNodeMap.keys());
};
Mirror.prototype.getMeta = function (n) {
}
getMeta(n) {
return this.nodeMetaMap.get(n) || null;
};
Mirror.prototype.removeNodeFromMap = function (n) {
var _this = this;
var id = this.getId(n);
this.idNodeMap["delete"](id);
}
removeNodeFromMap(n) {
const id = this.getId(n);
this.idNodeMap.delete(id);
if (n.childNodes) {
n.childNodes.forEach(function (childNode) {
return _this.removeNodeFromMap(childNode);
});
n.childNodes.forEach((childNode) => this.removeNodeFromMap(childNode));
}
};
Mirror.prototype.has = function (id) {
}
has(id) {
return this.idNodeMap.has(id);
};
Mirror.prototype.hasNode = function (node) {
}
hasNode(node) {
return this.nodeMetaMap.has(node);
};
Mirror.prototype.add = function (n, meta) {
var id = meta.id;
}
add(n, meta) {
const id = meta.id;
this.idNodeMap.set(id, n);
this.nodeMetaMap.set(n, meta);
};
Mirror.prototype.replace = function (id, n) {
var oldNode = this.getNode(id);
}
replace(id, n) {
const oldNode = this.getNode(id);
if (oldNode) {
var meta = this.nodeMetaMap.get(oldNode);
const meta = this.nodeMetaMap.get(oldNode);
if (meta)

@@ -61,9 +58,8 @@ this.nodeMetaMap.set(n, meta);

this.idNodeMap.set(id, n);
};
Mirror.prototype.reset = function () {
}
reset() {
this.idNodeMap = new Map();
this.nodeMetaMap = new WeakMap();
};
return Mirror;
}());
}
}
function createMirror$1() {

@@ -602,3 +598,3 @@ return new Mirror$1();

diffChildren(oldTree, newTree, replayer, rrnodeMirror);
diffAfterUpdatingChildren(oldTree, newTree, replayer, rrnodeMirror);
diffAfterUpdatingChildren(oldTree, newTree, replayer);
}

@@ -650,2 +646,3 @@ function diffBeforeUpdatingChildren(oldTree, newTree, replayer, rrnodeMirror) {

}
diffProps(oldElement, newRRElement, rrnodeMirror);
break;

@@ -656,3 +653,3 @@ }

}
function diffAfterUpdatingChildren(oldTree, newTree, replayer, rrnodeMirror) {
function diffAfterUpdatingChildren(oldTree, newTree, replayer) {
var _a;

@@ -668,3 +665,2 @@ switch (newTree.RRNodeType) {

const newRRElement = newTree;
diffProps(oldElement, newRRElement, rrnodeMirror);
newRRElement.scrollData &&

@@ -671,0 +667,0 @@ replayer.applyScroll(newRRElement.scrollData, true);

@@ -7,2 +7,3 @@ export { addCustomEvent, freezePage } from '../index.js';

export { default as record } from '../record/index.js';
export { default as canvasMutation } from '../replay/canvas/index.js';
export { EventType, IncrementalSource, MouseInteractions, ReplayerEvents } from '../../../types/dist/types.js';

@@ -9,0 +10,0 @@ export { Replayer } from '../replay/index.js';

@@ -83,2 +83,5 @@ function pathToSelector(node) {

}
if (typeof value === 'bigint') {
return value.toString() + 'n';
}
if (value instanceof Event) {

@@ -85,0 +88,0 @@ const eventResult = {};

@@ -175,2 +175,3 @@ import { genId, NodeType } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';

}
return false;
}

@@ -177,0 +178,0 @@ replace(iframeMirror, obj, iframeEl, keys) {

@@ -21,3 +21,3 @@ import { createMirror, snapshot } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';

function record(options = {}) {
const { emit, checkoutEveryNms, checkoutEveryNth, blockClass = 'rr-block', blockSelector = null, ignoreClass = 'rr-ignore', ignoreSelector = null, maskTextClass = 'rr-mask', maskTextSelector = null, inlineStylesheet = true, maskAllInputs, maskInputOptions: _maskInputOptions, slimDOMOptions: _slimDOMOptions, maskInputFn, maskTextFn, hooks, packFn, sampling = {}, dataURLOptions = {}, mousemoveWait, recordCanvas = false, recordCrossOriginIframes = false, recordAfter = options.recordAfter === 'DOMContentLoaded'
const { emit, checkoutEveryNms, checkoutEveryNth, blockClass = 'rr-block', blockSelector = null, ignoreClass = 'rr-ignore', ignoreSelector = null, maskTextClass = 'rr-mask', maskTextSelector = null, inlineStylesheet = true, maskAllInputs, maskInputOptions: _maskInputOptions, slimDOMOptions: _slimDOMOptions, maskInputFn, maskTextFn, hooks, packFn, sampling = {}, dataURLOptions = {}, mousemoveWait, recordDOM = true, recordCanvas = false, recordCrossOriginIframes = false, recordAfter = options.recordAfter === 'DOMContentLoaded'
? options.recordAfter

@@ -212,2 +212,5 @@ : 'load', userTriggeredOnInput = false, collectFonts = false, inlineImages = false, plugins, keepIframeSrcFn = () => false, ignoreCSSAttributes = new Set([]), errorHandler, } = options;

takeFullSnapshot = (isCheckout = false) => {
if (!recordDOM) {
return;
}
wrappedEmit(wrapEvent({

@@ -320,2 +323,8 @@ type: EventType.Meta,

},
customElementCb: (c) => {
wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,
data: Object.assign({ source: IncrementalSource.CustomElement }, c),
}));
},
blockClass,

@@ -329,2 +338,3 @@ ignoreClass,

sampling,
recordDOM,
recordCanvas,

@@ -331,0 +341,0 @@ inlineImages,

import { isShadowRoot, isNativeShadowDom, getInputType, maskInputValue, ignoreAttribute, transformAttribute, toLowerCase, needMaskingText, IGNORED_NODE, serializeNodeWithId } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';
import { isIgnored, isBlocked, isSerialized, isAncestorRemoved, hasShadowRoot, inDom, getShadowHost, isSerializedIframe, isSerializedStylesheet } from '../utils.js';
import { isIgnored, isBlocked, isSerialized, isAncestorRemoved, closestElementOfNode, hasShadowRoot, inDom, getShadowHost, isSerializedIframe, isSerializedStylesheet } from '../utils.js';

@@ -98,2 +98,3 @@ function isNodeInLinkedList(n) {

this.attributes = [];
this.attributeMap = new WeakMap();
this.removes = [];

@@ -126,3 +127,5 @@ this.mapRemoves = [];

const pushAdd = (n) => {
if (!n.parentNode || !inDom(n)) {
if (!n.parentNode ||
!inDom(n) ||
n.parentNode.tagName === 'TEXTAREA') {
return;

@@ -257,6 +260,12 @@ }

texts: this.texts
.map((text) => ({
id: this.mirror.getId(text.node),
value: text.value,
}))
.map((text) => {
const n = text.node;
if (n.parentNode.tagName === 'TEXTAREA') {
this.genTextAreaValueMutation(n.parentNode);
}
return {
id: this.mirror.getId(n),
value: text.value,
};
})
.filter((text) => !addedIds.has(text.id))

@@ -295,2 +304,3 @@ .filter((text) => this.mirror.has(text.id)),

this.attributes = [];
this.attributeMap = new WeakMap();
this.removes = [];

@@ -303,2 +313,16 @@ this.addedSet = new Set();

};
this.genTextAreaValueMutation = (textarea) => {
let item = this.attributeMap.get(textarea);
if (!item) {
item = {
node: textarea,
attributes: {},
styleDiff: {},
_unchangedStyles: {},
};
this.attributes.push(item);
this.attributeMap.set(textarea, item);
}
item.attributes.value = Array.from(textarea.childNodes, (cn) => cn.textContent || '').join('');
};
this.processMutation = (m) => {

@@ -308,9 +332,2 @@ if (isIgnored(m.target, this.mirror)) {

}
let unattachedDoc;
try {
unattachedDoc = document.implementation.createHTMLDocument();
}
catch (e) {
unattachedDoc = this.doc;
}
switch (m.type) {

@@ -322,5 +339,5 @@ case 'characterData': {

this.texts.push({
value: needMaskingText(m.target, this.maskTextClass, this.maskTextSelector) && value
value: needMaskingText(m.target, this.maskTextClass, this.maskTextSelector, true) && value
? this.maskTextFn
? this.maskTextFn(value)
? this.maskTextFn(value, closestElementOfNode(m.target))
: value.replace(/[\S]/g, '*')

@@ -352,3 +369,3 @@ : value,

}
let item = this.attributes.find((a) => a.node === m.target);
let item = this.attributeMap.get(m.target);
if (target.tagName === 'IFRAME' &&

@@ -372,2 +389,3 @@ attributeName === 'src' &&

this.attributes.push(item);
this.attributeMap.set(m.target, item);
}

@@ -382,3 +400,12 @@ if (attributeName === 'type' &&

if (attributeName === 'style') {
const old = unattachedDoc.createElement('span');
if (!this.unattachedDoc) {
try {
this.unattachedDoc =
document.implementation.createHTMLDocument();
}
catch (e) {
this.unattachedDoc = this.doc;
}
}
const old = this.unattachedDoc.createElement('span');
if (m.oldValue) {

@@ -415,2 +442,6 @@ old.setAttribute('style', m.oldValue);

return;
if (m.target.tagName === 'TEXTAREA') {
this.genTextAreaValueMutation(m.target);
return;
}
m.addedNodes.forEach((n) => this.genAdds(n, m.target));

@@ -417,0 +448,0 @@ m.removedNodes.forEach((n) => {

@@ -231,8 +231,2 @@ import { toLowerCase, getInputType, maskInputValue } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';

}
function wrapEventWithUserTriggeredFlag(v, enable) {
const value = Object.assign({}, v);
if (!enable)
delete value.userTriggered;
return value;
}
const INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];

@@ -275,3 +269,5 @@ const lastInputValueMap = new WeakMap();

}
cbWithDedup(target, callbackWrapper(wrapEventWithUserTriggeredFlag)({ text, isChecked, userTriggered }, userTriggeredOnInput));
cbWithDedup(target, userTriggeredOnInput
? { text, isChecked, userTriggered }
: { text, isChecked });
const name = target.name;

@@ -283,7 +279,6 @@ if (type === 'radio' && name && isChecked) {

if (el !== target) {
cbWithDedup(el, callbackWrapper(wrapEventWithUserTriggeredFlag)({
text: el.value,
isChecked: !isChecked,
userTriggered: false,
}, userTriggeredOnInput));
const text = el.value;
cbWithDedup(el, userTriggeredOnInput
? { text, isChecked: !isChecked, userTriggered: false }
: { text, isChecked: !isChecked });
}

@@ -523,3 +518,5 @@ });

: (_c = (_b = host.ownerDocument) === null || _b === void 0 ? void 0 : _b.defaultView) === null || _c === void 0 ? void 0 : _c.ShadowRoot;
const originalPropertyDescriptor = Object.getOwnPropertyDescriptor(patchTarget === null || patchTarget === void 0 ? void 0 : patchTarget.prototype, 'adoptedStyleSheets');
const originalPropertyDescriptor = (patchTarget === null || patchTarget === void 0 ? void 0 : patchTarget.prototype)
? Object.getOwnPropertyDescriptor(patchTarget === null || patchTarget === void 0 ? void 0 : patchTarget.prototype, 'adoptedStyleSheets')
: undefined;
if (hostId === null ||

@@ -710,4 +707,25 @@ hostId === -1 ||

}
function initCustomElementObserver({ doc, customElementCb, }) {
const win = doc.defaultView;
if (!win || !win.customElements)
return () => { };
const restoreHandler = patch(win.customElements, 'define', function (original) {
return function (name, constructor, options) {
try {
customElementCb({
define: {
name,
},
});
}
catch (e) {
console.warn(`Custom element callback failed for ${name}`);
}
return original.apply(this, [name, constructor, options]);
};
});
return restoreHandler;
}
function mergeHooks(o, hooks) {
const { mutationCb, mousemoveCb, mouseInteractionCb, scrollCb, viewportResizeCb, inputCb, mediaInteractionCb, styleSheetRuleCb, styleDeclarationCb, canvasMutationCb, fontCb, selectionCb, } = o;
const { mutationCb, mousemoveCb, mouseInteractionCb, scrollCb, viewportResizeCb, inputCb, mediaInteractionCb, styleSheetRuleCb, styleDeclarationCb, canvasMutationCb, fontCb, selectionCb, customElementCb, } = o;
o.mutationCb = (...p) => {

@@ -785,2 +803,8 @@ if (hooks.mutation) {

};
o.customElementCb = (...c) => {
if (hooks.customElement) {
hooks.customElement(...c);
}
customElementCb(...c);
};
}

@@ -794,3 +818,6 @@ function initObservers(o, hooks = {}) {

mergeHooks(o, hooks);
const mutationObserver = initMutationObserver(o, o.doc);
let mutationObserver;
if (o.recordDOM) {
mutationObserver = initMutationObserver(o, o.doc);
}
const mousemoveHandler = initMoveObserver(o);

@@ -804,12 +831,18 @@ const mouseInteractionHandler = initMouseInteractionObserver(o);

const mediaInteractionHandler = initMediaInteractionObserver(o);
const styleSheetObserver = initStyleSheetObserver(o, { win: currentWindow });
const adoptedStyleSheetObserver = initAdoptedStyleSheetObserver(o, o.doc);
const styleDeclarationObserver = initStyleDeclarationObserver(o, {
win: currentWindow,
});
const fontObserver = o.collectFonts
? initFontObserver(o)
: () => {
};
let styleSheetObserver = () => { };
let adoptedStyleSheetObserver = () => { };
let styleDeclarationObserver = () => { };
let fontObserver = () => { };
if (o.recordDOM) {
styleSheetObserver = initStyleSheetObserver(o, { win: currentWindow });
adoptedStyleSheetObserver = initAdoptedStyleSheetObserver(o, o.doc);
styleDeclarationObserver = initStyleDeclarationObserver(o, {
win: currentWindow,
});
if (o.collectFonts) {
fontObserver = initFontObserver(o);
}
}
const selectionObserver = initSelectionObserver(o);
const customElementObserver = initCustomElementObserver(o);
const pluginHandlers = [];

@@ -821,3 +854,3 @@ for (const plugin of o.plugins) {

mutationBuffers.forEach((b) => b.reset());
mutationObserver.disconnect();
mutationObserver === null || mutationObserver === void 0 ? void 0 : mutationObserver.disconnect();
mousemoveHandler();

@@ -834,2 +867,3 @@ mouseInteractionHandler();

selectionObserver();
customElementObserver();
pluginHandlers.forEach((h) => h());

@@ -836,0 +870,0 @@ });

@@ -17,3 +17,3 @@ import { CanvasContext } from '../../../../../types/dist/types.js';

setTimeout(() => {
const recordArgs = serializeArgs([...args], win, this);
const recordArgs = serializeArgs(args, win, this);
cb(this.canvas, {

@@ -20,0 +20,0 @@ type: CanvasContext['2D'],

@@ -103,3 +103,3 @@ import { encode } from './../../../../../../ext/base64-arraybuffer/dist/base64-arraybuffer.es5.js';

const serializeArgs = (args, win, ctx) => {
return [...args].map((arg) => serializeArg(arg, win, ctx));
return args.map((arg) => serializeArg(arg, win, ctx));
};

@@ -106,0 +106,0 @@ const isInstanceOfWebGLObject = (value, win) => {

@@ -27,3 +27,3 @@ import { CanvasContext } from '../../../../../types/dist/types.js';

!isBlocked(this.canvas, blockClass, blockSelector, true)) {
const recordArgs = serializeArgs([...args], win, this);
const recordArgs = serializeArgs(args, win, this);
const mutation = {

@@ -30,0 +30,0 @@ type,

@@ -45,11 +45,8 @@ import { stringifyRule } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';

styleId = this.styleMirror.add(sheet);
const rules = Array.from(sheet.rules || CSSRule);
styles.push({
styleId,
rules: rules.map((r, index) => {
return {
rule: stringifyRule(r),
index,
};
}),
rules: Array.from(sheet.rules || CSSRule, (r, index) => ({
rule: stringifyRule(r),
index,
})),
});

@@ -56,0 +53,0 @@ }

@@ -150,5 +150,5 @@ import { classMatchesRegex, IGNORED_NODE, isShadowRoot } from '../../rrweb-snapshot/es/rrweb-snapshot.js';

}
function isBlocked(node, blockClass, blockSelector, checkAncestors) {
function closestElementOfNode(node) {
if (!node) {
return false;
return null;
}

@@ -158,4 +158,12 @@ const el = node.nodeType === node.ELEMENT_NODE

: node.parentElement;
if (!el)
return el;
}
function isBlocked(node, blockClass, blockSelector, checkAncestors) {
if (!node) {
return false;
}
const el = closestElementOfNode(node);
if (!el) {
return false;
}
try {

@@ -403,2 +411,2 @@ if (typeof blockClass === 'string') {

export { StyleSheetMirror, _mirror, getBaseDimension, getNestedRule, getPositionsAndIndex, getRootShadowHost, getShadowHost, getWindowHeight, getWindowScroll, getWindowWidth, hasShadowRoot, hookSetter, inDom, isAncestorRemoved, isBlocked, isIgnored, isSerialized, isSerializedIframe, isSerializedStylesheet, iterateResolveTree, legacy_isTouchEvent, nowTimestamp, on, patch, polyfill, queueToResolveTrees, shadowHostInDom, throttle, uniqueTextMutations };
export { StyleSheetMirror, _mirror, closestElementOfNode, getBaseDimension, getNestedRule, getPositionsAndIndex, getRootShadowHost, getShadowHost, getWindowHeight, getWindowScroll, getWindowWidth, hasShadowRoot, hookSetter, inDom, isAncestorRemoved, isBlocked, isIgnored, isSerialized, isSerializedIframe, isSerializedStylesheet, iterateResolveTree, legacy_isTouchEvent, nowTimestamp, on, patch, polyfill, queueToResolveTrees, shadowHostInDom, throttle, uniqueTextMutations };

@@ -28,2 +28,3 @@ var EventType = /* @__PURE__ */ ((EventType2) => {

IncrementalSource2[IncrementalSource2["AdoptedStyleSheet"] = 15] = "AdoptedStyleSheet";
IncrementalSource2[IncrementalSource2["CustomElement"] = 16] = "CustomElement";
return IncrementalSource2;

@@ -30,0 +31,0 @@ })(IncrementalSource || {});

{
"name": "rrweb",
"version": "2.0.0-alpha.11",
"version": "2.0.0-alpha.12",
"description": "record and replay the web",

@@ -15,2 +15,3 @@ "scripts": {

"test:update": "yarn test:headless -- --updateSnapshot",
"retest:update": "PUPPETEER_HEADLESS=true yarn retest -- --updateSnapshot",
"repl": "yarn bundle:browser && node scripts/repl.js",

@@ -85,3 +86,3 @@ "live-stream": "yarn bundle:browser && node scripts/stream.js",

"dependencies": {
"@rrweb/types": "^2.0.0-alpha.11",
"@rrweb/types": "^2.0.0-alpha.12",
"@types/css-font-loading-module": "0.0.7",

@@ -92,5 +93,5 @@ "@xstate/fsm": "^1.4.0",

"mitt": "^3.0.0",
"rrdom": "^2.0.0-alpha.11",
"rrweb-snapshot": "^2.0.0-alpha.11"
"rrdom": "^2.0.0-alpha.12",
"rrweb-snapshot": "^2.0.0-alpha.12"
}
}
import record from './record';
import { Replayer } from './replay';
import canvasMutation from './replay/canvas';
import { _mirror } from './utils';
import * as utils from './utils';
export { EventType, IncrementalSource, MouseInteractions, ReplayerEvents, } from '@rrweb/types';
export { EventType, IncrementalSource, MouseInteractions, ReplayerEvents, type eventWithTime, } from '@rrweb/types';
export type { recordOptions } from './types';
declare const addCustomEvent: <T>(tag: string, payload: T) => void;
declare const freezePage: () => void;
export { record, addCustomEvent, freezePage, Replayer, _mirror as mirror, utils, };
export { record, addCustomEvent, freezePage, Replayer, canvasMutation, _mirror as mirror, utils, };

@@ -8,2 +8,3 @@ import type { MutationBufferParam } from '../types';

private attributes;
private attributeMap;
private removes;

@@ -36,2 +37,3 @@ private mapRemoves;

private processedNodeManager;
private unattachedDoc;
init(options: MutationBufferParam): void;

@@ -46,4 +48,5 @@ freeze(): void;

emit: () => void;
private genTextAreaValueMutation;
private processMutation;
private genAdds;
}

@@ -9,3 +9,3 @@ import type { Mirror, MaskInputOptions, SlimDOMOptions, MaskInputFn, MaskTextFn, DataURLOptions } from 'rrweb-snapshot';

import type { StylesheetManager } from './record/stylesheet-manager';
import type { addedNodeMutation, blockClass, canvasMutationCallback, eventWithTime, fontCallback, hooksParam, inputCallback, IWindow, KeepIframeSrcFn, listenerHandler, maskTextClass, mediaInteractionCallback, mouseInteractionCallBack, mousemoveCallBack, mutationCallBack, RecordPlugin, SamplingStrategy, scrollCallback, selectionCallback, styleDeclarationCallback, styleSheetRuleCallback, viewportResizeCallback } from '@rrweb/types';
import type { addedNodeMutation, blockClass, canvasMutationCallback, customElementCallback, eventWithTime, fontCallback, hooksParam, inputCallback, IWindow, KeepIframeSrcFn, listenerHandler, maskTextClass, mediaInteractionCallback, mouseInteractionCallBack, mousemoveCallBack, mutationCallBack, RecordPlugin, SamplingStrategy, scrollCallback, selectionCallback, styleDeclarationCallback, styleSheetRuleCallback, viewportResizeCallback } from '@rrweb/types';
import type ProcessedNodeManager from './record/processed-node-manager';

@@ -33,2 +33,3 @@ export type recordOptions<T> = {

dataURLOptions?: DataURLOptions;
recordDOM?: boolean;
recordCanvas?: boolean;

@@ -68,4 +69,6 @@ recordCrossOriginIframes?: boolean;

canvasMutationCb: canvasMutationCallback;
customElementCb: customElementCallback;
fontCb: fontCallback;
sampling: SamplingStrategy;
recordDOM: boolean;
recordCanvas: boolean;

@@ -72,0 +75,0 @@ inlineImages: boolean;

@@ -19,2 +19,3 @@ import type { throttleOptions, listenerHandler, hookResetter, blockClass, addedNodeMutation, DocumentDimension, IWindow, DeprecatedMirror, textMutation } from '@rrweb/types';

export declare function getWindowWidth(): number;
export declare function closestElementOfNode(node: Node | null): HTMLElement | null;
export declare function isBlocked(node: Node | null, blockClass: blockClass, blockSelector: string | null, checkAncestors: boolean): boolean;

@@ -21,0 +22,0 @@ export declare function isSerialized(n: Node, mirror: Mirror): boolean;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc