UNPKG

rrweb

Version:
15 lines (13 loc) 90.4 kB
var rrweb=function(e){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var t,n=function(){return(n=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 r(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function i(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(t||(t={}));var a=1,s=RegExp("[^a-z1-6-_]");function l(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(c).join(""):null}catch(e){return null}}function c(e){return function(e){return"styleSheet"in e}(e)?l(e.styleSheet)||"":e.cssText}var u=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,d=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,f=/^(data:)([^,]*),(.*)/i;function p(e,t){return(e||"").replace(u,(function(e,n,r,o,i,a){var s,l=r||i||a,c=n||o||"";if(!l)return e;if(!d.test(l))return"url("+c+l+c+")";if(f.test(l))return"url("+c+l+c+")";if("/"===l[0])return"url("+c+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+l)+c+")";var u=t.split("/"),p=l.split("/");u.pop();for(var h=0,v=p;h<v.length;h++){var m=v[h];"."!==m&&(".."===m?u.pop():u.push(m))}return"url("+c+u.join("/")+c+")"}))}function h(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function v(e,t,n){return"src"===t||("href"===t||"xlink:href"===t)&&n?h(e,n):"srcset"===t&&n?function(e,t){return""===t.trim()?t:t.split(",").map((function(t){var n=t.trimLeft().trimRight().split(" ");return 2===n.length?h(e,n[0])+" "+n[1]:1===n.length?""+h(e,n[0]):""})).join(", ")}(e,n):"style"===t&&n?p(n,location.href):n}function m(e,n){var r,o=n.doc,i=n.blockClass,a=n.blockSelector,c=n.inlineStylesheet,u=n.maskInputOptions,d=void 0===u?{}:u,f=n.recordCanvas;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:for(var h=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach((function(e){if(t.test(e))return!0}));return!!n&&e.matches(n)}(e,i,a),m=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return s.test(t)?"div":t}(e),y={},g=0,b=Array.from(e.attributes);g<b.length;g++){var S=b[g],w=S.name,E=S.value;y[w]=v(o,w,E)}if("link"===m&&c){var C,x=Array.from(o.styleSheets).find((function(t){return t.href===e.href}));(C=l(x))&&(delete y.rel,delete y.href,y._cssText=p(C,x.href))}if("style"===m&&e.sheet&&!(e.innerText||e.textContent||"").trim().length)(C=l(e.sheet))&&(y._cssText=p(C,location.href));if("input"===m||"textarea"===m||"select"===m){E=e.value;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&E?y.value=d[y.type]||d[m]?"*".repeat(E.length):E:e.checked&&(y.checked=e.checked)}if("option"===m){var T=e.parentElement;y.value===T.value&&(y.selected=e.selected)}if("canvas"===m&&f&&(y.rr_dataURL=e.toDataURL()),"audio"!==m&&"video"!==m||(y.rr_mediaState=e.paused?"paused":"played"),e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop),h){var M=e.getBoundingClientRect(),I=M.width,k=M.height;y={class:y.class,rr_width:I+"px",rr_height:k+"px"}}return{type:t.Element,tagName:m,attributes:y,childNodes:[],isSVG:(r=e,"svg"===r.tagName||r instanceof SVGElement||void 0),needBlock:h};case e.TEXT_NODE:var N=e.parentNode&&e.parentNode.tagName,_=e.textContent,O="STYLE"===N||void 0;return O&&_&&(_=p(_,location.href)),"SCRIPT"===N&&(_="SCRIPT_PLACEHOLDER"),{type:t.Text,textContent:_||"",isStyle:O};case e.CDATA_SECTION_NODE:return{type:t.CDATA,textContent:""};case e.COMMENT_NODE:return{type:t.Comment,textContent:e.textContent||""};default:return!1}}function y(e){return void 0===e?"":e.toLowerCase()}function g(e,n){var r,o=n.doc,i=n.map,s=n.blockClass,l=n.blockSelector,c=n.skipChild,u=void 0!==c&&c,d=n.inlineStylesheet,f=void 0===d||d,p=n.maskInputOptions,h=void 0===p?{}:p,v=n.slimDOMOptions,b=n.recordCanvas,S=void 0!==b&&b,w=n.preserveWhiteSpace,E=void 0===w||w,C=m(e,{doc:o,blockClass:s,blockSelector:l,inlineStylesheet:f,maskInputOptions:h,recordCanvas:S});if(!C)return console.warn(e,"not serialized"),null;r="__sn"in e?e.__sn.id:!function(e,n){if(n.comment&&e.type===t.Comment)return!0;if(e.type===t.Element){if(n.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as))return!0;if(n.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(y(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===y(e.attributes.name)||"icon"===y(e.attributes.rel)||"apple-touch-icon"===y(e.attributes.rel)||"shortcut icon"===y(e.attributes.rel))))return!0;if("meta"===e.tagName){if(n.headMetaDescKeywords&&y(e.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(y(e.attributes.property).match(/^(og|twitter|fb):/)||y(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===y(e.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===y(e.attributes.name)||"googlebot"===y(e.attributes.name)||"bingbot"===y(e.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===y(e.attributes.name)||"generator"===y(e.attributes.name)||"framework"===y(e.attributes.name)||"publisher"===y(e.attributes.name)||"progid"===y(e.attributes.name)||y(e.attributes.property).match(/^article:/)||y(e.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===y(e.attributes.name)||"yandex-verification"===y(e.attributes.name)||"csrf-token"===y(e.attributes.name)||"p:domain_verify"===y(e.attributes.name)||"verify-v1"===y(e.attributes.name)||"verification"===y(e.attributes.name)||"shopify-checkout-api-token"===y(e.attributes.name)))return!0}}return!1}(C,v)&&(E||C.type!==t.Text||C.isStyle||C.textContent.replace(/^\s+|\s+$/gm,"").length)?a++:-2;var x=Object.assign(C,{id:r});if(e.__sn=x,-2===r)return null;i[r]=e;var T=!u;if(x.type===t.Element&&(T=T&&!x.needBlock,delete x.needBlock),(x.type===t.Document||x.type===t.Element)&&T){v.headWhitespace&&C.type===t.Element&&"head"===C.tagName&&(E=!1);for(var M=0,I=Array.from(e.childNodes);M<I.length;M++){var k=g(I[M],{doc:o,map:i,blockClass:s,blockSelector:l,skipChild:u,inlineStylesheet:f,maskInputOptions:h,slimDOMOptions:v,recordCanvas:S,preserveWhiteSpace:E});k&&x.childNodes.push(k)}}return x}var b=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function S(e,t){void 0===t&&(t={});var n=1,r=1;function o(e){var t=e.match(/\n/g);t&&(n+=t.length);var o=e.lastIndexOf("\n");r=-1===o?r+e.length:e.length-o}function i(){var e={line:n,column:r};return function(t){return t.position=new a(e),p(),t}}var a=function(e){this.start=e,this.end={line:n,column:r},this.source=t.source};a.prototype.content=e;var s=[];function l(o){var i=new Error(t.source+":"+n+":"+r+": "+o);if(i.reason=o,i.filename=t.source,i.line=n,i.column=r,i.source=e,!t.silent)throw i;s.push(i)}function c(){return f(/^{\s*/)}function u(){return f(/^}/)}function d(){var t,n=[];for(p(),h(n);e.length&&"}"!==e.charAt(0)&&(t=I()||k());)!1!==t&&(n.push(t),h(n));return n}function f(t){var n=t.exec(e);if(n){var r=n[0];return o(r),e=e.slice(r.length),n}}function p(){f(/^\s*/)}function h(e){var t;for(void 0===e&&(e=[]);t=v();)!1!==t&&e.push(t),t=v();return e}function v(){var t=i();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var n=2;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return l("End of comment missing");var a=e.slice(2,n-2);return r+=2,o(a),e=e.slice(n),r+=2,t({type:"comment",comment:a})}}function m(){var e=f(/^([^{]+)/);if(e)return w(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function y(){var e=i(),t=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var n=w(t[0]);if(!f(/^:\s*/))return l("property missing ':'");var r=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:n.replace(b,""),value:r?w(r[0]).replace(b,""):""});return f(/^[;\s]*/),o}}function g(){var e,t=[];if(!c())return l("missing '{'");for(h(t);e=y();)!1!==e&&(t.push(e),h(t)),e=y();return u()?t:l("missing '}'")}function S(){for(var e,t=[],n=i();e=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),f(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:g()})}var E,C=M("import"),x=M("charset"),T=M("namespace");function M(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=i(),r=f(t);if(r){var o={type:e};return o[e]=r[1].trim(),n(o)}}}function I(){if("@"===e[0])return function(){var e=i(),t=f(/^@([-\w]+)?keyframes\s*/);if(t){var n=t[1];if(!(t=f(/^([-\w]+)\s*/)))return l("@keyframes missing name");var r,o=t[1];if(!c())return l("@keyframes missing '{'");for(var a=h();r=S();)a.push(r),a=a.concat(h());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:a}):l("@keyframes missing '}'")}}()||function(){var e=i(),t=f(/^@media *([^{]+)/);if(t){var n=w(t[1]);if(!c())return l("@media missing '{'");var r=h().concat(d());return u()?e({type:"media",media:n,rules:r}):l("@media missing '}'")}}()||function(){var e=i(),t=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:w(t[1]),media:w(t[2])})}()||function(){var e=i(),t=f(/^@supports *([^{]+)/);if(t){var n=w(t[1]);if(!c())return l("@supports missing '{'");var r=h().concat(d());return u()?e({type:"supports",supports:n,rules:r}):l("@supports missing '}'")}}()||C()||x()||T()||function(){var e=i(),t=f(/^@([-\w]+)?document *([^{]+)/);if(t){var n=w(t[1]),r=w(t[2]);if(!c())return l("@document missing '{'");var o=h().concat(d());return u()?e({type:"document",document:r,vendor:n,rules:o}):l("@document missing '}'")}}()||function(){var e=i();if(f(/^@page */)){var t=m()||[];if(!c())return l("@page missing '{'");for(var n,r=h();n=y();)r.push(n),r=r.concat(h());return u()?e({type:"page",selectors:t,declarations:r}):l("@page missing '}'")}}()||function(){var e=i();if(f(/^@host\s*/)){if(!c())return l("@host missing '{'");var t=h().concat(d());return u()?e({type:"host",rules:t}):l("@host missing '}'")}}()||function(){var e=i();if(f(/^@font-face\s*/)){if(!c())return l("@font-face missing '{'");for(var t,n=h();t=y();)n.push(t),n=n.concat(h());return u()?e({type:"font-face",declarations:n}):l("@font-face missing '}'")}}()}function k(){var e=i(),t=m();return t?(h(),e({type:"rule",selectors:t,declarations:g()})):l("selector missing")}return function e(t,n){for(var r=t&&"string"==typeof t.type,o=r?t:n,i=0,a=Object.keys(t);i<a.length;i++){var s=a[i],l=t[s];Array.isArray(l)?l.forEach((function(t){e(t,o)})):l&&"object"==typeof l&&e(l,o)}r&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:n||null});return t}((E=d(),{type:"stylesheet",stylesheet:{source:t.source,rules:E,parsingErrors:s}}))}function w(e){return e?e.replace(/^\s+|\s+$/g,""):""}var E={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 C,x,T,M,I,k=/([^\\]):hover/g;function N(e){var t=S(e,{silent:!0});return t.stylesheet?(t.stylesheet.rules.forEach((function(t){"selectors"in t&&(t.selectors||[]).forEach((function(t){if(k.test(t)){var n=t.replace(k,"$1.\\:hover");e=e.replace(t,t+", "+n)}}))})),e):e}function _(e,n){var r=n.doc,o=n.hackCss;switch(e.type){case t.Document:return r.implementation.createDocument(null,"",null);case t.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case t.Element:var i,a=function(e){var t=E[e.tagName]?E[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);i=e.isSVG?r.createElementNS("http://www.w3.org/2000/svg",a):r.createElement(a);var s=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var n=e.attributes[t];if(n="boolean"==typeof n||"number"==typeof n?"":n,t.startsWith("rr_")){if("canvas"===a&&"rr_dataURL"===t){var s=document.createElement("img");s.src=n,s.onload=function(){var e=i.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===t&&(i.style.width=n),"rr_height"===t&&(i.style.height=n),"rr_mediaState"===t)switch(n){case"played":i.play();case"paused":i.pause()}}else{var l="textarea"===a&&"value"===t,c="style"===a&&"_cssText"===t;if(c&&o&&(n=N(n)),l||c){for(var u=r.createTextNode(n),d=0,f=Array.from(i.childNodes);d<f.length;d++){var p=f[d];p.nodeType===i.TEXT_NODE&&i.removeChild(p)}return i.appendChild(u),"continue"}if("iframe"===a&&"src"===t)return"continue";try{e.isSVG&&"xlink:href"===t?i.setAttributeNS("http://www.w3.org/1999/xlink",t,n):"onload"===t||"onclick"===t||"onmouse"===t.substring(0,7)?i.setAttribute("_"+t,n):i.setAttribute(t,n)}catch(e){}}};for(var l in e.attributes)s(l);return i;case t.Text:return r.createTextNode(e.isStyle&&o?N(e.textContent):e.textContent);case t.CDATA:return r.createCDATASection(e.textContent);case t.Comment:return r.createComment(e.textContent);default:return null}}function O(e,n){var r=n.doc,o=n.map,i=n.skipChild,a=void 0!==i&&i,s=n.hackCss,l=void 0===s||s,c=_(e,{doc:r,hackCss:l});if(!c)return null;if(e.type===t.Document&&(r.close(),r.open(),c=r),c.__sn=e,o[e.id]=c,(e.type===t.Document||e.type===t.Element)&&!a)for(var u=0,d=e.childNodes;u<d.length;u++){var f=d[u],p=O(f,{doc:r,map:o,skipChild:!1,hackCss:l});p?c.appendChild(p):console.warn("Failed to rebuild",f)}return c}function L(e,n){var r=n.doc,o=n.onVisit,i=n.hackCss,a={},s=O(e,{doc:r,map:a,skipChild:!1,hackCss:void 0===i||i});return function(e,t){for(var n in e)e[n]&&(r=e[n],t(r));var r}(a,(function(e){o&&o(e),function(e){var n=e.__sn;if(n.type===t.Element){var r=e;for(var o in n.attributes)if(n.attributes.hasOwnProperty(o)&&o.startsWith("rr_")){var i=n.attributes[o];"rr_scrollLeft"===o&&(r.scrollLeft=i),"rr_scrollTop"===o&&(r.scrollTop=i)}}}(e)})),[s,a]}function D(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)}}(C=e.EventType||(e.EventType={}))[C.DomContentLoaded=0]="DomContentLoaded",C[C.Load=1]="Load",C[C.FullSnapshot=2]="FullSnapshot",C[C.IncrementalSnapshot=3]="IncrementalSnapshot",C[C.Meta=4]="Meta",C[C.Custom=5]="Custom",(x=e.IncrementalSource||(e.IncrementalSource={}))[x.Mutation=0]="Mutation",x[x.MouseMove=1]="MouseMove",x[x.MouseInteraction=2]="MouseInteraction",x[x.Scroll=3]="Scroll",x[x.ViewportResize=4]="ViewportResize",x[x.Input=5]="Input",x[x.TouchMove=6]="TouchMove",x[x.MediaInteraction=7]="MediaInteraction",x[x.StyleSheetRule=8]="StyleSheetRule",x[x.CanvasMutation=9]="CanvasMutation",x[x.Font=10]="Font",x[x.Log=11]="Log",(T=e.MouseInteractions||(e.MouseInteractions={}))[T.MouseUp=0]="MouseUp",T[T.MouseDown=1]="MouseDown",T[T.Click=2]="Click",T[T.ContextMenu=3]="ContextMenu",T[T.DblClick=4]="DblClick",T[T.Focus=5]="Focus",T[T.Blur=6]="Blur",T[T.TouchStart=7]="TouchStart",T[T.TouchMove_Departed=8]="TouchMove_Departed",T[T.TouchEnd=9]="TouchEnd",function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause"}(M||(M={})),(I=e.ReplayerEvents||(e.ReplayerEvents={})).Start="start",I.Pause="pause",I.Resume="resume",I.Resize="resize",I.Finish="finish",I.FullsnapshotRebuilded="fullsnapshot-rebuilded",I.LoadStylesheetStart="load-stylesheet-start",I.LoadStylesheetEnd="load-stylesheet-end",I.SkipStart="skip-start",I.SkipEnd="skip-end",I.MouseInteraction="mouse-interaction",I.EventCast="event-cast",I.CustomEvent="custom-event",I.Flush="flush",I.StateChange="state-change";var R={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return R.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete R.map[t],e.childNodes&&e.childNodes.forEach((function(e){return R.removeNodeFromMap(e)}))},has:function(e){return R.map.hasOwnProperty(e)}};function A(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(i){var a=Date.now();o||!1!==n.leading||(o=a);var s=t-(a-o),l=this,c=arguments;s<=0||s>t?(r&&(window.clearTimeout(r),r=null),o=a,e.apply(l,c)):r||!1===n.trailing||(r=window.setTimeout((function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(l,c)}),s))}}function F(e,t,n,r,o){void 0===o&&(o=window);var i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),i&&i.set&&i.set.call(this,e)}}),function(){return F(e,t,i||{},!0)}}function P(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,function(){e[t]=r}}catch(e){return function(){}}}function j(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function z(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function W(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||W(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,W(e.parentNode,t)}function U(e){return"__sn"in e&&-2===e.__sn.id}function V(e){var t=R.getId(e);return!R.has(t)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||V(e.parentNode))}function B(e){return Boolean(e.changedTouches)}function H(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function X(t){switch(t.type){case e.EventType.DomContentLoaded:case e.EventType.Load:case e.EventType.Custom:return!1;case e.EventType.FullSnapshot:case e.EventType.Meta:return!0}switch(t.data.source){case e.IncrementalSource.MouseMove:case e.IncrementalSource.MouseInteraction:case e.IncrementalSource.TouchMove:case e.IncrementalSource.MediaInteraction:return!1;case e.IncrementalSource.ViewportResize:case e.IncrementalSource.StyleSheetRule:case e.IncrementalSource.Scroll:case e.IncrementalSource.Input:return!0}return!0}var Y=function(){function t(){this.reset()}return t.prototype.add=function(e){var t=this.indexes.get(e.parentId),n={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(n.parent=t,t.children[n.id]=n):this.tree[n.id]=n,this.indexes.set(n.id,n)},t.prototype.remove=function(e){var t=this,n=this.indexes.get(e.parentId),r=this.indexes.get(e.id),o=function(e){t.removeIdSet.add(e);var n=R.getNode(e);null==n||n.childNodes.forEach((function(e){"__sn"in e&&o(e.__sn.id)}))},i=function(n){t.removeIdSet.add(n.id),Object.values(n.children).forEach((function(e){return i(e)}));var r=t.indexes.get(n.id);if(r){var o=r.parent;o&&(delete r.parent,delete o.children[r.id],t.indexes.delete(e.id))}};r?n?(delete r.parent,delete n.children[r.id],this.indexes.delete(e.id),i(r)):(delete this.tree[r.id],this.indexes.delete(r.id),i(r)):(this.removeNodeMutations.push(e),o(e.id))},t.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},t.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},t.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},t.prototype.input=function(e){this.inputMap.set(e.id,e)},t.prototype.flush=function(){var t,n,o,i,a=this,s=this.tree,l=this.removeNodeMutations,c=this.textMutations,u=this.attributeMutations,d={source:e.IncrementalSource.Mutation,removes:l,texts:c,attributes:u,adds:[]},f=function(e,t){t&&a.removeIdSet.add(e.id),d.texts=d.texts.concat(t?[]:e.texts).filter((function(e){return!a.removeIdSet.has(e.id)})),d.attributes=d.attributes.concat(t?[]:e.attributes).filter((function(e){return!a.removeIdSet.has(e.id)})),a.removeIdSet.has(e.id)||a.removeIdSet.has(e.mutation.parentId)||t?Object.values(e.children).forEach((function(e){return f(e,!0)})):(d.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return f(e,!1)})))};Object.values(s).forEach((function(e){return f(e,!1)}));try{for(var p=r(this.scrollMap.keys()),h=p.next();!h.done;h=p.next()){var v=h.value;this.removeIdSet.has(v)&&this.scrollMap.delete(v)}}catch(e){t={error:e}}finally{try{h&&!h.done&&(n=p.return)&&n.call(p)}finally{if(t)throw t.error}}try{for(var m=r(this.inputMap.keys()),y=m.next();!y.done;y=m.next()){v=y.value;this.removeIdSet.has(v)&&this.inputMap.delete(v)}}catch(e){o={error:e}}finally{try{y&&!y.done&&(i=m.return)&&i.call(m)}finally{if(o)throw o.error}}var g=new Map(this.scrollMap),b=new Map(this.inputMap);return this.reset(),{mutationData:d,scrollMap:g,inputMap:b}},t.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},t}();function q(e){var t,n,o={},i=function(e,t){var n={value:e,parent:t,children:[]};return o[e.node.id]=n,n},a=[];try{for(var s=r(e),l=s.next();!l.done;l=s.next()){var c=l.value,u=c.nextId,d=c.parentId;if(u&&u in o){var f=o[u];if(f.parent){var p=f.parent.children.indexOf(f);f.parent.children.splice(p,0,i(c,f.parent))}else{p=a.indexOf(f);a.splice(p,0,i(c,null))}}else if(d in o){var h=o[d];h.children.push(i(c,h))}else a.push(i(c,null))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a}function G(e,t){t(e.value);for(var n=e.children.length-1;n>=0;n--)G(e.children[n],t)}var J=Object.freeze({__proto__:null,on:D,mirror:R,throttle:A,hookSetter:F,patch:P,getWindowHeight:j,getWindowWidth:z,isBlocked:W,isIgnored:U,isAncestorRemoved:V,isTouchEvent:B,polyfill:H,needCastInSyncMode:X,TreeIndex:Y,queueToResolveTrees:q,iterateResolveTree:G});function K(e){return"__ln"in e}var $=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&K(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&K(e.nextSibling)){n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),Z=function(e,t){return e+"@"+t};function Q(e){return"__sn"in e}function ee(e,t){e.delete(t),t.childNodes.forEach((function(t){return ee(e,t)}))}function te(e,t){var n=t.parentNode;if(!n)return!1;var r=R.getId(n);return!!e.some((function(e){return e.id===r}))||te(e,n)}function ne(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||ne(e,n))}function re(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,o=[];if(r.children&&r.children.length>0)for(var i=0;i<r.children.length;i++){var a=r.children[i];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&o.push(a)}o.length>1&&(n+=":eq("+o.indexOf(e)+")"),t=n+(t?">"+t:""),e=r}return t}function oe(e,t){var n={numOfKeysLimit:50};Object.assign(n,t);var r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var i=r.indexOf(this);~i?r.splice(i+1):r.push(this),~i?o.splice(i,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null==t)return t;if(function(e){return"object"==typeof e&&Object.keys(e).length>n.numOfKeysLimit||"function"==typeof e}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=t.slice(0,n.stringLengthLimit)+"...");return t}(t);if(t instanceof Event){var a={};for(var s in t){var l=t[s];Array.isArray(l)?a[s]=re(l.length?l[0]:null):a[s]=l}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t}))}var ie=new(function(){function e(){var e=this;this.frozen=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(t){t.forEach(e.processMutation),e.frozen||e.emit()},this.emit=function(){for(var t,n,o,i,a=[],s=new $,l=function(t){for(var n=t,r=-2;-2===r;)r=(n=n&&n.nextSibling)&&R.getId(n);return-1===r&&W(t.nextSibling,e.blockClass)&&(r=null),r},c=function(t){if(t.parentNode&&document.contains(t)){var n=R.getId(t.parentNode),r=l(t);if(-1===n||-1===r)return s.addNode(t);var o=g(t,{doc:document,map:R.map,blockClass:e.blockClass,blockSelector:e.blockSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas});o&&a.push({parentId:n,nextId:r,node:o})}};e.mapRemoves.length;)R.removeNodeFromMap(e.mapRemoves.shift());try{for(var u=r(e.movedSet),d=u.next();!d.done;d=u.next()){var f=d.value;te(e.removes,f)&&!e.movedSet.has(f.parentNode)||c(f)}}catch(e){t={error:e}}finally{try{d&&!d.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}try{for(var p=r(e.addedSet),h=p.next();!h.done;h=p.next()){f=h.value;ne(e.droppedSet,f)||te(e.removes,f)?ne(e.movedSet,f)?c(f):e.droppedSet.add(f):c(f)}}catch(e){o={error:e}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}for(var v=null;s.length;){var m=null;if(v){var y=R.getId(v.value.parentNode),b=l(v.value);-1!==y&&-1!==b&&(m=v)}if(!m)for(var S=s.length-1;S>=0;S--){var w=s.get(S);y=R.getId(w.value.parentNode),b=l(w.value);if(-1!==y&&-1!==b){m=w;break}}if(!m){for(;s.head;)s.removeNode(s.head.value);break}v=m.previous,s.removeNode(m.value),c(m.value)}var E={texts:e.texts.map((function(e){return{id:R.getId(e.node),value:e.value}})).filter((function(e){return R.has(e.id)})),attributes:e.attributes.map((function(e){return{id:R.getId(e.node),attributes:e.attributes}})).filter((function(e){return R.has(e.id)})),removes:e.removes,adds:a};(E.texts.length||E.attributes.length||E.removes.length||E.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.emissionCallback(E))},this.processMutation=function(t){if(!U(t.target))switch(t.type){case"characterData":var n=t.target.textContent;W(t.target,e.blockClass)||n===t.oldValue||e.texts.push({value:n,node:t.target});break;case"attributes":n=t.target.getAttribute(t.attributeName);if(W(t.target,e.blockClass)||n===t.oldValue)return;var r=e.attributes.find((function(e){return e.node===t.target}));r||(r={node:t.target,attributes:{}},e.attributes.push(r)),r.attributes[t.attributeName]=v(document,t.attributeName,n);break;case"childList":t.addedNodes.forEach((function(n){return e.genAdds(n,t.target)})),t.removedNodes.forEach((function(n){var r=R.getId(n),o=R.getId(t.target);W(n,e.blockClass)||W(t.target,e.blockClass)||U(n)||(e.addedSet.has(n)?(ee(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||V(t.target)||(e.movedSet.has(n)&&e.movedMap[Z(r,o)]?ee(e.movedSet,n):e.removes.push({parentId:o,id:r})),e.mapRemoves.push(n))}))}},this.genAdds=function(t,n){if(!(W(t,e.blockClass)||n&&W(n,e.blockClass))){if(Q(t)){if(U(t))return;e.movedSet.add(t);var r=null;n&&Q(n)&&(r=n.__sn.id),r&&(e.movedMap[Z(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e,t,n,r,o,i,a){this.blockClass=t,this.blockSelector=n,this.inlineStylesheet=r,this.maskInputOptions=o,this.recordCanvas=i,this.slimDOMOptions=a,this.emissionCallback=e},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.isFrozen=function(){return this.frozen},e}());function ae(t,n,r){if(!1===r.mouseInteraction)return function(){};var o=!0===r.mouseInteraction||void 0===r.mouseInteraction?{}:r.mouseInteraction,i=[];return Object.keys(e.MouseInteractions).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==o[e]})).forEach((function(r){var o=r.toLowerCase(),a=function(r){return function(o){if(!W(o.target,n)){var i=R.getId(o.target),a=B(o)?o.changedTouches[0]:o,s=a.clientX,l=a.clientY;t({type:e.MouseInteractions[r],id:i,x:s,y:l})}}}(r);i.push(D(o,a))})),function(){i.forEach((function(e){return e()}))}}var se,le=["INPUT","TEXTAREA","SELECT"],ce=new WeakMap;function ue(t,o){void 0===o&&(o={}),function(e,t){var n=e.mutationCb,r=e.mousemoveCb,o=e.mouseInteractionCb,a=e.scrollCb,s=e.viewportResizeCb,l=e.inputCb,c=e.mediaInteractionCb,u=e.styleSheetRuleCb,d=e.canvasMutationCb,f=e.fontCb,p=e.logCb;e.mutationCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.mutation&&t.mutation.apply(t,i(e)),n.apply(void 0,i(e))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,i(e)),r.apply(void 0,i(e))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,i(e)),o.apply(void 0,i(e))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,i(e)),a.apply(void 0,i(e))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,i(e)),s.apply(void 0,i(e))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,i(e)),l.apply(void 0,i(e))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,i(e)),c.apply(void 0,i(e))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,i(e)),u.apply(void 0,i(e))},e.canvasMutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.canvasMutation&&t.canvasMutation.apply(t,i(e)),d.apply(void 0,i(e))},e.fontCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.font&&t.font.apply(t,i(e)),f.apply(void 0,i(e))},e.logCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.log&&t.log.apply(t,i(e)),p.apply(void 0,i(e))}}(t,o);var a,s,l=function(e,t,n,r,o,i,a){ie.init(e,t,n,r,o,i,a);var s=new MutationObserver(ie.processMutations.bind(ie));return s.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}(t.mutationCb,t.blockClass,t.blockSelector,t.inlineStylesheet,t.maskInputOptions,t.recordCanvas,t.slimDOMOptions),c=function(t,n){if(!1===n.mousemove)return function(){};var r,o="number"==typeof n.mousemove?n.mousemove:50,i=[],a=A((function(n){var o=Date.now()-r;t(i.map((function(e){return e.timeOffset-=o,e})),n?e.IncrementalSource.TouchMove:e.IncrementalSource.MouseMove),i=[],r=null}),500),s=A((function(e){var t=e.target,n=B(e)?e.changedTouches[0]:e,o=n.clientX,s=n.clientY;r||(r=Date.now()),i.push({x:o,y:s,id:R.getId(t),timeOffset:Date.now()-r}),a(B(e))}),o,{trailing:!1}),l=[D("mousemove",s),D("touchmove",s)];return function(){l.forEach((function(e){return e()}))}}(t.mousemoveCb,t.sampling),u=ae(t.mouseInteractionCb,t.blockClass,t.sampling),d=(a=t.scrollCb,s=t.blockClass,D("scroll",A((function(e){if(e.target&&!W(e.target,s)){var t=R.getId(e.target);if(e.target===document){var n=document.scrollingElement||document.documentElement;a({id:t,x:n.scrollLeft,y:n.scrollTop})}else a({id:t,x:e.target.scrollLeft,y:e.target.scrollTop})}}),t.sampling.scroll||100))),f=function(e){var t=-1,n=-1;return D("resize",A((function(){var r=j(),o=z();t===r&&n==o||(e({width:Number(o),height:Number(r)}),t=r,n=o)}),200),window)}(t.viewportResizeCb),p=function(e,t,r,o,a,s){function l(e){var n=e.target;if(n&&n.tagName&&!(le.indexOf(n.tagName)<0)&&!W(n,t)){var i=n.type;if("password"!==i&&!n.classList.contains(r)){var s=n.value,l=!1;"radio"===i||"checkbox"===i?l=n.checked:(o[n.tagName.toLowerCase()]||o[i])&&(s=a?a(s):"*".repeat(s.length)),c(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&&c(e,{text:e.value,isChecked:!l})}))}}}function c(t,r){var o=ce.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){ce.set(t,r);var i=R.getId(t);e(n(n({},r),{id:i}))}}var u=("last"===s.input?["change"]:["input","change"]).map((function(e){return D(e,l)})),d=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),f=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"]];return d&&d.set&&u.push.apply(u,i(f.map((function(e){return F(e[0],e[1],{set:function(){l({target:this})}})})))),function(){u.forEach((function(e){return e()}))}}(t.inputCb,t.blockClass,t.ignoreClass,t.maskInputOptions,t.maskInputFn,t.sampling),h=function(e,t){var n=function(n){return function(r){var o=r.target;o&&!W(o,t)&&e({type:"play"===n?M.Play:M.Pause,id:R.getId(o)})}},r=[D("play",n("play")),D("pause",n("pause"))];return function(){r.forEach((function(e){return e()}))}}(t.mediaInteractionCb,t.blockClass),v=function(e){var t=CSSStyleSheet.prototype.insertRule;CSSStyleSheet.prototype.insertRule=function(n,r){var o=R.getId(this.ownerNode);return-1!==o&&e({id:o,adds:[{rule:n,index:r}]}),t.apply(this,arguments)};var n=CSSStyleSheet.prototype.deleteRule;return CSSStyleSheet.prototype.deleteRule=function(t){var r=R.getId(this.ownerNode);return-1!==r&&e({id:r,removes:[{index:t}]}),n.apply(this,arguments)},function(){CSSStyleSheet.prototype.insertRule=t,CSSStyleSheet.prototype.deleteRule=n}}(t.styleSheetRuleCb),m=t.recordCanvas?function(e,t){var n,o,a=Object.getOwnPropertyNames(CanvasRenderingContext2D.prototype),s=[],l=function(n){try{if("function"!=typeof CanvasRenderingContext2D.prototype[n])return"continue";var r=P(CanvasRenderingContext2D.prototype,n,(function(r){return function(){for(var o=this,a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return W(this.canvas,t)||setTimeout((function(){var t=i(a);"drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement&&(t[0]=t[0].toDataURL()),e({id:R.getId(o.canvas),property:n,args:t})}),0),r.apply(this,a)}}));s.push(r)}catch(t){var o=F(CanvasRenderingContext2D.prototype,n,{set:function(t){e({id:R.getId(this.canvas),property:n,args:[t],setter:!0})}});s.push(o)}};try{for(var c=r(a),u=c.next();!u.done;u=c.next()){l(u.value)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}return function(){s.forEach((function(e){return e()}))}}(t.canvasMutationCb,t.blockClass):function(){},y=t.collectFonts?function(e){var t=[],n=new WeakMap,r=FontFace;window.FontFace=function(e,t,o){var i=new r(e,t,o);return n.set(i,{family:e,buffer:"string"!=typeof t,descriptors:o,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};var o=P(document.fonts,"add",(function(t){return function(r){return setTimeout((function(){var t=n.get(r);t&&(e(t),n.delete(r))}),0),t.apply(this,[r])}}));return t.push((function(){window.FonFace=r})),t.push(o),function(){t.forEach((function(e){return e()}))}}(t.fontCb):function(){},g=t.logOptions?function(e,t){var n,o,a=this,s=t.logger;if(!s)return function(){};var l=0,c=[];if(t.level.includes("error")&&window){var u=window.onerror;window.onerror=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];u&&u.apply(a,n);var o=[];n[n.length-1]instanceof Error&&(o=v(n[n.length-1].stack,0));var i=[oe(n[0],t.stringifyOptions)];e({level:"error",trace:o,payload:i})},c.push((function(){window.onerror=u}))}try{for(var d=r(t.level),f=d.next();!f.done;f=d.next()){var p=f.value;c.push(h(s,p))}}catch(e){n={error:e}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(n)throw n.error}}return function(){c.forEach((function(e){return e()}))};function h(n,r){var o=this;return n[r]?P(n,r,(function(n){return function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];n.apply(o,a);try{var c=v((new Error).stack),u=a.map((function(e){return oe(e,t.stringifyOptions)}));++l<t.lengthThreshold?e({level:r,trace:c,payload:u}):l===t.lengthThreshold&&e({level:"warn",trace:[],payload:[oe("The number of log records reached the threshold.")]})}catch(e){n.apply(void 0,i(["rrweb logger error:",e],a))}}})):function(){}}function v(e,t){void 0===t&&(t=1);var n=[];return e&&(n=e.split("at").splice(1+t).map((function(e){return e.trim()}))),n}}(t.logCb,t.logOptions):function(){};return function(){l.disconnect(),c(),u(),d(),f(),p(),h(),v(),m(),y(),g()}}function de(e){return n(n({},e),{timestamp:Date.now()})}function fe(t){void 0===t&&(t={});var r=t.emit,i=t.checkoutEveryNms,a=t.checkoutEveryNth,s=t.blockClass,l=void 0===s?"rr-block":s,c=t.blockSelector,u=void 0===c?null:c,d=t.ignoreClass,f=void 0===d?"rr-ignore":d,p=t.inlineStylesheet,h=void 0===p||p,v=t.maskAllInputs,m=t.maskInputOptions,y=t.slimDOMOptions,b=t.maskInputFn,S=t.hooks,w=t.packFn,E=t.sampling,C=void 0===E?{}:E,x=t.mousemoveWait,T=t.recordCanvas,M=void 0!==T&&T,I=t.collectFonts,k=void 0!==I&&I,N=t.recordLog,_=void 0!==N&&N;if(!r)throw new Error("emit function is required");void 0!==x&&void 0===C.mousemove&&(C.mousemove=x);var O,L=!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:void 0!==m?m:{},A=!0===y||"all"===y?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===y,headMetaDescKeywords:"all"===y}:y||{},F={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:console},P=_?!0===_?F:Object.assign({},F,_):{};H();var W=0;function U(t){var n,r,i,a;void 0===t&&(t=!1),se(de({type:e.EventType.Meta,data:{href:window.location.href,width:z(),height:j()}}),t);var s=ie.isFrozen();ie.freeze();var c=o(function(e,t){var n=t||{},r=n.blockClass,o=void 0===r?"rr-block":r,i=n.inlineStylesheet,a=void 0===i||i,s=n.recordCanvas,l=void 0!==s&&s,c=n.blockSelector,u=void 0===c?null:c,d=n.maskAllInputs,f=void 0!==d&&d,p=n.slimDOM,h=void 0!==p&&p,v={};return[g(e,{doc:e,map:v,blockClass:o,blockSelector:u,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===f?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:!1===f?{}:f,slimDOMOptions:!0===h||"all"===h?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===h,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===h?{}:h,recordCanvas:l}),v]}(document,{blockClass:l,blockSelector:u,inlineStylesheet:h,maskAllInputs:L,slimDOM:A,recordCanvas:M}),2),d=c[0],f=c[1];if(!d)return console.warn("Failed to snapshot the document");R.map=f,se(de({type:e.EventType.FullSnapshot,data:{node:d,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(r=null===(n=null===document||void 0===document?void 0:document.body)||void 0===n?void 0:n.parentElement)||void 0===r?void 0:r.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(a=null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.parentElement)||void 0===a?void 0:a.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),s||(ie.emit(),ie.unfreeze())}se=function(t,n){if(!ie.isFrozen()||t.type===e.EventType.FullSnapshot||t.type===e.EventType.IncrementalSnapshot&&t.data.source===e.IncrementalSource.Mutation||(ie.emit(),ie.unfreeze()),r(w?w(t):t,n),t.type===e.EventType.FullSnapshot)O=t,W=0;else if(t.type===e.EventType.IncrementalSnapshot){W++;var o=a&&W>=a,s=i&&t.timestamp-O.timestamp>i;(o||s)&&U(!0)}};try{var V=[];V.push(D("DOMContentLoaded",(function(){se(de({type:e.EventType.DomContentLoaded,data:{}}))})));var B=function(){U(),V.push(ue({mutationCb:function(t){return se(de({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.Mutation},t)}))},mousemoveCb:function(t,n){return se(de({type:e.EventType.IncrementalSnapshot,data:{source:n,positions:t}}))},mouseInteractionCb:function(t){return se(de({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.MouseInteraction},t)}))},scrollCb:function(t){return se(de({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.Scroll},t)}))},viewportResizeCb:function(t){return se(de({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.ViewportResize},t)}))},inputCb:function(t){return se(de({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.Input},t)}))},mediaInteractionCb:function(t){return se(de({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.MediaInteraction},t)}))},styleSheetRuleCb:function(t){return se(de({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.StyleSheetRule},t)}))},canvasMutationCb:function(t){return se(de({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.CanvasMutation},t)}))},fontCb:function(t){return se(de({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.Font},t)}))},logCb:function(t){return se(de({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.Log},t)}))},blockClass:l,blockSelector:u,ignoreClass:f,maskInputOptions:L,maskInputFn:b,inlineStylesheet:h,sampling:C,recordCanvas:M,collectFonts:k,slimDOMOptions:A,logOptions:P},S))};return"interactive"===document.readyState||"complete"===document.readyState?B():V.push(D("load",(function(){se(de({type:e.EventType.Load,data:{}})),B()}),window)),function(){V.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}function pe(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)}))}}}fe.addCustomEvent=function(t,n){if(!se)throw new Error("please add custom event after start recording");se(de({type:e.EventType.Custom,data:{tag:t,payload:n}}))},fe.freezePage=function(){ie.freeze()};var he=Object.freeze({__proto__:null,default:pe});function ve(e,t){if(void 0===e&&(e=window),void 0===t&&(t=document),!("scrollBehavior"in t.documentElement.style)||!0===e.__forceSmoothScrollPolyfill__){var n,r=e.HTMLElement||e.Element,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||s,scrollIntoView:r.prototype.scrollIntoView},i=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!==l(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):o.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]&&(l(arguments[0])?o.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)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==l(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");o.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!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):o.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!==l(arguments[0])){var n=f(this),r=n.getBoundingClientRect(),i=this.getBoundingClientRect();n!==t.body?(h.call(this,n,n.scrollLeft+i.left-r.left,n.scrollTop+i.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:i.left,top:i.top,behavior:"smooth"})}else o.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(e,t){this.scrollLeft=e,this.scrollTop=t}function l(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 c(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function u(t,n){var r=e.getComputedStyle(t,null)["overflow"+n];return"auto"===r||"scroll"===r}function d(e){var t=c(e,"Y")&&u(e,"Y"),n=c(e,"X")&&u(e,"X");return t||n}function f(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}function p(t){var n,r,o,a=(i()-t.startTime)/468;n=function(e){return.5*(1-Math.cos(Math.PI*e))}(a=a>1?1:a),r=t.startX+(t.x-t.startX)*n,o=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,r,o),r===t.x&&o===t.y||e.requestAnimationFrame(p.bind(e,t))}function h(n,r,a){var l,c,u,d,f=i();n===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=o.scroll):(l=n,c=n.scrollLeft,u=n.scrollTop,d=s),p({scrollable:l,method:d,startTime:f,startX:c,startY:u,x:r,y:a})}}var me,ye=function(){function e(e,t){void 0===e&&(e=[]),this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t}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,i(e))},e.prototype.start=function(){this.actions.sort((function(e,t){return e.delay-t.