posthog-js 1.45.0 → 1.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/array.full.js +12 -12
- package/dist/array.full.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/es.js +40 -25
- package/dist/es.js.map +1 -1
- package/dist/module.d.ts +30 -18
- package/dist/module.js +40 -25
- package/dist/module.js.map +1 -1
- package/dist/recorder-v2.js +19 -0
- package/dist/recorder-v2.js.map +1 -0
- package/dist/recorder.js +12 -12
- package/dist/recorder.js.map +1 -1
- package/lib/package.json +3 -2
- package/package.json +3 -2
- package/react/package.json +3 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
!function(){"use strict";var e;function t(){
|
|
2
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
3
|
+
t=function(){return e};var e={},n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof p?t:p,a=Object.create(o.prototype),i=new k(r||[]);return a._invoke=function(e,t,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return M()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var s=b(i,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=l(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,i),a}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d={};function p(){}function f(){}function h(){}var g={};c(g,a,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(w([])));v&&v!==n&&r.call(v,a)&&(g=v);var y=h.prototype=p.prototype=Object.create(g);function I(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,i,s){var c=l(e[o],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,s)}),(function(e){n("throw",e,i,s)})):t.resolve(d).then((function(e){u.value=e,i(u)}),(function(e){return n("throw",e,i,s)}))}s(c.arg)}var o;this._invoke=function(e,r){function a(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(a,a):a()}}function b(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=l(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function w(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return f.prototype=h,c(y,"constructor",h),c(h,"constructor",f),f.displayName=c(h,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,c(e,s,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},I(C.prototype),c(C.prototype,i,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(t,n,r,o),a);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},I(y),c(y,s,"Generator"),c(y,a,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=w,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:w(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){s=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw o}}return a}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=c(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw a}}}}function d(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function p(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function f(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(h).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function h(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=f(e.styleSheet)||t}catch(e){}return t}!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 g=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function m(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,a=e.maskInputFn,i=o||"";return(t[n.toLowerCase()]||t[r])&&(i=a?a(i):"*".repeat(i.length)),i}var v="__rrweb_original__";var y,I,C=1,b=new RegExp("[^a-z0-9-_:]");function S(){return C++}var A=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,k=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,w=/^(data:)([^,]*),(.*)/i;function M(e,t){return(e||"").replace(A,(function(e,n,r,o,a,i){var s,c=r||a||i,u=n||o||"";if(!c)return e;if(!k.test(c))return"url(".concat(u).concat(c).concat(u,")");if(w.test(c))return"url(".concat(u).concat(c).concat(u,")");if("/"===c[0])return"url(".concat(u).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)).concat(u,")");var l=t.split("/"),d=c.split("/");l.pop();for(var p=0,f=d;p<f.length;p++){var h=f[p];"."!==h&&(".."===h?l.pop():l.push(h))}return"url(".concat(u).concat(l.join("/")).concat(u,")")}))}var N=/^[^ \t\n\r\u000c]+/,O=/^[, \t\n\r\u000c]+/;function T(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function E(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function R(){var e=document.createElement("a");return e.href="",e.href}function L(e,t,n,r){return"src"===n||"href"===n&&r&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&r&&"#"!==r[0]?T(e,r):"background"!==n||!r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&r?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}for(var o=[];r(O),!(n>=t.length);){var a=r(N);if(","===a.slice(-1))a=T(e,a.substring(0,a.length-1)),o.push(a);else{var i="";a=T(e,a);for(var s=!1;;){var c=t.charAt(n);if(""===c){o.push((a+i).trim());break}if(s)")"===c&&(s=!1);else{if(","===c){n+=1,o.push((a+i).trim());break}"("===c&&(s=!0)}i+=c,n+=1}}}return o.join(", ")}(e,r):"style"===n&&r?M(r,R()):"object"===t&&"data"===n&&r?T(e,r):r:T(e,r)}function x(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&x(e.parentNode,t,n);for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return!!n&&x(e.parentNode,t,n)}function F(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===r)return!1;if("string"==typeof t){if(r.classList.contains(t))return!0;if(r.closest(".".concat(t)))return!0}else if(x(r,t,!0))return!0;if(n){if(r.matches(n))return!0;if(r.closest(n))return!0}return!1}function D(t,n){var r=n.doc,o=n.mirror,a=n.blockClass,i=n.blockSelector,s=n.maskTextClass,c=n.maskTextSelector,u=n.inlineStylesheet,l=n.maskInputOptions,d=void 0===l?{}:l,p=n.maskTextFn,h=n.maskInputFn,g=n.dataURLOptions,C=void 0===g?{}:g,S=n.inlineImages,A=n.recordCanvas,k=n.keepIframeSrcFn,w=n.newlyAddedElement,N=void 0!==w&&w,O=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(r,o);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode}:{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:O};case t.ELEMENT_NODE:return function(t,n){for(var r=n.doc,o=n.blockClass,a=n.blockSelector,i=n.inlineStylesheet,s=n.maskInputOptions,c=void 0===s?{}:s,u=n.maskInputFn,l=n.dataURLOptions,d=void 0===l?{}:l,p=n.inlineImages,h=n.recordCanvas,g=n.keepIframeSrcFn,C=n.newlyAddedElement,S=void 0!==C&&C,A=n.rootId,k=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return!!n&&e.matches(n)}(t,o,a),w=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return b.test(t)?"div":t}(t),N={},O=t.attributes.length,T=0;T<O;T++){var x=t.attributes[T];N[x.name]=L(r,w,x.name,x.value)}if("link"===w&&i){var F=Array.from(r.styleSheets).find((function(e){return e.href===t.href})),D=null;F&&(D=f(F)),D&&(delete N.rel,delete N.href,N._cssText=M(D,F.href))}if("style"===w&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){(D=f(t.sheet))&&(N._cssText=M(D,R()))}if("input"===w||"textarea"===w||"select"===w){var W=t.value,G=t.checked;"radio"!==N.type&&"checkbox"!==N.type&&"submit"!==N.type&&"button"!==N.type&&W?N.value=m({type:N.type,tagName:w,value:W,maskInputOptions:c,maskInputFn:u}):G&&(N.checked=G)}"option"===w&&(t.selected&&!c.select?N.selected=!0:delete N.selected);if("canvas"===w&&h)if("2d"===t.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var o=t.getImageData,a=v in o?o.__rrweb_original__:o;if(new Uint32Array(a.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(t)||(N.rr_dataURL=t.toDataURL(d.type,d.quality));else if(!("__context"in t)){var B=t.toDataURL(d.type,d.quality),Z=document.createElement("canvas");Z.width=t.width,Z.height=t.height,B!==Z.toDataURL(d.type,d.quality)&&(N.rr_dataURL=B)}if("img"===w&&p){y||(y=r.createElement("canvas"),I=y.getContext("2d"));var V=t,U=V.crossOrigin;V.crossOrigin="anonymous";var K=function(){try{y.width=V.naturalWidth,y.height=V.naturalHeight,I.drawImage(V,0,0),N.rr_dataURL=y.toDataURL(d.type,d.quality)}catch(e){console.warn("Cannot inline img src=".concat(V.currentSrc,"! Error: ").concat(e))}U?N.crossOrigin=U:V.removeAttribute("crossorigin")};V.complete&&0!==V.naturalWidth?K():V.onload=K}"audio"!==w&&"video"!==w||(N.rr_mediaState=t.paused?"paused":"played",N.rr_mediaCurrentTime=t.currentTime);S||(t.scrollLeft&&(N.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(N.rr_scrollTop=t.scrollTop));if(k){var _=t.getBoundingClientRect(),Y=_.width,j=_.height;N={class:N.class,rr_width:"".concat(Y,"px"),rr_height:"".concat(j,"px")}}"iframe"!==w||g(N.src)||(t.contentDocument||(N.rr_src=N.src),delete N.src);return{type:e.Element,tagName:w,attributes:N,childNodes:[],isSVG:E(t)||void 0,needBlock:k,rootId:A}}(t,{doc:r,blockClass:a,blockSelector:i,inlineStylesheet:u,maskInputOptions:d,maskInputFn:h,dataURLOptions:C,inlineImages:S,recordCanvas:A,keepIframeSrcFn:k,newlyAddedElement:N,rootId:O});case t.TEXT_NODE:return function(t,n){var r,o=n.maskTextClass,a=n.maskTextSelector,i=n.maskTextFn,s=n.rootId,c=t.parentNode&&t.parentNode.tagName,u=t.textContent,l="STYLE"===c||void 0,d="SCRIPT"===c||void 0;if(l&&u){try{t.nextSibling||t.previousSibling||(null===(r=t.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(u=(p=t.parentNode.sheet).cssRules?Array.from(p.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(e),t)}u=M(u,R())}var p;d&&(u="SCRIPT_PLACEHOLDER");!l&&!d&&u&&F(t,o,a)&&(u=i?i(u):u.replace(/[\S]/g,"*"));return{type:e.Text,textContent:u||"",isStyle:l,rootId:s}}(t,{maskTextClass:s,maskTextSelector:c,maskTextFn:p,rootId:O});case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:O};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:O};default:return!1}}function W(e){return void 0===e?"":e.toLowerCase()}function G(t,n){var r,o=n.doc,a=n.mirror,i=n.blockClass,s=n.blockSelector,c=n.maskTextClass,u=n.maskTextSelector,l=n.skipChild,f=void 0!==l&&l,h=n.inlineStylesheet,g=void 0===h||h,m=n.maskInputOptions,v=void 0===m?{}:m,y=n.maskTextFn,I=n.maskInputFn,C=n.slimDOMOptions,b=n.dataURLOptions,A=void 0===b?{}:b,k=n.inlineImages,w=void 0!==k&&k,M=n.recordCanvas,N=void 0!==M&&M,O=n.onSerialize,T=n.onIframeLoad,E=n.iframeLoadTimeout,R=void 0===E?5e3:E,L=n.onStylesheetLoad,x=n.stylesheetLoadTimeout,F=void 0===x?5e3:x,B=n.keepIframeSrcFn,Z=void 0===B?function(){return!1}:B,V=n.newlyAddedElement,U=void 0!==V&&V,K=n.preserveWhiteSpace,_=void 0===K||K,Y=D(t,{doc:o,mirror:a,blockClass:i,blockSelector:s,maskTextClass:c,maskTextSelector:u,inlineStylesheet:g,maskInputOptions:v,maskTextFn:y,maskInputFn:I,dataURLOptions:A,inlineImages:w,recordCanvas:N,keepIframeSrcFn:Z,newlyAddedElement:U});if(!Y)return console.warn(t,"not serialized"),null;r=a.hasNode(t)?a.getId(t):!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(W(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===W(t.attributes.name)||"icon"===W(t.attributes.rel)||"apple-touch-icon"===W(t.attributes.rel)||"shortcut icon"===W(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&W(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(W(t.attributes.property).match(/^(og|twitter|fb):/)||W(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===W(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===W(t.attributes.name)||"googlebot"===W(t.attributes.name)||"bingbot"===W(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===W(t.attributes.name)||"generator"===W(t.attributes.name)||"framework"===W(t.attributes.name)||"publisher"===W(t.attributes.name)||"progid"===W(t.attributes.name)||W(t.attributes.property).match(/^article:/)||W(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===W(t.attributes.name)||"yandex-verification"===W(t.attributes.name)||"csrf-token"===W(t.attributes.name)||"p:domain_verify"===W(t.attributes.name)||"verify-v1"===W(t.attributes.name)||"verification"===W(t.attributes.name)||"shopify-checkout-api-token"===W(t.attributes.name)))return!0}}return!1}(Y,C)&&(_||Y.type!==e.Text||Y.isStyle||Y.textContent.replace(/^\s+|\s+$/gm,"").length)?S():-2;var j=Object.assign(Y,{id:r});if(a.add(t,j),-2===r)return null;O&&O(t);var J=!f;if(j.type===e.Element){J=J&&!j.needBlock,delete j.needBlock;var z=t.shadowRoot;z&&p(z)&&(j.isShadowHost=!0)}if((j.type===e.Document||j.type===e.Element)&&J){C.headWhitespace&&j.type===e.Element&&"head"===j.tagName&&(_=!1);for(var Q={doc:o,mirror:a,blockClass:i,blockSelector:s,maskTextClass:c,maskTextSelector:u,skipChild:f,inlineStylesheet:g,maskInputOptions:v,maskTextFn:y,maskInputFn:I,slimDOMOptions:C,dataURLOptions:A,inlineImages:w,recordCanvas:N,preserveWhiteSpace:_,onSerialize:O,onIframeLoad:T,iframeLoadTimeout:R,onStylesheetLoad:L,stylesheetLoadTimeout:F,keepIframeSrcFn:Z},H=0,P=Array.from(t.childNodes);H<P.length;H++){($=G(P[H],Q))&&j.childNodes.push($)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(t)&&t.shadowRoot)for(var X=0,q=Array.from(t.shadowRoot.childNodes);X<q.length;X++){var $;($=G(q[X],Q))&&(p(t.shadowRoot)&&($.isShadow=!0),j.childNodes.push($))}}return t.parentNode&&d(t.parentNode)&&p(t.parentNode)&&(j.isShadow=!0),j.type===e.Element&&"iframe"===j.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var o,a=!1;try{o=r.document.readyState}catch(e){return}if("complete"===o){var i="about:blank";if(r.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){a||(t(),a=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),a=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&T){var n=G(e,{doc:e,mirror:a,blockClass:i,blockSelector:s,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:g,maskInputOptions:v,maskTextFn:y,maskInputFn:I,slimDOMOptions:C,dataURLOptions:A,inlineImages:w,recordCanvas:N,preserveWhiteSpace:_,onSerialize:O,onIframeLoad:T,iframeLoadTimeout:R,onStylesheetLoad:L,stylesheetLoadTimeout:F,keepIframeSrcFn:Z});n&&T(t,n)}}),R),j.type===e.Element&&"link"===j.tagName&&"stylesheet"===j.attributes.rel&&function(e,t,n){var r,o=!1;try{r=e.sheet}catch(e){return}if(!r){var a=setTimeout((function(){o||(t(),o=!0)}),n);e.addEventListener("load",(function(){clearTimeout(a),o=!0,t()}))}}(t,(function(){if(L){var e=G(t,{doc:o,mirror:a,blockClass:i,blockSelector:s,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:g,maskInputOptions:v,maskTextFn:y,maskInputFn:I,slimDOMOptions:C,dataURLOptions:A,inlineImages:w,recordCanvas:N,preserveWhiteSpace:_,onSerialize:O,onIframeLoad:T,iframeLoadTimeout:R,onStylesheetLoad:L,stylesheetLoadTimeout:F,keepIframeSrcFn:Z});e&&L(t,e)}}),F),j}function B(e,t){var n=t||{},r=n.mirror,o=void 0===r?new g:r,a=n.blockClass,i=void 0===a?"rr-block":a,s=n.blockSelector,c=void 0===s?null:s,u=n.maskTextClass,l=void 0===u?"rr-mask":u,d=n.maskTextSelector,p=void 0===d?null:d,f=n.inlineStylesheet,h=void 0===f||f,m=n.inlineImages,v=void 0!==m&&m,y=n.recordCanvas,I=void 0!==y&&y,C=n.maskAllInputs,b=void 0!==C&&C,S=n.maskTextFn,A=n.maskInputFn,k=n.slimDOM,w=void 0!==k&&k,M=n.dataURLOptions,N=n.preserveWhiteSpace,O=n.onSerialize,T=n.onIframeLoad,E=n.iframeLoadTimeout,R=n.onStylesheetLoad,L=n.stylesheetLoadTimeout,x=n.keepIframeSrcFn;return G(e,{doc:e,mirror:o,blockClass:i,blockSelector:c,maskTextClass:l,maskTextSelector:p,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===b?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===b?{password:!0}:b,maskTextFn:S,maskInputFn:A,slimDOMOptions:!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===w,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===w?{}:w,dataURLOptions:M,inlineImages:v,recordCanvas:I,preserveWhiteSpace:N,onSerialize:O,onIframeLoad:T,iframeLoadTimeout:E,onStylesheetLoad:R,stylesheetLoadTimeout:L,keepIframeSrcFn:void 0===x?function(){return!1}:x,newlyAddedElement:!1})}function Z(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var V="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",U={map:{},getId:function(){return console.error(V),-1},getNode:function(){return console.error(V),null},removeNodeFromMap:function(){console.error(V)},has:function(){return console.error(V),!1},reset:function(){console.error(V)}};function K(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,o=0;return function(){for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];var c=Date.now();o||!1!==n.leading||(o=c);var u=t-(c-o),l=this;u<=0||u>t?(r&&(clearTimeout(r),r=null),o=c,e.apply(l,i)):r||!1===n.trailing||(r=setTimeout((function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(l,i)}),u))}}function _(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,a=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),a&&a.set&&a.set.call(this,e)}}),function(){return _(e,t,a||{},!0)}}function Y(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(e){var t,n,r,o,a,i,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==s?void 0:s.documentElement.scrollLeft)||(null===(n=null===(t=null==s?void 0:s.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null==s?void 0:s.body)||void 0===r?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null===(a=null===(o=null==s?void 0:s.body)||void 0===o?void 0:o.parentElement)||void 0===a?void 0:a.scrollTop)||(null===(i=null==s?void 0:s.body)||void 0===i?void 0:i.scrollTop)||0}}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 Q(e,t,n,r){if(!e)return!1;var o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(x(o,t,r))return!0;if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function H(e,t){return-2===t.getId(e)}function P(e,t){if(d(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||P(e.parentNode,t))}function X(e){return Boolean(e.changedTouches)}function q(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})}function $(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function ee(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function te(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(U=new Proxy(U,{get:function(e,t,n){return"map"===t&&console.error(V),Reflect.get(e,t,n)}}));var ne=function(){function e(){r(this,e),this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}return a(e,[{key:"getId",value:function(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}},{key:"has",value:function(e){return this.styleIDMap.has(e)}},{key:"add",value:function(e,t){return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n}},{key:"getStyle",value:function(e){return this.idStyleMap.get(e)||null}},{key:"reset",value:function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}},{key:"generateId",value:function(){return this.id++}}]),e}();function re(e){var t,n,r=null;return(null===(n=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function oe(e){var t=e.ownerDocument;if(!t)return!1;var n=function(e){for(var t,n=e;t=re(n);)n=t;return n}(e);return t.contains(n)}function ae(e){var t=e.ownerDocument;return!!t&&(t.contains(e)||oe(e))}var ie=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(ie||{}),se=function(e){return e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e}(se||{}),ce=function(e){return e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e}(ce||{}),ue=function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e}(ue||{});function le(e){return"__ln"in e}var de=function(){function e(){r(this,e),this.length=0,this.head=null}return a(e,[{key:"get",value: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}},{key:"addNode",value:function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&le(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&&le(e.nextSibling)&&e.nextSibling.__ln.previous){var r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++}},{key:"removeNode",value: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}(),pe=function(e,t){return"".concat(e,"@").concat(t)},fe=function(){function e(){var t=this;r(this,e),this.frozen=!1,this.locked=!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(e){e.forEach(t.processMutation),t.emit()},this.emit=function(){if(!t.frozen&&!t.locked){for(var e=[],n=new de,r=function(e){for(var n=e,r=-2;-2===r;)r=(n=n&&n.nextSibling)&&t.mirror.getId(n);return r},o=function(o){if(o.parentNode&&ae(o)){var a=d(o.parentNode)?t.mirror.getId(re(o)):t.mirror.getId(o.parentNode),i=r(o);if(-1===a||-1===i)return n.addNode(o);var s=G(o,{doc:t.doc,mirror:t.mirror,blockClass:t.blockClass,blockSelector:t.blockSelector,maskTextClass:t.maskTextClass,maskTextSelector:t.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:t.inlineStylesheet,maskInputOptions:t.maskInputOptions,maskTextFn:t.maskTextFn,maskInputFn:t.maskInputFn,slimDOMOptions:t.slimDOMOptions,dataURLOptions:t.dataURLOptions,recordCanvas:t.recordCanvas,inlineImages:t.inlineImages,onSerialize:function(e){$(e,t.mirror)&&t.iframeManager.addIframe(e),ee(e,t.mirror)&&t.stylesheetManager.trackLinkElement(e),te(o)&&t.shadowDomManager.addShadowRoot(o.shadowRoot,t.doc)},onIframeLoad:function(e,n){t.iframeManager.attachIframe(e,n),t.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:function(e,n){t.stylesheetManager.attachLinkElement(e,n)}});s&&e.push({parentId:a,nextId:i,node:s})}};t.mapRemoves.length;)t.mirror.removeNodeFromMap(t.mapRemoves.shift());for(var a=0,i=Array.from(t.movedSet.values());a<i.length;a++){var s=i[a];ge(t.removes,s,t.mirror)&&!t.movedSet.has(s.parentNode)||o(s)}for(var c=0,u=Array.from(t.addedSet.values());c<u.length;c++){var l=u[c];ve(t.droppedSet,l)||ge(t.removes,l,t.mirror)?ve(t.movedSet,l)?o(l):t.droppedSet.add(l):o(l)}for(var p=null;n.length;){var f=null;if(p){var h=t.mirror.getId(p.value.parentNode),g=r(p.value);-1!==h&&-1!==g&&(f=p)}if(!f)for(var m=n.length-1;m>=0;m--){var v=n.get(m);if(v){var y=t.mirror.getId(v.value.parentNode);if(-1===r(v.value))continue;if(-1!==y){f=v;break}var I=v.value;if(I.parentNode&&I.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var C=I.parentNode.host;if(-1!==t.mirror.getId(C)){f=v;break}}}}if(!f){for(;n.head;)n.removeNode(n.head.value);break}p=f.previous,n.removeNode(f.value),o(f.value)}var b={texts:t.texts.map((function(e){return{id:t.mirror.getId(e.node),value:e.value}})).filter((function(e){return t.mirror.has(e.id)})),attributes:t.attributes.map((function(e){return{id:t.mirror.getId(e.node),attributes:e.attributes}})).filter((function(e){return t.mirror.has(e.id)})),removes:t.removes,adds:e};(b.texts.length||b.attributes.length||b.removes.length||b.adds.length)&&(t.texts=[],t.attributes=[],t.removes=[],t.addedSet=new Set,t.movedSet=new Set,t.droppedSet=new Set,t.movedMap={},t.mutationCb(b))}},this.processMutation=function(e){if(!H(e.target,t.mirror))switch(e.type){case"characterData":var n=e.target.textContent;Q(e.target,t.blockClass,t.blockSelector,!1)||n===e.oldValue||t.texts.push({value:F(e.target,t.maskTextClass,t.maskTextSelector)&&n?t.maskTextFn?t.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:e.target});break;case"attributes":var r=e.target,o=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(o=m({maskInputOptions:t.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:o,maskInputFn:t.maskInputFn})),Q(e.target,t.blockClass,t.blockSelector,!1)||o===e.oldValue)return;var a=t.attributes.find((function(t){return t.node===e.target}));if("IFRAME"===r.tagName&&"src"===e.attributeName&&!t.keepIframeSrcFn(o)){if(r.contentDocument)return;e.attributeName="rr_src"}if(a||(a={node:e.target,attributes:{}},t.attributes.push(a)),"style"===e.attributeName){var i=t.doc.createElement("span");e.oldValue&&i.setAttribute("style",e.oldValue),void 0!==a.attributes.style&&null!==a.attributes.style||(a.attributes.style={});for(var s=a.attributes.style,c=0,u=Array.from(r.style);c<u.length;c++){var l=u[c],f=r.style.getPropertyValue(l),h=r.style.getPropertyPriority(l);f===i.style.getPropertyValue(l)&&h===i.style.getPropertyPriority(l)||(s[l]=""===h?f:[f,h])}for(var g=0,v=Array.from(i.style);g<v.length;g++){var y=v[g];""===r.style.getPropertyValue(y)&&(s[y]=!1)}}else a.attributes[e.attributeName]=L(t.doc,r.tagName,e.attributeName,o);break;case"childList":if(Q(e.target,t.blockClass,t.blockSelector,!0))return;e.addedNodes.forEach((function(n){return t.genAdds(n,e.target)})),e.removedNodes.forEach((function(n){var r=t.mirror.getId(n),o=d(e.target)?t.mirror.getId(e.target.host):t.mirror.getId(e.target);Q(e.target,t.blockClass,t.blockSelector,!1)||H(n,t.mirror)||!function(e,t){return-1!==t.getId(e)}(n,t.mirror)||(t.addedSet.has(n)?(he(t.addedSet,n),t.droppedSet.add(n)):t.addedSet.has(e.target)&&-1===r||P(e.target,t.mirror)||(t.movedSet.has(n)&&t.movedMap[pe(r,o)]?he(t.movedSet,n):t.removes.push({parentId:o,id:r,isShadow:!(!d(e.target)||!p(e.target))||void 0})),t.mapRemoves.push(n))}))}},this.genAdds=function(e,n){if(!t.processedNodeManager.inOtherBuffer(e,t)){if(t.mirror.hasNode(e)){if(H(e,t.mirror))return;t.movedSet.add(e);var r=null;n&&t.mirror.hasNode(n)&&(r=t.mirror.getId(n)),r&&-1!==r&&(t.movedMap[pe(t.mirror.getId(e),r)]=!0)}else t.addedSet.add(e),t.droppedSet.delete(e);Q(e,t.blockClass,t.blockSelector,!1)||(e.childNodes.forEach((function(e){return t.genAdds(e)})),te(e)&&e.shadowRoot.childNodes.forEach((function(n){t.processedNodeManager.add(n,t),t.genAdds(n,e)})))}}}return a(e,[{key:"init",value:function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((function(n){t[n]=e[n]}))}},{key:"freeze",value:function(){this.frozen=!0,this.canvasManager.freeze()}},{key:"unfreeze",value:function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}},{key:"isFrozen",value:function(){return this.frozen}},{key:"lock",value:function(){this.locked=!0,this.canvasManager.lock()}},{key:"unlock",value:function(){this.locked=!1,this.canvasManager.unlock(),this.emit()}},{key:"reset",value:function(){this.shadowDomManager.reset(),this.canvasManager.reset()}}]),e}();function he(e,t){e.delete(t),t.childNodes.forEach((function(t){return he(e,t)}))}function ge(e,t,n){return 0!==e.length&&me(e,t,n)}function me(e,t,n){var r=t.parentNode;if(!r)return!1;var o=n.getId(r);return!!e.some((function(e){return e.id===o}))||me(e,r,n)}function ve(e,t){return 0!==e.size&&ye(e,t)}function ye(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||ye(e,n))}var Ie=[],Ce=new(function(){function e(){r(this,e),this.nodeMap=new WeakMap,this.periodicallyClear()}return a(e,[{key:"periodicallyClear",value:function(){var e=this;requestAnimationFrame((function(){e.clear(),e.periodicallyClear()}))}},{key:"inOtherBuffer",value:function(e,t){var n=this.nodeMap.get(e);return n&&Array.from(n).some((function(e){return e!==t}))}},{key:"add",value:function(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}},{key:"clear",value:function(){this.nodeMap=new WeakMap}}]),e}());function be(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function Se(e,t){var n,r,o=new fe;Ie.push(o),o.init(e);var a=window.MutationObserver||window.__rrMutationObserver,i=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");i&&window[i]&&(a=window[i]);var s=new a(o.processMutations.bind(o));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Ae(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,o=e.mirror;if(!1===n.mousemove)return function(){};var a,i="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,c=[],u=K((function(e){var n=Date.now()-a;t(c.map((function(e){return e.timeOffset-=n,e})),e),c=[],a=null}),s),l=K((function(e){var t=be(e),n=X(e)?e.changedTouches[0]:e,r=n.clientX,i=n.clientY;a||(a=Date.now()),c.push({x:r,y:i,id:o.getId(t),timeOffset:Date.now()-a}),u("undefined"!=typeof DragEvent&&e instanceof DragEvent?se.Drag:e instanceof MouseEvent?se.MouseMove:se.TouchMove)}),i,{trailing:!1}),d=[Z("mousemove",l,r),Z("touchmove",l,r),Z("drag",l,r)];return function(){d.forEach((function(e){return e()}))}}function ke(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.sampling;if(!1===i.mouseInteraction)return function(){};var s=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,c=[];return Object.keys(ce).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]})).forEach((function(e){var i=e.toLowerCase(),s=function(e){return function(n){var i=be(n);if(!Q(i,o,a,!0)){var s=X(n)?n.changedTouches[0]:n;if(s){var c=r.getId(i),u=s.clientX,l=s.clientY;t({type:ce[e],id:c,x:u,y:l})}}}}(e);c.push(Z(i,s,n))})),function(){c.forEach((function(e){return e()}))}}function we(e){var t=e.scrollCb,n=e.doc,r=e.mirror,o=e.blockClass,a=e.blockSelector;return Z("scroll",K((function(e){var i=be(e);if(i&&!Q(i,o,a,!0)){var s=r.getId(i);if(i===n&&n.defaultView){var c=j(n.defaultView);t({id:s,x:c.left,y:c.top})}else t({id:s,x:i.scrollLeft,y:i.scrollTop})}}),e.sampling.scroll||100),n)}function Me(e){var t=e.viewportResizeCb,n=-1,r=-1;return Z("resize",K((function(){var e=J(),o=z();n===e&&r===o||(t({width:Number(o),height:Number(e)}),n=e,r=o)}),200),window)}function Ne(e,t){var n=Object.assign({},e);return t||delete n.userTriggered,n}var Oe=["INPUT","TEXTAREA","SELECT"],Te=new WeakMap;function Ee(e){var t=e.inputCb,n=e.doc,r=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.ignoreClass,c=e.maskInputOptions,u=e.maskInputFn,l=e.sampling,d=e.userTriggeredOnInput;function p(e){var t=be(e),r=e.isTrusted;if(t&&"OPTION"===t.tagName&&(t=t.parentElement),t&&t.tagName&&!(Oe.indexOf(t.tagName)<0)&&!Q(t,o,a,!0)){var s=t.type;if(!t.classList.contains(i)){var l=t.value,p=!1;"radio"===s||"checkbox"===s?p=t.checked:(c[t.tagName.toLowerCase()]||c[s])&&(l=m({maskInputOptions:c,tagName:t.tagName,type:s,value:l,maskInputFn:u})),f(t,Ne({text:l,isChecked:p,userTriggered:r},d));var h=t.name;"radio"===s&&h&&p&&n.querySelectorAll('input[type="radio"][name="'.concat(h,'"]')).forEach((function(e){e!==t&&f(e,Ne({text:e.value,isChecked:!p,userTriggered:!1},d))}))}}}function f(e,n){var o=Te.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){Te.set(e,n);var a=r.getId(e);t(Object.assign(Object.assign({},n),{id:a}))}}var h=("last"===l.input?["change"]:["input","change"]).map((function(e){return Z(e,p,n)})),g=n.defaultView;if(!g)return function(){h.forEach((function(e){return e()}))};var v=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),y=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return v&&v.set&&h.push.apply(h,s(y.map((function(e){return _(e[0],e[1],{set:function(){p({target:this})}},!1,g)})))),function(){h.forEach((function(e){return e()}))}}function Re(e){return function(e,t){if(Ue("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Ue("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Ue("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Ue("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){var r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function Le(e,t,n){var r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function xe(e,t){var n=e.styleSheetRuleCb,r=e.mirror,o=e.stylesheetManager,a=t.win;if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return function(){};var c=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=function(e,t){var a=Le(this,r,o.styleMirror),i=a.id,s=a.styleId;return(i&&-1!==i||s&&-1!==s)&&n({id:i,styleId:s,adds:[{rule:e,index:t}]}),c.apply(this,[e,t])};var u,l,d=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=function(e){var t=Le(this,r,o.styleMirror),a=t.id,i=t.styleId;return(a&&-1!==a||i&&-1!==i)&&n({id:a,styleId:i,removes:[{index:e}]}),d.apply(this,[e])},a.CSSStyleSheet.prototype.replace&&(u=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=function(e){var t=Le(this,r,o.styleMirror),a=t.id,i=t.styleId;return(a&&-1!==a||i&&-1!==i)&&n({id:a,styleId:i,replace:e}),u.apply(this,[e])}),a.CSSStyleSheet.prototype.replaceSync&&(l=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=function(e){var t=Le(this,r,o.styleMirror),a=t.id,i=t.styleId;return(a&&-1!==a||i&&-1!==i)&&n({id:a,styleId:i,replaceSync:e}),l.apply(this,[e])});var p={};Ke("CSSGroupingRule")?p.CSSGroupingRule=a.CSSGroupingRule:(Ke("CSSMediaRule")&&(p.CSSMediaRule=a.CSSMediaRule),Ke("CSSConditionRule")&&(p.CSSConditionRule=a.CSSConditionRule),Ke("CSSSupportsRule")&&(p.CSSSupportsRule=a.CSSSupportsRule));var f={};return Object.entries(p).forEach((function(e){var t=i(e,2),a=t[0],c=t[1];f[a]={insertRule:c.prototype.insertRule,deleteRule:c.prototype.deleteRule},c.prototype.insertRule=function(e,t){var i=Le(this.parentStyleSheet,r,o.styleMirror),c=i.id,u=i.styleId;return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,adds:[{rule:e,index:[].concat(s(Re(this)),[t||0])}]}),f[a].insertRule.apply(this,[e,t])},c.prototype.deleteRule=function(e){var t=Le(this.parentStyleSheet,r,o.styleMirror),i=t.id,c=t.styleId;return(i&&-1!==i||c&&-1!==c)&&n({id:i,styleId:c,removes:[{index:[].concat(s(Re(this)),[e])}]}),f[a].deleteRule.apply(this,[e])}})),function(){a.CSSStyleSheet.prototype.insertRule=c,a.CSSStyleSheet.prototype.deleteRule=d,u&&(a.CSSStyleSheet.prototype.replace=u),l&&(a.CSSStyleSheet.prototype.replaceSync=l),Object.entries(p).forEach((function(e){var t=i(e,2),n=t[0],r=t[1];r.prototype.insertRule=f[n].insertRule,r.prototype.deleteRule=f[n].deleteRule}))}}function Fe(e,t){var n,r,o,a=e.mirror,i=e.stylesheetManager,s=null;s="#document"===t.nodeName?a.getId(t):a.getId(t.host);var c="#document"===t.nodeName?null===(n=t.defaultView)||void 0===n?void 0:n.Document:null===(o=null===(r=t.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===o?void 0:o.ShadowRoot,u=Object.getOwnPropertyDescriptor(null==c?void 0:c.prototype,"adoptedStyleSheets");return null!==s&&-1!==s&&c&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:function(){var e;return null===(e=u.get)||void 0===e?void 0:e.call(this)},set:function(e){var t,n=null===(t=u.set)||void 0===t?void 0:t.call(this,e);if(null!==s&&-1!==s)try{i.adoptStyleSheets(e,s)}catch(e){}return n}}),function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}):function(){}}function De(e,t){var n=e.styleDeclarationCb,r=e.mirror,o=e.ignoreCSSAttributes,a=e.stylesheetManager,i=t.win,s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(e,t,i){var c;if(o.has(e))return s.apply(this,[e,t,i]);var u=Le(null===(c=this.parentRule)||void 0===c?void 0:c.parentStyleSheet,r,a.styleMirror),l=u.id,d=u.styleId;return(l&&-1!==l||d&&-1!==d)&&n({id:l,styleId:d,set:{property:e,value:t,priority:i},index:Re(this.parentRule)}),s.apply(this,[e,t,i])};var c=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(e){var t;if(o.has(e))return c.apply(this,[e]);var i=Le(null===(t=this.parentRule)||void 0===t?void 0:t.parentStyleSheet,r,a.styleMirror),s=i.id,u=i.styleId;return(s&&-1!==s||u&&-1!==u)&&n({id:s,styleId:u,remove:{property:e},index:Re(this.parentRule)}),c.apply(this,[e])},function(){i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=c}}function We(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.blockSelector,o=e.mirror,a=e.sampling,i=function(e){return K((function(a){var i=be(a);if(i&&!Q(i,n,r,!0)){var s=i.currentTime,c=i.volume,u=i.muted,l=i.playbackRate;t({type:e,id:o.getId(i),currentTime:s,volume:c,muted:u,playbackRate:l})}}),a.media||500)},s=[Z("play",i(0)),Z("pause",i(1)),Z("seeked",i(2)),Z("volumechange",i(3)),Z("ratechange",i(4))];return function(){s.forEach((function(e){return e()}))}}function Ge(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var o=[],a=new WeakMap,i=r.FontFace;r.FontFace=function(e,t,n){var r=new i(e,t,n);return a.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=Y(n.fonts,"add",(function(e){return function(n){return setTimeout((function(){var e=a.get(n);e&&(t(e),a.delete(n))}),0),e.apply(this,[n])}}));return o.push((function(){r.FontFace=i})),o.push(s),function(){o.forEach((function(e){return e()}))}}function Be(e){var t=e.doc,n=e.mirror,r=e.blockClass,o=e.blockSelector,a=e.selectionCb,i=!0,s=function(){var e=t.getSelection();if(!(!e||i&&(null==e?void 0:e.isCollapsed))){i=e.isCollapsed||!1;for(var s=[],c=e.rangeCount||0,u=0;u<c;u++){var l=e.getRangeAt(u),d=l.startContainer,p=l.startOffset,f=l.endContainer,h=l.endOffset;Q(d,r,o,!0)||Q(f,r,o,!0)||s.push({start:n.getId(d),startOffset:p,end:n.getId(f),endOffset:h})}a({ranges:s})}};return s(),Z("selectionchange",s)}function Ze(e,t){var n=e.mutationCb,r=e.mousemoveCb,o=e.mouseInteractionCb,a=e.scrollCb,i=e.viewportResizeCb,s=e.inputCb,c=e.mediaInteractionCb,u=e.styleSheetRuleCb,l=e.styleDeclarationCb,d=e.canvasMutationCb,p=e.fontCb,f=e.selectionCb;e.mutationCb=function(){t.mutation&&t.mutation.apply(t,arguments),n.apply(void 0,arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove.apply(t,arguments),r.apply(void 0,arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction.apply(t,arguments),o.apply(void 0,arguments)},e.scrollCb=function(){t.scroll&&t.scroll.apply(t,arguments),a.apply(void 0,arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize.apply(t,arguments),i.apply(void 0,arguments)},e.inputCb=function(){t.input&&t.input.apply(t,arguments),s.apply(void 0,arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction.apply(t,arguments),c.apply(void 0,arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule.apply(t,arguments),u.apply(void 0,arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration.apply(t,arguments),l.apply(void 0,arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation.apply(t,arguments),d.apply(void 0,arguments)},e.fontCb=function(){t.font&&t.font.apply(t,arguments),p.apply(void 0,arguments)},e.selectionCb=function(){t.selection&&t.selection.apply(t,arguments),f.apply(void 0,arguments)}}function Ve(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.doc.defaultView;if(!n)return function(){};Ze(e,t);var r,o=Se(e,e.doc),a=Ae(e),i=ke(e),s=we(e),c=Me(e),u=Ee(e),d=We(e),p=xe(e,{win:n}),f=Fe(e,e.doc),h=De(e,{win:n}),g=e.collectFonts?Ge(e):function(){},m=Be(e),v=[],y=l(e.plugins);try{for(y.s();!(r=y.n()).done;){var I=r.value;v.push(I.observer(I.callback,n,I.options))}}catch(e){y.e(e)}finally{y.f()}return function(){Ie.forEach((function(e){return e.reset()})),o.disconnect(),a(),i(),s(),c(),u(),d(),p(),f(),h(),g(),m(),v.forEach((function(e){return e()}))}}function Ue(e){return void 0!==window[e]}function Ke(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var _e=function(){function e(t){r(this,e),this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}return a(e,[{key:"getId",value:function(e,t,n,r){var o=n||this.getIdToRemoteIdMap(e),a=r||this.getRemoteIdToIdMap(e),i=o.get(t);return i||(i=this.generateIdFn(),o.set(t,i),a.set(i,t)),i}},{key:"getIds",value:function(e,t){var n=this,r=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return t.map((function(t){return n.getId(e,t,r,o)}))}},{key:"getRemoteId",value:function(e,t,n){var r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var o=r.get(t);return o||-1}},{key:"getRemoteIds",value:function(e,t){var n=this,r=this.getRemoteIdToIdMap(e);return t.map((function(t){return n.getRemoteId(e,t,r)}))}},{key:"reset",value:function(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}},{key:"getIdToRemoteIdMap",value:function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}},{key:"getRemoteIdToIdMap",value:function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}]),e}(),Ye=function(){function t(e){r(this,t),this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new _e(S),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new _e(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}return a(t,[{key:"addIframe",value:function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}},{key:"addLoadListener",value:function(e){this.loadListener=e}},{key:"attachIframe",value:function(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}},{key:"handleMessage",value:function(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var n=this.crossOriginIframeMap.get(e.source);if(n){var r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}}}},{key:"transformCrossOriginEvent",value:function(e,t){var n,r=this;switch(t.type){case ie.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var o=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,o),this.patchRootIdOnNode(t.data.node,o),{timestamp:t.timestamp,type:ie.IncrementalSnapshot,data:{source:se.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case ie.Meta:case ie.Load:case ie.DomContentLoaded:return!1;case ie.Plugin:return t;case ie.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ie.IncrementalSnapshot:switch(t.data.source){case se.Mutation:return t.data.adds.forEach((function(t){r.replaceIds(t,e,["parentId","nextId","previousId"]),r.replaceIdOnNode(t.node,e);var n=r.crossOriginIframeRootIdMap.get(e);n&&r.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((function(t){r.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((function(t){r.replaceIds(t,e,["id"])})),t.data.texts.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case se.Drag:case se.TouchMove:case se.MouseMove:return t.data.positions.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case se.ViewportResize:return!1;case se.MediaInteraction:case se.MouseInteraction:case se.Scroll:case se.CanvasMutation:case se.Input:return this.replaceIds(t.data,e,["id"]),t;case se.StyleSheetRule:case se.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case se.Font:return t;case se.Selection:return t.data.ranges.forEach((function(t){r.replaceIds(t,e,["start","end"])})),t;case se.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach((function(t){r.replaceStyleIds(t,e,["styleId"])})),t}}}},{key:"replace",value:function(e,t,n,r){var o,a=l(r);try{for(a.s();!(o=a.n()).done;){var i=o.value;(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]))}}catch(e){a.e(e)}finally{a.f()}return t}},{key:"replaceIds",value:function(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}},{key:"replaceStyleIds",value:function(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}},{key:"replaceIdOnNode",value:function(e,t){var n=this;this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((function(e){n.replaceIdOnNode(e,t)}))}},{key:"patchRootIdOnNode",value:function(t,n){var r=this;t.type===e.Document||t.rootId||(t.rootId=n),"childNodes"in t&&t.childNodes.forEach((function(e){r.patchRootIdOnNode(e,n)}))}}]),t}(),je=function(){function e(t){r(this,e),this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}return a(e,[{key:"init",value:function(){this.reset(),this.patchAttachShadow(Element,document)}},{key:"addShadowRoot",value:function(e,t){var n=this;if(p(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var r=Se(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((function(){return r.disconnect()})),this.restoreHandlers.push(we(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((function(){e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&n.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,n.mirror.getId(e.host)),n.restoreHandlers.push(Fe({mirror:n.mirror,stylesheetManager:n.bypassOptions.stylesheetManager},e))}),0)}}},{key:"observeAttachShadow",value:function(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}},{key:"patchAttachShadow",value:function(e,t){var n=this;this.restoreHandlers.push(Y(e.prototype,"attachShadow",(function(e){return function(r){var o=e.call(this,r);return this.shadowRoot&&ae(this)&&n.addShadowRoot(this.shadowRoot,t),o}})))}},{key:"reset",value:function(){this.restoreHandlers.forEach((function(e){try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}]),e}();function Je(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}c((r=r.apply(e,t||[])).next())}))}for(var ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Qe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),He=0;He<ze.length;He++)Qe[ze.charCodeAt(He)]=He;var Pe=new Map;var Xe=function(e,t,r){if(e&&(et(e,t)||"object"===n(e))){var o=function(e,t){var n=Pe.get(e);return n||(n=new Map,Pe.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(r,e.constructor.name),a=o.indexOf(e);return-1===a&&(a=o.length,o.push(e)),a}};function qe(e,t,r){if(e instanceof Array)return e.map((function(e){return qe(e,t,r)}));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var o=e.constructor.name,a=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=ze[n[t]>>2],o+=ze[(3&n[t])<<4|n[t+1]>>4],o+=ze[(15&n[t+1])<<2|n[t+2]>>6],o+=ze[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:o,base64:a}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[qe(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement)return{rr_type:e.constructor.name,src:e.src};if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[qe(e.data,t,r),e.width,e.height]}:et(e,t)||"object"===n(e)?{rr_type:e.constructor.name,index:Xe(e,t,r)}:e}var $e=function(e,t,n){return s(e).map((function(e){return qe(e,t,n)}))},et=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function tt(e,t,n){var r=[];try{var o=Y(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r){Q(this,t,n,!0)||"__context"in this||(this.__context=r);for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return e.apply(this,[r].concat(a))}}));r.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){r.forEach((function(e){return e()}))}}function nt(e,t,n,r,o,a,i){var s,c=[],u=l(Object.getOwnPropertyNames(e));try{var d=function(){var a=s.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return"continue";try{if("function"!=typeof e[a])return"continue";var u=Y(e,a,(function(e){return function(){for(var s=arguments.length,c=new Array(s),u=0;u<s;u++)c[u]=arguments[u];var l=e.apply(this,c);if(Xe(l,i,this),!Q(this.canvas,r,o,!0)){var d=$e([].concat(c),i,this),p={type:t,property:a,args:d};n(this.canvas,p)}return l}}));c.push(u)}catch(r){var l=_(e,a,{set:function(e){n(this.canvas,{type:t,property:a,args:[e],setter:!0})}});c.push(l)}};for(u.s();!(s=u.n()).done;)d()}catch(e){u.e(e)}finally{u.f()}return c}var rt=null;try{var ot="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||"function"==typeof require&&require("worker_threads");rt=ot.Worker}catch(e){}function at(e,t,n){var r=void 0===t?null:t,o=function(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}(e,void 0!==n&&n),a=o.indexOf("\n",10)+1,i=o.substring(a)+(r?"//# sourceMappingURL="+r:"");return function(e){return new rt(i,Object.assign({},e,{eval:!0}))}}function it(e,t,n){var r=void 0===t?null:t,o=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,a=n.length;o<a;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),a=o.indexOf("\n",10)+1,i=o.substring(a)+(r?"//# sourceMappingURL="+r:""),s=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(s)}var st="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var ct,ut,lt,dt,pt,ft,ht=(ct="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",ut=null,lt=!1,st?at(ct,ut,lt):function(e,t,n){var r;return function(o){return r=r||it(e,t,n),new Worker(r,o)}}(ct,ut,lt)),gt=function(){function e(t){var n=this;r(this,e),this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(n.rafStamps.invokeId&&n.rafStamps.latestId!==n.rafStamps.invokeId)&&n.rafStamps.invokeId||(n.rafStamps.invokeId=n.rafStamps.latestId),n.pendingCanvasMutations.has(e)||n.pendingCanvasMutations.set(e,[]),n.pendingCanvasMutations.get(e).push(t)};var o=t.sampling,a=void 0===o?"all":o,i=t.win,s=t.blockClass,c=t.blockSelector,u=t.recordCanvas,l=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,u&&"all"===a&&this.initCanvasMutationObserver(i,s,c),u&&"number"==typeof a&&this.initCanvasFPSObserver(a,i,s,c,{dataURLOptions:l})}return a(e,[{key:"reset",value:function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}},{key:"freeze",value:function(){this.frozen=!0}},{key:"unfreeze",value:function(){this.frozen=!1}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}},{key:"initCanvasFPSObserver",value:function(e,n,r,o,a){var i=this,s=tt(n,r,o),c=new Map,u=new ht;u.onmessage=function(e){var t=e.data.id;if(c.set(t,!1),"base64"in e.data){var n=e.data,r=n.base64,o=n.type,a=n.width,s=n.height;i.mutationCb({id:t,type:ue["2D"],commands:[{property:"clearRect",args:[0,0,a,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:o}]},0,0]}]})}};var l,d=1e3/e,p=0;l=requestAnimationFrame((function e(s){var f;p&&s-p<d?l=requestAnimationFrame(e):(p=s,(f=[],n.document.querySelectorAll("canvas").forEach((function(e){Q(e,r,o,!0)||f.push(e)})),f).forEach((function(e){return Je(i,void 0,void 0,t().mark((function n(){var r,o,i,s;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=this.mirror.getId(e),!c.get(o)){t.next=3;break}return t.abrupt("return");case 3:return c.set(o,!0),["webgl","webgl2"].includes(e.__context)&&(i=e.getContext(e.__context),!1===(null===(r=null==i?void 0:i.getContextAttributes())||void 0===r?void 0:r.preserveDrawingBuffer)&&(null==i||i.clear(i.COLOR_BUFFER_BIT))),t.next=7,createImageBitmap(e);case 7:s=t.sent,u.postMessage({id:o,bitmap:s,width:e.width,height:e.height,dataURLOptions:a.dataURLOptions},[s]);case 9:case"end":return t.stop()}}),n,this)})))})),l=requestAnimationFrame(e))})),this.resetObservers=function(){s(),cancelAnimationFrame(l)}}},{key:"initCanvasMutationObserver",value:function(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=tt(e,t,n),o=function(e,t,n,r){var o,a=[],i=l(Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype));try{var s=function(){var i=o.value;try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])return"continue";var s=Y(t.CanvasRenderingContext2D.prototype,i,(function(o){return function(){for(var a=this,s=arguments.length,c=new Array(s),u=0;u<s;u++)c[u]=arguments[u];return Q(this.canvas,n,r,!0)||setTimeout((function(){var n=$e([].concat(c),t,a);e(a.canvas,{type:ue["2D"],property:i,args:n})}),0),o.apply(this,c)}}));a.push(s)}catch(n){var c=_(t.CanvasRenderingContext2D.prototype,i,{set:function(t){e(this.canvas,{type:ue["2D"],property:i,args:[t],setter:!0})}});a.push(c)}};for(i.s();!(o=i.n()).done;)s()}catch(e){i.e(e)}finally{i.f()}return function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,n),a=function(e,t,n,r,o){var a=[];return a.push.apply(a,s(nt(t.WebGLRenderingContext.prototype,ue.WebGL,e,n,r,0,t))),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,s(nt(t.WebGL2RenderingContext.prototype,ue.WebGL2,e,n,r,0,t))),function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=function(){r(),o(),a()}}},{key:"startPendingCanvasMutationFlusher",value:function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"startRAFTimestamping",value:function(){var e=this;requestAnimationFrame((function t(n){e.rafStamps.latestId=n,requestAnimationFrame(t)}))}},{key:"flushPendingCanvasMutations",value:function(){var e=this;this.pendingCanvasMutations.forEach((function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"flushPendingCanvasMutationFor",value:function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){var t=
|
|
4
|
+
/*! *****************************************************************************
|
|
5
|
+
Copyright (c) Microsoft Corporation.
|
|
6
|
+
|
|
7
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
8
|
+
purpose with or without fee is hereby granted.
|
|
9
|
+
|
|
10
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
11
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
12
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
13
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
14
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
15
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
16
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
17
|
+
***************************************************************************** */
|
|
18
|
+
function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["type"]);return t})),o=n[0].type;this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}}}]),e}(),mt=function(){function e(t){r(this,e),this.trackedLinkElements=new WeakSet,this.styleMirror=new ne,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}return a(e,[{key:"attachLinkElement",value:function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}},{key:"trackLinkElement",value:function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}},{key:"adoptStyleSheets",value:function(e,t){if(0!==e.length){var n,r={id:t,styleIds:[]},o=[],a=l(e);try{for(a.s();!(n=a.n()).done;){var i=n.value,s=void 0;if(this.styleMirror.has(i))s=this.styleMirror.getId(i);else{s=this.styleMirror.add(i);var c=Array.from(i.rules||CSSRule);o.push({styleId:s,rules:c.map((function(e,t){return{rule:h(e),index:t}}))})}r.styleIds.push(s)}}catch(e){a.e(e)}finally{a.f()}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),e}();function vt(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}var yt=!1,It=new g;function Ct(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,o=e.blockClass,a=void 0===o?"rr-block":o,i=e.blockSelector,s=void 0===i?null:i,c=e.ignoreClass,u=void 0===c?"rr-ignore":c,d=e.maskTextClass,p=void 0===d?"rr-mask":d,f=e.maskTextSelector,h=void 0===f?null:f,g=e.inlineStylesheet,m=void 0===g||g,v=e.maskAllInputs,y=e.maskInputOptions,I=e.slimDOMOptions,C=e.maskInputFn,b=e.maskTextFn,S=e.hooks,A=e.packFn,k=e.sampling,w=void 0===k?{}:k,M=e.dataURLOptions,N=void 0===M?{}:M,O=e.mousemoveWait,T=e.recordCanvas,E=void 0!==T&&T,R=e.recordCrossOriginIframes,L=void 0!==R&&R,x=e.recordAfter,F=void 0===x?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":x,D=e.userTriggeredOnInput,W=void 0!==D&&D,G=e.collectFonts,V=void 0!==G&&G,U=e.inlineImages,K=void 0!==U&&U,_=e.plugins,Y=e.keepIframeSrcFn,Q=void 0===Y?function(){return!1}:Y,H=e.ignoreCSSAttributes,P=void 0===H?new Set([]):H,X=!L||window.parent===window,ne=!1;if(!X)try{window.parent.document,ne=!1}catch(e){ne=!0}if(X&&!t)throw new Error("emit function is required");void 0!==O&&void 0===w.mousemove&&(w.mousemove=O),It.reset();var re,oe=!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,password:!0}:void 0!==y?y:{password:!0},ae=!0===I||"all"===I?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===I,headMetaDescKeywords:"all"===I}:I||{};q();var ce=0,ue=function(e){var t,n=l(_||[]);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.eventProcessor&&(e=r.eventProcessor(e))}}catch(e){n.e(e)}finally{n.f()}return A&&!ne&&(e=A(e)),e};dt=function(e,o){var a;if(!(null===(a=Ie[0])||void 0===a?void 0:a.isFrozen())||e.type===ie.FullSnapshot||e.type===ie.IncrementalSnapshot&&e.data.source===se.Mutation||Ie.forEach((function(e){return e.unfreeze()})),X)null==t||t(ue(e),o);else if(ne){var i={type:"rrweb",event:ue(e),origin:window.location.origin,isCheckout:o};window.parent.postMessage(i,"*")}if(e.type===ie.FullSnapshot)re=e,ce=0;else if(e.type===ie.IncrementalSnapshot){if(e.data.source===se.Mutation&&e.data.isAttachIframe)return;ce++;var s=r&&ce>=r,c=n&&e.timestamp-re.timestamp>n;(s||c)&&pt(!0)}};var le,de=function(e){dt(vt({type:ie.IncrementalSnapshot,data:Object.assign({source:se.Mutation},e)}))},pe=function(e){return dt(vt({type:ie.IncrementalSnapshot,data:Object.assign({source:se.Scroll},e)}))},fe=function(e){return dt(vt({type:ie.IncrementalSnapshot,data:Object.assign({source:se.CanvasMutation},e)}))},he=function(e){return dt(vt({type:ie.IncrementalSnapshot,data:Object.assign({source:se.AdoptedStyleSheet},e)}))},ge=new mt({mutationCb:de,adoptedStyleSheetCb:he}),me=new Ye({mirror:It,mutationCb:de,stylesheetManager:ge,recordCrossOriginIframes:L,wrappedEmit:dt}),ve=l(_||[]);try{for(ve.s();!(le=ve.n()).done;){var ye=le.value;ye.getMirror&&ye.getMirror({nodeMirror:It,crossOriginIframeMirror:me.crossOriginIframeMirror,crossOriginIframeStyleMirror:me.crossOriginIframeStyleMirror})}}catch(e){ve.e(e)}finally{ve.f()}ft=new gt({recordCanvas:E,mutationCb:fe,win:window,blockClass:a,blockSelector:s,mirror:It,sampling:w.canvas,dataURLOptions:N});var be=new je({mutationCb:de,scrollCb:pe,bypassOptions:{blockClass:a,blockSelector:s,maskTextClass:p,maskTextSelector:h,inlineStylesheet:m,maskInputOptions:oe,dataURLOptions:N,maskTextFn:b,maskInputFn:C,recordCanvas:E,inlineImages:K,sampling:w,slimDOMOptions:ae,iframeManager:me,stylesheetManager:ge,canvasManager:ft,keepIframeSrcFn:Q,processedNodeManager:Ce},mirror:It});pt=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];dt(vt({type:ie.Meta,data:{href:window.location.href,width:z(),height:J()}}),e),ge.reset(),be.init(),Ie.forEach((function(e){return e.lock()}));var t=B(document,{mirror:It,blockClass:a,blockSelector:s,maskTextClass:p,maskTextSelector:h,inlineStylesheet:m,maskAllInputs:oe,maskTextFn:b,slimDOM:ae,dataURLOptions:N,recordCanvas:E,inlineImages:K,onSerialize:function(e){$(e,It)&&me.addIframe(e),ee(e,It)&&ge.trackLinkElement(e),te(e)&&be.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){me.attachIframe(e,t),be.observeAttachShadow(e)},onStylesheetLoad:function(e,t){ge.attachLinkElement(e,t)},keepIframeSrcFn:Q});if(!t)return console.warn("Failed to snapshot the document");dt(vt({type:ie.FullSnapshot,data:{node:t,initialOffset:j(window)}})),Ie.forEach((function(e){return e.unlock()})),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ge.adoptStyleSheets(document.adoptedStyleSheets,It.getId(document))};try{var Se=[],Ae=function(e){var t;return Ve({mutationCb:de,mousemoveCb:function(e,t){return dt(vt({type:ie.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return dt(vt({type:ie.IncrementalSnapshot,data:Object.assign({source:se.MouseInteraction},e)}))},scrollCb:pe,viewportResizeCb:function(e){return dt(vt({type:ie.IncrementalSnapshot,data:Object.assign({source:se.ViewportResize},e)}))},inputCb:function(e){return dt(vt({type:ie.IncrementalSnapshot,data:Object.assign({source:se.Input},e)}))},mediaInteractionCb:function(e){return dt(vt({type:ie.IncrementalSnapshot,data:Object.assign({source:se.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return dt(vt({type:ie.IncrementalSnapshot,data:Object.assign({source:se.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return dt(vt({type:ie.IncrementalSnapshot,data:Object.assign({source:se.StyleDeclaration},e)}))},canvasMutationCb:fe,fontCb:function(e){return dt(vt({type:ie.IncrementalSnapshot,data:Object.assign({source:se.Font},e)}))},selectionCb:function(e){dt(vt({type:ie.IncrementalSnapshot,data:Object.assign({source:se.Selection},e)}))},blockClass:a,ignoreClass:u,maskTextClass:p,maskTextSelector:h,maskInputOptions:oe,inlineStylesheet:m,sampling:w,recordCanvas:E,inlineImages:K,userTriggeredOnInput:W,collectFonts:V,doc:e,maskInputFn:C,maskTextFn:b,keepIframeSrcFn:Q,blockSelector:s,slimDOMOptions:ae,dataURLOptions:N,mirror:It,iframeManager:me,stylesheetManager:ge,shadowDomManager:be,processedNodeManager:Ce,canvasManager:ft,ignoreCSSAttributes:P,plugins:(null===(t=null==_?void 0:_.filter((function(e){return e.observer})))||void 0===t?void 0:t.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return dt(vt({type:ie.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},S)};me.addLoadListener((function(e){try{Se.push(Ae(e.contentDocument))}catch(e){console.warn(e)}}));var ke=function(){pt(),Se.push(Ae(document)),yt=!0};return"interactive"===document.readyState||"complete"===document.readyState?ke():(Se.push(Z("DOMContentLoaded",(function(){dt(vt({type:ie.DomContentLoaded,data:{}})),"DOMContentLoaded"===F&&ke()}))),Se.push(Z("load",(function(){dt(vt({type:ie.Load,data:{}})),"load"===F&&ke()}),window))),function(){Se.forEach((function(e){return e()})),yt=!1}}catch(e){console.warn(e)}}Ct.addCustomEvent=function(e,t){if(!yt)throw new Error("please add custom event after start recording");dt(vt({type:ie.Custom,data:{tag:e,payload:t}}))},Ct.freezePage=function(){Ie.forEach((function(e){return e.freeze()}))},Ct.takeFullSnapshot=function(e){if(!yt)throw new Error("please take full snapshot after start recording");pt(e)},Ct.mirror=It;var bt=function(){function e(t){r(this,e),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}return a(e,[{key:"toString",value:function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?"".concat(this.functionName," (").concat(this.fileName,":").concat(e,":").concat(t,")"):"".concat(this.fileName,":").concat(e,":").concat(t)}}]),e}(),St=/(^|@)\S+:\d+/,At=/^\s*at .*(\S+:\d+|\(native\))/m,kt=/^(eval@)?(\[native code])?$/,wt={parse:function(e){if(!e)return[];if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(At))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(e));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(At)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),o=this.extractLocation(n?n[1]:r.pop()),a=r.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new bt({functionName:a,fileName:i,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(kt)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new bt({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new bt({functionName:r,fileName:o[0],lineNumber:o[1],columnNumber:o[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],o=2,a=n.length;o<a;o+=2){var i=t.exec(n[o]);i&&r.push(new bt({fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],o=0,a=n.length;o<a;o+=2){var i=t.exec(n[o]);i&&r.push(new bt({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(St)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new bt({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Mt(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 a=0;a<r.children.length;a++){var i=r.children[a];i.localName&&i.localName.toLowerCase&&i.localName.toLowerCase()===n&&o.push(i)}o.length>1&&(n+=":eq(".concat(o.indexOf(e),")")),t=n+(t?">"+t:""),e=r}return t}function Nt(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ot(e,t){if(0===t)return!0;for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];if(Nt(e[o])&&Ot(e[o],t-1))return!0}return!1}function Tt(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var a=r.indexOf(this);~a?r.splice(a+1):r.push(this),~a?o.splice(a,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(void 0===t)return"undefined";if(function(e){if(Nt(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Nt(e)&&Ot(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t="".concat(t.slice(0,n.stringLengthLimit),"..."));return t}(t);if(t instanceof Event){var i={};for(var s in t){var c=t[s];Array.isArray(c)?i[s]=Mt(c.length?c[0]:null):i[s]=c}return i}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Et={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Rt(e,t,n){var r,o=n?Object.assign({},Et,n):Et,a=o.logger;if(!a)return function(){};r="string"==typeof a?t[a]:a;var i=0,s=[];if(o.level.includes("error")){var c=function(t){var n=t.message,r=t.error,a=wt.parse(r).map((function(e){return e.toString()})),i=[Tt(n,o.stringifyOptions)];e({level:"error",trace:a,payload:i})};t.addEventListener("error",c),s.push((function(){t.removeEventListener("error",c)}));var u=function(t){var n,r;t.reason instanceof Error?(n=t.reason,r=[Tt("Uncaught (in promise) ".concat(n.name,": ").concat(n.message),o.stringifyOptions)]):(n=new Error,r=[Tt("Uncaught (in promise)",o.stringifyOptions),Tt(t.reason,o.stringifyOptions)]);var a=wt.parse(n).map((function(e){return e.toString()}));e({level:"error",trace:a,payload:r})};t.addEventListener("unhandledrejection",u),s.push((function(){t.removeEventListener("unhandledrejection",u)}))}var d,p=l(o.level);try{for(p.s();!(d=p.n()).done;){var f=d.value;s.push(h(r,f))}}catch(e){p.e(e)}finally{p.f()}return function(){s.forEach((function(e){return e()}))};function h(t,n){var r=this;return t[n]?Y(t,n,(function(t){return function(){for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];t.apply(r,s);try{var u=wt.parse(new Error).map((function(e){return e.toString()})).splice(1),l=s.map((function(e){return Tt(e,o.stringifyOptions)}));++i<o.lengthThreshold?e({level:n,trace:u,payload:l}):i===o.lengthThreshold&&e({level:"warn",trace:[],payload:[Tt("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,["rrweb logger error:",e].concat(s))}}})):function(){}}}var Lt="undefined"!=typeof window?window:{};Lt.rrweb={record:Ct,version:"2.0.0-alpha.5"},Lt.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:Rt,options:e}}}}();
|
|
19
|
+
//# sourceMappingURL=recorder-v2.js.map
|