Socket
Socket
Sign inDemoInstall

rrweb

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rrweb - npm Package Compare versions

Comparing version 0.7.16 to 0.7.17

76

dist/record/rrweb-record.js

@@ -121,3 +121,3 @@ var rrwebRecord = (function () {

}
function serializeNode(n, doc, blockClass, inlineStylesheet) {
function serializeNode(n, doc, blockClass, inlineStylesheet, maskAllInputs) {
switch (n.nodeType) {

@@ -189,3 +189,3 @@ case n.DOCUMENT_NODE:

value) {
attributes_1.value = value;
attributes_1.value = maskAllInputs ? '*'.repeat(value.length) : value;
}

@@ -244,6 +244,7 @@ else if (n.checked) {

}
function serializeNodeWithId(n, doc, map, blockClass, skipChild, inlineStylesheet) {
function serializeNodeWithId(n, doc, map, blockClass, skipChild, inlineStylesheet, maskAllInputs) {
if (skipChild === void 0) { skipChild = false; }
if (inlineStylesheet === void 0) { inlineStylesheet = true; }
var _serializedNode = serializeNode(n, doc, blockClass, inlineStylesheet);
if (maskAllInputs === void 0) { maskAllInputs = false; }
var _serializedNode = serializeNode(n, doc, blockClass, inlineStylesheet, maskAllInputs);
if (!_serializedNode) {

@@ -281,8 +282,9 @@ console.warn(n, 'not serialized');

}
function snapshot(n, blockClass, inlineStylesheet) {
function snapshot(n, blockClass, inlineStylesheet, maskAllInputs) {
if (blockClass === void 0) { blockClass = 'rr-block'; }
if (inlineStylesheet === void 0) { inlineStylesheet = true; }
if (maskAllInputs === void 0) { maskAllInputs = false; }
var idNodeMap = {};
return [
serializeNodeWithId(n, n, idNodeMap, blockClass, false, inlineStylesheet),
serializeNodeWithId(n, n, idNodeMap, blockClass, false, inlineStylesheet, maskAllInputs),
idNodeMap,

@@ -410,2 +412,5 @@ ];

}
function isTouchEvent(event) {
return Boolean(event.changedTouches);
}

@@ -439,3 +444,3 @@ var EventType;

MouseInteractions[MouseInteractions["TouchStart"] = 7] = "TouchStart";
MouseInteractions[MouseInteractions["TouchMove"] = 8] = "TouchMove";
MouseInteractions[MouseInteractions["TouchMove_Departed"] = 8] = "TouchMove_Departed";
MouseInteractions[MouseInteractions["TouchEnd"] = 9] = "TouchEnd";

@@ -488,3 +493,3 @@ })(MouseInteractions || (MouseInteractions = {}));

}
function initMutationObserver(cb, blockClass, inlineStylesheet) {
function initMutationObserver(cb, blockClass, inlineStylesheet, maskAllInputs) {
var observer = new MutationObserver(function (mutations) {

@@ -593,3 +598,3 @@ var texts = [];

: mirror.getId(n.nextSibling),
node: serializeNodeWithId(n, document, mirror.map, blockClass, true, inlineStylesheet)
node: serializeNodeWithId(n, document, mirror.map, blockClass, true, inlineStylesheet, maskAllInputs)
});

@@ -649,3 +654,3 @@ };

}
function initMousemoveObserver(cb) {
function initMoveObserver(cb) {
var positions = [];

@@ -663,3 +668,6 @@ var timeBaseline;

var updatePosition = throttle(function (evt) {
var clientX = evt.clientX, clientY = evt.clientY, target = evt.target;
var target = evt.target;
var _a = isTouchEvent(evt)
? evt.changedTouches[0]
: evt, clientX = _a.clientX, clientY = _a.clientY;
if (!timeBaseline) {

@@ -678,3 +686,9 @@ timeBaseline = Date.now();

});
return on('mousemove', updatePosition);
var handlers = [
on('mousemove', updatePosition),
on('touchmove', updatePosition),
];
return function () {
handlers.forEach(function (h) { return h(); });
};
}

@@ -689,3 +703,5 @@ function initMouseInteractionObserver(cb, blockClass) {

var id = mirror.getId(event.target);
var clientX = event.clientX, clientY = event.clientY;
var _a = isTouchEvent(event)
? event.changedTouches[0]
: event, clientX = _a.clientX, clientY = _a.clientY;
cb({

@@ -700,3 +716,3 @@ type: MouseInteractions[eventKey],

Object.keys(MouseInteractions)
.filter(function (key) { return Number.isNaN(Number(key)); })
.filter(function (key) { return Number.isNaN(Number(key)) && !key.endsWith('_Departed'); })
.forEach(function (eventKey) {

@@ -747,4 +763,19 @@ var eventName = eventKey.toLowerCase();

var INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];
var MASK_TYPES = [
'color',
'date',
'datetime-local',
'email',
'month',
'number',
'range',
'search',
'tel',
'text',
'time',
'url',
'week',
];
var lastInputValueMap = new WeakMap();
function initInputObserver(cb, blockClass, ignoreClass) {
function initInputObserver(cb, blockClass, ignoreClass, maskAllInputs) {
function eventHandler(event) {

@@ -765,5 +796,9 @@ var target = event.target;

var isChecked = false;
var hasTextInput = MASK_TYPES.includes(type) || target.tagName === 'TEXTAREA';
if (type === 'radio' || type === 'checkbox') {
isChecked = target.checked;
}
else if (hasTextInput && maskAllInputs) {
text = '*'.repeat(text.length);
}
cbWithDedup(target, { text: text, isChecked: isChecked });

@@ -819,8 +854,8 @@ var name = target.name;

function initObservers(o) {
var mutationObserver = initMutationObserver(o.mutationCb, o.blockClass, o.inlineStylesheet);
var mousemoveHandler = initMousemoveObserver(o.mousemoveCb);
var mutationObserver = initMutationObserver(o.mutationCb, o.blockClass, o.inlineStylesheet, o.maskAllInputs);
var mousemoveHandler = initMoveObserver(o.mousemoveCb);
var mouseInteractionHandler = initMouseInteractionObserver(o.mouseInteractionCb, o.blockClass);
var scrollHandler = initScrollObserver(o.scrollCb, o.blockClass);
var viewportResizeHandler = initViewportResizeObserver(o.viewportResizeCb);
var inputHandler = initInputObserver(o.inputCb, o.blockClass, o.ignoreClass);
var inputHandler = initInputObserver(o.inputCb, o.blockClass, o.ignoreClass, o.maskAllInputs);
return function () {

@@ -841,3 +876,3 @@ mutationObserver.disconnect();

if (options === void 0) { options = {}; }
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth, _a = options.blockClass, blockClass = _a === void 0 ? 'rr-block' : _a, _b = options.ignoreClass, ignoreClass = _b === void 0 ? 'rr-ignore' : _b, _c = options.inlineStylesheet, inlineStylesheet = _c === void 0 ? true : _c;
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth, _a = options.blockClass, blockClass = _a === void 0 ? 'rr-block' : _a, _b = options.ignoreClass, ignoreClass = _b === void 0 ? 'rr-ignore' : _b, _c = options.inlineStylesheet, inlineStylesheet = _c === void 0 ? true : _c, _d = options.maskAllInputs, maskAllInputs = _d === void 0 ? false : _d;
if (!emit) {

@@ -874,3 +909,3 @@ throw new Error('emit function is required');

}), isCheckout);
var _a = snapshot(document, blockClass, inlineStylesheet), node = _a[0], idNodeMap = _a[1];
var _a = snapshot(document, blockClass, inlineStylesheet, maskAllInputs), node = _a[0], idNodeMap = _a[1];
if (!node) {

@@ -943,2 +978,3 @@ return console.warn('Failed to snapshot the document');

ignoreClass: ignoreClass,
maskAllInputs: maskAllInputs,
inlineStylesheet: inlineStylesheet

@@ -945,0 +981,0 @@ }));

@@ -1,2 +0,2 @@

var rrwebRecord=function(){"use strict";var e,t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};!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 n=1;function r(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)?r(n.styleSheet)||"":n.cssText);var n},""):null}catch(e){return null}}var o=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,a=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,i=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function u(e,t){return e.replace(o,function(e,n,r,o){var u,c=n||r||o;if(!c)return e;if(!a.test(c))return"url('"+c+"')";if(i.test(c))return"url("+c+")";if("/"===c[0])return"url('"+(((u=t).indexOf("//")>-1?u.split("/").slice(0,3).join("/"):u.split("/")[0]).split("?")[0]+c)+"')";var s=t.split("/"),l=c.split("/");s.pop();for(var d=0,f=l;d<f.length;d++){var p=f[d];"."!==p&&(".."===p?s.pop():s.push(p))}return"url('"+s.join("/")+"')"})}function c(e,t){var n=e.createElement("a");return n.href=t,n.href}function s(t,o,a,i,l,d){void 0===l&&(l=!1),void 0===d&&(d=!0);var f,p=function(t,n,o,a){switch(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 i=!1;"string"==typeof o?i=t.classList.contains(o):t.classList.forEach(function(e){o.test(e)&&(i=!0)});for(var s=t.tagName.toLowerCase(),l={},d=0,f=Array.from(t.attributes);d<f.length;d++){var p=f[d],h=p.name,m=p.value;l[h]="src"===h||"href"===h?c(n,m):"style"===h?u(m,location.href):m}if("link"===s&&a){var v,y=Array.from(n.styleSheets).find(function(e){return e.href===t.href});(v=r(y))&&(delete l.rel,delete l.href,l._cssText=u(v,y.href))}if("style"===s&&t.sheet&&!t.innerText.trim().length&&(v=r(t.sheet))&&(l._cssText=u(v,location.href)),"input"!==s&&"textarea"!==s&&"select"!==s||(m=t.value,"radio"!==l.type&&"checkbox"!==l.type&&m?l.value=m:t.checked&&(l.checked=t.checked)),"option"===s){var g=t.parentElement;l.value===g.value&&(l.selected=t.selected)}if(i){var E=t.getBoundingClientRect(),b=E.width,C=E.height;l.rr_width=b+"px",l.rr_height=C+"px"}return{type:e.Element,tagName:s,attributes:l,childNodes:[],isSVG:(T=t,"svg"===T.tagName||T instanceof SVGElement||void 0),needBlock:i};case t.TEXT_NODE:var N=t.parentNode&&t.parentNode.tagName,w=t.textContent,S="STYLE"===N||void 0;return S&&w&&(w=u(w,location.href)),"SCRIPT"===N&&(w="SCRIPT_PLACEHOLDER"),{type:e.Text,textContent:w||"",isStyle:S};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}(t,o,i,d);if(!p)return console.warn(t,"not serialized"),null;f="__sn"in t?t.__sn.id:n++;var h=Object.assign(p,{id:f});t.__sn=h,a[f]=t;var m=!l;if(h.type===e.Element&&(m=m&&!h.needBlock,delete h.needBlock),(h.type===e.Document||h.type===e.Element)&&m)for(var v=0,y=Array.from(t.childNodes);v<y.length;v++){var g=s(y[v],o,a,i,l,d);g&&h.childNodes.push(g)}return h}function l(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var d,f,p,h,m={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return m.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete m.map[t],e.childNodes&&e.childNodes.forEach(function(e){return m.removeNodeFromMap(e)})},has:function(e){return m.map.hasOwnProperty(e)}};function v(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){var a=Date.now();o||!1!==n.leading||(o=a);var i=t-(a-o),u=this,c=arguments;i<=0||i>t?(r&&(window.clearTimeout(r),r=null),o=a,e.apply(u,c)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(u,c)},i))}}function y(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function g(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function E(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(e.parentNode,t)}return E(e.parentNode,t)}function b(e,t){e.delete(t),t.childNodes.forEach(function(t){return b(e,t)})}function C(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||C(e,n))}!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"}(d||(d={})),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"}(f||(f={})),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=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(p||(p={})),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"}(h||(h={}));var N=function(e,t){return e+"@"+t};function w(e){return"__sn"in e}function S(e,t,n){var r=new MutationObserver(function(r){var o=[],a=[],i=[],u=[],c=new Set,l=new Set,d=new Set,f={},p=function(e,n){if(!E(e,t)){if(w(e)){l.add(e);var r=null;n&&w(n)&&(r=n.__sn.id),r&&(f[N(e.__sn.id,r)]=!0)}else c.add(e),d.delete(e);e.childNodes.forEach(function(e){return p(e)})}};r.forEach(function(e){var n=e.type,r=e.target,u=e.oldValue,s=e.addedNodes,h=e.removedNodes,v=e.attributeName;switch(n){case"characterData":var y=r.textContent;E(r,t)||y===u||o.push({value:y,node:r});break;case"attributes":y=r.getAttribute(v);if(E(r,t)||y===u)return;var g=a.find(function(e){return e.node===r});g||(g={node:r,attributes:{}},a.push(g)),g.attributes[v]=y;break;case"childList":s.forEach(function(e){return p(e,r)}),h.forEach(function(e){var n=m.getId(e),o=m.getId(r);E(e,t)||(c.has(e)?(b(c,e),d.add(e)):c.has(r)&&-1===n||function e(t){var n=m.getId(t);return!m.has(n)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode))}(r)||(l.has(e)&&f[N(n,o)]?b(l,e):i.push({parentId:o,id:n})),m.removeNodeFromMap(e))})}});var h=[],v=function(e){var r=m.getId(e.parentNode);if(-1===r)return h.push(e);u.push({parentId:r,previousId:e.previousSibling?m.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?m.getId(e.nextSibling):e.nextSibling,node:s(e,document,m.map,t,!0,n)})};for(Array.from(l).forEach(v),Array.from(c).forEach(function(e){C(d,e)||function e(t,n){var r=n.parentNode;if(!r)return!1;var o=m.getId(r);return!!t.some(function(e){return e.id===o})||e(t,r)}(i,e)?C(l,e)?v(e):d.add(e):v(e)});h.length&&!h.every(function(e){return-1===m.getId(e.parentNode)});)v(h.shift());var y={texts:o.map(function(e){return{id:m.getId(e.node),value:e.value}}).filter(function(e){return m.has(e.id)}),attributes:a.map(function(e){return{id:m.getId(e.node),attributes:e.attributes}}).filter(function(e){return m.has(e.id)}),removes:i,adds:u};(y.texts.length||y.attributes.length||y.removes.length||y.adds.length)&&e(y)});return r.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function T(e,t){var n=[];return Object.keys(p).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(r){var o=r.toLowerCase(),a=function(n){return function(r){if(!E(r.target,t)){var o=m.getId(r.target),a=r.clientX,i=r.clientY;e({type:p[n],id:o,x:a,y:i})}}}(r);n.push(l(o,a))}),function(){n.forEach(function(e){return e()})}}var I=["INPUT","TEXTAREA","SELECT"],D=new WeakMap;function M(e,n,r){function o(e){var t=e.target;if(t&&t.tagName&&!(I.indexOf(t.tagName)<0)&&!E(t,n)){var o=t.type;if("password"!==o&&!t.classList.contains(r)){var i=t.value,u=!1;"radio"!==o&&"checkbox"!==o||(u=t.checked),a(t,{text:i,isChecked:u});var c=t.name;"radio"===o&&c&&u&&document.querySelectorAll('input[type="radio"][name="'+c+'"]').forEach(function(e){e!==t&&a(e,{text:e.value,isChecked:!u})})}}}function a(n,r){var o=D.get(n);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){D.set(n,r);var a=m.getId(n);e(t({},r,{id:a}))}}var i=["input","change"].map(function(e){return l(e,o)}),u=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),c=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]];return u&&u.set&&i.push.apply(i,c.map(function(e){return function e(t,n,r){var o=Object.getOwnPropertyDescriptor(t,n);return Object.defineProperty(t,n,{set:function(e){var t=this;setTimeout(function(){r.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return e(t,n,o||{})}}(e[0],e[1],{set:function(){o({target:this})}})})),function(){i.forEach(function(e){return e()})}}function k(e){var t,n,r,o,a=S(e.mutationCb,e.blockClass,e.inlineStylesheet),i=(t=e.mousemoveCb,r=[],o=v(function(){var e=Date.now()-n;t(r.map(function(t){return t.timeOffset-=e,t})),r=[],n=null},500),l("mousemove",v(function(e){var t=e.clientX,a=e.clientY,i=e.target;n||(n=Date.now()),r.push({x:t,y:a,id:m.getId(i),timeOffset:Date.now()-n}),o()},50,{trailing:!1}))),u=T(e.mouseInteractionCb,e.blockClass),c=function(e,t){return l("scroll",v(function(n){if(n.target&&!E(n.target,t)){var r=m.getId(n.target);if(n.target===document){var o=document.scrollingElement||document.documentElement;e({id:r,x:o.scrollLeft,y:o.scrollTop})}else e({id:r,x:n.target.scrollLeft,y:n.target.scrollTop})}},100))}(e.scrollCb,e.blockClass),s=function(e){return l("resize",v(function(){var t=y(),n=g();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),d=M(e.inputCb,e.blockClass,e.ignoreClass);return function(){a.disconnect(),i(),u(),c(),s(),d()}}function x(e){return t({},e,{timestamp:Date.now()})}return function(e){void 0===e&&(e={});var n,r=e.emit,o=e.checkoutEveryNms,a=e.checkoutEveryNth,i=e.blockClass,u=void 0===i?"rr-block":i,c=e.ignoreClass,p=void 0===c?"rr-ignore":c,h=e.inlineStylesheet,v=void 0===h||h;if(!r)throw new Error("emit function is required");var E=0,b=function(e,t){if(r(e,t),e.type===d.FullSnapshot)n=e,E=0;else if(e.type===d.IncrementalSnapshot){E++;var i=a&&E>=a,u=o&&e.timestamp-n.timestamp>o;(i||u)&&C(!0)}};function C(e){void 0===e&&(e=!1),b(x({type:d.Meta,data:{href:window.location.href,width:g(),height:y()}}),e);var t=function(e,t,n){void 0===t&&(t="rr-block"),void 0===n&&(n=!0);var r={};return[s(e,e,r,t,!1,n),r]}(document,u,v),n=t[0],r=t[1];if(!n)return console.warn("Failed to snapshot the document");m.map=r,b(x({type:d.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var N=[];N.push(l("DOMContentLoaded",function(){b(x({type:d.DomContentLoaded,data:{}}))}));var w=function(){C(),N.push(k({mutationCb:function(e){return b(x({type:d.IncrementalSnapshot,data:t({source:f.Mutation},e)}))},mousemoveCb:function(e){return b(x({type:d.IncrementalSnapshot,data:{source:f.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return b(x({type:d.IncrementalSnapshot,data:t({source:f.MouseInteraction},e)}))},scrollCb:function(e){return b(x({type:d.IncrementalSnapshot,data:t({source:f.Scroll},e)}))},viewportResizeCb:function(e){return b(x({type:d.IncrementalSnapshot,data:t({source:f.ViewportResize},e)}))},inputCb:function(e){return b(x({type:d.IncrementalSnapshot,data:t({source:f.Input},e)}))},blockClass:u,ignoreClass:p,inlineStylesheet:v}))};return"interactive"===document.readyState||"complete"===document.readyState?w():N.push(l("load",function(){b(x({type:d.Load,data:{}})),w()},window)),function(){N.forEach(function(e){return e()})}}catch(e){console.warn(e)}}}();
var rrwebRecord=function(){"use strict";var e,t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};!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 n=1;function r(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)?r(n.styleSheet)||"":n.cssText);var n},""):null}catch(e){return null}}var o=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,a=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,i=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function u(e,t){return e.replace(o,function(e,n,r,o){var u,c=n||r||o;if(!c)return e;if(!a.test(c))return"url('"+c+"')";if(i.test(c))return"url("+c+")";if("/"===c[0])return"url('"+(((u=t).indexOf("//")>-1?u.split("/").slice(0,3).join("/"):u.split("/")[0]).split("?")[0]+c)+"')";var s=t.split("/"),l=c.split("/");s.pop();for(var d=0,f=l;d<f.length;d++){var p=f[d];"."!==p&&(".."===p?s.pop():s.push(p))}return"url('"+s.join("/")+"')"})}function c(e,t){var n=e.createElement("a");return n.href=t,n.href}function s(t,o,a,i,l,d,f){void 0===l&&(l=!1),void 0===d&&(d=!0),void 0===f&&(f=!1);var p,h=function(t,n,o,a,i){switch(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 s=!1;"string"==typeof o?s=t.classList.contains(o):t.classList.forEach(function(e){o.test(e)&&(s=!0)});for(var l=t.tagName.toLowerCase(),d={},f=0,p=Array.from(t.attributes);f<p.length;f++){var h=p[f],m=h.name,v=h.value;d[m]="src"===m||"href"===m?c(n,v):"style"===m?u(v,location.href):v}if("link"===l&&a){var y,g=Array.from(n.styleSheets).find(function(e){return e.href===t.href});(y=r(g))&&(delete d.rel,delete d.href,d._cssText=u(y,g.href))}if("style"===l&&t.sheet&&!t.innerText.trim().length&&(y=r(t.sheet))&&(d._cssText=u(y,location.href)),"input"!==l&&"textarea"!==l&&"select"!==l||(v=t.value,"radio"!==d.type&&"checkbox"!==d.type&&v?d.value=i?"*".repeat(v.length):v:t.checked&&(d.checked=t.checked)),"option"===l){var E=t.parentElement;d.value===E.value&&(d.selected=t.selected)}if(s){var b=t.getBoundingClientRect(),C=b.width,N=b.height;d.rr_width=C+"px",d.rr_height=N+"px"}return{type:e.Element,tagName:l,attributes:d,childNodes:[],isSVG:(S=t,"svg"===S.tagName||S instanceof SVGElement||void 0),needBlock:s};case t.TEXT_NODE:var w=t.parentNode&&t.parentNode.tagName,T=t.textContent,I="STYLE"===w||void 0;return I&&T&&(T=u(T,location.href)),"SCRIPT"===w&&(T="SCRIPT_PLACEHOLDER"),{type:e.Text,textContent:T||"",isStyle:I};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 S}(t,o,i,d,f);if(!h)return console.warn(t,"not serialized"),null;p="__sn"in t?t.__sn.id:n++;var m=Object.assign(h,{id:p});t.__sn=m,a[p]=t;var v=!l;if(m.type===e.Element&&(v=v&&!m.needBlock,delete m.needBlock),(m.type===e.Document||m.type===e.Element)&&v)for(var y=0,g=Array.from(t.childNodes);y<g.length;y++){var E=s(g[y],o,a,i,l,d);E&&m.childNodes.push(E)}return m}function l(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var d,f,p,h,m={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return m.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete m.map[t],e.childNodes&&e.childNodes.forEach(function(e){return m.removeNodeFromMap(e)})},has:function(e){return m.map.hasOwnProperty(e)}};function v(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){var a=Date.now();o||!1!==n.leading||(o=a);var i=t-(a-o),u=this,c=arguments;i<=0||i>t?(r&&(window.clearTimeout(r),r=null),o=a,e.apply(u,c)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(u,c)},i))}}function y(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function g(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function E(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(e.parentNode,t)}return E(e.parentNode,t)}function b(e){return Boolean(e.changedTouches)}function C(e,t){e.delete(t),t.childNodes.forEach(function(t){return C(e,t)})}function N(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||N(e,n))}!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"}(d||(d={})),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"}(f||(f={})),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"}(p||(p={})),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"}(h||(h={}));var w=function(e,t){return e+"@"+t};function T(e){return"__sn"in e}function I(e,t,n,r){var o=new MutationObserver(function(o){var a=[],i=[],u=[],c=[],l=new Set,d=new Set,f=new Set,p={},h=function(e,n){if(!E(e,t)){if(T(e)){d.add(e);var r=null;n&&T(n)&&(r=n.__sn.id),r&&(p[w(e.__sn.id,r)]=!0)}else l.add(e),f.delete(e);e.childNodes.forEach(function(e){return h(e)})}};o.forEach(function(e){var n=e.type,r=e.target,o=e.oldValue,c=e.addedNodes,s=e.removedNodes,v=e.attributeName;switch(n){case"characterData":var y=r.textContent;E(r,t)||y===o||a.push({value:y,node:r});break;case"attributes":y=r.getAttribute(v);if(E(r,t)||y===o)return;var g=i.find(function(e){return e.node===r});g||(g={node:r,attributes:{}},i.push(g)),g.attributes[v]=y;break;case"childList":c.forEach(function(e){return h(e,r)}),s.forEach(function(e){var n=m.getId(e),o=m.getId(r);E(e,t)||(l.has(e)?(C(l,e),f.add(e)):l.has(r)&&-1===n||function e(t){var n=m.getId(t);return!m.has(n)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode))}(r)||(d.has(e)&&p[w(n,o)]?C(d,e):u.push({parentId:o,id:n})),m.removeNodeFromMap(e))})}});var v=[],y=function(e){var o=m.getId(e.parentNode);if(-1===o)return v.push(e);c.push({parentId:o,previousId:e.previousSibling?m.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?m.getId(e.nextSibling):e.nextSibling,node:s(e,document,m.map,t,!0,n,r)})};for(Array.from(d).forEach(y),Array.from(l).forEach(function(e){N(f,e)||function e(t,n){var r=n.parentNode;if(!r)return!1;var o=m.getId(r);return!!t.some(function(e){return e.id===o})||e(t,r)}(u,e)?N(d,e)?y(e):f.add(e):y(e)});v.length&&!v.every(function(e){return-1===m.getId(e.parentNode)});)y(v.shift());var g={texts:a.map(function(e){return{id:m.getId(e.node),value:e.value}}).filter(function(e){return m.has(e.id)}),attributes:i.map(function(e){return{id:m.getId(e.node),attributes:e.attributes}}).filter(function(e){return m.has(e.id)}),removes:u,adds:c};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&e(g)});return o.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),o}function S(e,t){var n=[];return Object.keys(p).filter(function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")}).forEach(function(r){var o=r.toLowerCase(),a=function(n){return function(r){if(!E(r.target,t)){var o=m.getId(r.target),a=b(r)?r.changedTouches[0]:r,i=a.clientX,u=a.clientY;e({type:p[n],id:o,x:i,y:u})}}}(r);n.push(l(o,a))}),function(){n.forEach(function(e){return e()})}}var D=["INPUT","TEXTAREA","SELECT"],k=["color","date","datetime-local","email","month","number","range","search","tel","text","time","url","week"],M=new WeakMap;function x(e,n,r,o){function a(e){var t=e.target;if(t&&t.tagName&&!(D.indexOf(t.tagName)<0)&&!E(t,n)){var a=t.type;if("password"!==a&&!t.classList.contains(r)){var u=t.value,c=!1,s=k.includes(a)||"TEXTAREA"===t.tagName;"radio"===a||"checkbox"===a?c=t.checked:s&&o&&(u="*".repeat(u.length)),i(t,{text:u,isChecked:c});var l=t.name;"radio"===a&&l&&c&&document.querySelectorAll('input[type="radio"][name="'+l+'"]').forEach(function(e){e!==t&&i(e,{text:e.value,isChecked:!c})})}}}function i(n,r){var o=M.get(n);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){M.set(n,r);var a=m.getId(n);e(t({},r,{id:a}))}}var u=["input","change"].map(function(e){return l(e,a)}),c=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),s=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]];return c&&c.set&&u.push.apply(u,s.map(function(e){return function e(t,n,r){var o=Object.getOwnPropertyDescriptor(t,n);return Object.defineProperty(t,n,{set:function(e){var t=this;setTimeout(function(){r.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return e(t,n,o||{})}}(e[0],e[1],{set:function(){a({target:this})}})})),function(){u.forEach(function(e){return e()})}}function _(e){var t,n,r,o,a,i,u=I(e.mutationCb,e.blockClass,e.inlineStylesheet,e.maskAllInputs),c=(t=e.mousemoveCb,r=[],o=v(function(){var e=Date.now()-n;t(r.map(function(t){return t.timeOffset-=e,t})),r=[],n=null},500),a=v(function(e){var t=e.target,a=b(e)?e.changedTouches[0]:e,i=a.clientX,u=a.clientY;n||(n=Date.now()),r.push({x:i,y:u,id:m.getId(t),timeOffset:Date.now()-n}),o()},50,{trailing:!1}),i=[l("mousemove",a),l("touchmove",a)],function(){i.forEach(function(e){return e()})}),s=S(e.mouseInteractionCb,e.blockClass),d=function(e,t){return l("scroll",v(function(n){if(n.target&&!E(n.target,t)){var r=m.getId(n.target);if(n.target===document){var o=document.scrollingElement||document.documentElement;e({id:r,x:o.scrollLeft,y:o.scrollTop})}else e({id:r,x:n.target.scrollLeft,y:n.target.scrollTop})}},100))}(e.scrollCb,e.blockClass),f=function(e){return l("resize",v(function(){var t=y(),n=g();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),p=x(e.inputCb,e.blockClass,e.ignoreClass,e.maskAllInputs);return function(){u.disconnect(),c(),s(),d(),f(),p()}}function L(e){return t({},e,{timestamp:Date.now()})}return function(e){void 0===e&&(e={});var n,r=e.emit,o=e.checkoutEveryNms,a=e.checkoutEveryNth,i=e.blockClass,u=void 0===i?"rr-block":i,c=e.ignoreClass,p=void 0===c?"rr-ignore":c,h=e.inlineStylesheet,v=void 0===h||h,E=e.maskAllInputs,b=void 0!==E&&E;if(!r)throw new Error("emit function is required");var C=0,N=function(e,t){if(r(e,t),e.type===d.FullSnapshot)n=e,C=0;else if(e.type===d.IncrementalSnapshot){C++;var i=a&&C>=a,u=o&&e.timestamp-n.timestamp>o;(i||u)&&w(!0)}};function w(e){void 0===e&&(e=!1),N(L({type:d.Meta,data:{href:window.location.href,width:g(),height:y()}}),e);var t=function(e,t,n,r){void 0===t&&(t="rr-block"),void 0===n&&(n=!0),void 0===r&&(r=!1);var o={};return[s(e,e,o,t,!1,n,r),o]}(document,u,v,b),n=t[0],r=t[1];if(!n)return console.warn("Failed to snapshot the document");m.map=r,N(L({type:d.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var T=[];T.push(l("DOMContentLoaded",function(){N(L({type:d.DomContentLoaded,data:{}}))}));var I=function(){w(),T.push(_({mutationCb:function(e){return N(L({type:d.IncrementalSnapshot,data:t({source:f.Mutation},e)}))},mousemoveCb:function(e){return N(L({type:d.IncrementalSnapshot,data:{source:f.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return N(L({type:d.IncrementalSnapshot,data:t({source:f.MouseInteraction},e)}))},scrollCb:function(e){return N(L({type:d.IncrementalSnapshot,data:t({source:f.Scroll},e)}))},viewportResizeCb:function(e){return N(L({type:d.IncrementalSnapshot,data:t({source:f.ViewportResize},e)}))},inputCb:function(e){return N(L({type:d.IncrementalSnapshot,data:t({source:f.Input},e)}))},blockClass:u,ignoreClass:p,maskAllInputs:b,inlineStylesheet:v}))};return"interactive"===document.readyState||"complete"===document.readyState?I():T.push(l("load",function(){N(L({type:d.Load,data:{}})),I()},window)),function(){T.forEach(function(e){return e()})}}catch(e){console.warn(e)}}}();
//# sourceMappingURL=rrweb-record.min.js.map

@@ -1,2 +0,2 @@

var rrweb=function(e){"use strict";var t,n=function(){return(n=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(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"}(t||(t={}));var o=1;function r(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)?r(n.styleSheet)||"":n.cssText);var n},""):null}catch(e){return null}}var i=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,a=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,s=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function l(e,t){return e.replace(i,function(e,n,o,r){var i,l=n||o||r;if(!l)return e;if(!a.test(l))return"url('"+l+"')";if(s.test(l))return"url("+l+")";if("/"===l[0])return"url('"+(((i=t).indexOf("//")>-1?i.split("/").slice(0,3).join("/"):i.split("/")[0]).split("?")[0]+l)+"')";var c=t.split("/"),u=l.split("/");c.pop();for(var d=0,f=u;d<f.length;d++){var p=f[d];"."!==p&&(".."===p?c.pop():c.push(p))}return"url('"+c.join("/")+"')"})}function c(e,t){var n=e.createElement("a");return n.href=t,n.href}function u(e,n,i,a,s,d){void 0===s&&(s=!1),void 0===d&&(d=!0);var f,p=function(e,n,o,i){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:t.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:t.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:var a=!1;"string"==typeof o?a=e.classList.contains(o):e.classList.forEach(function(e){o.test(e)&&(a=!0)});for(var s=e.tagName.toLowerCase(),u={},d=0,f=Array.from(e.attributes);d<f.length;d++){var p=f[d],h=p.name,m=p.value;u[h]="src"===h||"href"===h?c(n,m):"style"===h?l(m,location.href):m}if("link"===s&&i){var v,y=Array.from(n.styleSheets).find(function(t){return t.href===e.href});(v=r(y))&&(delete u.rel,delete u.href,u._cssText=l(v,y.href))}if("style"===s&&e.sheet&&!e.innerText.trim().length&&(v=r(e.sheet))&&(u._cssText=l(v,location.href)),"input"!==s&&"textarea"!==s&&"select"!==s||(m=e.value,"radio"!==u.type&&"checkbox"!==u.type&&m?u.value=m:e.checked&&(u.checked=e.checked)),"option"===s){var g=e.parentElement;u.value===g.value&&(u.selected=e.selected)}if(a){var b=e.getBoundingClientRect(),E=b.width,w=b.height;u.rr_width=E+"px",u.rr_height=w+"px"}return{type:t.Element,tagName:s,attributes:u,childNodes:[],isSVG:(N=e,"svg"===N.tagName||N instanceof SVGElement||void 0),needBlock:a};case e.TEXT_NODE:var I=e.parentNode&&e.parentNode.tagName,S=e.textContent,T="STYLE"===I||void 0;return T&&S&&(S=l(S,location.href)),"SCRIPT"===I&&(S="SCRIPT_PLACEHOLDER"),{type:t.Text,textContent:S||"",isStyle:T};case e.CDATA_SECTION_NODE:return{type:t.CDATA,textContent:""};case e.COMMENT_NODE:return{type:t.Comment,textContent:e.textContent||""};default:return!1}var N}(e,n,a,d);if(!p)return console.warn(e,"not serialized"),null;f="__sn"in e?e.__sn.id:o++;var h=Object.assign(p,{id:f});e.__sn=h,i[f]=e;var m=!s;if(h.type===t.Element&&(m=m&&!h.needBlock,delete h.needBlock),(h.type===t.Document||h.type===t.Element)&&m)for(var v=0,y=Array.from(e.childNodes);v<y.length;v++){var g=u(y[v],n,i,a,s,d);g&&h.childNodes.push(g)}return h}var d={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};var f=/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,p=/([^\\]):hover/g;function h(e){return e.replace(f,function(e,t,n){if(p.test(t)){var o=t.replace(p,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+o.replace(/^\s*/,"")+n}return e})}function m(e,n){switch(e.type){case t.Document:return n.implementation.createDocument(null,"",null);case t.DocumentType:return n.implementation.createDocumentType(e.name,e.publicId,e.systemId);case t.Element:var o=function(e){var t=d[e.tagName]?d[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e),r=void 0;for(var i in r=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",o):n.createElement(o),e.attributes)if(e.attributes.hasOwnProperty(i)&&!i.startsWith("rr_")){var a=e.attributes[i];a="boolean"==typeof a?"":a;var s="textarea"===o&&"value"===i,l="style"===o&&"_cssText"===i;if(l&&(a=h(a)),s||l){var c=n.createTextNode(a);r.appendChild(c);continue}if("iframe"===o&&"src"===i)continue;try{e.isSVG&&"xlink:href"===i?r.setAttributeNS("http://www.w3.org/1999/xlink",i,a):r.setAttribute(i,a)}catch(e){}}else e.attributes.rr_width&&(r.style.width=e.attributes.rr_width),e.attributes.rr_height&&(r.style.height=e.attributes.rr_height);return r;case t.Text:return n.createTextNode(e.isStyle?h(e.textContent):e.textContent);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function v(e,n,o,r){void 0===r&&(r=!1);var i=m(e,n);if(!i)return null;if(e.type===t.Document&&(n.close(),n.open(),i=n),i.__sn=e,o[e.id]=i,(e.type===t.Document||e.type===t.Element)&&!r)for(var a=0,s=e.childNodes;a<s.length;a++){var l=s[a],c=v(l,n,o);c?i.appendChild(c):console.warn("Failed to rebuild",l)}return i}function y(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)}}var g,b,E,w,I={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return I.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete I.map[t],e.childNodes&&e.childNodes.forEach(function(e){return I.removeNodeFromMap(e)})},has:function(e){return I.map.hasOwnProperty(e)}};function S(e,t,n){void 0===n&&(n={});var o=null,r=0;return function(){var i=Date.now();r||!1!==n.leading||(r=i);var a=t-(i-r),s=this,l=arguments;a<=0||a>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)},a))}}function T(){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 C(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||C(e.parentNode,t)}return C(e.parentNode,t)}function x(e,t){e.delete(t),t.childNodes.forEach(function(t){return x(e,t)})}function M(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||M(e,n))}(g=e.EventType||(e.EventType={}))[g.DomContentLoaded=0]="DomContentLoaded",g[g.Load=1]="Load",g[g.FullSnapshot=2]="FullSnapshot",g[g.IncrementalSnapshot=3]="IncrementalSnapshot",g[g.Meta=4]="Meta",(b=e.IncrementalSource||(e.IncrementalSource={}))[b.Mutation=0]="Mutation",b[b.MouseMove=1]="MouseMove",b[b.MouseInteraction=2]="MouseInteraction",b[b.Scroll=3]="Scroll",b[b.ViewportResize=4]="ViewportResize",b[b.Input=5]="Input",(E=e.MouseInteractions||(e.MouseInteractions={}))[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=8]="TouchMove",E[E.TouchEnd=9]="TouchEnd",(w=e.ReplayerEvents||(e.ReplayerEvents={})).Start="start",w.Pause="pause",w.Resume="resume",w.Resize="resize",w.Finish="finish",w.FullsnapshotRebuilded="fullsnapshot-rebuilded",w.LoadStylesheetStart="load-stylesheet-start",w.LoadStylesheetEnd="load-stylesheet-end",w.SkipStart="skip-start",w.SkipEnd="skip-end",w.MouseInteraction="mouse-interaction";var k=function(e,t){return e+"@"+t};function D(e){return"__sn"in e}function O(e,t,n){var o=new MutationObserver(function(o){var r=[],i=[],a=[],s=[],l=new Set,c=new Set,d=new Set,f={},p=function(e,n){if(!C(e,t)){if(D(e)){c.add(e);var o=null;n&&D(n)&&(o=n.__sn.id),o&&(f[k(e.__sn.id,o)]=!0)}else l.add(e),d.delete(e);e.childNodes.forEach(function(e){return p(e)})}};o.forEach(function(e){var n=e.type,o=e.target,s=e.oldValue,u=e.addedNodes,h=e.removedNodes,m=e.attributeName;switch(n){case"characterData":var v=o.textContent;C(o,t)||v===s||r.push({value:v,node:o});break;case"attributes":v=o.getAttribute(m);if(C(o,t)||v===s)return;var y=i.find(function(e){return e.node===o});y||(y={node:o,attributes:{}},i.push(y)),y.attributes[m]=v;break;case"childList":u.forEach(function(e){return p(e,o)}),h.forEach(function(e){var n=I.getId(e),r=I.getId(o);C(e,t)||(l.has(e)?(x(l,e),d.add(e)):l.has(o)&&-1===n||function e(t){var n=I.getId(t);return!I.has(n)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode))}(o)||(c.has(e)&&f[k(n,r)]?x(c,e):a.push({parentId:r,id:n})),I.removeNodeFromMap(e))})}});var h=[],m=function(e){var o=I.getId(e.parentNode);if(-1===o)return h.push(e);s.push({parentId:o,previousId:e.previousSibling?I.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?I.getId(e.nextSibling):e.nextSibling,node:u(e,document,I.map,t,!0,n)})};for(Array.from(c).forEach(m),Array.from(l).forEach(function(e){M(d,e)||function e(t,n){var o=n.parentNode;if(!o)return!1;var r=I.getId(o);return!!t.some(function(e){return e.id===r})||e(t,o)}(a,e)?M(c,e)?m(e):d.add(e):m(e)});h.length&&!h.every(function(e){return-1===I.getId(e.parentNode)});)m(h.shift());var v={texts:r.map(function(e){return{id:I.getId(e.node),value:e.value}}).filter(function(e){return I.has(e.id)}),attributes:i.map(function(e){return{id:I.getId(e.node),attributes:e.attributes}}).filter(function(e){return I.has(e.id)}),removes:a,adds:s};(v.texts.length||v.attributes.length||v.removes.length||v.adds.length)&&e(v)});return o.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),o}function L(t,n){var o=[];return Object.keys(e.MouseInteractions).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(r){var i=r.toLowerCase(),a=function(o){return function(r){if(!C(r.target,n)){var i=I.getId(r.target),a=r.clientX,s=r.clientY;t({type:e.MouseInteractions[o],id:i,x:a,y:s})}}}(r);o.push(y(i,a))}),function(){o.forEach(function(e){return e()})}}var A=["INPUT","TEXTAREA","SELECT"],R=new WeakMap;function _(e,t,o){function r(e){var n=e.target;if(n&&n.tagName&&!(A.indexOf(n.tagName)<0)&&!C(n,t)){var r=n.type;if("password"!==r&&!n.classList.contains(o)){var a=n.value,s=!1;"radio"!==r&&"checkbox"!==r||(s=n.checked),i(n,{text:a,isChecked:s});var l=n.name;"radio"===r&&l&&s&&document.querySelectorAll('input[type="radio"][name="'+l+'"]').forEach(function(e){e!==n&&i(e,{text:e.value,isChecked:!s})})}}}function i(t,o){var r=R.get(t);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){R.set(t,o);var i=I.getId(t);e(n({},o,{id:i}))}}var a=["input","change"].map(function(e){return y(e,r)}),s=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),l=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]];return s&&s.set&&a.push.apply(a,l.map(function(e){return function e(t,n,o){var r=Object.getOwnPropertyDescriptor(t,n);return Object.defineProperty(t,n,{set:function(e){var t=this;setTimeout(function(){o.set.call(t,e)},0),r&&r.set&&r.set.call(this,e)}}),function(){return e(t,n,r||{})}}(e[0],e[1],{set:function(){r({target:this})}})})),function(){a.forEach(function(e){return e()})}}function F(e){var t,n,o,r,i=O(e.mutationCb,e.blockClass,e.inlineStylesheet),a=(t=e.mousemoveCb,o=[],r=S(function(){var e=Date.now()-n;t(o.map(function(t){return t.timeOffset-=e,t})),o=[],n=null},500),y("mousemove",S(function(e){var t=e.clientX,i=e.clientY,a=e.target;n||(n=Date.now()),o.push({x:t,y:i,id:I.getId(a),timeOffset:Date.now()-n}),r()},50,{trailing:!1}))),s=L(e.mouseInteractionCb,e.blockClass),l=function(e,t){return y("scroll",S(function(n){if(n.target&&!C(n.target,t)){var o=I.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})}},100))}(e.scrollCb,e.blockClass),c=function(e){return y("resize",S(function(){var t=T(),n=N();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),u=_(e.inputCb,e.blockClass,e.ignoreClass);return function(){i.disconnect(),a(),s(),l(),c(),u()}}function B(e){return n({},e,{timestamp:Date.now()})}function j(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map(function(e){e(n)}),(e["*"]||[]).slice().map(function(e){e(t,n)})}}}var z=Object.freeze({default:j});var P,X=(function(e,t){!function(){e.exports={polyfill:function(){var e=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)){var n,o=e.HTMLElement||e.Element,r=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:o.prototype.scroll||l,scrollIntoView:o.prototype.scrollIntoView},a=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,s=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(c(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},o.prototype.scroll=o.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==c(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},o.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},o.prototype.scrollIntoView=function(){if(!0!==c(arguments[0])){var n=function(e){for(;e!==t.body&&!1===f(e);)e=e.parentNode||e.host;return e}(this),o=n.getBoundingClientRect(),r=this.getBoundingClientRect();n!==t.body?(h.call(this,n,n.scrollLeft+r.left-o.left,n.scrollTop+r.top-o.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})):e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function l(e,t){this.scrollLeft=e,this.scrollTop=t}function c(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function u(e,t){return"Y"===t?e.clientHeight+s<e.scrollHeight:"X"===t?e.clientWidth+s<e.scrollWidth:void 0}function d(t,n){var o=e.getComputedStyle(t,null)["overflow"+n];return"auto"===o||"scroll"===o}function f(e){var t=u(e,"Y")&&d(e,"Y"),n=u(e,"X")&&d(e,"X");return t||n}function p(t){var n,o,i,s,l=(a()-t.startTime)/r;s=l=l>1?1:l,n=.5*(1-Math.cos(Math.PI*s)),o=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,o,i),o===t.x&&i===t.y||e.requestAnimationFrame(p.bind(e,t))}function h(n,o,r){var s,c,u,d,f=a();n===t.body?(s=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(s=n,c=n.scrollLeft,u=n.scrollTop,d=l),p({scrollable:s,method:d,startTime:f,startX:c,startY:u,x:o,y:r})}}}}()}(P={exports:{}},P.exports),P.exports).polyfill,Y=function(){function e(e,t){void 0===t&&(t=[]),this.timeOffset=0,this.actions=t,this.config=e}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,e)},e.prototype.start=function(){this.actions.sort(function(e,t){return e.delay-t.delay}),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this.config,o=this;this.raf=requestAnimationFrame(function r(i){for(o.timeOffset+=(i-e)*n.speed,e=i;t.length;){var a=t[0];if(!(o.timeOffset>=a.delay))break;t.shift(),a.doAction()}(t.length>0||o.config.liveMode)&&(o.raf=requestAnimationFrame(r))})},e.prototype.clear=function(){this.raf&&cancelAnimationFrame(this.raf),this.actions.length=0},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var o=Math.floor((t+n)/2);if(this.actions[o].delay<e.delay)t=o+1;else{if(!(this.actions[o].delay>e.delay))return o;n=o-1}}return t},e}(),H=j||z,V=function(){function t(e,t){if(this.events=[],this.emitter=H(),this.baselineTime=0,this.noramlSpeed=-1,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this);var n={speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1};this.config=Object.assign({},n,t),this.timer=new Y(this.config),X(),this.setupDom(),this.emitter.on("resize",this.handleResize)}return t.prototype.on=function(e,t){this.emitter.on(e,t)},t.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach(function(n){t.config[n]=e[n]}),this.config.skipInactive||(this.noramlSpeed=-1)},t.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.timestamp}},t.prototype.getTimeOffset=function(){return this.baselineTime-this.events[0].timestamp},t.prototype.play=function(t){void 0===t&&(t=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+t;for(var n=new Array,o=0,r=this.events;o<r.length;o++){var i=r[o],a=i.timestamp<this.baselineTime,s=this.getCastFn(i,a);a?s():n.push({doAction:s,delay:this.getDelay(i)})}this.timer.addActions(n),this.timer.start(),this.emitter.emit(e.ReplayerEvents.Start)},t.prototype.pause=function(){this.timer.clear(),this.emitter.emit(e.ReplayerEvents.Pause)},t.prototype.resume=function(t){void 0===t&&(t=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+t;for(var n=new Array,o=0,r=this.events;o<r.length;o++){var i=r[o];if(!(i.timestamp<=this.lastPlayedEvent.timestamp||i===this.lastPlayedEvent)){var a=this.getCastFn(i);n.push({doAction:a,delay:this.getDelay(i)})}}this.timer.addActions(n),this.timer.start(),this.emitter.emit(e.ReplayerEvents.Resume)},t.prototype.addEvent=function(e){this.getCastFn(e,!0)()},t.prototype.setupDom=function(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin"),this.iframe.setAttribute("scrolling","no"),this.wrapper.appendChild(this.iframe)},t.prototype.handleResize=function(e){this.iframe.width=e.width+"px",this.iframe.height=e.height+"px"},t.prototype.getDelay=function(t){if(t.type===e.EventType.IncrementalSnapshot&&t.data.source===e.IncrementalSource.MouseMove){var n=t.data.positions[0].timeOffset,o=t.timestamp+n;return t.delay=o-this.baselineTime,o-this.baselineTime}return t.delay=t.timestamp-this.baselineTime,t.timestamp-this.baselineTime},t.prototype.getCastFn=function(t,n){var o,r=this;switch(void 0===n&&(n=!1),t.type){case e.EventType.DomContentLoaded:case e.EventType.Load:break;case e.EventType.Meta:o=function(){return r.emitter.emit(e.ReplayerEvents.Resize,{width:t.data.width,height:t.data.height})};break;case e.EventType.FullSnapshot:o=function(){r.rebuildFullSnapshot(t),r.iframe.contentWindow.scrollTo(t.data.initialOffset)};break;case e.EventType.IncrementalSnapshot:o=function(){if(r.applyIncremental(t,n),t===r.nextUserInteractionEvent&&(r.nextUserInteractionEvent=null,r.restoreSpeed()),r.config.skipInactive&&!r.nextUserInteractionEvent){for(var o=0,i=r.events;o<i.length;o++){var a=i[o];if(!(a.timestamp<=t.timestamp)&&r.isUserInteraction(a)){a.delay-t.delay>1e4*r.config.speed&&(r.nextUserInteractionEvent=a);break}}if(r.nextUserInteractionEvent){r.noramlSpeed=r.config.speed;var s=r.nextUserInteractionEvent.delay-t.delay,l={speed:Math.min(Math.round(s/5e3),360)};r.setConfig(l),r.emitter.emit(e.ReplayerEvents.SkipStart,l)}}}}return function(){o&&o(),r.lastPlayedEvent=t,t===r.events[r.events.length-1]&&(r.restoreSpeed(),r.emitter.emit(e.ReplayerEvents.Finish))}},t.prototype.rebuildFullSnapshot=function(t){var n,o,r;Object.keys(this.missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.missingNodeRetryMap),this.missingNodeRetryMap={},I.map=(n=t.data.node,o=this.iframe.contentDocument,r={},[v(n,o,r),r])[1];var i=document.createElement("style"),a=this.iframe.contentDocument,s=a.documentElement,l=a.head;s.insertBefore(i,l);for(var c=["iframe, ."+this.config.blockClass+" { background: #ccc }","noscript { display: none !important; }"],u=0;u<c.length;u++)i.sheet.insertRule(c[u],u);this.emitter.emit(e.ReplayerEvents.FullsnapshotRebuilded),this.waitForStylesheetLoad()},t.prototype.waitForStylesheetLoad=function(){var t=this,n=this.iframe.contentDocument.head;if(n){var o,r=new Set;n.querySelectorAll('link[rel="stylesheet"]').forEach(function(n){n.sheet||(0===r.size&&(t.pause(),t.emitter.emit(e.ReplayerEvents.LoadStylesheetStart),o=window.setTimeout(function(){t.resume(t.timer.timeOffset),o=-1},t.config.loadTimeout)),r.add(n),n.addEventListener("load",function(){r.delete(n),0===r.size&&-1!==o&&(t.resume(t.timer.timeOffset),t.emitter.emit(e.ReplayerEvents.LoadStylesheetEnd),o&&window.clearTimeout(o))}))})}},t.prototype.applyIncremental=function(t,o){var r=this,i=t.data;switch(i.source){case e.IncrementalSource.Mutation:i.removes.forEach(function(e){var t=I.getNode(e.id);if(!t)return r.warnNodeNotFound(i,e.id);var n=I.getNode(e.parentId);if(!n)return r.warnNodeNotFound(i,e.parentId);I.removeNodeFromMap(t),n&&n.removeChild(t)});var a=n({},this.missingNodeRetryMap),s=[],l=function(e){var t=I.getNode(e.parentId);if(!t)return s.push(e);var n=v(e.node,r.iframe.contentDocument,I.map,!0),o=null,i=null;e.previousId&&(o=I.getNode(e.previousId)),e.nextId&&(i=I.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(o&&o.nextSibling&&o.nextSibling.parentNode?t.insertBefore(n,o.nextSibling):i&&i.parentNode?t.insertBefore(n,i):t.appendChild(n),(e.previousId||e.nextId)&&r.resolveMissingNode(a,t,n,e)):a[e.node.id]={node:n,mutation:e}};for(i.adds.forEach(function(e){l(e)});s.length;){if(s.every(function(e){return!Boolean(I.getNode(e.parentId))}))return s.forEach(function(e){return r.warnNodeNotFound(i,e.node.id)});var c=s.shift();l(c)}Object.keys(a).length&&Object.assign(this.missingNodeRetryMap,a),i.texts.forEach(function(e){var t=I.getNode(e.id);if(!t)return r.warnNodeNotFound(i,e.id);t.textContent=e.value}),i.attributes.forEach(function(e){var t=I.getNode(e.id);if(!t)return r.warnNodeNotFound(i,e.id);for(var n in e.attributes)if("string"==typeof n){var o=e.attributes[n];null!==o?t.setAttribute(n,o):t.removeAttribute(n)}});break;case e.IncrementalSource.MouseMove:if(o){var u=i.positions[i.positions.length-1];this.moveAndHover(i,u.x,u.y,u.id)}else i.positions.forEach(function(e){var n={doAction:function(){r.moveAndHover(i,e.x,e.y,e.id)},delay:e.timeOffset+t.timestamp-r.baselineTime};r.timer.addAction(n)});break;case e.IncrementalSource.MouseInteraction:if(-1===i.id)break;var d=new Event(e.MouseInteractions[i.type].toLowerCase());if(!(f=I.getNode(i.id)))return this.debugNodeNotFound(i,i.id);switch(this.emitter.emit(e.ReplayerEvents.MouseInteraction,{type:i.type,target:f}),i.type){case e.MouseInteractions.Blur:f.blur&&f.blur();break;case e.MouseInteractions.Focus:f.focus&&f.focus({preventScroll:!0});break;case e.MouseInteractions.Click:o||(this.moveAndHover(i,i.x,i.y,i.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:f.dispatchEvent(d)}break;case e.IncrementalSource.Scroll:if(-1===i.id)break;if(!(f=I.getNode(i.id)))return this.debugNodeNotFound(i,i.id);if(f===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:i.y,left:i.x,behavior:o?"auto":"smooth"});else try{f.scrollTop=i.y,f.scrollLeft=i.x}catch(e){}break;case e.IncrementalSource.ViewportResize:this.emitter.emit(e.ReplayerEvents.Resize,{width:i.width,height:i.height});break;case e.IncrementalSource.Input:if(-1===i.id)break;var f;if(!(f=I.getNode(i.id)))return this.debugNodeNotFound(i,i.id);try{f.checked=i.isChecked,f.value=i.text}catch(e){}}},t.prototype.resolveMissingNode=function(e,t,n,o){var r=o.previousId,i=o.nextId,a=r&&e[r],s=i&&e[i];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}},t.prototype.moveAndHover=function(e,t,n,o){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px";var r=I.getNode(o);if(!r)return this.debugNodeNotFound(e,o);this.hoverElements(r)},t.prototype.hoverElements=function(e){this.iframe.contentDocument.querySelectorAll(".\\:hover").forEach(function(e){e.classList.remove(":hover")});for(var t=e;t;)t.classList.add(":hover"),t=t.parentElement},t.prototype.isUserInteraction=function(t){return t.type===e.EventType.IncrementalSnapshot&&(t.data.source>e.IncrementalSource.Mutation&&t.data.source<=e.IncrementalSource.Input)},t.prototype.restoreSpeed=function(){if(-1!==this.noramlSpeed){var t={speed:this.noramlSpeed};this.setConfig(t),this.emitter.emit(e.ReplayerEvents.SkipEnd,t),this.noramlSpeed=-1}},t.prototype.warnNodeNotFound=function(e,t){this.config.showWarning&&console.warn("[replayer]","Node with id '"+t+"' not found in",e)},t.prototype.debugNodeNotFound=function(e,t){this.config.showDebug&&console.log("[replayer]","Node with id '"+t+"' not found in",e)},t}();return e.record=function(t){void 0===t&&(t={});var o,r=t.emit,i=t.checkoutEveryNms,a=t.checkoutEveryNth,s=t.blockClass,l=void 0===s?"rr-block":s,c=t.ignoreClass,d=void 0===c?"rr-ignore":c,f=t.inlineStylesheet,p=void 0===f||f;if(!r)throw new Error("emit function is required");var h=0,m=function(t,n){if(r(t,n),t.type===e.EventType.FullSnapshot)o=t,h=0;else if(t.type===e.EventType.IncrementalSnapshot){h++;var s=a&&h>=a,l=i&&t.timestamp-o.timestamp>i;(s||l)&&v(!0)}};function v(t){void 0===t&&(t=!1),m(B({type:e.EventType.Meta,data:{href:window.location.href,width:N(),height:T()}}),t);var n=function(e,t,n){void 0===t&&(t="rr-block"),void 0===n&&(n=!0);var o={};return[u(e,e,o,t,!1,n),o]}(document,l,p),o=n[0],r=n[1];if(!o)return console.warn("Failed to snapshot the document");I.map=r,m(B({type:e.EventType.FullSnapshot,data:{node:o,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var g=[];g.push(y("DOMContentLoaded",function(){m(B({type:e.EventType.DomContentLoaded,data:{}}))}));var b=function(){v(),g.push(F({mutationCb:function(t){return m(B({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.Mutation},t)}))},mousemoveCb:function(t){return m(B({type:e.EventType.IncrementalSnapshot,data:{source:e.IncrementalSource.MouseMove,positions:t}}))},mouseInteractionCb:function(t){return m(B({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.MouseInteraction},t)}))},scrollCb:function(t){return m(B({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.Scroll},t)}))},viewportResizeCb:function(t){return m(B({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.ViewportResize},t)}))},inputCb:function(t){return m(B({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.Input},t)}))},blockClass:l,ignoreClass:d,inlineStylesheet:p}))};return"interactive"===document.readyState||"complete"===document.readyState?b():g.push(y("load",function(){m(B({type:e.EventType.Load,data:{}})),b()},window)),function(){g.forEach(function(e){return e()})}}catch(e){console.warn(e)}},e.Replayer=V,e.mirror=I,e}({});
var rrweb=function(e){"use strict";var t,n=function(){return(n=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(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"}(t||(t={}));var o=1;function r(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)?r(n.styleSheet)||"":n.cssText);var n},""):null}catch(e){return null}}var i=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,a=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,s=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function l(e,t){return e.replace(i,function(e,n,o,r){var i,l=n||o||r;if(!l)return e;if(!a.test(l))return"url('"+l+"')";if(s.test(l))return"url("+l+")";if("/"===l[0])return"url('"+(((i=t).indexOf("//")>-1?i.split("/").slice(0,3).join("/"):i.split("/")[0]).split("?")[0]+l)+"')";var c=t.split("/"),u=l.split("/");c.pop();for(var d=0,f=u;d<f.length;d++){var p=f[d];"."!==p&&(".."===p?c.pop():c.push(p))}return"url('"+c.join("/")+"')"})}function c(e,t){var n=e.createElement("a");return n.href=t,n.href}function u(e,n,i,a,s,d,f){void 0===s&&(s=!1),void 0===d&&(d=!0),void 0===f&&(f=!1);var p,h=function(e,n,o,i,a){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:t.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:t.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:var s=!1;"string"==typeof o?s=e.classList.contains(o):e.classList.forEach(function(e){o.test(e)&&(s=!0)});for(var u=e.tagName.toLowerCase(),d={},f=0,p=Array.from(e.attributes);f<p.length;f++){var h=p[f],m=h.name,v=h.value;d[m]="src"===m||"href"===m?c(n,v):"style"===m?l(v,location.href):v}if("link"===u&&i){var y,g=Array.from(n.styleSheets).find(function(t){return t.href===e.href});(y=r(g))&&(delete d.rel,delete d.href,d._cssText=l(y,g.href))}if("style"===u&&e.sheet&&!e.innerText.trim().length&&(y=r(e.sheet))&&(d._cssText=l(y,location.href)),"input"!==u&&"textarea"!==u&&"select"!==u||(v=e.value,"radio"!==d.type&&"checkbox"!==d.type&&v?d.value=a?"*".repeat(v.length):v:e.checked&&(d.checked=e.checked)),"option"===u){var b=e.parentElement;d.value===b.value&&(d.selected=e.selected)}if(s){var E=e.getBoundingClientRect(),w=E.width,I=E.height;d.rr_width=w+"px",d.rr_height=I+"px"}return{type:t.Element,tagName:u,attributes:d,childNodes:[],isSVG:(C=e,"svg"===C.tagName||C instanceof SVGElement||void 0),needBlock:s};case e.TEXT_NODE:var T=e.parentNode&&e.parentNode.tagName,S=e.textContent,N="STYLE"===T||void 0;return N&&S&&(S=l(S,location.href)),"SCRIPT"===T&&(S="SCRIPT_PLACEHOLDER"),{type:t.Text,textContent:S||"",isStyle:N};case e.CDATA_SECTION_NODE:return{type:t.CDATA,textContent:""};case e.COMMENT_NODE:return{type:t.Comment,textContent:e.textContent||""};default:return!1}var C}(e,n,a,d,f);if(!h)return console.warn(e,"not serialized"),null;p="__sn"in e?e.__sn.id:o++;var m=Object.assign(h,{id:p});e.__sn=m,i[p]=e;var v=!s;if(m.type===t.Element&&(v=v&&!m.needBlock,delete m.needBlock),(m.type===t.Document||m.type===t.Element)&&v)for(var y=0,g=Array.from(e.childNodes);y<g.length;y++){var b=u(g[y],n,i,a,s,d);b&&m.childNodes.push(b)}return m}var d={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};var f=/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,p=/([^\\]):hover/g;function h(e){return e.replace(f,function(e,t,n){if(p.test(t)){var o=t.replace(p,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+o.replace(/^\s*/,"")+n}return e})}function m(e,n){switch(e.type){case t.Document:return n.implementation.createDocument(null,"",null);case t.DocumentType:return n.implementation.createDocumentType(e.name,e.publicId,e.systemId);case t.Element:var o=function(e){var t=d[e.tagName]?d[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e),r=void 0;for(var i in r=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",o):n.createElement(o),e.attributes)if(e.attributes.hasOwnProperty(i)&&!i.startsWith("rr_")){var a=e.attributes[i];a="boolean"==typeof a?"":a;var s="textarea"===o&&"value"===i,l="style"===o&&"_cssText"===i;if(l&&(a=h(a)),s||l){var c=n.createTextNode(a);r.appendChild(c);continue}if("iframe"===o&&"src"===i)continue;try{e.isSVG&&"xlink:href"===i?r.setAttributeNS("http://www.w3.org/1999/xlink",i,a):r.setAttribute(i,a)}catch(e){}}else e.attributes.rr_width&&(r.style.width=e.attributes.rr_width),e.attributes.rr_height&&(r.style.height=e.attributes.rr_height);return r;case t.Text:return n.createTextNode(e.isStyle?h(e.textContent):e.textContent);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function v(e,n,o,r){void 0===r&&(r=!1);var i=m(e,n);if(!i)return null;if(e.type===t.Document&&(n.close(),n.open(),i=n),i.__sn=e,o[e.id]=i,(e.type===t.Document||e.type===t.Element)&&!r)for(var a=0,s=e.childNodes;a<s.length;a++){var l=s[a],c=v(l,n,o);c?i.appendChild(c):console.warn("Failed to rebuild",l)}return i}function y(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)}}var g,b,E,w,I={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return I.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete I.map[t],e.childNodes&&e.childNodes.forEach(function(e){return I.removeNodeFromMap(e)})},has:function(e){return I.map.hasOwnProperty(e)}};function T(e,t,n){void 0===n&&(n={});var o=null,r=0;return function(){var i=Date.now();r||!1!==n.leading||(r=i);var a=t-(i-r),s=this,l=arguments;a<=0||a>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)},a))}}function S(){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 C(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||C(e.parentNode,t)}return C(e.parentNode,t)}function x(e){return Boolean(e.changedTouches)}function M(e,t){e.delete(t),t.childNodes.forEach(function(t){return M(e,t)})}function k(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||k(e,n))}(g=e.EventType||(e.EventType={}))[g.DomContentLoaded=0]="DomContentLoaded",g[g.Load=1]="Load",g[g.FullSnapshot=2]="FullSnapshot",g[g.IncrementalSnapshot=3]="IncrementalSnapshot",g[g.Meta=4]="Meta",(b=e.IncrementalSource||(e.IncrementalSource={}))[b.Mutation=0]="Mutation",b[b.MouseMove=1]="MouseMove",b[b.MouseInteraction=2]="MouseInteraction",b[b.Scroll=3]="Scroll",b[b.ViewportResize=4]="ViewportResize",b[b.Input=5]="Input",(E=e.MouseInteractions||(e.MouseInteractions={}))[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",(w=e.ReplayerEvents||(e.ReplayerEvents={})).Start="start",w.Pause="pause",w.Resume="resume",w.Resize="resize",w.Finish="finish",w.FullsnapshotRebuilded="fullsnapshot-rebuilded",w.LoadStylesheetStart="load-stylesheet-start",w.LoadStylesheetEnd="load-stylesheet-end",w.SkipStart="skip-start",w.SkipEnd="skip-end",w.MouseInteraction="mouse-interaction";var D=function(e,t){return e+"@"+t};function O(e){return"__sn"in e}function L(e,t,n,o){var r=new MutationObserver(function(r){var i=[],a=[],s=[],l=[],c=new Set,d=new Set,f=new Set,p={},h=function(e,n){if(!C(e,t)){if(O(e)){d.add(e);var o=null;n&&O(n)&&(o=n.__sn.id),o&&(p[D(e.__sn.id,o)]=!0)}else c.add(e),f.delete(e);e.childNodes.forEach(function(e){return h(e)})}};r.forEach(function(e){var n=e.type,o=e.target,r=e.oldValue,l=e.addedNodes,u=e.removedNodes,m=e.attributeName;switch(n){case"characterData":var v=o.textContent;C(o,t)||v===r||i.push({value:v,node:o});break;case"attributes":v=o.getAttribute(m);if(C(o,t)||v===r)return;var y=a.find(function(e){return e.node===o});y||(y={node:o,attributes:{}},a.push(y)),y.attributes[m]=v;break;case"childList":l.forEach(function(e){return h(e,o)}),u.forEach(function(e){var n=I.getId(e),r=I.getId(o);C(e,t)||(c.has(e)?(M(c,e),f.add(e)):c.has(o)&&-1===n||function e(t){var n=I.getId(t);return!I.has(n)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode))}(o)||(d.has(e)&&p[D(n,r)]?M(d,e):s.push({parentId:r,id:n})),I.removeNodeFromMap(e))})}});var m=[],v=function(e){var r=I.getId(e.parentNode);if(-1===r)return m.push(e);l.push({parentId:r,previousId:e.previousSibling?I.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?I.getId(e.nextSibling):e.nextSibling,node:u(e,document,I.map,t,!0,n,o)})};for(Array.from(d).forEach(v),Array.from(c).forEach(function(e){k(f,e)||function e(t,n){var o=n.parentNode;if(!o)return!1;var r=I.getId(o);return!!t.some(function(e){return e.id===r})||e(t,o)}(s,e)?k(d,e)?v(e):f.add(e):v(e)});m.length&&!m.every(function(e){return-1===I.getId(e.parentNode)});)v(m.shift());var y={texts:i.map(function(e){return{id:I.getId(e.node),value:e.value}}).filter(function(e){return I.has(e.id)}),attributes:a.map(function(e){return{id:I.getId(e.node),attributes:e.attributes}}).filter(function(e){return I.has(e.id)}),removes:s,adds:l};(y.texts.length||y.attributes.length||y.removes.length||y.adds.length)&&e(y)});return r.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function A(t,n){var o=[];return Object.keys(e.MouseInteractions).filter(function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")}).forEach(function(r){var i=r.toLowerCase(),a=function(o){return function(r){if(!C(r.target,n)){var i=I.getId(r.target),a=x(r)?r.changedTouches[0]:r,s=a.clientX,l=a.clientY;t({type:e.MouseInteractions[o],id:i,x:s,y:l})}}}(r);o.push(y(i,a))}),function(){o.forEach(function(e){return e()})}}var R=["INPUT","TEXTAREA","SELECT"],_=["color","date","datetime-local","email","month","number","range","search","tel","text","time","url","week"],F=new WeakMap;function B(e,t,o,r){function i(e){var n=e.target;if(n&&n.tagName&&!(R.indexOf(n.tagName)<0)&&!C(n,t)){var i=n.type;if("password"!==i&&!n.classList.contains(o)){var s=n.value,l=!1,c=_.includes(i)||"TEXTAREA"===n.tagName;"radio"===i||"checkbox"===i?l=n.checked:c&&r&&(s="*".repeat(s.length)),a(n,{text:s,isChecked:l});var u=n.name;"radio"===i&&u&&l&&document.querySelectorAll('input[type="radio"][name="'+u+'"]').forEach(function(e){e!==n&&a(e,{text:e.value,isChecked:!l})})}}}function a(t,o){var r=F.get(t);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){F.set(t,o);var i=I.getId(t);e(n({},o,{id:i}))}}var s=["input","change"].map(function(e){return y(e,i)}),l=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),c=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]];return l&&l.set&&s.push.apply(s,c.map(function(e){return function e(t,n,o){var r=Object.getOwnPropertyDescriptor(t,n);return Object.defineProperty(t,n,{set:function(e){var t=this;setTimeout(function(){o.set.call(t,e)},0),r&&r.set&&r.set.call(this,e)}}),function(){return e(t,n,r||{})}}(e[0],e[1],{set:function(){i({target:this})}})})),function(){s.forEach(function(e){return e()})}}function j(e){var t,n,o,r,i,a,s=L(e.mutationCb,e.blockClass,e.inlineStylesheet,e.maskAllInputs),l=(t=e.mousemoveCb,o=[],r=T(function(){var e=Date.now()-n;t(o.map(function(t){return t.timeOffset-=e,t})),o=[],n=null},500),i=T(function(e){var t=e.target,i=x(e)?e.changedTouches[0]:e,a=i.clientX,s=i.clientY;n||(n=Date.now()),o.push({x:a,y:s,id:I.getId(t),timeOffset:Date.now()-n}),r()},50,{trailing:!1}),a=[y("mousemove",i),y("touchmove",i)],function(){a.forEach(function(e){return e()})}),c=A(e.mouseInteractionCb,e.blockClass),u=function(e,t){return y("scroll",T(function(n){if(n.target&&!C(n.target,t)){var o=I.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})}},100))}(e.scrollCb,e.blockClass),d=function(e){return y("resize",T(function(){var t=S(),n=N();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),f=B(e.inputCb,e.blockClass,e.ignoreClass,e.maskAllInputs);return function(){s.disconnect(),l(),c(),u(),d(),f()}}function z(e){return n({},e,{timestamp:Date.now()})}function P(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map(function(e){e(n)}),(e["*"]||[]).slice().map(function(e){e(t,n)})}}}var X=Object.freeze({default:P});var Y,H=(function(e,t){!function(){e.exports={polyfill:function(){var e=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)){var n,o=e.HTMLElement||e.Element,r=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:o.prototype.scroll||l,scrollIntoView:o.prototype.scrollIntoView},a=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,s=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(c(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},o.prototype.scroll=o.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==c(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},o.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},o.prototype.scrollIntoView=function(){if(!0!==c(arguments[0])){var n=function(e){for(;e!==t.body&&!1===f(e);)e=e.parentNode||e.host;return e}(this),o=n.getBoundingClientRect(),r=this.getBoundingClientRect();n!==t.body?(h.call(this,n,n.scrollLeft+r.left-o.left,n.scrollTop+r.top-o.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})):e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function l(e,t){this.scrollLeft=e,this.scrollTop=t}function c(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function u(e,t){return"Y"===t?e.clientHeight+s<e.scrollHeight:"X"===t?e.clientWidth+s<e.scrollWidth:void 0}function d(t,n){var o=e.getComputedStyle(t,null)["overflow"+n];return"auto"===o||"scroll"===o}function f(e){var t=u(e,"Y")&&d(e,"Y"),n=u(e,"X")&&d(e,"X");return t||n}function p(t){var n,o,i,s,l=(a()-t.startTime)/r;s=l=l>1?1:l,n=.5*(1-Math.cos(Math.PI*s)),o=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,o,i),o===t.x&&i===t.y||e.requestAnimationFrame(p.bind(e,t))}function h(n,o,r){var s,c,u,d,f=a();n===t.body?(s=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(s=n,c=n.scrollLeft,u=n.scrollTop,d=l),p({scrollable:s,method:d,startTime:f,startX:c,startY:u,x:o,y:r})}}}}()}(Y={exports:{}},Y.exports),Y.exports).polyfill,V=function(){function e(e,t){void 0===t&&(t=[]),this.timeOffset=0,this.actions=t,this.config=e}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,e)},e.prototype.start=function(){this.actions.sort(function(e,t){return e.delay-t.delay}),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this.config,o=this;this.raf=requestAnimationFrame(function r(i){for(o.timeOffset+=(i-e)*n.speed,e=i;t.length;){var a=t[0];if(!(o.timeOffset>=a.delay))break;t.shift(),a.doAction()}(t.length>0||o.config.liveMode)&&(o.raf=requestAnimationFrame(r))})},e.prototype.clear=function(){this.raf&&cancelAnimationFrame(this.raf),this.actions.length=0},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var o=Math.floor((t+n)/2);if(this.actions[o].delay<e.delay)t=o+1;else{if(!(this.actions[o].delay>e.delay))return o;n=o-1}}return t},e}(),U=P||X,W=function(){function t(e,t){if(this.events=[],this.emitter=U(),this.baselineTime=0,this.noramlSpeed=-1,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this);var n={speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1};this.config=Object.assign({},n,t),this.timer=new V(this.config),H(),this.setupDom(),this.emitter.on("resize",this.handleResize)}return t.prototype.on=function(e,t){this.emitter.on(e,t)},t.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach(function(n){t.config[n]=e[n]}),this.config.skipInactive||(this.noramlSpeed=-1)},t.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.timestamp}},t.prototype.getTimeOffset=function(){return this.baselineTime-this.events[0].timestamp},t.prototype.play=function(t){void 0===t&&(t=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+t;for(var n=new Array,o=0,r=this.events;o<r.length;o++){var i=r[o],a=i.timestamp<this.baselineTime,s=this.getCastFn(i,a);a?s():n.push({doAction:s,delay:this.getDelay(i)})}this.timer.addActions(n),this.timer.start(),this.emitter.emit(e.ReplayerEvents.Start)},t.prototype.pause=function(){this.timer.clear(),this.emitter.emit(e.ReplayerEvents.Pause)},t.prototype.resume=function(t){void 0===t&&(t=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+t;for(var n=new Array,o=0,r=this.events;o<r.length;o++){var i=r[o];if(!(i.timestamp<=this.lastPlayedEvent.timestamp||i===this.lastPlayedEvent)){var a=this.getCastFn(i);n.push({doAction:a,delay:this.getDelay(i)})}}this.timer.addActions(n),this.timer.start(),this.emitter.emit(e.ReplayerEvents.Resume)},t.prototype.addEvent=function(e){this.getCastFn(e,!0)()},t.prototype.setupDom=function(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin"),this.iframe.setAttribute("scrolling","no"),this.wrapper.appendChild(this.iframe)},t.prototype.handleResize=function(e){this.iframe.width=e.width+"px",this.iframe.height=e.height+"px"},t.prototype.getDelay=function(t){if(t.type===e.EventType.IncrementalSnapshot&&t.data.source===e.IncrementalSource.MouseMove){var n=t.data.positions[0].timeOffset,o=t.timestamp+n;return t.delay=o-this.baselineTime,o-this.baselineTime}return t.delay=t.timestamp-this.baselineTime,t.timestamp-this.baselineTime},t.prototype.getCastFn=function(t,n){var o,r=this;switch(void 0===n&&(n=!1),t.type){case e.EventType.DomContentLoaded:case e.EventType.Load:break;case e.EventType.Meta:o=function(){return r.emitter.emit(e.ReplayerEvents.Resize,{width:t.data.width,height:t.data.height})};break;case e.EventType.FullSnapshot:o=function(){r.rebuildFullSnapshot(t),r.iframe.contentWindow.scrollTo(t.data.initialOffset)};break;case e.EventType.IncrementalSnapshot:o=function(){if(r.applyIncremental(t,n),t===r.nextUserInteractionEvent&&(r.nextUserInteractionEvent=null,r.restoreSpeed()),r.config.skipInactive&&!r.nextUserInteractionEvent){for(var o=0,i=r.events;o<i.length;o++){var a=i[o];if(!(a.timestamp<=t.timestamp)&&r.isUserInteraction(a)){a.delay-t.delay>1e4*r.config.speed&&(r.nextUserInteractionEvent=a);break}}if(r.nextUserInteractionEvent){r.noramlSpeed=r.config.speed;var s=r.nextUserInteractionEvent.delay-t.delay,l={speed:Math.min(Math.round(s/5e3),360)};r.setConfig(l),r.emitter.emit(e.ReplayerEvents.SkipStart,l)}}}}return function(){o&&o(),r.lastPlayedEvent=t,t===r.events[r.events.length-1]&&(r.restoreSpeed(),r.emitter.emit(e.ReplayerEvents.Finish))}},t.prototype.rebuildFullSnapshot=function(t){var n,o,r;Object.keys(this.missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.missingNodeRetryMap),this.missingNodeRetryMap={},I.map=(n=t.data.node,o=this.iframe.contentDocument,r={},[v(n,o,r),r])[1];var i=document.createElement("style"),a=this.iframe.contentDocument,s=a.documentElement,l=a.head;s.insertBefore(i,l);for(var c=["iframe, ."+this.config.blockClass+" { background: #ccc }","noscript { display: none !important; }"],u=0;u<c.length;u++)i.sheet.insertRule(c[u],u);this.emitter.emit(e.ReplayerEvents.FullsnapshotRebuilded),this.waitForStylesheetLoad()},t.prototype.waitForStylesheetLoad=function(){var t=this,n=this.iframe.contentDocument.head;if(n){var o,r=new Set;n.querySelectorAll('link[rel="stylesheet"]').forEach(function(n){n.sheet||(0===r.size&&(t.pause(),t.emitter.emit(e.ReplayerEvents.LoadStylesheetStart),o=window.setTimeout(function(){t.resume(t.timer.timeOffset),o=-1},t.config.loadTimeout)),r.add(n),n.addEventListener("load",function(){r.delete(n),0===r.size&&-1!==o&&(t.resume(t.timer.timeOffset),t.emitter.emit(e.ReplayerEvents.LoadStylesheetEnd),o&&window.clearTimeout(o))}))})}},t.prototype.applyIncremental=function(t,o){var r=this,i=t.data;switch(i.source){case e.IncrementalSource.Mutation:i.removes.forEach(function(e){var t=I.getNode(e.id);if(!t)return r.warnNodeNotFound(i,e.id);var n=I.getNode(e.parentId);if(!n)return r.warnNodeNotFound(i,e.parentId);I.removeNodeFromMap(t),n&&n.removeChild(t)});var a=n({},this.missingNodeRetryMap),s=[],l=function(e){var t=I.getNode(e.parentId);if(!t)return s.push(e);var n=v(e.node,r.iframe.contentDocument,I.map,!0),o=null,i=null;e.previousId&&(o=I.getNode(e.previousId)),e.nextId&&(i=I.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(o&&o.nextSibling&&o.nextSibling.parentNode?t.insertBefore(n,o.nextSibling):i&&i.parentNode?t.insertBefore(n,i):t.appendChild(n),(e.previousId||e.nextId)&&r.resolveMissingNode(a,t,n,e)):a[e.node.id]={node:n,mutation:e}};for(i.adds.forEach(function(e){l(e)});s.length;){if(s.every(function(e){return!Boolean(I.getNode(e.parentId))}))return s.forEach(function(e){return r.warnNodeNotFound(i,e.node.id)});var c=s.shift();l(c)}Object.keys(a).length&&Object.assign(this.missingNodeRetryMap,a),i.texts.forEach(function(e){var t=I.getNode(e.id);if(!t)return r.warnNodeNotFound(i,e.id);t.textContent=e.value}),i.attributes.forEach(function(e){var t=I.getNode(e.id);if(!t)return r.warnNodeNotFound(i,e.id);for(var n in e.attributes)if("string"==typeof n){var o=e.attributes[n];null!==o?t.setAttribute(n,o):t.removeAttribute(n)}});break;case e.IncrementalSource.MouseMove:if(o){var u=i.positions[i.positions.length-1];this.moveAndHover(i,u.x,u.y,u.id)}else i.positions.forEach(function(e){var n={doAction:function(){r.moveAndHover(i,e.x,e.y,e.id)},delay:e.timeOffset+t.timestamp-r.baselineTime};r.timer.addAction(n)});break;case e.IncrementalSource.MouseInteraction:if(-1===i.id)break;var d=new Event(e.MouseInteractions[i.type].toLowerCase());if(!(f=I.getNode(i.id)))return this.debugNodeNotFound(i,i.id);switch(this.emitter.emit(e.ReplayerEvents.MouseInteraction,{type:i.type,target:f}),i.type){case e.MouseInteractions.Blur:f.blur&&f.blur();break;case e.MouseInteractions.Focus:f.focus&&f.focus({preventScroll:!0});break;case e.MouseInteractions.Click:case e.MouseInteractions.TouchStart:case e.MouseInteractions.TouchEnd:o||(this.moveAndHover(i,i.x,i.y,i.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:f.dispatchEvent(d)}break;case e.IncrementalSource.Scroll:if(-1===i.id)break;if(!(f=I.getNode(i.id)))return this.debugNodeNotFound(i,i.id);if(f===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:i.y,left:i.x,behavior:o?"auto":"smooth"});else try{f.scrollTop=i.y,f.scrollLeft=i.x}catch(e){}break;case e.IncrementalSource.ViewportResize:this.emitter.emit(e.ReplayerEvents.Resize,{width:i.width,height:i.height});break;case e.IncrementalSource.Input:if(-1===i.id)break;var f;if(!(f=I.getNode(i.id)))return this.debugNodeNotFound(i,i.id);try{f.checked=i.isChecked,f.value=i.text}catch(e){}}},t.prototype.resolveMissingNode=function(e,t,n,o){var r=o.previousId,i=o.nextId,a=r&&e[r],s=i&&e[i];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}},t.prototype.moveAndHover=function(e,t,n,o){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px";var r=I.getNode(o);if(!r)return this.debugNodeNotFound(e,o);this.hoverElements(r)},t.prototype.hoverElements=function(e){this.iframe.contentDocument.querySelectorAll(".\\:hover").forEach(function(e){e.classList.remove(":hover")});for(var t=e;t;)t.classList.add(":hover"),t=t.parentElement},t.prototype.isUserInteraction=function(t){return t.type===e.EventType.IncrementalSnapshot&&(t.data.source>e.IncrementalSource.Mutation&&t.data.source<=e.IncrementalSource.Input)},t.prototype.restoreSpeed=function(){if(-1!==this.noramlSpeed){var t={speed:this.noramlSpeed};this.setConfig(t),this.emitter.emit(e.ReplayerEvents.SkipEnd,t),this.noramlSpeed=-1}},t.prototype.warnNodeNotFound=function(e,t){this.config.showWarning&&console.warn("[replayer]","Node with id '"+t+"' not found in",e)},t.prototype.debugNodeNotFound=function(e,t){this.config.showDebug&&console.log("[replayer]","Node with id '"+t+"' not found in",e)},t}();return e.record=function(t){void 0===t&&(t={});var o,r=t.emit,i=t.checkoutEveryNms,a=t.checkoutEveryNth,s=t.blockClass,l=void 0===s?"rr-block":s,c=t.ignoreClass,d=void 0===c?"rr-ignore":c,f=t.inlineStylesheet,p=void 0===f||f,h=t.maskAllInputs,m=void 0!==h&&h;if(!r)throw new Error("emit function is required");var v=0,g=function(t,n){if(r(t,n),t.type===e.EventType.FullSnapshot)o=t,v=0;else if(t.type===e.EventType.IncrementalSnapshot){v++;var s=a&&v>=a,l=i&&t.timestamp-o.timestamp>i;(s||l)&&b(!0)}};function b(t){void 0===t&&(t=!1),g(z({type:e.EventType.Meta,data:{href:window.location.href,width:N(),height:S()}}),t);var n=function(e,t,n,o){void 0===t&&(t="rr-block"),void 0===n&&(n=!0),void 0===o&&(o=!1);var r={};return[u(e,e,r,t,!1,n,o),r]}(document,l,p,m),o=n[0],r=n[1];if(!o)return console.warn("Failed to snapshot the document");I.map=r,g(z({type:e.EventType.FullSnapshot,data:{node:o,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var E=[];E.push(y("DOMContentLoaded",function(){g(z({type:e.EventType.DomContentLoaded,data:{}}))}));var w=function(){b(),E.push(j({mutationCb:function(t){return g(z({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.Mutation},t)}))},mousemoveCb:function(t){return g(z({type:e.EventType.IncrementalSnapshot,data:{source:e.IncrementalSource.MouseMove,positions:t}}))},mouseInteractionCb:function(t){return g(z({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.MouseInteraction},t)}))},scrollCb:function(t){return g(z({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.Scroll},t)}))},viewportResizeCb:function(t){return g(z({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.ViewportResize},t)}))},inputCb:function(t){return g(z({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.Input},t)}))},blockClass:l,ignoreClass:d,maskAllInputs:m,inlineStylesheet:p}))};return"interactive"===document.readyState||"complete"===document.readyState?w():E.push(y("load",function(){g(z({type:e.EventType.Load,data:{}})),w()},window)),function(){E.forEach(function(e){return e()})}}catch(e){console.warn(e)}},e.Replayer=W,e.mirror=I,e}({});
//# sourceMappingURL=rrweb.min.js.map

@@ -118,3 +118,3 @@ /*! *****************************************************************************

}
function serializeNode(n, doc, blockClass, inlineStylesheet) {
function serializeNode(n, doc, blockClass, inlineStylesheet, maskAllInputs) {
switch (n.nodeType) {

@@ -186,3 +186,3 @@ case n.DOCUMENT_NODE:

value) {
attributes_1.value = value;
attributes_1.value = maskAllInputs ? '*'.repeat(value.length) : value;
}

@@ -241,6 +241,7 @@ else if (n.checked) {

}
function serializeNodeWithId(n, doc, map, blockClass, skipChild, inlineStylesheet) {
function serializeNodeWithId(n, doc, map, blockClass, skipChild, inlineStylesheet, maskAllInputs) {
if (skipChild === void 0) { skipChild = false; }
if (inlineStylesheet === void 0) { inlineStylesheet = true; }
var _serializedNode = serializeNode(n, doc, blockClass, inlineStylesheet);
if (maskAllInputs === void 0) { maskAllInputs = false; }
var _serializedNode = serializeNode(n, doc, blockClass, inlineStylesheet, maskAllInputs);
if (!_serializedNode) {

@@ -278,8 +279,9 @@ console.warn(n, 'not serialized');

}
function snapshot(n, blockClass, inlineStylesheet) {
function snapshot(n, blockClass, inlineStylesheet, maskAllInputs) {
if (blockClass === void 0) { blockClass = 'rr-block'; }
if (inlineStylesheet === void 0) { inlineStylesheet = true; }
if (maskAllInputs === void 0) { maskAllInputs = false; }
var idNodeMap = {};
return [
serializeNodeWithId(n, n, idNodeMap, blockClass, false, inlineStylesheet),
serializeNodeWithId(n, n, idNodeMap, blockClass, false, inlineStylesheet, maskAllInputs),
idNodeMap,

@@ -407,2 +409,5 @@ ];

}
function isTouchEvent(event) {
return Boolean(event.changedTouches);
}

@@ -436,3 +441,3 @@ var EventType;

MouseInteractions[MouseInteractions["TouchStart"] = 7] = "TouchStart";
MouseInteractions[MouseInteractions["TouchMove"] = 8] = "TouchMove";
MouseInteractions[MouseInteractions["TouchMove_Departed"] = 8] = "TouchMove_Departed";
MouseInteractions[MouseInteractions["TouchEnd"] = 9] = "TouchEnd";

@@ -485,3 +490,3 @@ })(MouseInteractions || (MouseInteractions = {}));

}
function initMutationObserver(cb, blockClass, inlineStylesheet) {
function initMutationObserver(cb, blockClass, inlineStylesheet, maskAllInputs) {
var observer = new MutationObserver(function (mutations) {

@@ -590,3 +595,3 @@ var texts = [];

: mirror.getId(n.nextSibling),
node: serializeNodeWithId(n, document, mirror.map, blockClass, true, inlineStylesheet)
node: serializeNodeWithId(n, document, mirror.map, blockClass, true, inlineStylesheet, maskAllInputs)
});

@@ -646,3 +651,3 @@ };

}
function initMousemoveObserver(cb) {
function initMoveObserver(cb) {
var positions = [];

@@ -660,3 +665,6 @@ var timeBaseline;

var updatePosition = throttle(function (evt) {
var clientX = evt.clientX, clientY = evt.clientY, target = evt.target;
var target = evt.target;
var _a = isTouchEvent(evt)
? evt.changedTouches[0]
: evt, clientX = _a.clientX, clientY = _a.clientY;
if (!timeBaseline) {

@@ -675,3 +683,9 @@ timeBaseline = Date.now();

});
return on('mousemove', updatePosition);
var handlers = [
on('mousemove', updatePosition),
on('touchmove', updatePosition),
];
return function () {
handlers.forEach(function (h) { return h(); });
};
}

@@ -686,3 +700,5 @@ function initMouseInteractionObserver(cb, blockClass) {

var id = mirror.getId(event.target);
var clientX = event.clientX, clientY = event.clientY;
var _a = isTouchEvent(event)
? event.changedTouches[0]
: event, clientX = _a.clientX, clientY = _a.clientY;
cb({

@@ -697,3 +713,3 @@ type: MouseInteractions[eventKey],

Object.keys(MouseInteractions)
.filter(function (key) { return Number.isNaN(Number(key)); })
.filter(function (key) { return Number.isNaN(Number(key)) && !key.endsWith('_Departed'); })
.forEach(function (eventKey) {

@@ -744,4 +760,19 @@ var eventName = eventKey.toLowerCase();

var INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];
var MASK_TYPES = [
'color',
'date',
'datetime-local',
'email',
'month',
'number',
'range',
'search',
'tel',
'text',
'time',
'url',
'week',
];
var lastInputValueMap = new WeakMap();
function initInputObserver(cb, blockClass, ignoreClass) {
function initInputObserver(cb, blockClass, ignoreClass, maskAllInputs) {
function eventHandler(event) {

@@ -762,5 +793,9 @@ var target = event.target;

var isChecked = false;
var hasTextInput = MASK_TYPES.includes(type) || target.tagName === 'TEXTAREA';
if (type === 'radio' || type === 'checkbox') {
isChecked = target.checked;
}
else if (hasTextInput && maskAllInputs) {
text = '*'.repeat(text.length);
}
cbWithDedup(target, { text: text, isChecked: isChecked });

@@ -816,8 +851,8 @@ var name = target.name;

function initObservers(o) {
var mutationObserver = initMutationObserver(o.mutationCb, o.blockClass, o.inlineStylesheet);
var mousemoveHandler = initMousemoveObserver(o.mousemoveCb);
var mutationObserver = initMutationObserver(o.mutationCb, o.blockClass, o.inlineStylesheet, o.maskAllInputs);
var mousemoveHandler = initMoveObserver(o.mousemoveCb);
var mouseInteractionHandler = initMouseInteractionObserver(o.mouseInteractionCb, o.blockClass);
var scrollHandler = initScrollObserver(o.scrollCb, o.blockClass);
var viewportResizeHandler = initViewportResizeObserver(o.viewportResizeCb);
var inputHandler = initInputObserver(o.inputCb, o.blockClass, o.ignoreClass);
var inputHandler = initInputObserver(o.inputCb, o.blockClass, o.ignoreClass, o.maskAllInputs);
return function () {

@@ -838,3 +873,3 @@ mutationObserver.disconnect();

if (options === void 0) { options = {}; }
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth, _a = options.blockClass, blockClass = _a === void 0 ? 'rr-block' : _a, _b = options.ignoreClass, ignoreClass = _b === void 0 ? 'rr-ignore' : _b, _c = options.inlineStylesheet, inlineStylesheet = _c === void 0 ? true : _c;
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth, _a = options.blockClass, blockClass = _a === void 0 ? 'rr-block' : _a, _b = options.ignoreClass, ignoreClass = _b === void 0 ? 'rr-ignore' : _b, _c = options.inlineStylesheet, inlineStylesheet = _c === void 0 ? true : _c, _d = options.maskAllInputs, maskAllInputs = _d === void 0 ? false : _d;
if (!emit) {

@@ -871,3 +906,3 @@ throw new Error('emit function is required');

}), isCheckout);
var _a = snapshot(document, blockClass, inlineStylesheet), node = _a[0], idNodeMap = _a[1];
var _a = snapshot(document, blockClass, inlineStylesheet, maskAllInputs), node = _a[0], idNodeMap = _a[1];
if (!node) {

@@ -940,2 +975,3 @@ return console.warn('Failed to snapshot the document');

ignoreClass: ignoreClass,
maskAllInputs: maskAllInputs,
inlineStylesheet: inlineStylesheet

@@ -942,0 +978,0 @@ }));

@@ -1,2 +0,2 @@

var NodeType,__assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};!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"}(NodeType||(NodeType={}));var _id=1;function genId(){return _id++}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+getCssRuleString(t)},""):null}catch(e){return null}}function getCssRuleString(e){return isCSSImportRule(e)?getCssRulesString(e.styleSheet)||"":e.cssText}function isCSSImportRule(e){return"styleSheet"in e}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,DATA_URI=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,r,o){var i=n||r||o;if(!i)return e;if(!RELATIVE_PATH.test(i))return"url('"+i+"')";if(DATA_URI.test(i))return"url("+i+")";if("/"===i[0])return"url('"+(extractOrigin(t)+i)+"')";var a=t.split("/"),s=i.split("/");a.pop();for(var u=0,c=s;u<c.length;u++){var l=c[u];"."!==l&&(".."===l?a.pop():a.push(l))}return"url('"+a.join("/")+"')"})}function absoluteToDoc(e,t){var n=e.createElement("a");return n.href=t,n.href}function isSVGElement(e){return"svg"===e.tagName||e instanceof SVGElement}function serializeNode(e,t,n,r){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:var o=!1;"string"==typeof n?o=e.classList.contains(n):e.classList.forEach(function(e){n.test(e)&&(o=!0)});for(var i=e.tagName.toLowerCase(),a={},s=0,u=Array.from(e.attributes);s<u.length;s++){var c=u[s],l=c.name,d=c.value;a[l]="src"===l||"href"===l?absoluteToDoc(t,d):"style"===l?absoluteToStylesheet(d,location.href):d}if("link"===i&&r){var p,f=Array.from(t.styleSheets).find(function(t){return t.href===e.href});(p=getCssRulesString(f))&&(delete a.rel,delete a.href,a._cssText=absoluteToStylesheet(p,f.href))}if("style"===i&&e.sheet&&!e.innerText.trim().length)(p=getCssRulesString(e.sheet))&&(a._cssText=absoluteToStylesheet(p,location.href));if("input"===i||"textarea"===i||"select"===i){d=e.value;"radio"!==a.type&&"checkbox"!==a.type&&d?a.value=d:e.checked&&(a.checked=e.checked)}if("option"===i){var m=e.parentElement;a.value===m.value&&(a.selected=e.selected)}if(o){var v=e.getBoundingClientRect(),h=v.width,y=v.height;a.rr_width=h+"px",a.rr_height=y+"px"}return{type:NodeType.Element,tagName:i,attributes:a,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:o};case e.TEXT_NODE:var g=e.parentNode&&e.parentNode.tagName,E=e.textContent,T="STYLE"===g||void 0;return T&&E&&(E=absoluteToStylesheet(E,location.href)),"SCRIPT"===g&&(E="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:E||"",isStyle:T};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,n,r,o,i){void 0===o&&(o=!1),void 0===i&&(i=!0);var a,s=serializeNode(e,t,r,i);if(!s)return console.warn(e,"not serialized"),null;a="__sn"in e?e.__sn.id:genId();var u=Object.assign(s,{id:a});e.__sn=u,n[a]=e;var c=!o;if(u.type===NodeType.Element&&(c=c&&!u.needBlock,delete u.needBlock),(u.type===NodeType.Document||u.type===NodeType.Element)&&c)for(var l=0,d=Array.from(e.childNodes);l<d.length;l++){var p=serializeNodeWithId(d[l],t,n,r,o,i);p&&u.childNodes.push(p)}return u}function snapshot(e,t,n){void 0===t&&(t="rr-block"),void 0===n&&(n=!0);var r={};return[serializeNodeWithId(e,e,r,t,!1,n),r]}function on(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var EventType,IncrementalSource,MouseInteractions,ReplayerEvents,mirror={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return mirror.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete mirror.map[t],e.childNodes&&e.childNodes.forEach(function(e){return mirror.removeNodeFromMap(e)})},has:function(e){return mirror.map.hasOwnProperty(e)}};function throttle(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){var i=Date.now();o||!1!==n.leading||(o=i);var a=t-(i-o),s=this,u=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=i,e.apply(s,u)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(s,u)},a))}}function hookSetter(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),r&&r.set&&r.set.call(this,e)}}),function(){return hookSetter(e,t,r||{})}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function isBlocked(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||isBlocked(e.parentNode,t)}return isBlocked(e.parentNode,t)}function isAncestorRemoved(e){var t=mirror.getId(e);return!mirror.has(t)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||isAncestorRemoved(e.parentNode))}function deepDelete(e,t){e.delete(t),t.childNodes.forEach(function(t){return deepDelete(e,t)})}function isParentRemoved(e,t){var n=t.parentNode;if(!n)return!1;var r=mirror.getId(n);return!!e.some(function(e){return e.id===r})||isParentRemoved(e,n)}function isAncestorInSet(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||isAncestorInSet(e,n))}!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"}(EventType||(EventType={})),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"}(IncrementalSource||(IncrementalSource={})),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=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(MouseInteractions||(MouseInteractions={})),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"}(ReplayerEvents||(ReplayerEvents={}));var moveKey=function(e,t){return e+"@"+t};function isINode(e){return"__sn"in e}function initMutationObserver(e,t,n){var r=new MutationObserver(function(r){var o=[],i=[],a=[],s=[],u=new Set,c=new Set,l=new Set,d={},p=function(e,n){if(!isBlocked(e,t)){if(isINode(e)){c.add(e);var r=null;n&&isINode(n)&&(r=n.__sn.id),r&&(d[moveKey(e.__sn.id,r)]=!0)}else u.add(e),l.delete(e);e.childNodes.forEach(function(e){return p(e)})}};r.forEach(function(e){var n=e.type,r=e.target,s=e.oldValue,f=e.addedNodes,m=e.removedNodes,v=e.attributeName;switch(n){case"characterData":var h=r.textContent;isBlocked(r,t)||h===s||o.push({value:h,node:r});break;case"attributes":h=r.getAttribute(v);if(isBlocked(r,t)||h===s)return;var y=i.find(function(e){return e.node===r});y||(y={node:r,attributes:{}},i.push(y)),y.attributes[v]=h;break;case"childList":f.forEach(function(e){return p(e,r)}),m.forEach(function(e){var n=mirror.getId(e),o=mirror.getId(r);isBlocked(e,t)||(u.has(e)?(deepDelete(u,e),l.add(e)):u.has(r)&&-1===n||isAncestorRemoved(r)||(c.has(e)&&d[moveKey(n,o)]?deepDelete(c,e):a.push({parentId:o,id:n})),mirror.removeNodeFromMap(e))})}});var f=[],m=function(e){var r=mirror.getId(e.parentNode);if(-1===r)return f.push(e);s.push({parentId:r,previousId:e.previousSibling?mirror.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?mirror.getId(e.nextSibling):e.nextSibling,node:serializeNodeWithId(e,document,mirror.map,t,!0,n)})};for(Array.from(c).forEach(m),Array.from(u).forEach(function(e){isAncestorInSet(l,e)||isParentRemoved(a,e)?isAncestorInSet(c,e)?m(e):l.add(e):m(e)});f.length&&!f.every(function(e){return-1===mirror.getId(e.parentNode)});)m(f.shift());var v={texts:o.map(function(e){return{id:mirror.getId(e.node),value:e.value}}).filter(function(e){return mirror.has(e.id)}),attributes:i.map(function(e){return{id:mirror.getId(e.node),attributes:e.attributes}}).filter(function(e){return mirror.has(e.id)}),removes:a,adds:s};(v.texts.length||v.attributes.length||v.removes.length||v.adds.length)&&e(v)});return r.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function initMousemoveObserver(e){var t,n=[],r=throttle(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return on("mousemove",throttle(function(e){var o=e.clientX,i=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:o,y:i,id:mirror.getId(a),timeOffset:Date.now()-t}),r()},50,{trailing:!1}))}function initMouseInteractionObserver(e,t){var n=[];return Object.keys(MouseInteractions).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(r){var o=r.toLowerCase(),i=function(n){return function(r){if(!isBlocked(r.target,t)){var o=mirror.getId(r.target),i=r.clientX,a=r.clientY;e({type:MouseInteractions[n],id:o,x:i,y:a})}}}(r);n.push(on(o,i))}),function(){n.forEach(function(e){return e()})}}function initScrollObserver(e,t){return on("scroll",throttle(function(n){if(n.target&&!isBlocked(n.target,t)){var r=mirror.getId(n.target);if(n.target===document){var o=document.scrollingElement||document.documentElement;e({id:r,x:o.scrollLeft,y:o.scrollTop})}else e({id:r,x:n.target.scrollLeft,y:n.target.scrollTop})}},100))}function initViewportResizeObserver(e){return on("resize",throttle(function(){var t=getWindowHeight(),n=getWindowWidth();e({width:Number(n),height:Number(t)})},200),window)}var INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],lastInputValueMap=new WeakMap;function initInputObserver(e,t,n){function r(e){var r=e.target;if(r&&r.tagName&&!(INPUT_TAGS.indexOf(r.tagName)<0)&&!isBlocked(r,t)){var i=r.type;if("password"!==i&&!r.classList.contains(n)){var a=r.value,s=!1;"radio"!==i&&"checkbox"!==i||(s=r.checked),o(r,{text:a,isChecked:s});var u=r.name;"radio"===i&&u&&s&&document.querySelectorAll('input[type="radio"][name="'+u+'"]').forEach(function(e){e!==r&&o(e,{text:e.value,isChecked:!s})})}}}function o(t,n){var r=lastInputValueMap.get(t);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){lastInputValueMap.set(t,n);var o=mirror.getId(t);e(__assign({},n,{id:o}))}}var i=["input","change"].map(function(e){return on(e,r)}),a=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),s=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]];return a&&a.set&&i.push.apply(i,s.map(function(e){return hookSetter(e[0],e[1],{set:function(){r({target:this})}})})),function(){i.forEach(function(e){return e()})}}function initObservers(e){var t=initMutationObserver(e.mutationCb,e.blockClass,e.inlineStylesheet),n=initMousemoveObserver(e.mousemoveCb),r=initMouseInteractionObserver(e.mouseInteractionCb,e.blockClass),o=initScrollObserver(e.scrollCb,e.blockClass),i=initViewportResizeObserver(e.viewportResizeCb),a=initInputObserver(e.inputCb,e.blockClass,e.ignoreClass);return function(){t.disconnect(),n(),r(),o(),i(),a()}}function wrapEvent(e){return __assign({},e,{timestamp:Date.now()})}function record(e){void 0===e&&(e={});var t,n=e.emit,r=e.checkoutEveryNms,o=e.checkoutEveryNth,i=e.blockClass,a=void 0===i?"rr-block":i,s=e.ignoreClass,u=void 0===s?"rr-ignore":s,c=e.inlineStylesheet,l=void 0===c||c;if(!n)throw new Error("emit function is required");var d=0,p=function(e,i){if(n(e,i),e.type===EventType.FullSnapshot)t=e,d=0;else if(e.type===EventType.IncrementalSnapshot){d++;var a=o&&d>=o,s=r&&e.timestamp-t.timestamp>r;(a||s)&&f(!0)}};function f(e){void 0===e&&(e=!1),p(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),e);var t=snapshot(document,a,l),n=t[0],r=t[1];if(!n)return console.warn("Failed to snapshot the document");mirror.map=r,p(wrapEvent({type:EventType.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var m=[];m.push(on("DOMContentLoaded",function(){p(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var v=function(){f(),m.push(initObservers({mutationCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))},blockClass:a,ignoreClass:u,inlineStylesheet:l}))};return"interactive"===document.readyState||"complete"===document.readyState?v():m.push(on("load",function(){p(wrapEvent({type:EventType.Load,data:{}})),v()},window)),function(){m.forEach(function(e){return e()})}}catch(e){console.warn(e)}}export default record;
var NodeType,__assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};!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"}(NodeType||(NodeType={}));var _id=1;function genId(){return _id++}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+getCssRuleString(t)},""):null}catch(e){return null}}function getCssRuleString(e){return isCSSImportRule(e)?getCssRulesString(e.styleSheet)||"":e.cssText}function isCSSImportRule(e){return"styleSheet"in e}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,DATA_URI=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,r,o){var i=n||r||o;if(!i)return e;if(!RELATIVE_PATH.test(i))return"url('"+i+"')";if(DATA_URI.test(i))return"url("+i+")";if("/"===i[0])return"url('"+(extractOrigin(t)+i)+"')";var a=t.split("/"),s=i.split("/");a.pop();for(var u=0,c=s;u<c.length;u++){var l=c[u];"."!==l&&(".."===l?a.pop():a.push(l))}return"url('"+a.join("/")+"')"})}function absoluteToDoc(e,t){var n=e.createElement("a");return n.href=t,n.href}function isSVGElement(e){return"svg"===e.tagName||e instanceof SVGElement}function serializeNode(e,t,n,r,o){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:var i=!1;"string"==typeof n?i=e.classList.contains(n):e.classList.forEach(function(e){n.test(e)&&(i=!0)});for(var a=e.tagName.toLowerCase(),s={},u=0,c=Array.from(e.attributes);u<c.length;u++){var l=c[u],d=l.name,p=l.value;s[d]="src"===d||"href"===d?absoluteToDoc(t,p):"style"===d?absoluteToStylesheet(p,location.href):p}if("link"===a&&r){var m,f=Array.from(t.styleSheets).find(function(t){return t.href===e.href});(m=getCssRulesString(f))&&(delete s.rel,delete s.href,s._cssText=absoluteToStylesheet(m,f.href))}if("style"===a&&e.sheet&&!e.innerText.trim().length)(m=getCssRulesString(e.sheet))&&(s._cssText=absoluteToStylesheet(m,location.href));if("input"===a||"textarea"===a||"select"===a){p=e.value;"radio"!==s.type&&"checkbox"!==s.type&&p?s.value=o?"*".repeat(p.length):p:e.checked&&(s.checked=e.checked)}if("option"===a){var h=e.parentElement;s.value===h.value&&(s.selected=e.selected)}if(i){var v=e.getBoundingClientRect(),y=v.width,g=v.height;s.rr_width=y+"px",s.rr_height=g+"px"}return{type:NodeType.Element,tagName:a,attributes:s,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:i};case e.TEXT_NODE:var E=e.parentNode&&e.parentNode.tagName,T=e.textContent,S="STYLE"===E||void 0;return S&&T&&(T=absoluteToStylesheet(T,location.href)),"SCRIPT"===E&&(T="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:T||"",isStyle:S};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,n,r,o,i,a){void 0===o&&(o=!1),void 0===i&&(i=!0),void 0===a&&(a=!1);var s,u=serializeNode(e,t,r,i,a);if(!u)return console.warn(e,"not serialized"),null;s="__sn"in e?e.__sn.id:genId();var c=Object.assign(u,{id:s});e.__sn=c,n[s]=e;var l=!o;if(c.type===NodeType.Element&&(l=l&&!c.needBlock,delete c.needBlock),(c.type===NodeType.Document||c.type===NodeType.Element)&&l)for(var d=0,p=Array.from(e.childNodes);d<p.length;d++){var m=serializeNodeWithId(p[d],t,n,r,o,i);m&&c.childNodes.push(m)}return c}function snapshot(e,t,n,r){void 0===t&&(t="rr-block"),void 0===n&&(n=!0),void 0===r&&(r=!1);var o={};return[serializeNodeWithId(e,e,o,t,!1,n,r),o]}function on(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var EventType,IncrementalSource,MouseInteractions,ReplayerEvents,mirror={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return mirror.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete mirror.map[t],e.childNodes&&e.childNodes.forEach(function(e){return mirror.removeNodeFromMap(e)})},has:function(e){return mirror.map.hasOwnProperty(e)}};function throttle(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){var i=Date.now();o||!1!==n.leading||(o=i);var a=t-(i-o),s=this,u=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=i,e.apply(s,u)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(s,u)},a))}}function hookSetter(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),r&&r.set&&r.set.call(this,e)}}),function(){return hookSetter(e,t,r||{})}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function isBlocked(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||isBlocked(e.parentNode,t)}return isBlocked(e.parentNode,t)}function isAncestorRemoved(e){var t=mirror.getId(e);return!mirror.has(t)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||isAncestorRemoved(e.parentNode))}function isTouchEvent(e){return Boolean(e.changedTouches)}function deepDelete(e,t){e.delete(t),t.childNodes.forEach(function(t){return deepDelete(e,t)})}function isParentRemoved(e,t){var n=t.parentNode;if(!n)return!1;var r=mirror.getId(n);return!!e.some(function(e){return e.id===r})||isParentRemoved(e,n)}function isAncestorInSet(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||isAncestorInSet(e,n))}!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"}(EventType||(EventType={})),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"}(IncrementalSource||(IncrementalSource={})),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"}(MouseInteractions||(MouseInteractions={})),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"}(ReplayerEvents||(ReplayerEvents={}));var moveKey=function(e,t){return e+"@"+t};function isINode(e){return"__sn"in e}function initMutationObserver(e,t,n,r){var o=new MutationObserver(function(o){var i=[],a=[],s=[],u=[],c=new Set,l=new Set,d=new Set,p={},m=function(e,n){if(!isBlocked(e,t)){if(isINode(e)){l.add(e);var r=null;n&&isINode(n)&&(r=n.__sn.id),r&&(p[moveKey(e.__sn.id,r)]=!0)}else c.add(e),d.delete(e);e.childNodes.forEach(function(e){return m(e)})}};o.forEach(function(e){var n=e.type,r=e.target,o=e.oldValue,u=e.addedNodes,f=e.removedNodes,h=e.attributeName;switch(n){case"characterData":var v=r.textContent;isBlocked(r,t)||v===o||i.push({value:v,node:r});break;case"attributes":v=r.getAttribute(h);if(isBlocked(r,t)||v===o)return;var y=a.find(function(e){return e.node===r});y||(y={node:r,attributes:{}},a.push(y)),y.attributes[h]=v;break;case"childList":u.forEach(function(e){return m(e,r)}),f.forEach(function(e){var n=mirror.getId(e),o=mirror.getId(r);isBlocked(e,t)||(c.has(e)?(deepDelete(c,e),d.add(e)):c.has(r)&&-1===n||isAncestorRemoved(r)||(l.has(e)&&p[moveKey(n,o)]?deepDelete(l,e):s.push({parentId:o,id:n})),mirror.removeNodeFromMap(e))})}});var f=[],h=function(e){var o=mirror.getId(e.parentNode);if(-1===o)return f.push(e);u.push({parentId:o,previousId:e.previousSibling?mirror.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?mirror.getId(e.nextSibling):e.nextSibling,node:serializeNodeWithId(e,document,mirror.map,t,!0,n,r)})};for(Array.from(l).forEach(h),Array.from(c).forEach(function(e){isAncestorInSet(d,e)||isParentRemoved(s,e)?isAncestorInSet(l,e)?h(e):d.add(e):h(e)});f.length&&!f.every(function(e){return-1===mirror.getId(e.parentNode)});)h(f.shift());var v={texts:i.map(function(e){return{id:mirror.getId(e.node),value:e.value}}).filter(function(e){return mirror.has(e.id)}),attributes:a.map(function(e){return{id:mirror.getId(e.node),attributes:e.attributes}}).filter(function(e){return mirror.has(e.id)}),removes:s,adds:u};(v.texts.length||v.attributes.length||v.removes.length||v.adds.length)&&e(v)});return o.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),o}function initMoveObserver(e){var t,n=[],r=throttle(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500),o=throttle(function(e){var o=e.target,i=isTouchEvent(e)?e.changedTouches[0]:e,a=i.clientX,s=i.clientY;t||(t=Date.now()),n.push({x:a,y:s,id:mirror.getId(o),timeOffset:Date.now()-t}),r()},50,{trailing:!1}),i=[on("mousemove",o),on("touchmove",o)];return function(){i.forEach(function(e){return e()})}}function initMouseInteractionObserver(e,t){var n=[];return Object.keys(MouseInteractions).filter(function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")}).forEach(function(r){var o=r.toLowerCase(),i=function(n){return function(r){if(!isBlocked(r.target,t)){var o=mirror.getId(r.target),i=isTouchEvent(r)?r.changedTouches[0]:r,a=i.clientX,s=i.clientY;e({type:MouseInteractions[n],id:o,x:a,y:s})}}}(r);n.push(on(o,i))}),function(){n.forEach(function(e){return e()})}}function initScrollObserver(e,t){return on("scroll",throttle(function(n){if(n.target&&!isBlocked(n.target,t)){var r=mirror.getId(n.target);if(n.target===document){var o=document.scrollingElement||document.documentElement;e({id:r,x:o.scrollLeft,y:o.scrollTop})}else e({id:r,x:n.target.scrollLeft,y:n.target.scrollTop})}},100))}function initViewportResizeObserver(e){return on("resize",throttle(function(){var t=getWindowHeight(),n=getWindowWidth();e({width:Number(n),height:Number(t)})},200),window)}var INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],MASK_TYPES=["color","date","datetime-local","email","month","number","range","search","tel","text","time","url","week"],lastInputValueMap=new WeakMap;function initInputObserver(e,t,n,r){function o(e){var o=e.target;if(o&&o.tagName&&!(INPUT_TAGS.indexOf(o.tagName)<0)&&!isBlocked(o,t)){var a=o.type;if("password"!==a&&!o.classList.contains(n)){var s=o.value,u=!1,c=MASK_TYPES.includes(a)||"TEXTAREA"===o.tagName;"radio"===a||"checkbox"===a?u=o.checked:c&&r&&(s="*".repeat(s.length)),i(o,{text:s,isChecked:u});var l=o.name;"radio"===a&&l&&u&&document.querySelectorAll('input[type="radio"][name="'+l+'"]').forEach(function(e){e!==o&&i(e,{text:e.value,isChecked:!u})})}}}function i(t,n){var r=lastInputValueMap.get(t);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){lastInputValueMap.set(t,n);var o=mirror.getId(t);e(__assign({},n,{id:o}))}}var a=["input","change"].map(function(e){return on(e,o)}),s=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),u=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]];return s&&s.set&&a.push.apply(a,u.map(function(e){return hookSetter(e[0],e[1],{set:function(){o({target:this})}})})),function(){a.forEach(function(e){return e()})}}function initObservers(e){var t=initMutationObserver(e.mutationCb,e.blockClass,e.inlineStylesheet,e.maskAllInputs),n=initMoveObserver(e.mousemoveCb),r=initMouseInteractionObserver(e.mouseInteractionCb,e.blockClass),o=initScrollObserver(e.scrollCb,e.blockClass),i=initViewportResizeObserver(e.viewportResizeCb),a=initInputObserver(e.inputCb,e.blockClass,e.ignoreClass,e.maskAllInputs);return function(){t.disconnect(),n(),r(),o(),i(),a()}}function wrapEvent(e){return __assign({},e,{timestamp:Date.now()})}function record(e){void 0===e&&(e={});var t,n=e.emit,r=e.checkoutEveryNms,o=e.checkoutEveryNth,i=e.blockClass,a=void 0===i?"rr-block":i,s=e.ignoreClass,u=void 0===s?"rr-ignore":s,c=e.inlineStylesheet,l=void 0===c||c,d=e.maskAllInputs,p=void 0!==d&&d;if(!n)throw new Error("emit function is required");var m=0,f=function(e,i){if(n(e,i),e.type===EventType.FullSnapshot)t=e,m=0;else if(e.type===EventType.IncrementalSnapshot){m++;var a=o&&m>=o,s=r&&e.timestamp-t.timestamp>r;(a||s)&&h(!0)}};function h(e){void 0===e&&(e=!1),f(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),e);var t=snapshot(document,a,l,p),n=t[0],r=t[1];if(!n)return console.warn("Failed to snapshot the document");mirror.map=r,f(wrapEvent({type:EventType.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var v=[];v.push(on("DOMContentLoaded",function(){f(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var y=function(){h(),v.push(initObservers({mutationCb:function(e){return f(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return f(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return f(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return f(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return f(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return f(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))},blockClass:a,ignoreClass:u,maskAllInputs:p,inlineStylesheet:l}))};return"interactive"===document.readyState||"complete"===document.readyState?y():v.push(on("load",function(){f(wrapEvent({type:EventType.Load,data:{}})),y()},window)),function(){v.forEach(function(e){return e()})}}catch(e){console.warn(e)}}export default record;
//# sourceMappingURL=rrweb-record.min.js.map

@@ -1,2 +0,2 @@

var NodeType,__assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};!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"}(NodeType||(NodeType={}));var _id=1;function genId(){return _id++}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+getCssRuleString(t)},""):null}catch(e){return null}}function getCssRuleString(e){return isCSSImportRule(e)?getCssRulesString(e.styleSheet)||"":e.cssText}function isCSSImportRule(e){return"styleSheet"in e}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,DATA_URI=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,r,o){var i=n||r||o;if(!i)return e;if(!RELATIVE_PATH.test(i))return"url('"+i+"')";if(DATA_URI.test(i))return"url("+i+")";if("/"===i[0])return"url('"+(extractOrigin(t)+i)+"')";var s=t.split("/"),a=i.split("/");s.pop();for(var l=0,c=a;l<c.length;l++){var u=c[l];"."!==u&&(".."===u?s.pop():s.push(u))}return"url('"+s.join("/")+"')"})}function absoluteToDoc(e,t){var n=e.createElement("a");return n.href=t,n.href}function isSVGElement(e){return"svg"===e.tagName||e instanceof SVGElement}function serializeNode(e,t,n,r){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:var o=!1;"string"==typeof n?o=e.classList.contains(n):e.classList.forEach(function(e){n.test(e)&&(o=!0)});for(var i=e.tagName.toLowerCase(),s={},a=0,l=Array.from(e.attributes);a<l.length;a++){var c=l[a],u=c.name,d=c.value;s[u]="src"===u||"href"===u?absoluteToDoc(t,d):"style"===u?absoluteToStylesheet(d,location.href):d}if("link"===i&&r){var p,f=Array.from(t.styleSheets).find(function(t){return t.href===e.href});(p=getCssRulesString(f))&&(delete s.rel,delete s.href,s._cssText=absoluteToStylesheet(p,f.href))}if("style"===i&&e.sheet&&!e.innerText.trim().length)(p=getCssRulesString(e.sheet))&&(s._cssText=absoluteToStylesheet(p,location.href));if("input"===i||"textarea"===i||"select"===i){d=e.value;"radio"!==s.type&&"checkbox"!==s.type&&d?s.value=d:e.checked&&(s.checked=e.checked)}if("option"===i){var m=e.parentElement;s.value===m.value&&(s.selected=e.selected)}if(o){var h=e.getBoundingClientRect(),v=h.width,y=h.height;s.rr_width=v+"px",s.rr_height=y+"px"}return{type:NodeType.Element,tagName:i,attributes:s,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:o};case e.TEXT_NODE:var g=e.parentNode&&e.parentNode.tagName,b=e.textContent,E="STYLE"===g||void 0;return E&&b&&(b=absoluteToStylesheet(b,location.href)),"SCRIPT"===g&&(b="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:b||"",isStyle:E};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,n,r,o,i){void 0===o&&(o=!1),void 0===i&&(i=!0);var s,a=serializeNode(e,t,r,i);if(!a)return console.warn(e,"not serialized"),null;s="__sn"in e?e.__sn.id:genId();var l=Object.assign(a,{id:s});e.__sn=l,n[s]=e;var c=!o;if(l.type===NodeType.Element&&(c=c&&!l.needBlock,delete l.needBlock),(l.type===NodeType.Document||l.type===NodeType.Element)&&c)for(var u=0,d=Array.from(e.childNodes);u<d.length;u++){var p=serializeNodeWithId(d[u],t,n,r,o,i);p&&l.childNodes.push(p)}return l}function snapshot(e,t,n){void 0===t&&(t="rr-block"),void 0===n&&(n=!0);var r={};return[serializeNodeWithId(e,e,r,t,!1,n),r]}var tagMap={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function getTagName(e){var t=tagMap[e.tagName]?tagMap[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}var CSS_SELECTOR=/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,HOVER_SELECTOR=/([^\\]):hover/g;function addHoverClass(e){return e.replace(CSS_SELECTOR,function(e,t,n){if(HOVER_SELECTOR.test(t)){var r=t.replace(HOVER_SELECTOR,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+r.replace(/^\s*/,"")+n}return e})}function buildNode(e,t){switch(e.type){case NodeType.Document:return t.implementation.createDocument(null,"",null);case NodeType.DocumentType:return t.implementation.createDocumentType(e.name,e.publicId,e.systemId);case NodeType.Element:var n=getTagName(e),r=void 0;for(var o in r=e.isSVG?t.createElementNS("http://www.w3.org/2000/svg",n):t.createElement(n),e.attributes)if(e.attributes.hasOwnProperty(o)&&!o.startsWith("rr_")){var i=e.attributes[o];i="boolean"==typeof i?"":i;var s="textarea"===n&&"value"===o,a="style"===n&&"_cssText"===o;if(a&&(i=addHoverClass(i)),s||a){var l=t.createTextNode(i);r.appendChild(l);continue}if("iframe"===n&&"src"===o)continue;try{e.isSVG&&"xlink:href"===o?r.setAttributeNS("http://www.w3.org/1999/xlink",o,i):r.setAttribute(o,i)}catch(e){}}else e.attributes.rr_width&&(r.style.width=e.attributes.rr_width),e.attributes.rr_height&&(r.style.height=e.attributes.rr_height);return r;case NodeType.Text:return t.createTextNode(e.isStyle?addHoverClass(e.textContent):e.textContent);case NodeType.CDATA:return t.createCDATASection(e.textContent);case NodeType.Comment:return t.createComment(e.textContent);default:return null}}function buildNodeWithSN(e,t,n,r){void 0===r&&(r=!1);var o=buildNode(e,t);if(!o)return null;if(e.type===NodeType.Document&&(t.close(),t.open(),o=t),o.__sn=e,n[e.id]=o,(e.type===NodeType.Document||e.type===NodeType.Element)&&!r)for(var i=0,s=e.childNodes;i<s.length;i++){var a=s[i],l=buildNodeWithSN(a,t,n);l?o.appendChild(l):console.warn("Failed to rebuild",a)}return o}function rebuild(e,t){var n={};return[buildNodeWithSN(e,t,n),n]}function on(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var EventType,IncrementalSource,MouseInteractions,ReplayerEvents,mirror={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return mirror.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete mirror.map[t],e.childNodes&&e.childNodes.forEach(function(e){return mirror.removeNodeFromMap(e)})},has:function(e){return mirror.map.hasOwnProperty(e)}};function throttle(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){var i=Date.now();o||!1!==n.leading||(o=i);var s=t-(i-o),a=this,l=arguments;s<=0||s>t?(r&&(window.clearTimeout(r),r=null),o=i,e.apply(a,l)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(a,l)},s))}}function hookSetter(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),r&&r.set&&r.set.call(this,e)}}),function(){return hookSetter(e,t,r||{})}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function isBlocked(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||isBlocked(e.parentNode,t)}return isBlocked(e.parentNode,t)}function isAncestorRemoved(e){var t=mirror.getId(e);return!mirror.has(t)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||isAncestorRemoved(e.parentNode))}function deepDelete(e,t){e.delete(t),t.childNodes.forEach(function(t){return deepDelete(e,t)})}function isParentRemoved(e,t){var n=t.parentNode;if(!n)return!1;var r=mirror.getId(n);return!!e.some(function(e){return e.id===r})||isParentRemoved(e,n)}function isAncestorInSet(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||isAncestorInSet(e,n))}!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"}(EventType||(EventType={})),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"}(IncrementalSource||(IncrementalSource={})),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=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(MouseInteractions||(MouseInteractions={})),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"}(ReplayerEvents||(ReplayerEvents={}));var moveKey=function(e,t){return e+"@"+t};function isINode(e){return"__sn"in e}function initMutationObserver(e,t,n){var r=new MutationObserver(function(r){var o=[],i=[],s=[],a=[],l=new Set,c=new Set,u=new Set,d={},p=function(e,n){if(!isBlocked(e,t)){if(isINode(e)){c.add(e);var r=null;n&&isINode(n)&&(r=n.__sn.id),r&&(d[moveKey(e.__sn.id,r)]=!0)}else l.add(e),u.delete(e);e.childNodes.forEach(function(e){return p(e)})}};r.forEach(function(e){var n=e.type,r=e.target,a=e.oldValue,f=e.addedNodes,m=e.removedNodes,h=e.attributeName;switch(n){case"characterData":var v=r.textContent;isBlocked(r,t)||v===a||o.push({value:v,node:r});break;case"attributes":v=r.getAttribute(h);if(isBlocked(r,t)||v===a)return;var y=i.find(function(e){return e.node===r});y||(y={node:r,attributes:{}},i.push(y)),y.attributes[h]=v;break;case"childList":f.forEach(function(e){return p(e,r)}),m.forEach(function(e){var n=mirror.getId(e),o=mirror.getId(r);isBlocked(e,t)||(l.has(e)?(deepDelete(l,e),u.add(e)):l.has(r)&&-1===n||isAncestorRemoved(r)||(c.has(e)&&d[moveKey(n,o)]?deepDelete(c,e):s.push({parentId:o,id:n})),mirror.removeNodeFromMap(e))})}});var f=[],m=function(e){var r=mirror.getId(e.parentNode);if(-1===r)return f.push(e);a.push({parentId:r,previousId:e.previousSibling?mirror.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?mirror.getId(e.nextSibling):e.nextSibling,node:serializeNodeWithId(e,document,mirror.map,t,!0,n)})};for(Array.from(c).forEach(m),Array.from(l).forEach(function(e){isAncestorInSet(u,e)||isParentRemoved(s,e)?isAncestorInSet(c,e)?m(e):u.add(e):m(e)});f.length&&!f.every(function(e){return-1===mirror.getId(e.parentNode)});)m(f.shift());var h={texts:o.map(function(e){return{id:mirror.getId(e.node),value:e.value}}).filter(function(e){return mirror.has(e.id)}),attributes:i.map(function(e){return{id:mirror.getId(e.node),attributes:e.attributes}}).filter(function(e){return mirror.has(e.id)}),removes:s,adds:a};(h.texts.length||h.attributes.length||h.removes.length||h.adds.length)&&e(h)});return r.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function initMousemoveObserver(e){var t,n=[],r=throttle(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return on("mousemove",throttle(function(e){var o=e.clientX,i=e.clientY,s=e.target;t||(t=Date.now()),n.push({x:o,y:i,id:mirror.getId(s),timeOffset:Date.now()-t}),r()},50,{trailing:!1}))}function initMouseInteractionObserver(e,t){var n=[];return Object.keys(MouseInteractions).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(r){var o=r.toLowerCase(),i=function(n){return function(r){if(!isBlocked(r.target,t)){var o=mirror.getId(r.target),i=r.clientX,s=r.clientY;e({type:MouseInteractions[n],id:o,x:i,y:s})}}}(r);n.push(on(o,i))}),function(){n.forEach(function(e){return e()})}}function initScrollObserver(e,t){return on("scroll",throttle(function(n){if(n.target&&!isBlocked(n.target,t)){var r=mirror.getId(n.target);if(n.target===document){var o=document.scrollingElement||document.documentElement;e({id:r,x:o.scrollLeft,y:o.scrollTop})}else e({id:r,x:n.target.scrollLeft,y:n.target.scrollTop})}},100))}function initViewportResizeObserver(e){return on("resize",throttle(function(){var t=getWindowHeight(),n=getWindowWidth();e({width:Number(n),height:Number(t)})},200),window)}var INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],lastInputValueMap=new WeakMap;function initInputObserver(e,t,n){function r(e){var r=e.target;if(r&&r.tagName&&!(INPUT_TAGS.indexOf(r.tagName)<0)&&!isBlocked(r,t)){var i=r.type;if("password"!==i&&!r.classList.contains(n)){var s=r.value,a=!1;"radio"!==i&&"checkbox"!==i||(a=r.checked),o(r,{text:s,isChecked:a});var l=r.name;"radio"===i&&l&&a&&document.querySelectorAll('input[type="radio"][name="'+l+'"]').forEach(function(e){e!==r&&o(e,{text:e.value,isChecked:!a})})}}}function o(t,n){var r=lastInputValueMap.get(t);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){lastInputValueMap.set(t,n);var o=mirror.getId(t);e(__assign({},n,{id:o}))}}var i=["input","change"].map(function(e){return on(e,r)}),s=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),a=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]];return s&&s.set&&i.push.apply(i,a.map(function(e){return hookSetter(e[0],e[1],{set:function(){r({target:this})}})})),function(){i.forEach(function(e){return e()})}}function initObservers(e){var t=initMutationObserver(e.mutationCb,e.blockClass,e.inlineStylesheet),n=initMousemoveObserver(e.mousemoveCb),r=initMouseInteractionObserver(e.mouseInteractionCb,e.blockClass),o=initScrollObserver(e.scrollCb,e.blockClass),i=initViewportResizeObserver(e.viewportResizeCb),s=initInputObserver(e.inputCb,e.blockClass,e.ignoreClass);return function(){t.disconnect(),n(),r(),o(),i(),s()}}function wrapEvent(e){return __assign({},e,{timestamp:Date.now()})}function record(e){void 0===e&&(e={});var t,n=e.emit,r=e.checkoutEveryNms,o=e.checkoutEveryNth,i=e.blockClass,s=void 0===i?"rr-block":i,a=e.ignoreClass,l=void 0===a?"rr-ignore":a,c=e.inlineStylesheet,u=void 0===c||c;if(!n)throw new Error("emit function is required");var d=0,p=function(e,i){if(n(e,i),e.type===EventType.FullSnapshot)t=e,d=0;else if(e.type===EventType.IncrementalSnapshot){d++;var s=o&&d>=o,a=r&&e.timestamp-t.timestamp>r;(s||a)&&f(!0)}};function f(e){void 0===e&&(e=!1),p(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),e);var t=snapshot(document,s,u),n=t[0],r=t[1];if(!n)return console.warn("Failed to snapshot the document");mirror.map=r,p(wrapEvent({type:EventType.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var m=[];m.push(on("DOMContentLoaded",function(){p(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var h=function(){f(),m.push(initObservers({mutationCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))},blockClass:s,ignoreClass:l,inlineStylesheet:u}))};return"interactive"===document.readyState||"complete"===document.readyState?h():m.push(on("load",function(){p(wrapEvent({type:EventType.Load,data:{}})),h()},window)),function(){m.forEach(function(e){return e()})}}catch(e){console.warn(e)}}function mitt(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map(function(e){e(n)}),(e["*"]||[]).slice().map(function(e){e(t,n)})}}}var mittProxy=Object.freeze({default:mitt});function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var smoothscroll=createCommonjsModule(function(e,t){!function(){e.exports={polyfill:function(){var e=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)){var n,r=e.HTMLElement||e.Element,o=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||l,scrollIntoView:r.prototype.scrollIntoView},s=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?m.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(c(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):m.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==c(arguments[0])){var e=arguments[0].left,t=arguments[0].top;m.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==c(arguments[0])){var n=function(e){for(;e!==t.body&&!1===p(e);)e=e.parentNode||e.host;return e}(this),r=n.getBoundingClientRect(),o=this.getBoundingClientRect();n!==t.body?(m.call(this,n,n.scrollLeft+o.left-r.left,n.scrollTop+o.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function l(e,t){this.scrollLeft=e,this.scrollTop=t}function c(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function u(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function d(t,n){var r=e.getComputedStyle(t,null)["overflow"+n];return"auto"===r||"scroll"===r}function p(e){var t=u(e,"Y")&&d(e,"Y"),n=u(e,"X")&&d(e,"X");return t||n}function f(t){var n,r,i,a,l=(s()-t.startTime)/o;a=l=l>1?1:l,n=.5*(1-Math.cos(Math.PI*a)),r=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,r,i),r===t.x&&i===t.y||e.requestAnimationFrame(f.bind(e,t))}function m(n,r,o){var a,c,u,d,p=s();n===t.body?(a=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(a=n,c=n.scrollLeft,u=n.scrollTop,d=l),f({scrollable:a,method:d,startTime:p,startX:c,startY:u,x:r,y:o})}}}}()}),smoothscroll_1=smoothscroll.polyfill,Timer=function(){function e(e,t){void 0===t&&(t=[]),this.timeOffset=0,this.actions=t,this.config=e}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,e)},e.prototype.start=function(){this.actions.sort(function(e,t){return e.delay-t.delay}),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this.config,r=this;this.raf=requestAnimationFrame(function o(i){for(r.timeOffset+=(i-e)*n.speed,e=i;t.length;){var s=t[0];if(!(r.timeOffset>=s.delay))break;t.shift(),s.doAction()}(t.length>0||r.config.liveMode)&&(r.raf=requestAnimationFrame(o))})},e.prototype.clear=function(){this.raf&&cancelAnimationFrame(this.raf),this.actions.length=0},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var r=Math.floor((t+n)/2);if(this.actions[r].delay<e.delay)t=r+1;else{if(!(this.actions[r].delay>e.delay))return r;n=r-1}}return t},e}(),rules=function(e){return["iframe, ."+e+" { background: #ccc }","noscript { display: none !important; }"]},SKIP_TIME_THRESHOLD=1e4,SKIP_TIME_INTERVAL=5e3,mitt$1=mitt||mittProxy,REPLAY_CONSOLE_PREFIX="[replayer]",Replayer=function(){function e(e,t){if(this.events=[],this.emitter=mitt$1(),this.baselineTime=0,this.noramlSpeed=-1,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this);var n={speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1};this.config=Object.assign({},n,t),this.timer=new Timer(this.config),smoothscroll_1(),this.setupDom(),this.emitter.on("resize",this.handleResize)}return e.prototype.on=function(e,t){this.emitter.on(e,t)},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach(function(n){t.config[n]=e[n]}),this.config.skipInactive||(this.noramlSpeed=-1)},e.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.timestamp}},e.prototype.getTimeOffset=function(){return this.baselineTime-this.events[0].timestamp},e.prototype.play=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,r=this.events;n<r.length;n++){var o=r[n],i=o.timestamp<this.baselineTime,s=this.getCastFn(o,i);i?s():t.push({doAction:s,delay:this.getDelay(o)})}this.timer.addActions(t),this.timer.start(),this.emitter.emit(ReplayerEvents.Start)},e.prototype.pause=function(){this.timer.clear(),this.emitter.emit(ReplayerEvents.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,r=this.events;n<r.length;n++){var o=r[n];if(!(o.timestamp<=this.lastPlayedEvent.timestamp||o===this.lastPlayedEvent)){var i=this.getCastFn(o);t.push({doAction:i,delay:this.getDelay(o)})}}this.timer.addActions(t),this.timer.start(),this.emitter.emit(ReplayerEvents.Resume)},e.prototype.addEvent=function(e){this.getCastFn(e,!0)()},e.prototype.setupDom=function(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin"),this.iframe.setAttribute("scrolling","no"),this.wrapper.appendChild(this.iframe)},e.prototype.handleResize=function(e){this.iframe.width=e.width+"px",this.iframe.height=e.height+"px"},e.prototype.getDelay=function(e){if(e.type===EventType.IncrementalSnapshot&&e.data.source===IncrementalSource.MouseMove){var t=e.data.positions[0].timeOffset,n=e.timestamp+t;return e.delay=n-this.baselineTime,n-this.baselineTime}return e.delay=e.timestamp-this.baselineTime,e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,r=this;switch(void 0===t&&(t=!1),e.type){case EventType.DomContentLoaded:case EventType.Load:break;case EventType.Meta:n=function(){return r.emitter.emit(ReplayerEvents.Resize,{width:e.data.width,height:e.data.height})};break;case EventType.FullSnapshot:n=function(){r.rebuildFullSnapshot(e),r.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case EventType.IncrementalSnapshot:n=function(){if(r.applyIncremental(e,t),e===r.nextUserInteractionEvent&&(r.nextUserInteractionEvent=null,r.restoreSpeed()),r.config.skipInactive&&!r.nextUserInteractionEvent){for(var n=0,o=r.events;n<o.length;n++){var i=o[n];if(!(i.timestamp<=e.timestamp)&&r.isUserInteraction(i)){i.delay-e.delay>SKIP_TIME_THRESHOLD*r.config.speed&&(r.nextUserInteractionEvent=i);break}}if(r.nextUserInteractionEvent){r.noramlSpeed=r.config.speed;var s=r.nextUserInteractionEvent.delay-e.delay,a={speed:Math.min(Math.round(s/SKIP_TIME_INTERVAL),360)};r.setConfig(a),r.emitter.emit(ReplayerEvents.SkipStart,a)}}}}return function(){n&&n(),r.lastPlayedEvent=e,e===r.events[r.events.length-1]&&(r.restoreSpeed(),r.emitter.emit(ReplayerEvents.Finish))}},e.prototype.rebuildFullSnapshot=function(e){Object.keys(this.missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.missingNodeRetryMap),this.missingNodeRetryMap={},mirror.map=rebuild(e.data.node,this.iframe.contentDocument)[1];var t=document.createElement("style"),n=this.iframe.contentDocument,r=n.documentElement,o=n.head;r.insertBefore(t,o);for(var i=rules(this.config.blockClass),s=0;s<i.length;s++)t.sheet.insertRule(i[s],s);this.emitter.emit(ReplayerEvents.FullsnapshotRebuilded),this.waitForStylesheetLoad()},e.prototype.waitForStylesheetLoad=function(){var e=this,t=this.iframe.contentDocument.head;if(t){var n,r=new Set;t.querySelectorAll('link[rel="stylesheet"]').forEach(function(t){t.sheet||(0===r.size&&(e.pause(),e.emitter.emit(ReplayerEvents.LoadStylesheetStart),n=window.setTimeout(function(){e.resume(e.timer.timeOffset),n=-1},e.config.loadTimeout)),r.add(t),t.addEventListener("load",function(){r.delete(t),0===r.size&&-1!==n&&(e.resume(e.timer.timeOffset),e.emitter.emit(ReplayerEvents.LoadStylesheetEnd),n&&window.clearTimeout(n))}))})}},e.prototype.applyIncremental=function(e,t){var n=this,r=e.data;switch(r.source){case IncrementalSource.Mutation:r.removes.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(r,e.id);var o=mirror.getNode(e.parentId);if(!o)return n.warnNodeNotFound(r,e.parentId);mirror.removeNodeFromMap(t),o&&o.removeChild(t)});var o=__assign({},this.missingNodeRetryMap),i=[],s=function(e){var t=mirror.getNode(e.parentId);if(!t)return i.push(e);var r=buildNodeWithSN(e.node,n.iframe.contentDocument,mirror.map,!0),s=null,a=null;e.previousId&&(s=mirror.getNode(e.previousId)),e.nextId&&(a=mirror.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(s&&s.nextSibling&&s.nextSibling.parentNode?t.insertBefore(r,s.nextSibling):a&&a.parentNode?t.insertBefore(r,a):t.appendChild(r),(e.previousId||e.nextId)&&n.resolveMissingNode(o,t,r,e)):o[e.node.id]={node:r,mutation:e}};for(r.adds.forEach(function(e){s(e)});i.length;){if(i.every(function(e){return!Boolean(mirror.getNode(e.parentId))}))return i.forEach(function(e){return n.warnNodeNotFound(r,e.node.id)});var a=i.shift();s(a)}Object.keys(o).length&&Object.assign(this.missingNodeRetryMap,o),r.texts.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(r,e.id);t.textContent=e.value}),r.attributes.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(r,e.id);for(var o in e.attributes)if("string"==typeof o){var i=e.attributes[o];null!==i?t.setAttribute(o,i):t.removeAttribute(o)}});break;case IncrementalSource.MouseMove:if(t){var l=r.positions[r.positions.length-1];this.moveAndHover(r,l.x,l.y,l.id)}else r.positions.forEach(function(t){var o={doAction:function(){n.moveAndHover(r,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-n.baselineTime};n.timer.addAction(o)});break;case IncrementalSource.MouseInteraction:if(-1===r.id)break;var c=new Event(MouseInteractions[r.type].toLowerCase());if(!(u=mirror.getNode(r.id)))return this.debugNodeNotFound(r,r.id);switch(this.emitter.emit(ReplayerEvents.MouseInteraction,{type:r.type,target:u}),r.type){case MouseInteractions.Blur:u.blur&&u.blur();break;case MouseInteractions.Focus:u.focus&&u.focus({preventScroll:!0});break;case MouseInteractions.Click:t||(this.moveAndHover(r,r.x,r.y,r.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:u.dispatchEvent(c)}break;case IncrementalSource.Scroll:if(-1===r.id)break;if(!(u=mirror.getNode(r.id)))return this.debugNodeNotFound(r,r.id);if(u===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:r.y,left:r.x,behavior:t?"auto":"smooth"});else try{u.scrollTop=r.y,u.scrollLeft=r.x}catch(e){}break;case IncrementalSource.ViewportResize:this.emitter.emit(ReplayerEvents.Resize,{width:r.width,height:r.height});break;case IncrementalSource.Input:if(-1===r.id)break;var u;if(!(u=mirror.getNode(r.id)))return this.debugNodeNotFound(r,r.id);try{u.checked=r.isChecked,u.value=r.text}catch(e){}}},e.prototype.resolveMissingNode=function(e,t,n,r){var o=r.previousId,i=r.nextId,s=o&&e[o],a=i&&e[i];if(s){var l=s,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}if(a){var d=a;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,n,r){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px";var o=mirror.getNode(r);if(!o)return this.debugNodeNotFound(e,r);this.hoverElements(o)},e.prototype.hoverElements=function(e){this.iframe.contentDocument.querySelectorAll(".\\:hover").forEach(function(e){e.classList.remove(":hover")});for(var t=e;t;)t.classList.add(":hover"),t=t.parentElement},e.prototype.isUserInteraction=function(e){return e.type===EventType.IncrementalSnapshot&&(e.data.source>IncrementalSource.Mutation&&e.data.source<=IncrementalSource.Input)},e.prototype.restoreSpeed=function(){if(-1!==this.noramlSpeed){var e={speed:this.noramlSpeed};this.setConfig(e),this.emitter.emit(ReplayerEvents.SkipEnd,e),this.noramlSpeed=-1}},e.prototype.warnNodeNotFound=function(e,t){this.config.showWarning&&console.warn(REPLAY_CONSOLE_PREFIX,"Node with id '"+t+"' not found in",e)},e.prototype.debugNodeNotFound=function(e,t){this.config.showDebug&&console.log(REPLAY_CONSOLE_PREFIX,"Node with id '"+t+"' not found in",e)},e}();export{record,Replayer,mirror,EventType,IncrementalSource,MouseInteractions,ReplayerEvents};
var NodeType,__assign=function(){return(__assign=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(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"}(NodeType||(NodeType={}));var _id=1;function genId(){return _id++}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+getCssRuleString(t)},""):null}catch(e){return null}}function getCssRuleString(e){return isCSSImportRule(e)?getCssRulesString(e.styleSheet)||"":e.cssText}function isCSSImportRule(e){return"styleSheet"in e}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,DATA_URI=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,o,r){var i=n||o||r;if(!i)return e;if(!RELATIVE_PATH.test(i))return"url('"+i+"')";if(DATA_URI.test(i))return"url("+i+")";if("/"===i[0])return"url('"+(extractOrigin(t)+i)+"')";var s=t.split("/"),a=i.split("/");s.pop();for(var l=0,c=a;l<c.length;l++){var u=c[l];"."!==u&&(".."===u?s.pop():s.push(u))}return"url('"+s.join("/")+"')"})}function absoluteToDoc(e,t){var n=e.createElement("a");return n.href=t,n.href}function isSVGElement(e){return"svg"===e.tagName||e instanceof SVGElement}function serializeNode(e,t,n,o,r){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:var i=!1;"string"==typeof n?i=e.classList.contains(n):e.classList.forEach(function(e){n.test(e)&&(i=!0)});for(var s=e.tagName.toLowerCase(),a={},l=0,c=Array.from(e.attributes);l<c.length;l++){var u=c[l],d=u.name,p=u.value;a[d]="src"===d||"href"===d?absoluteToDoc(t,p):"style"===d?absoluteToStylesheet(p,location.href):p}if("link"===s&&o){var f,h=Array.from(t.styleSheets).find(function(t){return t.href===e.href});(f=getCssRulesString(h))&&(delete a.rel,delete a.href,a._cssText=absoluteToStylesheet(f,h.href))}if("style"===s&&e.sheet&&!e.innerText.trim().length)(f=getCssRulesString(e.sheet))&&(a._cssText=absoluteToStylesheet(f,location.href));if("input"===s||"textarea"===s||"select"===s){p=e.value;"radio"!==a.type&&"checkbox"!==a.type&&p?a.value=r?"*".repeat(p.length):p:e.checked&&(a.checked=e.checked)}if("option"===s){var m=e.parentElement;a.value===m.value&&(a.selected=e.selected)}if(i){var v=e.getBoundingClientRect(),y=v.width,g=v.height;a.rr_width=y+"px",a.rr_height=g+"px"}return{type:NodeType.Element,tagName:s,attributes:a,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:i};case e.TEXT_NODE:var E=e.parentNode&&e.parentNode.tagName,b=e.textContent,T="STYLE"===E||void 0;return T&&b&&(b=absoluteToStylesheet(b,location.href)),"SCRIPT"===E&&(b="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:b||"",isStyle:T};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,n,o,r,i,s){void 0===r&&(r=!1),void 0===i&&(i=!0),void 0===s&&(s=!1);var a,l=serializeNode(e,t,o,i,s);if(!l)return console.warn(e,"not serialized"),null;a="__sn"in e?e.__sn.id:genId();var c=Object.assign(l,{id:a});e.__sn=c,n[a]=e;var u=!r;if(c.type===NodeType.Element&&(u=u&&!c.needBlock,delete c.needBlock),(c.type===NodeType.Document||c.type===NodeType.Element)&&u)for(var d=0,p=Array.from(e.childNodes);d<p.length;d++){var f=serializeNodeWithId(p[d],t,n,o,r,i);f&&c.childNodes.push(f)}return c}function snapshot(e,t,n,o){void 0===t&&(t="rr-block"),void 0===n&&(n=!0),void 0===o&&(o=!1);var r={};return[serializeNodeWithId(e,e,r,t,!1,n,o),r]}var tagMap={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function getTagName(e){var t=tagMap[e.tagName]?tagMap[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}var CSS_SELECTOR=/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,HOVER_SELECTOR=/([^\\]):hover/g;function addHoverClass(e){return e.replace(CSS_SELECTOR,function(e,t,n){if(HOVER_SELECTOR.test(t)){var o=t.replace(HOVER_SELECTOR,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+o.replace(/^\s*/,"")+n}return e})}function buildNode(e,t){switch(e.type){case NodeType.Document:return t.implementation.createDocument(null,"",null);case NodeType.DocumentType:return t.implementation.createDocumentType(e.name,e.publicId,e.systemId);case NodeType.Element:var n=getTagName(e),o=void 0;for(var r in o=e.isSVG?t.createElementNS("http://www.w3.org/2000/svg",n):t.createElement(n),e.attributes)if(e.attributes.hasOwnProperty(r)&&!r.startsWith("rr_")){var i=e.attributes[r];i="boolean"==typeof i?"":i;var s="textarea"===n&&"value"===r,a="style"===n&&"_cssText"===r;if(a&&(i=addHoverClass(i)),s||a){var l=t.createTextNode(i);o.appendChild(l);continue}if("iframe"===n&&"src"===r)continue;try{e.isSVG&&"xlink:href"===r?o.setAttributeNS("http://www.w3.org/1999/xlink",r,i):o.setAttribute(r,i)}catch(e){}}else e.attributes.rr_width&&(o.style.width=e.attributes.rr_width),e.attributes.rr_height&&(o.style.height=e.attributes.rr_height);return o;case NodeType.Text:return t.createTextNode(e.isStyle?addHoverClass(e.textContent):e.textContent);case NodeType.CDATA:return t.createCDATASection(e.textContent);case NodeType.Comment:return t.createComment(e.textContent);default:return null}}function buildNodeWithSN(e,t,n,o){void 0===o&&(o=!1);var r=buildNode(e,t);if(!r)return null;if(e.type===NodeType.Document&&(t.close(),t.open(),r=t),r.__sn=e,n[e.id]=r,(e.type===NodeType.Document||e.type===NodeType.Element)&&!o)for(var i=0,s=e.childNodes;i<s.length;i++){var a=s[i],l=buildNodeWithSN(a,t,n);l?r.appendChild(l):console.warn("Failed to rebuild",a)}return r}function rebuild(e,t){var n={};return[buildNodeWithSN(e,t,n),n]}function on(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)}}var EventType,IncrementalSource,MouseInteractions,ReplayerEvents,mirror={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return mirror.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete mirror.map[t],e.childNodes&&e.childNodes.forEach(function(e){return mirror.removeNodeFromMap(e)})},has:function(e){return mirror.map.hasOwnProperty(e)}};function throttle(e,t,n){void 0===n&&(n={});var o=null,r=0;return function(){var i=Date.now();r||!1!==n.leading||(r=i);var s=t-(i-r),a=this,l=arguments;s<=0||s>t?(o&&(window.clearTimeout(o),o=null),r=i,e.apply(a,l)):o||!1===n.trailing||(o=window.setTimeout(function(){r=!1===n.leading?0:Date.now(),o=null,e.apply(a,l)},s))}}function hookSetter(e,t,n){var o=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return hookSetter(e,t,o||{})}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function isBlocked(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||isBlocked(e.parentNode,t)}return isBlocked(e.parentNode,t)}function isAncestorRemoved(e){var t=mirror.getId(e);return!mirror.has(t)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||isAncestorRemoved(e.parentNode))}function isTouchEvent(e){return Boolean(e.changedTouches)}function deepDelete(e,t){e.delete(t),t.childNodes.forEach(function(t){return deepDelete(e,t)})}function isParentRemoved(e,t){var n=t.parentNode;if(!n)return!1;var o=mirror.getId(n);return!!e.some(function(e){return e.id===o})||isParentRemoved(e,n)}function isAncestorInSet(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||isAncestorInSet(e,n))}!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"}(EventType||(EventType={})),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"}(IncrementalSource||(IncrementalSource={})),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"}(MouseInteractions||(MouseInteractions={})),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"}(ReplayerEvents||(ReplayerEvents={}));var moveKey=function(e,t){return e+"@"+t};function isINode(e){return"__sn"in e}function initMutationObserver(e,t,n,o){var r=new MutationObserver(function(r){var i=[],s=[],a=[],l=[],c=new Set,u=new Set,d=new Set,p={},f=function(e,n){if(!isBlocked(e,t)){if(isINode(e)){u.add(e);var o=null;n&&isINode(n)&&(o=n.__sn.id),o&&(p[moveKey(e.__sn.id,o)]=!0)}else c.add(e),d.delete(e);e.childNodes.forEach(function(e){return f(e)})}};r.forEach(function(e){var n=e.type,o=e.target,r=e.oldValue,l=e.addedNodes,h=e.removedNodes,m=e.attributeName;switch(n){case"characterData":var v=o.textContent;isBlocked(o,t)||v===r||i.push({value:v,node:o});break;case"attributes":v=o.getAttribute(m);if(isBlocked(o,t)||v===r)return;var y=s.find(function(e){return e.node===o});y||(y={node:o,attributes:{}},s.push(y)),y.attributes[m]=v;break;case"childList":l.forEach(function(e){return f(e,o)}),h.forEach(function(e){var n=mirror.getId(e),r=mirror.getId(o);isBlocked(e,t)||(c.has(e)?(deepDelete(c,e),d.add(e)):c.has(o)&&-1===n||isAncestorRemoved(o)||(u.has(e)&&p[moveKey(n,r)]?deepDelete(u,e):a.push({parentId:r,id:n})),mirror.removeNodeFromMap(e))})}});var h=[],m=function(e){var r=mirror.getId(e.parentNode);if(-1===r)return h.push(e);l.push({parentId:r,previousId:e.previousSibling?mirror.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?mirror.getId(e.nextSibling):e.nextSibling,node:serializeNodeWithId(e,document,mirror.map,t,!0,n,o)})};for(Array.from(u).forEach(m),Array.from(c).forEach(function(e){isAncestorInSet(d,e)||isParentRemoved(a,e)?isAncestorInSet(u,e)?m(e):d.add(e):m(e)});h.length&&!h.every(function(e){return-1===mirror.getId(e.parentNode)});)m(h.shift());var v={texts:i.map(function(e){return{id:mirror.getId(e.node),value:e.value}}).filter(function(e){return mirror.has(e.id)}),attributes:s.map(function(e){return{id:mirror.getId(e.node),attributes:e.attributes}}).filter(function(e){return mirror.has(e.id)}),removes:a,adds:l};(v.texts.length||v.attributes.length||v.removes.length||v.adds.length)&&e(v)});return r.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function initMoveObserver(e){var t,n=[],o=throttle(function(){var o=Date.now()-t;e(n.map(function(e){return e.timeOffset-=o,e})),n=[],t=null},500),r=throttle(function(e){var r=e.target,i=isTouchEvent(e)?e.changedTouches[0]:e,s=i.clientX,a=i.clientY;t||(t=Date.now()),n.push({x:s,y:a,id:mirror.getId(r),timeOffset:Date.now()-t}),o()},50,{trailing:!1}),i=[on("mousemove",r),on("touchmove",r)];return function(){i.forEach(function(e){return e()})}}function initMouseInteractionObserver(e,t){var n=[];return Object.keys(MouseInteractions).filter(function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")}).forEach(function(o){var r=o.toLowerCase(),i=function(n){return function(o){if(!isBlocked(o.target,t)){var r=mirror.getId(o.target),i=isTouchEvent(o)?o.changedTouches[0]:o,s=i.clientX,a=i.clientY;e({type:MouseInteractions[n],id:r,x:s,y:a})}}}(o);n.push(on(r,i))}),function(){n.forEach(function(e){return e()})}}function initScrollObserver(e,t){return on("scroll",throttle(function(n){if(n.target&&!isBlocked(n.target,t)){var o=mirror.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})}},100))}function initViewportResizeObserver(e){return on("resize",throttle(function(){var t=getWindowHeight(),n=getWindowWidth();e({width:Number(n),height:Number(t)})},200),window)}var INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],MASK_TYPES=["color","date","datetime-local","email","month","number","range","search","tel","text","time","url","week"],lastInputValueMap=new WeakMap;function initInputObserver(e,t,n,o){function r(e){var r=e.target;if(r&&r.tagName&&!(INPUT_TAGS.indexOf(r.tagName)<0)&&!isBlocked(r,t)){var s=r.type;if("password"!==s&&!r.classList.contains(n)){var a=r.value,l=!1,c=MASK_TYPES.includes(s)||"TEXTAREA"===r.tagName;"radio"===s||"checkbox"===s?l=r.checked:c&&o&&(a="*".repeat(a.length)),i(r,{text:a,isChecked:l});var u=r.name;"radio"===s&&u&&l&&document.querySelectorAll('input[type="radio"][name="'+u+'"]').forEach(function(e){e!==r&&i(e,{text:e.value,isChecked:!l})})}}}function i(t,n){var o=lastInputValueMap.get(t);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){lastInputValueMap.set(t,n);var r=mirror.getId(t);e(__assign({},n,{id:r}))}}var s=["input","change"].map(function(e){return on(e,r)}),a=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),l=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]];return a&&a.set&&s.push.apply(s,l.map(function(e){return hookSetter(e[0],e[1],{set:function(){r({target:this})}})})),function(){s.forEach(function(e){return e()})}}function initObservers(e){var t=initMutationObserver(e.mutationCb,e.blockClass,e.inlineStylesheet,e.maskAllInputs),n=initMoveObserver(e.mousemoveCb),o=initMouseInteractionObserver(e.mouseInteractionCb,e.blockClass),r=initScrollObserver(e.scrollCb,e.blockClass),i=initViewportResizeObserver(e.viewportResizeCb),s=initInputObserver(e.inputCb,e.blockClass,e.ignoreClass,e.maskAllInputs);return function(){t.disconnect(),n(),o(),r(),i(),s()}}function wrapEvent(e){return __assign({},e,{timestamp:Date.now()})}function record(e){void 0===e&&(e={});var t,n=e.emit,o=e.checkoutEveryNms,r=e.checkoutEveryNth,i=e.blockClass,s=void 0===i?"rr-block":i,a=e.ignoreClass,l=void 0===a?"rr-ignore":a,c=e.inlineStylesheet,u=void 0===c||c,d=e.maskAllInputs,p=void 0!==d&&d;if(!n)throw new Error("emit function is required");var f=0,h=function(e,i){if(n(e,i),e.type===EventType.FullSnapshot)t=e,f=0;else if(e.type===EventType.IncrementalSnapshot){f++;var s=r&&f>=r,a=o&&e.timestamp-t.timestamp>o;(s||a)&&m(!0)}};function m(e){void 0===e&&(e=!1),h(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),e);var t=snapshot(document,s,u,p),n=t[0],o=t[1];if(!n)return console.warn("Failed to snapshot the document");mirror.map=o,h(wrapEvent({type:EventType.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var v=[];v.push(on("DOMContentLoaded",function(){h(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var y=function(){m(),v.push(initObservers({mutationCb:function(e){return h(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return h(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return h(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return h(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return h(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return h(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))},blockClass:s,ignoreClass:l,maskAllInputs:p,inlineStylesheet:u}))};return"interactive"===document.readyState||"complete"===document.readyState?y():v.push(on("load",function(){h(wrapEvent({type:EventType.Load,data:{}})),y()},window)),function(){v.forEach(function(e){return e()})}}catch(e){console.warn(e)}}function mitt(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map(function(e){e(n)}),(e["*"]||[]).slice().map(function(e){e(t,n)})}}}var mittProxy=Object.freeze({default:mitt});function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var smoothscroll=createCommonjsModule(function(e,t){!function(){e.exports={polyfill:function(){var e=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)){var n,o=e.HTMLElement||e.Element,r=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:o.prototype.scroll||l,scrollIntoView:o.prototype.scrollIntoView},s=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(c(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},o.prototype.scroll=o.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==c(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},o.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},o.prototype.scrollIntoView=function(){if(!0!==c(arguments[0])){var n=function(e){for(;e!==t.body&&!1===p(e);)e=e.parentNode||e.host;return e}(this),o=n.getBoundingClientRect(),r=this.getBoundingClientRect();n!==t.body?(h.call(this,n,n.scrollLeft+r.left-o.left,n.scrollTop+r.top-o.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})):e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function l(e,t){this.scrollLeft=e,this.scrollTop=t}function c(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function u(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function d(t,n){var o=e.getComputedStyle(t,null)["overflow"+n];return"auto"===o||"scroll"===o}function p(e){var t=u(e,"Y")&&d(e,"Y"),n=u(e,"X")&&d(e,"X");return t||n}function f(t){var n,o,i,a,l=(s()-t.startTime)/r;a=l=l>1?1:l,n=.5*(1-Math.cos(Math.PI*a)),o=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,o,i),o===t.x&&i===t.y||e.requestAnimationFrame(f.bind(e,t))}function h(n,o,r){var a,c,u,d,p=s();n===t.body?(a=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(a=n,c=n.scrollLeft,u=n.scrollTop,d=l),f({scrollable:a,method:d,startTime:p,startX:c,startY:u,x:o,y:r})}}}}()}),smoothscroll_1=smoothscroll.polyfill,Timer=function(){function e(e,t){void 0===t&&(t=[]),this.timeOffset=0,this.actions=t,this.config=e}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,e)},e.prototype.start=function(){this.actions.sort(function(e,t){return e.delay-t.delay}),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this.config,o=this;this.raf=requestAnimationFrame(function r(i){for(o.timeOffset+=(i-e)*n.speed,e=i;t.length;){var s=t[0];if(!(o.timeOffset>=s.delay))break;t.shift(),s.doAction()}(t.length>0||o.config.liveMode)&&(o.raf=requestAnimationFrame(r))})},e.prototype.clear=function(){this.raf&&cancelAnimationFrame(this.raf),this.actions.length=0},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var o=Math.floor((t+n)/2);if(this.actions[o].delay<e.delay)t=o+1;else{if(!(this.actions[o].delay>e.delay))return o;n=o-1}}return t},e}(),rules=function(e){return["iframe, ."+e+" { background: #ccc }","noscript { display: none !important; }"]},SKIP_TIME_THRESHOLD=1e4,SKIP_TIME_INTERVAL=5e3,mitt$1=mitt||mittProxy,REPLAY_CONSOLE_PREFIX="[replayer]",Replayer=function(){function e(e,t){if(this.events=[],this.emitter=mitt$1(),this.baselineTime=0,this.noramlSpeed=-1,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this);var n={speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1};this.config=Object.assign({},n,t),this.timer=new Timer(this.config),smoothscroll_1(),this.setupDom(),this.emitter.on("resize",this.handleResize)}return e.prototype.on=function(e,t){this.emitter.on(e,t)},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach(function(n){t.config[n]=e[n]}),this.config.skipInactive||(this.noramlSpeed=-1)},e.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.timestamp}},e.prototype.getTimeOffset=function(){return this.baselineTime-this.events[0].timestamp},e.prototype.play=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,o=this.events;n<o.length;n++){var r=o[n],i=r.timestamp<this.baselineTime,s=this.getCastFn(r,i);i?s():t.push({doAction:s,delay:this.getDelay(r)})}this.timer.addActions(t),this.timer.start(),this.emitter.emit(ReplayerEvents.Start)},e.prototype.pause=function(){this.timer.clear(),this.emitter.emit(ReplayerEvents.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,o=this.events;n<o.length;n++){var r=o[n];if(!(r.timestamp<=this.lastPlayedEvent.timestamp||r===this.lastPlayedEvent)){var i=this.getCastFn(r);t.push({doAction:i,delay:this.getDelay(r)})}}this.timer.addActions(t),this.timer.start(),this.emitter.emit(ReplayerEvents.Resume)},e.prototype.addEvent=function(e){this.getCastFn(e,!0)()},e.prototype.setupDom=function(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin"),this.iframe.setAttribute("scrolling","no"),this.wrapper.appendChild(this.iframe)},e.prototype.handleResize=function(e){this.iframe.width=e.width+"px",this.iframe.height=e.height+"px"},e.prototype.getDelay=function(e){if(e.type===EventType.IncrementalSnapshot&&e.data.source===IncrementalSource.MouseMove){var t=e.data.positions[0].timeOffset,n=e.timestamp+t;return e.delay=n-this.baselineTime,n-this.baselineTime}return e.delay=e.timestamp-this.baselineTime,e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,o=this;switch(void 0===t&&(t=!1),e.type){case EventType.DomContentLoaded:case EventType.Load:break;case EventType.Meta:n=function(){return o.emitter.emit(ReplayerEvents.Resize,{width:e.data.width,height:e.data.height})};break;case EventType.FullSnapshot:n=function(){o.rebuildFullSnapshot(e),o.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case EventType.IncrementalSnapshot:n=function(){if(o.applyIncremental(e,t),e===o.nextUserInteractionEvent&&(o.nextUserInteractionEvent=null,o.restoreSpeed()),o.config.skipInactive&&!o.nextUserInteractionEvent){for(var n=0,r=o.events;n<r.length;n++){var i=r[n];if(!(i.timestamp<=e.timestamp)&&o.isUserInteraction(i)){i.delay-e.delay>SKIP_TIME_THRESHOLD*o.config.speed&&(o.nextUserInteractionEvent=i);break}}if(o.nextUserInteractionEvent){o.noramlSpeed=o.config.speed;var s=o.nextUserInteractionEvent.delay-e.delay,a={speed:Math.min(Math.round(s/SKIP_TIME_INTERVAL),360)};o.setConfig(a),o.emitter.emit(ReplayerEvents.SkipStart,a)}}}}return function(){n&&n(),o.lastPlayedEvent=e,e===o.events[o.events.length-1]&&(o.restoreSpeed(),o.emitter.emit(ReplayerEvents.Finish))}},e.prototype.rebuildFullSnapshot=function(e){Object.keys(this.missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.missingNodeRetryMap),this.missingNodeRetryMap={},mirror.map=rebuild(e.data.node,this.iframe.contentDocument)[1];var t=document.createElement("style"),n=this.iframe.contentDocument,o=n.documentElement,r=n.head;o.insertBefore(t,r);for(var i=rules(this.config.blockClass),s=0;s<i.length;s++)t.sheet.insertRule(i[s],s);this.emitter.emit(ReplayerEvents.FullsnapshotRebuilded),this.waitForStylesheetLoad()},e.prototype.waitForStylesheetLoad=function(){var e=this,t=this.iframe.contentDocument.head;if(t){var n,o=new Set;t.querySelectorAll('link[rel="stylesheet"]').forEach(function(t){t.sheet||(0===o.size&&(e.pause(),e.emitter.emit(ReplayerEvents.LoadStylesheetStart),n=window.setTimeout(function(){e.resume(e.timer.timeOffset),n=-1},e.config.loadTimeout)),o.add(t),t.addEventListener("load",function(){o.delete(t),0===o.size&&-1!==n&&(e.resume(e.timer.timeOffset),e.emitter.emit(ReplayerEvents.LoadStylesheetEnd),n&&window.clearTimeout(n))}))})}},e.prototype.applyIncremental=function(e,t){var n=this,o=e.data;switch(o.source){case IncrementalSource.Mutation:o.removes.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(o,e.id);var r=mirror.getNode(e.parentId);if(!r)return n.warnNodeNotFound(o,e.parentId);mirror.removeNodeFromMap(t),r&&r.removeChild(t)});var r=__assign({},this.missingNodeRetryMap),i=[],s=function(e){var t=mirror.getNode(e.parentId);if(!t)return i.push(e);var o=buildNodeWithSN(e.node,n.iframe.contentDocument,mirror.map,!0),s=null,a=null;e.previousId&&(s=mirror.getNode(e.previousId)),e.nextId&&(a=mirror.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(s&&s.nextSibling&&s.nextSibling.parentNode?t.insertBefore(o,s.nextSibling):a&&a.parentNode?t.insertBefore(o,a):t.appendChild(o),(e.previousId||e.nextId)&&n.resolveMissingNode(r,t,o,e)):r[e.node.id]={node:o,mutation:e}};for(o.adds.forEach(function(e){s(e)});i.length;){if(i.every(function(e){return!Boolean(mirror.getNode(e.parentId))}))return i.forEach(function(e){return n.warnNodeNotFound(o,e.node.id)});var a=i.shift();s(a)}Object.keys(r).length&&Object.assign(this.missingNodeRetryMap,r),o.texts.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(o,e.id);t.textContent=e.value}),o.attributes.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(o,e.id);for(var r in e.attributes)if("string"==typeof r){var i=e.attributes[r];null!==i?t.setAttribute(r,i):t.removeAttribute(r)}});break;case IncrementalSource.MouseMove:if(t){var l=o.positions[o.positions.length-1];this.moveAndHover(o,l.x,l.y,l.id)}else o.positions.forEach(function(t){var r={doAction:function(){n.moveAndHover(o,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-n.baselineTime};n.timer.addAction(r)});break;case IncrementalSource.MouseInteraction:if(-1===o.id)break;var c=new Event(MouseInteractions[o.type].toLowerCase());if(!(u=mirror.getNode(o.id)))return this.debugNodeNotFound(o,o.id);switch(this.emitter.emit(ReplayerEvents.MouseInteraction,{type:o.type,target:u}),o.type){case MouseInteractions.Blur:u.blur&&u.blur();break;case MouseInteractions.Focus:u.focus&&u.focus({preventScroll:!0});break;case MouseInteractions.Click:case MouseInteractions.TouchStart:case MouseInteractions.TouchEnd:t||(this.moveAndHover(o,o.x,o.y,o.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:u.dispatchEvent(c)}break;case IncrementalSource.Scroll:if(-1===o.id)break;if(!(u=mirror.getNode(o.id)))return this.debugNodeNotFound(o,o.id);if(u===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:o.y,left:o.x,behavior:t?"auto":"smooth"});else try{u.scrollTop=o.y,u.scrollLeft=o.x}catch(e){}break;case IncrementalSource.ViewportResize:this.emitter.emit(ReplayerEvents.Resize,{width:o.width,height:o.height});break;case IncrementalSource.Input:if(-1===o.id)break;var u;if(!(u=mirror.getNode(o.id)))return this.debugNodeNotFound(o,o.id);try{u.checked=o.isChecked,u.value=o.text}catch(e){}}},e.prototype.resolveMissingNode=function(e,t,n,o){var r=o.previousId,i=o.nextId,s=r&&e[r],a=i&&e[i];if(s){var l=s,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}if(a){var d=a;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,n,o){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px";var r=mirror.getNode(o);if(!r)return this.debugNodeNotFound(e,o);this.hoverElements(r)},e.prototype.hoverElements=function(e){this.iframe.contentDocument.querySelectorAll(".\\:hover").forEach(function(e){e.classList.remove(":hover")});for(var t=e;t;)t.classList.add(":hover"),t=t.parentElement},e.prototype.isUserInteraction=function(e){return e.type===EventType.IncrementalSnapshot&&(e.data.source>IncrementalSource.Mutation&&e.data.source<=IncrementalSource.Input)},e.prototype.restoreSpeed=function(){if(-1!==this.noramlSpeed){var e={speed:this.noramlSpeed};this.setConfig(e),this.emitter.emit(ReplayerEvents.SkipEnd,e),this.noramlSpeed=-1}},e.prototype.warnNodeNotFound=function(e,t){this.config.showWarning&&console.warn(REPLAY_CONSOLE_PREFIX,"Node with id '"+t+"' not found in",e)},e.prototype.debugNodeNotFound=function(e,t){this.config.showDebug&&console.log(REPLAY_CONSOLE_PREFIX,"Node with id '"+t+"' not found in",e)},e}();export{record,Replayer,mirror,EventType,IncrementalSource,MouseInteractions,ReplayerEvents};
//# sourceMappingURL=rrweb.min.js.map

@@ -120,3 +120,3 @@ 'use strict';

}
function serializeNode(n, doc, blockClass, inlineStylesheet) {
function serializeNode(n, doc, blockClass, inlineStylesheet, maskAllInputs) {
switch (n.nodeType) {

@@ -188,3 +188,3 @@ case n.DOCUMENT_NODE:

value) {
attributes_1.value = value;
attributes_1.value = maskAllInputs ? '*'.repeat(value.length) : value;
}

@@ -243,6 +243,7 @@ else if (n.checked) {

}
function serializeNodeWithId(n, doc, map, blockClass, skipChild, inlineStylesheet) {
function serializeNodeWithId(n, doc, map, blockClass, skipChild, inlineStylesheet, maskAllInputs) {
if (skipChild === void 0) { skipChild = false; }
if (inlineStylesheet === void 0) { inlineStylesheet = true; }
var _serializedNode = serializeNode(n, doc, blockClass, inlineStylesheet);
if (maskAllInputs === void 0) { maskAllInputs = false; }
var _serializedNode = serializeNode(n, doc, blockClass, inlineStylesheet, maskAllInputs);
if (!_serializedNode) {

@@ -280,8 +281,9 @@ console.warn(n, 'not serialized');

}
function snapshot(n, blockClass, inlineStylesheet) {
function snapshot(n, blockClass, inlineStylesheet, maskAllInputs) {
if (blockClass === void 0) { blockClass = 'rr-block'; }
if (inlineStylesheet === void 0) { inlineStylesheet = true; }
if (maskAllInputs === void 0) { maskAllInputs = false; }
var idNodeMap = {};
return [
serializeNodeWithId(n, n, idNodeMap, blockClass, false, inlineStylesheet),
serializeNodeWithId(n, n, idNodeMap, blockClass, false, inlineStylesheet, maskAllInputs),
idNodeMap,

@@ -409,2 +411,5 @@ ];

}
function isTouchEvent(event) {
return Boolean(event.changedTouches);
}

@@ -438,3 +443,3 @@ var EventType;

MouseInteractions[MouseInteractions["TouchStart"] = 7] = "TouchStart";
MouseInteractions[MouseInteractions["TouchMove"] = 8] = "TouchMove";
MouseInteractions[MouseInteractions["TouchMove_Departed"] = 8] = "TouchMove_Departed";
MouseInteractions[MouseInteractions["TouchEnd"] = 9] = "TouchEnd";

@@ -487,3 +492,3 @@ })(MouseInteractions || (MouseInteractions = {}));

}
function initMutationObserver(cb, blockClass, inlineStylesheet) {
function initMutationObserver(cb, blockClass, inlineStylesheet, maskAllInputs) {
var observer = new MutationObserver(function (mutations) {

@@ -592,3 +597,3 @@ var texts = [];

: mirror.getId(n.nextSibling),
node: serializeNodeWithId(n, document, mirror.map, blockClass, true, inlineStylesheet)
node: serializeNodeWithId(n, document, mirror.map, blockClass, true, inlineStylesheet, maskAllInputs)
});

@@ -648,3 +653,3 @@ };

}
function initMousemoveObserver(cb) {
function initMoveObserver(cb) {
var positions = [];

@@ -662,3 +667,6 @@ var timeBaseline;

var updatePosition = throttle(function (evt) {
var clientX = evt.clientX, clientY = evt.clientY, target = evt.target;
var target = evt.target;
var _a = isTouchEvent(evt)
? evt.changedTouches[0]
: evt, clientX = _a.clientX, clientY = _a.clientY;
if (!timeBaseline) {

@@ -677,3 +685,9 @@ timeBaseline = Date.now();

});
return on('mousemove', updatePosition);
var handlers = [
on('mousemove', updatePosition),
on('touchmove', updatePosition),
];
return function () {
handlers.forEach(function (h) { return h(); });
};
}

@@ -688,3 +702,5 @@ function initMouseInteractionObserver(cb, blockClass) {

var id = mirror.getId(event.target);
var clientX = event.clientX, clientY = event.clientY;
var _a = isTouchEvent(event)
? event.changedTouches[0]
: event, clientX = _a.clientX, clientY = _a.clientY;
cb({

@@ -699,3 +715,3 @@ type: MouseInteractions[eventKey],

Object.keys(MouseInteractions)
.filter(function (key) { return Number.isNaN(Number(key)); })
.filter(function (key) { return Number.isNaN(Number(key)) && !key.endsWith('_Departed'); })
.forEach(function (eventKey) {

@@ -746,4 +762,19 @@ var eventName = eventKey.toLowerCase();

var INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];
var MASK_TYPES = [
'color',
'date',
'datetime-local',
'email',
'month',
'number',
'range',
'search',
'tel',
'text',
'time',
'url',
'week',
];
var lastInputValueMap = new WeakMap();
function initInputObserver(cb, blockClass, ignoreClass) {
function initInputObserver(cb, blockClass, ignoreClass, maskAllInputs) {
function eventHandler(event) {

@@ -764,5 +795,9 @@ var target = event.target;

var isChecked = false;
var hasTextInput = MASK_TYPES.includes(type) || target.tagName === 'TEXTAREA';
if (type === 'radio' || type === 'checkbox') {
isChecked = target.checked;
}
else if (hasTextInput && maskAllInputs) {
text = '*'.repeat(text.length);
}
cbWithDedup(target, { text: text, isChecked: isChecked });

@@ -818,8 +853,8 @@ var name = target.name;

function initObservers(o) {
var mutationObserver = initMutationObserver(o.mutationCb, o.blockClass, o.inlineStylesheet);
var mousemoveHandler = initMousemoveObserver(o.mousemoveCb);
var mutationObserver = initMutationObserver(o.mutationCb, o.blockClass, o.inlineStylesheet, o.maskAllInputs);
var mousemoveHandler = initMoveObserver(o.mousemoveCb);
var mouseInteractionHandler = initMouseInteractionObserver(o.mouseInteractionCb, o.blockClass);
var scrollHandler = initScrollObserver(o.scrollCb, o.blockClass);
var viewportResizeHandler = initViewportResizeObserver(o.viewportResizeCb);
var inputHandler = initInputObserver(o.inputCb, o.blockClass, o.ignoreClass);
var inputHandler = initInputObserver(o.inputCb, o.blockClass, o.ignoreClass, o.maskAllInputs);
return function () {

@@ -840,3 +875,3 @@ mutationObserver.disconnect();

if (options === void 0) { options = {}; }
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth, _a = options.blockClass, blockClass = _a === void 0 ? 'rr-block' : _a, _b = options.ignoreClass, ignoreClass = _b === void 0 ? 'rr-ignore' : _b, _c = options.inlineStylesheet, inlineStylesheet = _c === void 0 ? true : _c;
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth, _a = options.blockClass, blockClass = _a === void 0 ? 'rr-block' : _a, _b = options.ignoreClass, ignoreClass = _b === void 0 ? 'rr-ignore' : _b, _c = options.inlineStylesheet, inlineStylesheet = _c === void 0 ? true : _c, _d = options.maskAllInputs, maskAllInputs = _d === void 0 ? false : _d;
if (!emit) {

@@ -873,3 +908,3 @@ throw new Error('emit function is required');

}), isCheckout);
var _a = snapshot(document, blockClass, inlineStylesheet), node = _a[0], idNodeMap = _a[1];
var _a = snapshot(document, blockClass, inlineStylesheet, maskAllInputs), node = _a[0], idNodeMap = _a[1];
if (!node) {

@@ -942,2 +977,3 @@ return console.warn('Failed to snapshot the document');

ignoreClass: ignoreClass,
maskAllInputs: maskAllInputs,
inlineStylesheet: inlineStylesheet

@@ -944,0 +980,0 @@ }));

{
"name": "rrweb",
"version": "0.7.16",
"version": "0.7.17",
"description": "record and replay the web",

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

"mitt": "^1.1.3",
"rrweb-snapshot": "^0.7.11",
"rrweb-snapshot": "^0.7.12",
"smoothscroll-polyfill": "^0.4.3"
}
}

@@ -80,2 +80,3 @@ import { serializedNodeWithId, idNodeMap, INode } from 'rrweb-snapshot';

ignoreClass?: string;
maskAllInputs?: boolean;
inlineStylesheet?: boolean;

@@ -92,2 +93,3 @@ };

ignoreClass: string;
maskAllInputs: boolean;
inlineStylesheet: boolean;

@@ -148,3 +150,3 @@ };

TouchStart = 7,
TouchMove = 8,
TouchMove_Departed = 8,
TouchEnd = 9

@@ -151,0 +153,0 @@ }

@@ -11,1 +11,2 @@ import { Mirror, throttleOptions, listenerHandler, hookResetter, blockClass } from './types';

export declare function isAncestorRemoved(target: INode): boolean;
export declare function isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent;

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 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 not supported yet

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc