Socket
Socket
Sign inDemoInstall

rrweb

Package Overview
Dependencies
4
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.9.3 to 0.9.4

2

dist/record/rrweb-record.min.js

@@ -15,3 +15,3 @@ var rrwebRecord=function(){"use strict";

and limitations under the License.
***************************************************************************** */var e,t=function(){return(t=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function n(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}function r(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}!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"}(e||(e={}));var a=1,i=RegExp("[^a-z1-6-_]");function u(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce((function(e,t){return e+(function(e){return"styleSheet"in e}(n=t)?u(n.styleSheet)||"":n.cssText);var n}),""):null}catch(e){return null}}var s,l,c,d,p,f=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,v=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,h=/^(data:)([\w\/\+\-]+);(charset=[\w-]+|base64).*,(.*)/i;function m(e,t){return(e||"").replace(f,(function(e,n,o,r){var a,i=n||o||r;if(!i)return e;if(!v.test(i))return"url('"+i+"')";if(h.test(i))return"url("+i+")";if("/"===i[0])return"url('"+(((a=t).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+i+"')");var u=t.split("/"),s=i.split("/");u.pop();for(var l=0,c=s;l<c.length;l++){var d=c[l];"."!==d&&(".."===d?u.pop():u.push(d))}return"url('"+u.join("/")+"')"}))}function y(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function g(e,t,n){return"src"===t||"href"===t&&n?y(e,n):"srcset"===t&&n?function(e,t){return""===t.trim()?t:t.split(",").map((function(t){var n=t.trimLeft().trimRight().split(" ");return 2===n.length?y(e,n[0])+" "+n[1]:1===n.length?""+y(e,n[0]):""})).join(", ")}(e,n):"style"===t&&n?m(n,location.href):n}function b(t,n,o,r,a,s){switch(void 0===a&&(a={}),t.nodeType){case t.DOCUMENT_NODE:return{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId};case t.ELEMENT_NODE:var l=!1;"string"==typeof o?l=t.classList.contains(o):t.classList.forEach((function(e){o.test(e)&&(l=!0)}));for(var c=function(e){var t=e.toLowerCase().trim();return i.test(t)?"div":t}(t.tagName),d={},p=0,f=Array.from(t.attributes);p<f.length;p++){var v=f[p],h=v.name,y=v.value;d[h]=g(n,h,y)}if("link"===c&&r){var b,S=Array.from(n.styleSheets).find((function(e){return e.href===t.href}));(b=u(S))&&(delete d.rel,delete d.href,d._cssText=m(b,S.href))}if("style"===c&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(b=u(t.sheet))&&(d._cssText=m(b,location.href));if("input"===c||"textarea"===c||"select"===c){y=t.value;"radio"!==d.type&&"checkbox"!==d.type&&"submit"!==d.type&&"button"!==d.type&&y?d.value=a[d.type]||a[c]?"*".repeat(y.length):y:t.checked&&(d.checked=t.checked)}if("option"===c){var C=t.parentElement;d.value===C.value&&(d.selected=t.selected)}if("canvas"===c&&s&&(d.rr_dataURL=t.toDataURL()),"audio"!==c&&"video"!==c||(d.rr_mediaState=t.paused?"paused":"played"),t.scrollLeft&&(d.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(d.rr_scrollTop=t.scrollTop),l){var w=t.getBoundingClientRect(),E=w.width,I=w.height;d.rr_width=E+"px",d.rr_height=I+"px"}return{type:e.Element,tagName:c,attributes:d,childNodes:[],isSVG:(M=t,"svg"===M.tagName||M instanceof SVGElement||void 0),needBlock:l};case t.TEXT_NODE:var x=t.parentNode&&t.parentNode.tagName,N=t.textContent,T="STYLE"===x||void 0;return T&&N&&(N=m(N,location.href)),"SCRIPT"===x&&(N="SCRIPT_PLACEHOLDER"),{type:e.Text,textContent:N||"",isStyle:T};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:""};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||""};default:return!1}var M}function S(t,n,o,r,i,u,s,l){void 0===i&&(i=!1),void 0===u&&(u=!0);var c,d=b(t,n,r,u,s,l||!1);if(!d)return console.warn(t,"not serialized"),null;c="__sn"in t?t.__sn.id:a++;var p=Object.assign(d,{id:c});t.__sn=p,o[c]=t;var f=!i;if(p.type===e.Element&&(f=f&&!p.needBlock,delete p.needBlock),(p.type===e.Document||p.type===e.Element)&&f)for(var v=0,h=Array.from(t.childNodes);v<h.length;v++){var m=S(h[v],n,o,r,i,u,s,l);m&&p.childNodes.push(m)}return p}function C(e,t,n){void 0===n&&(n=document);var o={capture:!0,passive:!0};return n.addEventListener(e,t,o),function(){return n.removeEventListener(e,t,o)}}!function(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"}(s||(s={})),function(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"}(l||(l={})),function(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"}(c||(c={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause"}(d||(d={})),function(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"}(p||(p={}));var w={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return w.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete w.map[t],e.childNodes&&e.childNodes.forEach((function(e){return w.removeNodeFromMap(e)}))},has:function(e){return w.map.hasOwnProperty(e)}};function E(e,t,n){void 0===n&&(n={});var o=null,r=0;return function(a){var i=Date.now();r||!1!==n.leading||(r=i);var u=t-(i-r),s=this,l=arguments;u<=0||u>t?(o&&(window.clearTimeout(o),o=null),r=i,e.apply(s,l)):o||!1===n.trailing||(o=window.setTimeout((function(){r=!1===n.leading?0:Date.now(),o=null,e.apply(s,l)}),u))}}function I(e,t,n,o,r){void 0===r&&(r=window);var a=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,o?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),a&&a.set&&a.set.call(this,e)}}),function(){return I(e,t,a||{},!0)}}function x(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function N(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function T(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;return"string"==typeof t?n=e.classList.contains(t):e.classList.forEach((function(e){t.test(e)&&(n=!0)})),n||T(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,T(e.parentNode,t)}function M(e){return Boolean(e.changedTouches)}function _(e){return"__ln"in e}var k=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&_(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&_(e.nextSibling)){n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),this.length--)},e}(),D=function(e,t){return e+"@"+t};function L(e){return"__sn"in e}var O=function(e,t,o,r,a){var i=this;this.texts=[],this.attributes=[],this.removes=[],this.adds=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(e){var t,o,r,a;e.forEach(i.processMutation);var u=new k,s=function(e){var t=e.nextSibling&&w.getId(e.nextSibling);return-1===t&&T(e.nextSibling,i.blockClass)&&(t=null),t},l=function(e){if(e.parentNode){var t=w.getId(e.parentNode),n=s(e);if(-1===t||-1===n)return u.addNode(e);i.adds.push({parentId:t,nextId:n,node:S(e,document,w.map,i.blockClass,!0,i.inlineStylesheet,i.maskInputOptions,i.recordCanvas)})}};try{for(var c=n(i.movedSet),d=c.next();!d.done;d=c.next())l(v=d.value)}catch(e){t={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(t)throw t.error}}try{for(var p=n(i.addedSet),f=p.next();!f.done;f=p.next()){var v=f.value;P(i.droppedSet,v)||A(i.removes,v)?P(i.movedSet,v)?l(v):i.droppedSet.add(v):l(v)}}catch(e){r={error:e}}finally{try{f&&!f.done&&(a=p.return)&&a.call(p)}finally{if(r)throw r.error}}for(var h=null;u.length;){var m=null;if(h){var y=w.getId(h.value.parentNode),g=s(h.value);-1!==y&&-1!==g&&(m=h)}if(!m)for(var b=u.length-1;b>=0;b--){var C=u.get(b);if(y=w.getId(C.value.parentNode),g=s(C.value),-1!==y&&-1!==g){m=C;break}}if(!m)break;h=m.previous,u.removeNode(m.value),l(m.value)}i.emit()},this.emit=function(){var e={texts:i.texts.map((function(e){return{id:w.getId(e.node),value:e.value}})).filter((function(e){return w.has(e.id)})),attributes:i.attributes.map((function(e){return{id:w.getId(e.node),attributes:e.attributes}})).filter((function(e){return w.has(e.id)})),removes:i.removes,adds:i.adds};(e.texts.length||e.attributes.length||e.removes.length||e.adds.length)&&(i.emissionCallback(e),i.texts=[],i.attributes=[],i.removes=[],i.adds=[],i.addedSet=new Set,i.movedSet=new Set,i.droppedSet=new Set,i.movedMap={})},this.processMutation=function(e){switch(e.type){case"characterData":var t=e.target.textContent;T(e.target,i.blockClass)||t===e.oldValue||i.texts.push({value:t,node:e.target});break;case"attributes":if(t=e.target.getAttribute(e.attributeName),T(e.target,i.blockClass)||t===e.oldValue)return;var n=i.attributes.find((function(t){return t.node===e.target}));n||(n={node:e.target,attributes:{}},i.attributes.push(n)),n.attributes[e.attributeName]=g(document,e.attributeName,t);break;case"childList":e.addedNodes.forEach((function(t){return i.genAdds(t,e.target)})),e.removedNodes.forEach((function(t){var n=w.getId(t),o=w.getId(e.target);T(t,i.blockClass)||T(e.target,i.blockClass)||(i.addedSet.has(t)?(R(i.addedSet,t),i.droppedSet.add(t)):i.addedSet.has(e.target)&&-1===n||function e(t){var n=w.getId(t);return!w.has(n)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode))}(e.target)||(i.movedSet.has(t)&&i.movedMap[D(n,o)]?R(i.movedSet,t):i.removes.push({parentId:o,id:n})),w.removeNodeFromMap(t))}))}},this.genAdds=function(e,t){if(!T(e,i.blockClass)){if(L(e)){i.movedSet.add(e);var n=null;t&&L(t)&&(n=t.__sn.id),n&&(i.movedMap[D(e.__sn.id,n)]=!0)}else i.addedSet.add(e),i.droppedSet.delete(e);e.childNodes.forEach((function(e){return i.genAdds(e)}))}},this.blockClass=t,this.inlineStylesheet=o,this.maskInputOptions=r,this.recordCanvas=a,this.emissionCallback=e};function R(e,t){e.delete(t),t.childNodes.forEach((function(t){return R(e,t)}))}function A(e,t){var n=t.parentNode;if(!n)return!1;var o=w.getId(n);return!!e.some((function(e){return e.id===o}))||A(e,n)}function P(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||P(e,n))}function z(e,t,n){if(!1===n.mouseInteraction)return function(){};var o=!0===n.mouseInteraction||void 0===n.mouseInteraction?{}:n.mouseInteraction,r=[];return Object.keys(c).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==o[e]})).forEach((function(n){var o=n.toLowerCase(),a=function(n){return function(o){if(!T(o.target,t)){var r=w.getId(o.target),a=M(o)?o.changedTouches[0]:o,i=a.clientX,u=a.clientY;e({type:c[n],id:r,x:i,y:u})}}}(n);r.push(C(o,a))})),function(){r.forEach((function(e){return e()}))}}var F,j=["INPUT","TEXTAREA","SELECT"],H=new WeakMap;function U(e,t){var o,a,i=Object.getOwnPropertyNames(CanvasRenderingContext2D.prototype),u=[],s=function(n){try{if("function"!=typeof CanvasRenderingContext2D.prototype[n])return"continue";var o=function(e,t,n){try{if(!(t in e))return function(){};var o=e[t],r=n(o);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=r,function(){e[t]=o}}catch(e){return function(){}}}(CanvasRenderingContext2D.prototype,n,(function(o){return function(){for(var a=this,i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];return T(this.canvas,t)||setTimeout((function(){var t=r(i);"drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement&&(t[0]=t[0].toDataURL()),e({id:w.getId(a.canvas),property:n,args:t})}),0),o.apply(this,i)}}));u.push(o)}catch(t){var a=I(CanvasRenderingContext2D.prototype,n,{set:function(t){e({id:w.getId(this.canvas),property:n,args:[t],setter:!0})}});u.push(a)}};try{for(var l=n(i),c=l.next();!c.done;c=l.next()){s(c.value)}}catch(e){o={error:e}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}return function(){u.forEach((function(e){return e()}))}}function V(e,n){void 0===n&&(n={}),function(e,t){var n=e.mutationCb,o=e.mousemoveCb,a=e.mouseInteractionCb,i=e.scrollCb,u=e.viewportResizeCb,s=e.inputCb,l=e.mediaInteractionCb,c=e.styleSheetRuleCb,d=e.canvasMutationCb;e.mutationCb=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];t.mutation&&t.mutation.apply(t,r(e)),n.apply(void 0,r(e))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,r(e)),o.apply(void 0,r(e))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,r(e)),a.apply(void 0,r(e))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,r(e)),i.apply(void 0,r(e))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,r(e)),u.apply(void 0,r(e))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,r(e)),s.apply(void 0,r(e))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,r(e)),l.apply(void 0,r(e))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,r(e)),c.apply(void 0,r(e))},e.canvasMutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.canvasMutation&&t.canvasMutation.apply(t,r(e)),d.apply(void 0,r(e))}}(e,n);var o,a,i,u,s,c,p,f=(o=e.mutationCb,a=e.blockClass,i=e.inlineStylesheet,u=e.maskInputOptions,s=e.recordCanvas,c=new O(o,a,i,u,s),(p=new MutationObserver(c.processMutations)).observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),p),v=function(e,t){if(!1===t.mousemove)return function(){};var n,o="number"==typeof t.mousemove?t.mousemove:50,r=[],a=E((function(t){var o=Date.now()-n;e(r.map((function(e){return e.timeOffset-=o,e})),t?l.TouchMove:l.MouseMove),r=[],n=null}),500),i=E((function(e){var t=e.target,o=M(e)?e.changedTouches[0]:e,i=o.clientX,u=o.clientY;n||(n=Date.now()),r.push({x:i,y:u,id:w.getId(t),timeOffset:Date.now()-n}),a(M(e))}),o,{trailing:!1}),u=[C("mousemove",i),C("touchmove",i)];return function(){u.forEach((function(e){return e()}))}}(e.mousemoveCb,e.sampling),h=z(e.mouseInteractionCb,e.blockClass,e.sampling),m=function(e,t,n){return C("scroll",E((function(n){if(n.target&&!T(n.target,t)){var o=w.getId(n.target);if(n.target===document){var r=document.scrollingElement||document.documentElement;e({id:o,x:r.scrollLeft,y:r.scrollTop})}else e({id:o,x:n.target.scrollLeft,y:n.target.scrollTop})}}),n.scroll||100))}(e.scrollCb,e.blockClass,e.sampling),y=function(e){return C("resize",E((function(){var t=x(),n=N();e({width:Number(n),height:Number(t)})}),200),window)}(e.viewportResizeCb),g=function(e,n,o,a,i){function u(e){var t=e.target;if(t&&t.tagName&&!(j.indexOf(t.tagName)<0)&&!T(t,n)){var r=t.type;if("password"!==r&&!t.classList.contains(o)){var i=t.value,u=!1;"radio"===r||"checkbox"===r?u=t.checked:(a[t.tagName.toLowerCase()]||a[r])&&(i="*".repeat(i.length)),s(t,{text:i,isChecked:u});var l=t.name;"radio"===r&&l&&u&&document.querySelectorAll('input[type="radio"][name="'+l+'"]').forEach((function(e){e!==t&&s(e,{text:e.value,isChecked:!u})}))}}}function s(n,o){var r=H.get(n);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){H.set(n,o);var a=w.getId(n);e(t(t({},o),{id:a}))}}var l=("last"===i.input?["change"]:["input","change"]).map((function(e){return C(e,u)})),c=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),d=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"]];return c&&c.set&&l.push.apply(l,r(d.map((function(e){return I(e[0],e[1],{set:function(){u({target:this})}})})))),function(){l.forEach((function(e){return e()}))}}(e.inputCb,e.blockClass,e.ignoreClass,e.maskInputOptions,e.sampling),b=function(e,t){var n=function(n){return function(o){var r=o.target;r&&!T(r,t)&&e({type:"play"===n?d.Play:d.Pause,id:w.getId(r)})}},o=[C("play",n("play")),C("pause",n("pause"))];return function(){o.forEach((function(e){return e()}))}}(e.mediaInteractionCb,e.blockClass),S=function(e){var t=CSSStyleSheet.prototype.insertRule;CSSStyleSheet.prototype.insertRule=function(n,o){var r=w.getId(this.ownerNode);return-1!==r&&e({id:r,adds:[{rule:n,index:o}]}),t.apply(this,arguments)};var n=CSSStyleSheet.prototype.deleteRule;return CSSStyleSheet.prototype.deleteRule=function(t){var o=w.getId(this.ownerNode);return-1!==o&&e({id:o,removes:[{index:t}]}),n.apply(this,arguments)},function(){CSSStyleSheet.prototype.insertRule=t,CSSStyleSheet.prototype.deleteRule=n}}(e.styleSheetRuleCb),_=e.recordCanvas?U(e.canvasMutationCb,e.blockClass):function(){};return function(){f.disconnect(),v(),h(),m(),y(),g(),b(),S(),_()}}function B(e){return t(t({},e),{timestamp:Date.now()})}function X(e){void 0===e&&(e={});var n=e.emit,r=e.checkoutEveryNms,a=e.checkoutEveryNth,i=e.blockClass,u=void 0===i?"rr-block":i,c=e.ignoreClass,d=void 0===c?"rr-ignore":c,p=e.inlineStylesheet,f=void 0===p||p,v=e.maskAllInputs,h=e.maskInputOptions,m=e.hooks,y=e.packFn,g=e.sampling,b=void 0===g?{}:g,E=e.mousemoveWait,I=e.recordCanvas,T=void 0!==I&&I;if(!n)throw new Error("emit function is required");void 0!==E&&void 0===b.mousemove&&(b.mousemove=E);var M,_=!0===v?{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}:void 0!==h?h:{};"NodeList"in window&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach);var k=0;function D(e){var t,n,r,a;void 0===e&&(e=!1),F(B({type:s.Meta,data:{href:window.location.href,width:N(),height:x()}}),e);var i=o(function(e,t,n,o,r){void 0===t&&(t="rr-block"),void 0===n&&(n=!0);var a={};return[S(e,e,a,t,!1,n,!0===o?{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}:!1===o?{}:o,r),a]}(document,u,f,_,T),2),l=i[0],c=i[1];if(!l)return console.warn("Failed to snapshot the document");w.map=c,F(B({type:s.FullSnapshot,data:{node:l,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(a=null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.parentElement)||void 0===a?void 0:a.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}}))}F=function(e,t){if(n(y?y(e):e,t),e.type===s.FullSnapshot)M=e,k=0;else if(e.type===s.IncrementalSnapshot){k++;var o=a&&k>=a,i=r&&e.timestamp-M.timestamp>r;(o||i)&&D(!0)}};try{var L=[];L.push(C("DOMContentLoaded",(function(){F(B({type:s.DomContentLoaded,data:{}}))})));var O=function(){D(),L.push(V({mutationCb:function(e){return F(B({type:s.IncrementalSnapshot,data:t({source:l.Mutation},e)}))},mousemoveCb:function(e,t){return F(B({type:s.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return F(B({type:s.IncrementalSnapshot,data:t({source:l.MouseInteraction},e)}))},scrollCb:function(e){return F(B({type:s.IncrementalSnapshot,data:t({source:l.Scroll},e)}))},viewportResizeCb:function(e){return F(B({type:s.IncrementalSnapshot,data:t({source:l.ViewportResize},e)}))},inputCb:function(e){return F(B({type:s.IncrementalSnapshot,data:t({source:l.Input},e)}))},mediaInteractionCb:function(e){return F(B({type:s.IncrementalSnapshot,data:t({source:l.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return F(B({type:s.IncrementalSnapshot,data:t({source:l.StyleSheetRule},e)}))},canvasMutationCb:function(e){return F(B({type:s.IncrementalSnapshot,data:t({source:l.CanvasMutation},e)}))},blockClass:u,ignoreClass:d,maskInputOptions:_,inlineStylesheet:f,sampling:b,recordCanvas:T},m))};return"interactive"===document.readyState||"complete"===document.readyState?O():L.push(C("load",(function(){F(B({type:s.Load,data:{}})),O()}),window)),function(){L.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}return X.addCustomEvent=function(e,t){if(!F)throw new Error("please add custom event after start recording");F(B({type:s.Custom,data:{tag:e,payload:t}}))},X}();
***************************************************************************** */var e,t=function(){return(t=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function n(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}function r(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}!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"}(e||(e={}));var a=1,i=RegExp("[^a-z1-6-_]");function u(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce((function(e,t){return e+(function(e){return"styleSheet"in e}(n=t)?u(n.styleSheet)||"":n.cssText);var n}),""):null}catch(e){return null}}var s,l,c,d,p,f=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,v=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,h=/^(data:)([\w\/\+\-]+);(charset=[\w-]+|base64).*,(.*)/i;function m(e,t){return(e||"").replace(f,(function(e,n,o,r){var a,i=n||o||r;if(!i)return e;if(!v.test(i))return"url('"+i+"')";if(h.test(i))return"url("+i+")";if("/"===i[0])return"url('"+(((a=t).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+i+"')");var u=t.split("/"),s=i.split("/");u.pop();for(var l=0,c=s;l<c.length;l++){var d=c[l];"."!==d&&(".."===d?u.pop():u.push(d))}return"url('"+u.join("/")+"')"}))}function y(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function g(e,t,n){return"src"===t||"href"===t&&n?y(e,n):"srcset"===t&&n?function(e,t){return""===t.trim()?t:t.split(",").map((function(t){var n=t.trimLeft().trimRight().split(" ");return 2===n.length?y(e,n[0])+" "+n[1]:1===n.length?""+y(e,n[0]):""})).join(", ")}(e,n):"style"===t&&n?m(n,location.href):n}function b(t,n,o,r,a,s){switch(void 0===a&&(a={}),t.nodeType){case t.DOCUMENT_NODE:return{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId};case t.ELEMENT_NODE:var l=!1;"string"==typeof o?l=t.classList.contains(o):t.classList.forEach((function(e){o.test(e)&&(l=!0)}));for(var c=function(e){var t=e.toLowerCase().trim();return i.test(t)?"div":t}(t.tagName),d={},p=0,f=Array.from(t.attributes);p<f.length;p++){var v=f[p],h=v.name,y=v.value;d[h]=g(n,h,y)}if("link"===c&&r){var b,S=Array.from(n.styleSheets).find((function(e){return e.href===t.href}));(b=u(S))&&(delete d.rel,delete d.href,d._cssText=m(b,S.href))}if("style"===c&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(b=u(t.sheet))&&(d._cssText=m(b,location.href));if("input"===c||"textarea"===c||"select"===c){y=t.value;"radio"!==d.type&&"checkbox"!==d.type&&"submit"!==d.type&&"button"!==d.type&&y?d.value=a[d.type]||a[c]?"*".repeat(y.length):y:t.checked&&(d.checked=t.checked)}if("option"===c){var C=t.parentElement;d.value===C.value&&(d.selected=t.selected)}if("canvas"===c&&s&&(d.rr_dataURL=t.toDataURL()),"audio"!==c&&"video"!==c||(d.rr_mediaState=t.paused?"paused":"played"),t.scrollLeft&&(d.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(d.rr_scrollTop=t.scrollTop),l){var w=t.getBoundingClientRect(),E=w.width,I=w.height;d.rr_width=E+"px",d.rr_height=I+"px"}return{type:e.Element,tagName:c,attributes:d,childNodes:[],isSVG:(T=t,"svg"===T.tagName||T instanceof SVGElement||void 0),needBlock:l};case t.TEXT_NODE:var x=t.parentNode&&t.parentNode.tagName,N=t.textContent,_="STYLE"===x||void 0;return _&&N&&(N=m(N,location.href)),"SCRIPT"===x&&(N="SCRIPT_PLACEHOLDER"),{type:e.Text,textContent:N||"",isStyle:_};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:""};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||""};default:return!1}var T}function S(t,n,o,r,i,u,s,l){void 0===i&&(i=!1),void 0===u&&(u=!0);var c,d=b(t,n,r,u,s,l||!1);if(!d)return console.warn(t,"not serialized"),null;c="__sn"in t?t.__sn.id:a++;var p=Object.assign(d,{id:c});t.__sn=p,o[c]=t;var f=!i;if(p.type===e.Element&&(f=f&&!p.needBlock,delete p.needBlock),(p.type===e.Document||p.type===e.Element)&&f)for(var v=0,h=Array.from(t.childNodes);v<h.length;v++){var m=S(h[v],n,o,r,i,u,s,l);m&&p.childNodes.push(m)}return p}function C(e,t,n){void 0===n&&(n=document);var o={capture:!0,passive:!0};return n.addEventListener(e,t,o),function(){return n.removeEventListener(e,t,o)}}!function(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"}(s||(s={})),function(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"}(l||(l={})),function(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"}(c||(c={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause"}(d||(d={})),function(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"}(p||(p={}));var w={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return w.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete w.map[t],e.childNodes&&e.childNodes.forEach((function(e){return w.removeNodeFromMap(e)}))},has:function(e){return w.map.hasOwnProperty(e)}};function E(e,t,n){void 0===n&&(n={});var o=null,r=0;return function(a){var i=Date.now();r||!1!==n.leading||(r=i);var u=t-(i-r),s=this,l=arguments;u<=0||u>t?(o&&(window.clearTimeout(o),o=null),r=i,e.apply(s,l)):o||!1===n.trailing||(o=window.setTimeout((function(){r=!1===n.leading?0:Date.now(),o=null,e.apply(s,l)}),u))}}function I(e,t,n,o,r){void 0===r&&(r=window);var a=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,o?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),a&&a.set&&a.set.call(this,e)}}),function(){return I(e,t,a||{},!0)}}function x(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function N(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function _(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;return"string"==typeof t?n=e.classList.contains(t):e.classList.forEach((function(e){t.test(e)&&(n=!0)})),n||_(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,_(e.parentNode,t)}function T(e){return Boolean(e.changedTouches)}function M(e){return"__ln"in e}var k=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&M(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&M(e.nextSibling)){n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),D=function(e,t){return e+"@"+t};function L(e){return"__sn"in e}var O=function(e,t,o,r,a){var i=this;this.texts=[],this.attributes=[],this.removes=[],this.adds=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(e){var t,o,r,a;e.forEach(i.processMutation);var u=new k,s=function(e){var t=e.nextSibling&&w.getId(e.nextSibling);return-1===t&&_(e.nextSibling,i.blockClass)&&(t=null),t},l=function(e){if(e.parentNode){var t=w.getId(e.parentNode),n=s(e);if(-1===t||-1===n)return u.addNode(e);i.adds.push({parentId:t,nextId:n,node:S(e,document,w.map,i.blockClass,!0,i.inlineStylesheet,i.maskInputOptions,i.recordCanvas)})}};try{for(var c=n(i.movedSet),d=c.next();!d.done;d=c.next())l(v=d.value)}catch(e){t={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(t)throw t.error}}try{for(var p=n(i.addedSet),f=p.next();!f.done;f=p.next()){var v=f.value;P(i.droppedSet,v)||A(i.removes,v)?P(i.movedSet,v)?l(v):i.droppedSet.add(v):l(v)}}catch(e){r={error:e}}finally{try{f&&!f.done&&(a=p.return)&&a.call(p)}finally{if(r)throw r.error}}for(var h=null;u.length;){var m=null;if(h){var y=w.getId(h.value.parentNode),g=s(h.value);-1!==y&&-1!==g&&(m=h)}if(!m)for(var b=u.length-1;b>=0;b--){var C=u.get(b);if(y=w.getId(C.value.parentNode),g=s(C.value),-1!==y&&-1!==g){m=C;break}}if(!m)break;h=m.previous,u.removeNode(m.value),l(m.value)}i.emit()},this.emit=function(){var e={texts:i.texts.map((function(e){return{id:w.getId(e.node),value:e.value}})).filter((function(e){return w.has(e.id)})),attributes:i.attributes.map((function(e){return{id:w.getId(e.node),attributes:e.attributes}})).filter((function(e){return w.has(e.id)})),removes:i.removes,adds:i.adds};(e.texts.length||e.attributes.length||e.removes.length||e.adds.length)&&(i.emissionCallback(e),i.texts=[],i.attributes=[],i.removes=[],i.adds=[],i.addedSet=new Set,i.movedSet=new Set,i.droppedSet=new Set,i.movedMap={})},this.processMutation=function(e){switch(e.type){case"characterData":var t=e.target.textContent;_(e.target,i.blockClass)||t===e.oldValue||i.texts.push({value:t,node:e.target});break;case"attributes":if(t=e.target.getAttribute(e.attributeName),_(e.target,i.blockClass)||t===e.oldValue)return;var n=i.attributes.find((function(t){return t.node===e.target}));n||(n={node:e.target,attributes:{}},i.attributes.push(n)),n.attributes[e.attributeName]=g(document,e.attributeName,t);break;case"childList":e.addedNodes.forEach((function(t){return i.genAdds(t,e.target)})),e.removedNodes.forEach((function(t){var n=w.getId(t),o=w.getId(e.target);_(t,i.blockClass)||_(e.target,i.blockClass)||(i.addedSet.has(t)?(R(i.addedSet,t),i.droppedSet.add(t)):i.addedSet.has(e.target)&&-1===n||function e(t){var n=w.getId(t);return!w.has(n)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode))}(e.target)||(i.movedSet.has(t)&&i.movedMap[D(n,o)]?R(i.movedSet,t):i.removes.push({parentId:o,id:n})),w.removeNodeFromMap(t))}))}},this.genAdds=function(e,t){if(!_(e,i.blockClass)){if(L(e)){i.movedSet.add(e);var n=null;t&&L(t)&&(n=t.__sn.id),n&&(i.movedMap[D(e.__sn.id,n)]=!0)}else i.addedSet.add(e),i.droppedSet.delete(e);e.childNodes.forEach((function(e){return i.genAdds(e)}))}},this.blockClass=t,this.inlineStylesheet=o,this.maskInputOptions=r,this.recordCanvas=a,this.emissionCallback=e};function R(e,t){e.delete(t),t.childNodes.forEach((function(t){return R(e,t)}))}function A(e,t){var n=t.parentNode;if(!n)return!1;var o=w.getId(n);return!!e.some((function(e){return e.id===o}))||A(e,n)}function P(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||P(e,n))}function z(e,t,n){if(!1===n.mouseInteraction)return function(){};var o=!0===n.mouseInteraction||void 0===n.mouseInteraction?{}:n.mouseInteraction,r=[];return Object.keys(c).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==o[e]})).forEach((function(n){var o=n.toLowerCase(),a=function(n){return function(o){if(!_(o.target,t)){var r=w.getId(o.target),a=T(o)?o.changedTouches[0]:o,i=a.clientX,u=a.clientY;e({type:c[n],id:r,x:i,y:u})}}}(n);r.push(C(o,a))})),function(){r.forEach((function(e){return e()}))}}var F,j=["INPUT","TEXTAREA","SELECT"],H=new WeakMap;function U(e,t){var o,a,i=Object.getOwnPropertyNames(CanvasRenderingContext2D.prototype),u=[],s=function(n){try{if("function"!=typeof CanvasRenderingContext2D.prototype[n])return"continue";var o=function(e,t,n){try{if(!(t in e))return function(){};var o=e[t],r=n(o);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=r,function(){e[t]=o}}catch(e){return function(){}}}(CanvasRenderingContext2D.prototype,n,(function(o){return function(){for(var a=this,i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];return _(this.canvas,t)||setTimeout((function(){var t=r(i);"drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement&&(t[0]=t[0].toDataURL()),e({id:w.getId(a.canvas),property:n,args:t})}),0),o.apply(this,i)}}));u.push(o)}catch(t){var a=I(CanvasRenderingContext2D.prototype,n,{set:function(t){e({id:w.getId(this.canvas),property:n,args:[t],setter:!0})}});u.push(a)}};try{for(var l=n(i),c=l.next();!c.done;c=l.next()){s(c.value)}}catch(e){o={error:e}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}return function(){u.forEach((function(e){return e()}))}}function V(e,n){void 0===n&&(n={}),function(e,t){var n=e.mutationCb,o=e.mousemoveCb,a=e.mouseInteractionCb,i=e.scrollCb,u=e.viewportResizeCb,s=e.inputCb,l=e.mediaInteractionCb,c=e.styleSheetRuleCb,d=e.canvasMutationCb;e.mutationCb=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];t.mutation&&t.mutation.apply(t,r(e)),n.apply(void 0,r(e))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,r(e)),o.apply(void 0,r(e))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,r(e)),a.apply(void 0,r(e))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,r(e)),i.apply(void 0,r(e))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,r(e)),u.apply(void 0,r(e))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,r(e)),s.apply(void 0,r(e))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,r(e)),l.apply(void 0,r(e))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,r(e)),c.apply(void 0,r(e))},e.canvasMutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.canvasMutation&&t.canvasMutation.apply(t,r(e)),d.apply(void 0,r(e))}}(e,n);var o,a,i,u,s,c,p,f=(o=e.mutationCb,a=e.blockClass,i=e.inlineStylesheet,u=e.maskInputOptions,s=e.recordCanvas,c=new O(o,a,i,u,s),(p=new MutationObserver(c.processMutations)).observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),p),v=function(e,t){if(!1===t.mousemove)return function(){};var n,o="number"==typeof t.mousemove?t.mousemove:50,r=[],a=E((function(t){var o=Date.now()-n;e(r.map((function(e){return e.timeOffset-=o,e})),t?l.TouchMove:l.MouseMove),r=[],n=null}),500),i=E((function(e){var t=e.target,o=T(e)?e.changedTouches[0]:e,i=o.clientX,u=o.clientY;n||(n=Date.now()),r.push({x:i,y:u,id:w.getId(t),timeOffset:Date.now()-n}),a(T(e))}),o,{trailing:!1}),u=[C("mousemove",i),C("touchmove",i)];return function(){u.forEach((function(e){return e()}))}}(e.mousemoveCb,e.sampling),h=z(e.mouseInteractionCb,e.blockClass,e.sampling),m=function(e,t,n){return C("scroll",E((function(n){if(n.target&&!_(n.target,t)){var o=w.getId(n.target);if(n.target===document){var r=document.scrollingElement||document.documentElement;e({id:o,x:r.scrollLeft,y:r.scrollTop})}else e({id:o,x:n.target.scrollLeft,y:n.target.scrollTop})}}),n.scroll||100))}(e.scrollCb,e.blockClass,e.sampling),y=function(e){return C("resize",E((function(){var t=x(),n=N();e({width:Number(n),height:Number(t)})}),200),window)}(e.viewportResizeCb),g=function(e,n,o,a,i){function u(e){var t=e.target;if(t&&t.tagName&&!(j.indexOf(t.tagName)<0)&&!_(t,n)){var r=t.type;if("password"!==r&&!t.classList.contains(o)){var i=t.value,u=!1;"radio"===r||"checkbox"===r?u=t.checked:(a[t.tagName.toLowerCase()]||a[r])&&(i="*".repeat(i.length)),s(t,{text:i,isChecked:u});var l=t.name;"radio"===r&&l&&u&&document.querySelectorAll('input[type="radio"][name="'+l+'"]').forEach((function(e){e!==t&&s(e,{text:e.value,isChecked:!u})}))}}}function s(n,o){var r=H.get(n);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){H.set(n,o);var a=w.getId(n);e(t(t({},o),{id:a}))}}var l=("last"===i.input?["change"]:["input","change"]).map((function(e){return C(e,u)})),c=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),d=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"]];return c&&c.set&&l.push.apply(l,r(d.map((function(e){return I(e[0],e[1],{set:function(){u({target:this})}})})))),function(){l.forEach((function(e){return e()}))}}(e.inputCb,e.blockClass,e.ignoreClass,e.maskInputOptions,e.sampling),b=function(e,t){var n=function(n){return function(o){var r=o.target;r&&!_(r,t)&&e({type:"play"===n?d.Play:d.Pause,id:w.getId(r)})}},o=[C("play",n("play")),C("pause",n("pause"))];return function(){o.forEach((function(e){return e()}))}}(e.mediaInteractionCb,e.blockClass),S=function(e){var t=CSSStyleSheet.prototype.insertRule;CSSStyleSheet.prototype.insertRule=function(n,o){var r=w.getId(this.ownerNode);return-1!==r&&e({id:r,adds:[{rule:n,index:o}]}),t.apply(this,arguments)};var n=CSSStyleSheet.prototype.deleteRule;return CSSStyleSheet.prototype.deleteRule=function(t){var o=w.getId(this.ownerNode);return-1!==o&&e({id:o,removes:[{index:t}]}),n.apply(this,arguments)},function(){CSSStyleSheet.prototype.insertRule=t,CSSStyleSheet.prototype.deleteRule=n}}(e.styleSheetRuleCb),M=e.recordCanvas?U(e.canvasMutationCb,e.blockClass):function(){};return function(){f.disconnect(),v(),h(),m(),y(),g(),b(),S(),M()}}function B(e){return t(t({},e),{timestamp:Date.now()})}function X(e){void 0===e&&(e={});var n=e.emit,r=e.checkoutEveryNms,a=e.checkoutEveryNth,i=e.blockClass,u=void 0===i?"rr-block":i,c=e.ignoreClass,d=void 0===c?"rr-ignore":c,p=e.inlineStylesheet,f=void 0===p||p,v=e.maskAllInputs,h=e.maskInputOptions,m=e.hooks,y=e.packFn,g=e.sampling,b=void 0===g?{}:g,E=e.mousemoveWait,I=e.recordCanvas,_=void 0!==I&&I;if(!n)throw new Error("emit function is required");void 0!==E&&void 0===b.mousemove&&(b.mousemove=E);var T,M=!0===v?{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}:void 0!==h?h:{};"NodeList"in window&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach);var k=0;function D(e){var t,n,r,a;void 0===e&&(e=!1),F(B({type:s.Meta,data:{href:window.location.href,width:N(),height:x()}}),e);var i=o(function(e,t,n,o,r){void 0===t&&(t="rr-block"),void 0===n&&(n=!0);var a={};return[S(e,e,a,t,!1,n,!0===o?{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}:!1===o?{}:o,r),a]}(document,u,f,M,_),2),l=i[0],c=i[1];if(!l)return console.warn("Failed to snapshot the document");w.map=c,F(B({type:s.FullSnapshot,data:{node:l,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(a=null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.parentElement)||void 0===a?void 0:a.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}}))}F=function(e,t){if(n(y?y(e):e,t),e.type===s.FullSnapshot)T=e,k=0;else if(e.type===s.IncrementalSnapshot){k++;var o=a&&k>=a,i=r&&e.timestamp-T.timestamp>r;(o||i)&&D(!0)}};try{var L=[];L.push(C("DOMContentLoaded",(function(){F(B({type:s.DomContentLoaded,data:{}}))})));var O=function(){D(),L.push(V({mutationCb:function(e){return F(B({type:s.IncrementalSnapshot,data:t({source:l.Mutation},e)}))},mousemoveCb:function(e,t){return F(B({type:s.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return F(B({type:s.IncrementalSnapshot,data:t({source:l.MouseInteraction},e)}))},scrollCb:function(e){return F(B({type:s.IncrementalSnapshot,data:t({source:l.Scroll},e)}))},viewportResizeCb:function(e){return F(B({type:s.IncrementalSnapshot,data:t({source:l.ViewportResize},e)}))},inputCb:function(e){return F(B({type:s.IncrementalSnapshot,data:t({source:l.Input},e)}))},mediaInteractionCb:function(e){return F(B({type:s.IncrementalSnapshot,data:t({source:l.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return F(B({type:s.IncrementalSnapshot,data:t({source:l.StyleSheetRule},e)}))},canvasMutationCb:function(e){return F(B({type:s.IncrementalSnapshot,data:t({source:l.CanvasMutation},e)}))},blockClass:u,ignoreClass:d,maskInputOptions:M,inlineStylesheet:f,sampling:b,recordCanvas:_},m))};return"interactive"===document.readyState||"complete"===document.readyState?O():L.push(C("load",(function(){F(B({type:s.Load,data:{}})),O()}),window)),function(){L.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}return X.addCustomEvent=function(e,t){if(!F)throw new Error("please add custom event after start recording");F(B({type:s.Custom,data:{tag:e,payload:t}}))},X}();
//# sourceMappingURL=rrweb-record.min.js.map

@@ -74,2 +74,5 @@ import { __values } from '../../node_modules/tslib/tslib.es6.js';

}
if (n.__ln) {
delete n.__ln;
}
this.length--;

@@ -76,0 +79,0 @@ };

@@ -687,2 +687,5 @@ 'use strict';

}
if (n.__ln) {
delete n.__ln;
}
this.length--;

@@ -689,0 +692,0 @@ };

{
"name": "rrweb",
"version": "0.9.3",
"version": "0.9.4",
"description": "record and replay the web",

@@ -5,0 +5,0 @@ "scripts": {

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 too big to display

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

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