@highlight-run/rrweb 1.2.1 → 2.0.4

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.
Files changed (191) hide show
  1. package/dist/plugins/console-record.js +454 -0
  2. package/dist/plugins/console-record.min.js +12 -15
  3. package/dist/plugins/console-record.min.js.map +1 -1
  4. package/dist/plugins/console-replay.js +164 -0
  5. package/dist/plugins/console-replay.min.js +5 -0
  6. package/dist/plugins/console-replay.min.js.map +1 -0
  7. package/dist/plugins/sequential-id-record.js +30 -0
  8. package/dist/plugins/sequential-id-record.min.js +2 -0
  9. package/dist/plugins/sequential-id-record.min.js.map +1 -0
  10. package/dist/plugins/sequential-id-replay.js +33 -0
  11. package/dist/plugins/sequential-id-replay.min.js +2 -0
  12. package/dist/plugins/sequential-id-replay.min.js.map +1 -0
  13. package/dist/record/rrweb-record-pack.js +664 -0
  14. package/dist/record/rrweb-record-pack.min.js +4 -0
  15. package/dist/record/rrweb-record-pack.min.js.map +1 -0
  16. package/dist/record/rrweb-record.js +3202 -0
  17. package/dist/record/rrweb-record.min.js +5 -0
  18. package/dist/record/rrweb-record.min.js.map +1 -0
  19. package/dist/replay/rrweb-replay-unpack.js +4926 -0
  20. package/dist/replay/rrweb-replay-unpack.min.js +18 -0
  21. package/dist/replay/rrweb-replay-unpack.min.js.map +1 -0
  22. package/dist/replay/rrweb-replay.js +4518 -0
  23. package/dist/replay/rrweb-replay.min.js +18 -0
  24. package/dist/replay/rrweb-replay.min.js.map +1 -0
  25. package/dist/rrweb-all.js +8889 -0
  26. package/dist/rrweb-all.min.js +29 -0
  27. package/dist/rrweb-all.min.js.map +1 -0
  28. package/dist/rrweb.js +7558 -0
  29. package/dist/rrweb.min.js +6 -17
  30. package/dist/rrweb.min.js.map +1 -1
  31. package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__auto__createBase64WorkerFactory.js +12 -0
  32. package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__auto__isNodeJS.js +7 -0
  33. package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +31 -0
  34. package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__node__WorkerClass.js +11 -0
  35. package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__node__createBase64WorkerFactory.js +18 -0
  36. package/es/rrweb/_virtual/image-bitmap-data-url-worker.js +6 -0
  37. package/es/rrweb/ext/@xstate/fsm/es/index.js +17 -0
  38. package/es/rrweb/ext/base64-arraybuffer/dist/base64-arraybuffer.es5.js +49 -0
  39. package/es/rrweb/ext/fflate/esm/browser.js +777 -0
  40. package/es/rrweb/ext/mitt/dist/mitt.es.js +63 -0
  41. package/es/rrweb/ext/tslib/tslib.es6.js +38 -0
  42. package/es/rrweb/packages/rrdom/es/virtual-dom.js +1099 -0
  43. package/es/rrweb/packages/rrweb/src/entries/all.js +13 -0
  44. package/es/rrweb/packages/rrweb/src/index.js +14 -0
  45. package/es/rrweb/packages/rrweb/src/packer/base.js +3 -0
  46. package/es/rrweb/packages/rrweb/src/packer/pack.js +9 -0
  47. package/es/rrweb/packages/rrweb/src/packer/unpack.js +29 -0
  48. package/es/rrweb/packages/rrweb/src/plugins/console/record/error-stack-parser.js +178 -0
  49. package/es/rrweb/packages/rrweb/src/plugins/console/record/index.js +115 -0
  50. package/es/rrweb/packages/rrweb/src/plugins/console/record/stringify.js +128 -0
  51. package/es/rrweb/packages/rrweb/src/plugins/console/replay/index.js +94 -0
  52. package/es/rrweb/packages/rrweb/src/plugins/sequential-id/record/index.js +22 -0
  53. package/es/rrweb/packages/rrweb/src/plugins/sequential-id/replay/index.js +28 -0
  54. package/es/rrweb/packages/rrweb/src/record/iframe-manager.js +31 -0
  55. package/es/rrweb/packages/rrweb/src/record/index.js +356 -0
  56. package/es/rrweb/packages/rrweb/src/record/mutation.js +491 -0
  57. package/es/rrweb/packages/rrweb/src/record/observer.js +590 -0
  58. package/es/rrweb/packages/rrweb/src/record/observers/canvas/2d.js +49 -0
  59. package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js +172 -0
  60. package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas.js +25 -0
  61. package/es/rrweb/packages/rrweb/src/record/observers/canvas/serialize-args.js +123 -0
  62. package/es/rrweb/packages/rrweb/src/record/observers/canvas/webgl.js +59 -0
  63. package/es/rrweb/packages/rrweb/src/record/shadow-dom-manager.js +43 -0
  64. package/es/rrweb/packages/rrweb/src/record/stylesheet-manager.js +31 -0
  65. package/es/rrweb/packages/rrweb/src/replay/canvas/2d.js +29 -0
  66. package/es/rrweb/packages/rrweb/src/replay/canvas/deserialize-args.js +67 -0
  67. package/es/rrweb/packages/rrweb/src/replay/canvas/index.js +43 -0
  68. package/es/rrweb/packages/rrweb/src/replay/canvas/webgl.js +62 -0
  69. package/es/rrweb/packages/rrweb/src/replay/index.js +1555 -0
  70. package/es/rrweb/packages/rrweb/src/replay/machine.js +281 -0
  71. package/es/rrweb/packages/rrweb/src/replay/smoothscroll.js +219 -0
  72. package/es/rrweb/packages/rrweb/src/replay/styles/inject-style.js +8 -0
  73. package/es/rrweb/packages/rrweb/src/replay/timer.js +92 -0
  74. package/es/rrweb/packages/rrweb/src/types.js +75 -0
  75. package/es/rrweb/packages/rrweb/src/utils.js +315 -0
  76. package/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js +1821 -0
  77. package/lib/plugins/console-record.js +492 -0
  78. package/lib/plugins/console-replay.js +218 -0
  79. package/lib/plugins/sequential-id-record.js +27 -0
  80. package/lib/plugins/sequential-id-replay.js +32 -0
  81. package/lib/record/rrweb-record-pack.js +787 -0
  82. package/lib/record/rrweb-record.js +3363 -0
  83. package/lib/replay/rrweb-replay-unpack.js +5075 -0
  84. package/lib/replay/rrweb-replay.js +4665 -0
  85. package/lib/rrweb-all.js +9181 -0
  86. package/lib/rrweb.js +7814 -0
  87. package/package.json +41 -42
  88. package/typings/entries/all.d.ts +6 -0
  89. package/{dist → typings}/entries/record-pack.d.ts +0 -0
  90. package/{dist → typings}/entries/replay-unpack.d.ts +0 -0
  91. package/{dist → typings}/index.d.ts +1 -2
  92. package/{dist → typings}/packer/base.d.ts +1 -1
  93. package/{dist → typings}/packer/index.d.ts +0 -0
  94. package/{dist → typings}/packer/pack.d.ts +0 -0
  95. package/{dist → typings}/packer/unpack.d.ts +0 -0
  96. package/{dist → typings}/plugins/console/record/error-stack-parser.d.ts +0 -0
  97. package/{dist → typings}/plugins/console/record/index.d.ts +4 -3
  98. package/{dist → typings}/plugins/console/record/stringify.d.ts +1 -1
  99. package/{dist → typings}/plugins/console/replay/index.d.ts +2 -2
  100. package/{dist → typings}/plugins/sequential-id/record/index.d.ts +1 -1
  101. package/{dist → typings}/plugins/sequential-id/replay/index.d.ts +1 -1
  102. package/{dist → typings}/record/iframe-manager.d.ts +3 -3
  103. package/{dist/plugins → typings}/record/index.d.ts +9 -9
  104. package/{dist → typings}/record/mutation.d.ts +6 -8
  105. package/typings/record/observer.d.ts +7 -0
  106. package/{dist/plugins → typings}/record/observers/canvas/2d.d.ts +3 -2
  107. package/{dist → typings}/record/observers/canvas/canvas-manager.d.ts +5 -2
  108. package/{dist/plugins → typings}/record/observers/canvas/canvas.d.ts +2 -2
  109. package/typings/record/observers/canvas/serialize-args.d.ts +6 -0
  110. package/{dist/plugins → typings}/record/observers/canvas/webgl.d.ts +3 -2
  111. package/typings/record/observers/canvas/webgl2.d.ts +2 -0
  112. package/typings/record/shadow-dom-manager.d.ts +22 -0
  113. package/typings/record/stylesheet-manager.d.ts +12 -0
  114. package/typings/record/workers/image-bitmap-data-url-worker.d.ts +5 -0
  115. package/{dist → typings}/replay/canvas/2d.d.ts +3 -3
  116. package/typings/replay/canvas/deserialize-args.d.ts +7 -0
  117. package/{dist/plugins → typings}/replay/canvas/index.d.ts +10 -9
  118. package/typings/replay/canvas/webgl.d.ts +9 -0
  119. package/{dist → typings}/replay/index.d.ts +7 -9
  120. package/{dist → typings}/replay/machine.d.ts +0 -0
  121. package/{dist → typings}/replay/smoothscroll.d.ts +0 -0
  122. package/{dist → typings}/replay/styles/inject-style.d.ts +0 -0
  123. package/{dist → typings}/replay/timer.d.ts +0 -0
  124. package/{dist → typings}/rrdom/index.d.ts +0 -0
  125. package/{dist → typings}/rrdom/tree-node.d.ts +0 -0
  126. package/{dist/plugins → typings}/types.d.ts +536 -509
  127. package/typings/utils.d.ts +43 -0
  128. package/CHANGELOG.md +0 -26
  129. package/README.md +0 -124
  130. package/README.zh_CN.md +0 -122
  131. package/dist/entries/all.d.ts +0 -4
  132. package/dist/index.css +0 -82
  133. package/dist/index.css.map +0 -1
  134. package/dist/index.js +0 -3
  135. package/dist/index.js.LICENSE.txt +0 -14
  136. package/dist/index.js.map +0 -1
  137. package/dist/plugins/entries/all.d.ts +0 -4
  138. package/dist/plugins/entries/record-pack.d.ts +0 -2
  139. package/dist/plugins/entries/replay-unpack.d.ts +0 -2
  140. package/dist/plugins/index.d.ts +0 -9
  141. package/dist/plugins/packer/base.d.ts +0 -7
  142. package/dist/plugins/packer/index.d.ts +0 -2
  143. package/dist/plugins/packer/pack.d.ts +0 -2
  144. package/dist/plugins/packer/unpack.d.ts +0 -2
  145. package/dist/plugins/plugins/console/record/error-stack-parser.d.ts +0 -37
  146. package/dist/plugins/plugins/console/record/index.d.ts +0 -41
  147. package/dist/plugins/plugins/console/record/stringify.d.ts +0 -2
  148. package/dist/plugins/plugins/console/replay/index.d.ts +0 -9
  149. package/dist/plugins/plugins/sequential-id/record/index.d.ts +0 -6
  150. package/dist/plugins/plugins/sequential-id/replay/index.d.ts +0 -7
  151. package/dist/plugins/record/iframe-manager.d.ts +0 -13
  152. package/dist/plugins/record/mutation.d.ts +0 -45
  153. package/dist/plugins/record/observer.d.ts +0 -11
  154. package/dist/plugins/record/observers/canvas/canvas-manager.d.ts +0 -32
  155. package/dist/plugins/record/observers/canvas/serialize-args.d.ts +0 -6
  156. package/dist/plugins/record/shadow-dom-manager.d.ts +0 -34
  157. package/dist/plugins/replay/canvas/2d.d.ts +0 -9
  158. package/dist/plugins/replay/canvas/webgl.d.ts +0 -11
  159. package/dist/plugins/replay/index.d.ts +0 -82
  160. package/dist/plugins/replay/machine.d.ts +0 -85
  161. package/dist/plugins/replay/smoothscroll.d.ts +0 -1
  162. package/dist/plugins/replay/styles/inject-style.d.ts +0 -2
  163. package/dist/plugins/replay/timer.d.ts +0 -19
  164. package/dist/plugins/replay/virtual-styles.d.ts +0 -43
  165. package/dist/plugins/rrdom/index.d.ts +0 -1
  166. package/dist/plugins/rrdom/tree-node.d.ts +0 -20
  167. package/dist/plugins/snapshot/css.d.ts +0 -92
  168. package/dist/plugins/snapshot/index.d.ts +0 -5
  169. package/dist/plugins/snapshot/rebuild.d.ts +0 -19
  170. package/dist/plugins/snapshot/snapshot.d.ts +0 -49
  171. package/dist/plugins/snapshot/types.d.ts +0 -99
  172. package/dist/plugins/snapshot/utils.d.ts +0 -11
  173. package/dist/plugins/utils.d.ts +0 -71
  174. package/dist/record/index.d.ts +0 -9
  175. package/dist/record/observer.d.ts +0 -11
  176. package/dist/record/observers/canvas/2d.d.ts +0 -2
  177. package/dist/record/observers/canvas/canvas.d.ts +0 -2
  178. package/dist/record/observers/canvas/serialize-args.d.ts +0 -6
  179. package/dist/record/observers/canvas/webgl.d.ts +0 -2
  180. package/dist/record/shadow-dom-manager.d.ts +0 -34
  181. package/dist/replay/canvas/index.d.ts +0 -9
  182. package/dist/replay/canvas/webgl.d.ts +0 -11
  183. package/dist/replay/virtual-styles.d.ts +0 -43
  184. package/dist/snapshot/css.d.ts +0 -92
  185. package/dist/snapshot/index.d.ts +0 -5
  186. package/dist/snapshot/rebuild.d.ts +0 -19
  187. package/dist/snapshot/snapshot.d.ts +0 -49
  188. package/dist/snapshot/types.d.ts +0 -99
  189. package/dist/snapshot/utils.d.ts +0 -11
  190. package/dist/types.d.ts +0 -509
  191. package/dist/utils.d.ts +0 -71
package/dist/rrweb.min.js CHANGED
@@ -1,5 +1,8 @@
1
- var rrweb=function(e){"use strict";
2
- /*! *****************************************************************************
1
+ var rrweb=function(q){"use strict";var k;(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"})(k||(k={}));function Nt(e){return e.nodeType===e.ELEMENT_NODE}function ke(e){var t,r=(t=e)===null||t===void 0?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===e)}var Ke=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function Et(){return new Ke}function Qe(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,s=e.maskInputFn,a=o||"";return(t[r.toLowerCase()]||t[n])&&(s?a=s(a):a="*".repeat(a.length)),a}var wt="__rrweb_original__";function Gr(e){var t=e.getContext("2d");if(!t)return!0;for(var r=50,n=0;n<e.width;n+=r)for(var o=0;o<e.height;o+=r){var s=t.getImageData,a=wt in s?s[wt]:s,l=new Uint32Array(a.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer);if(l.some(function(c){return c!==0}))return!1}return!0}function Ct(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Br=1,zr=new RegExp("[^a-z0-9-_:]"),Re=-2;function Hr(){return Br++}function Yr(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return zr.test(t)?"div":t}function Je(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(Xr).join(""):null}catch{return null}}function Xr(e){var t=e.cssText;if(Zr(e))try{t=Je(e.styleSheet)||t}catch{}return t}function Zr(e){return"styleSheet"in e}function Kr(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function Qr(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var be,It,Jr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,qr=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,en=/^(data:)([^,]*),(.*)/i;function $e(e,t){return(e||"").replace(Jr,function(r,n,o,s,a,l){var c=o||a||l,i=n||s||"";if(!c)return r;if(!qr.test(c)||en.test(c))return"url("+i+c+i+")";if(c[0]==="/")return"url("+i+(Qr(t)+c)+i+")";var u=t.split("/"),d=c.split("/");u.pop();for(var m=0,h=d;m<h.length;m++){var g=h[m];g!=="."&&(g===".."?u.pop():u.push(g))}return"url("+i+u.join("/")+i+")"})}var tn=/^[^ \t\n\r\u000c]+/,rn=/^[, \t\n\r\u000c]+/;function nn(e,t){if(t.trim()==="")return t;var r=0;function n(i){var u,d=i.exec(t.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var o=[];n(rn),!(r>=t.length);){var s=n(tn);if(s.slice(-1)===",")s=Ve(e,s.substring(0,s.length-1)),o.push(s);else{var a="";s=Ve(e,s);for(var l=!1;;){var c=t.charAt(r);if(c===""){o.push((s+a).trim());break}else if(l)c===")"&&(l=!1);else if(c===","){r+=1,o.push((s+a).trim());break}else c==="("&&(l=!0);a+=c,r+=1}}}return o.join(", ")}function Ve(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function on(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function qe(){var e=document.createElement("a");return e.href="",e.href}function Mt(e,t,r,n){return r==="src"||r==="href"&&n||r==="xlink:href"&&n&&n[0]!=="#"||r==="background"&&n&&(t==="table"||t==="td"||t==="th")?Ve(e,n):r==="srcset"&&n?nn(e,n):r==="style"&&n?$e(n,qe()):t==="object"&&r==="data"&&n?Ve(e,n):n}function sn(e,t,r){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var o=e.classList[n];if(t.test(o))return!0}return r?e.matches(r):!1}function Ue(e,t,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var o=e.classList[n];if(t.test(o))return!0}return r&&e.matches(r)?!0:Ue(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,Ue(e.parentNode,t,r)}function an(e,t,r){var n=e.contentWindow;if(n){var o=!1,s;try{s=n.document.readyState}catch{return}if(s!=="complete"){var a=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()});return}var l="about:blank";if(n.location.href!==l||e.src===l||e.src===""){setTimeout(t,0);return}e.addEventListener("load",t)}}function ln(e){return e.getAttribute("href")?e.sheet!==null:!0}function cn(e,t,r){var n=!1,o;try{o=e.sheet}catch{return}if(!o){var s=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(s),n=!0,t()})}}function un(e,t){var r,n=t.doc,o=t.mirror,s=t.blockClass,a=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,i=t.inlineStylesheet,u=t.maskInputOptions,d=u===void 0?{}:u,m=t.maskTextFn,h=t.maskInputFn,g=t.dataURLOptions,f=g===void 0?{}:g,S=t.inlineImages,p=t.recordCanvas,b=t.keepIframeSrcFn,N=t.enableStrictPrivacy,I;if(o.getMeta(n)){var P=o.getId(n);I=P===1?void 0:P}switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:k.Document,childNodes:[],compatMode:e.compatMode,rootId:I}:{type:k.Document,childNodes:[],rootId:I};case e.DOCUMENT_TYPE_NODE:return{type:k.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:for(var A=sn(e,s,a),C=Yr(e),w={},H=e.attributes.length,X=0;X<H;X++){var Z=e.attributes[X];w[Z.name]=Mt(n,C,Z.name,Z.value)}if(C==="link"&&i){var J=Array.from(n.styleSheets).find(function(me){return me.href===e.href}),B=null;J&&(B=Je(J)),B&&(delete w.rel,delete w.href,w._cssText=$e(B,J.href))}if(C==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var B=Je(e.sheet);B&&(w._cssText=$e(B,qe()))}if(C==="input"||C==="textarea"||C==="select"){var ne=e.value;w.type!=="radio"&&w.type!=="checkbox"&&w.type!=="submit"&&w.type!=="button"&&ne?w.value=Qe({type:w.type,tagName:C,value:ne,maskInputOptions:d,maskInputFn:h}):e.checked&&(w.checked=e.checked)}if(C==="option"&&(e.selected&&!d.select?w.selected=!0:delete w.selected),C==="canvas"&&p){if(e.__context==="2d")Gr(e)||(w.rr_dataURL=e.toDataURL(f.type,f.quality));else if(!("__context"in e)){var K=e.toDataURL(f.type,f.quality),G=document.createElement("canvas");G.width=e.width,G.height=e.height;var $=G.toDataURL(f.type,f.quality);K!==$&&(w.rr_dataURL=K)}}if(C==="img"&&S){be||(be=n.createElement("canvas"),It=be.getContext("2d"));var L=e,v=L.crossOrigin;L.crossOrigin="anonymous";var y=function(){try{be.width=L.naturalWidth,be.height=L.naturalHeight,It.drawImage(L,0,0),w.rr_dataURL=be.toDataURL(f.type,f.quality)}catch(me){console.warn("Cannot inline img src="+L.currentSrc+"! Error: "+me)}v?w.crossOrigin=v:L.removeAttribute("crossorigin")};L.complete&&L.naturalWidth!==0?y():L.onload=y}if((C==="audio"||C==="video")&&(w.rr_mediaState=e.paused?"paused":"played",w.rr_mediaCurrentTime=e.currentTime),e.scrollLeft&&(w.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(w.rr_scrollTop=e.scrollTop),A||C==="img"&&N){var T=e.getBoundingClientRect(),E=T.width,R=T.height;w={class:w.class,rr_width:E+"px",rr_height:R+"px"},A=!0}return C==="iframe"&&!b(w.src)&&(e.contentDocument||(w.rr_src=w.src),delete w.src),{type:k.Element,tagName:C,attributes:w,childNodes:[],isSVG:on(e)||void 0,needBlock:A,rootId:I};case e.TEXT_NODE:var j=e.parentNode&&e.parentNode.tagName,_=e.textContent,re=j==="STYLE"?!0:void 0,F=j==="SCRIPT"?!0:void 0,W=!1;if(re&&_){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(_=Kr(e.parentNode.sheet))}catch(me){console.warn("Cannot get CSS styles from text's parentNode. Error: "+me,e)}_=$e(_,qe()),W=!0}if(F?(_="SCRIPT_PLACEHOLDER",W=!0):j==="NOSCRIPT"&&(_="",W=!0),!re&&!F&&Ue(e,l,c)&&_&&(_=m?m(_):_.replace(/[\S]/g,"*")),N&&!W&&j){var ue=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!ue.has(j)&&_&&(_=Ct(_))}return{type:k.Text,textContent:_||"",isStyle:re,rootId:I};case e.CDATA_SECTION_NODE:return{type:k.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:k.Comment,textContent:e.textContent||"",rootId:I};default:return!1}}function V(e){return e===void 0?"":e.toLowerCase()}function dn(e,t){return!!(t.comment&&e.type===k.Comment||e.type===k.Element&&(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js"))||t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(V(e.attributes.name).match(/^msapplication-tile(image|color)$/)||V(e.attributes.name)==="application-name"||V(e.attributes.rel)==="icon"||V(e.attributes.rel)==="apple-touch-icon"||V(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&V(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(V(e.attributes.property).match(/^(og|twitter|fb):/)||V(e.attributes.name).match(/^(og|twitter):/)||V(e.attributes.name)==="pinterest")||t.headMetaRobots&&(V(e.attributes.name)==="robots"||V(e.attributes.name)==="googlebot"||V(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(V(e.attributes.name)==="author"||V(e.attributes.name)==="generator"||V(e.attributes.name)==="framework"||V(e.attributes.name)==="publisher"||V(e.attributes.name)==="progid"||V(e.attributes.property).match(/^article:/)||V(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(V(e.attributes.name)==="google-site-verification"||V(e.attributes.name)==="yandex-verification"||V(e.attributes.name)==="csrf-token"||V(e.attributes.name)==="p:domain_verify"||V(e.attributes.name)==="verify-v1"||V(e.attributes.name)==="verification"||V(e.attributes.name)==="shopify-checkout-api-token"))))}function Se(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,s=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.skipChild,i=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,m=t.maskInputOptions,h=m===void 0?{}:m,g=t.maskTextFn,f=t.maskInputFn,S=t.slimDOMOptions,p=t.dataURLOptions,b=p===void 0?{}:p,N=t.inlineImages,I=N===void 0?!1:N,P=t.recordCanvas,A=P===void 0?!1:P,C=t.onSerialize,w=t.onIframeLoad,H=t.iframeLoadTimeout,X=H===void 0?5e3:H,Z=t.onStylesheetLoad,J=t.stylesheetLoadTimeout,B=J===void 0?5e3:J,ne=t.keepIframeSrcFn,K=ne===void 0?function(){return!1}:ne,G=t.enableStrictPrivacy,$=t.preserveWhiteSpace,L=$===void 0?!0:$,v=un(e,{doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:h,maskTextFn:g,maskInputFn:f,dataURLOptions:b,inlineImages:I,recordCanvas:A,keepIframeSrcFn:K,enableStrictPrivacy:G});if(!v)return console.warn(e,"not serialized"),null;var y;if(n.hasNode(e)?y=n.getId(e):dn(v,S)||!L&&v.type===k.Text&&!v.isStyle&&!v.textContent.replace(/^\s+|\s+$/gm,"").length?y=Re:y=Hr(),y===Re)return null;var T=Object.assign(v,{id:y});n.add(e,T),C&&C(e);var E=!i;if(T.type===k.Element){if(E=E&&!T.needBlock,T.needBlock&&T.tagName==="img"){var R=e.cloneNode();R.src="",n.add(R,T)}if(T.tagName==="link"){var R=e.cloneNode();R.href="",R.innerText=T.attributes._cssText,n.add(R,T)}delete T.needBlock,e.shadowRoot&&(T.isShadowHost=!0)}if((T.type===k.Document||T.type===k.Element)&&E){S.headWhitespace&&T.type===k.Element&&T.tagName==="head"&&(L=!1);for(var j={doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:i,inlineStylesheet:d,maskInputOptions:h,maskTextFn:g,maskInputFn:f,slimDOMOptions:S,dataURLOptions:b,inlineImages:I,recordCanvas:A,preserveWhiteSpace:L,onSerialize:C,onIframeLoad:w,iframeLoadTimeout:X,onStylesheetLoad:Z,stylesheetLoadTimeout:B,keepIframeSrcFn:K,enableStrictPrivacy:G},_=0,re=Array.from(e.childNodes);_<re.length;_++){var F=re[_],W=Se(F,j);W&&T.childNodes.push(W)}if(Nt(e)&&e.shadowRoot)for(var ue=0,me=Array.from(e.shadowRoot.childNodes);ue<me.length;ue++){var F=me[ue],W=Se(F,j);W&&(W.isShadow=!0,T.childNodes.push(W))}}return e.parentNode&&ke(e.parentNode)&&(T.isShadow=!0),T.type===k.Element&&T.tagName==="iframe"&&an(e,function(){var De=e.contentDocument;if(De&&w){var Ur=Se(De,{doc:De,mirror:n,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:g,maskInputFn:f,slimDOMOptions:S,dataURLOptions:b,inlineImages:I,recordCanvas:A,preserveWhiteSpace:L,onSerialize:C,onIframeLoad:w,iframeLoadTimeout:X,keepIframeSrcFn:K,enableStrictPrivacy:G});Ur&&w(e,Ur)}},X),T.type===k.Element&&T.tagName==="link"&&T.attributes.rel==="stylesheet"&&(cn(e,function(){if(Z){var De=Se(e,{doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:g,maskInputFn:f,slimDOMOptions:S,dataURLOptions:b,inlineImages:I,recordCanvas:A,preserveWhiteSpace:L,onSerialize:C,onIframeLoad:w,onStylesheetLoad:Z,iframeLoadTimeout:X,keepIframeSrcFn:K,enableStrictPrivacy:G});De&&Z(e,De)}},B),ln(e)===!1)?null:T}function hn(e,t){var r=t||{},n=r.mirror,o=n===void 0?new Ke:n,s=r.blockClass,a=s===void 0?"highlight-block":s,l=r.blockSelector,c=l===void 0?null:l,i=r.maskTextClass,u=i===void 0?"highlight-mask":i,d=r.maskTextSelector,m=d===void 0?null:d,h=r.inlineStylesheet,g=h===void 0?!0:h,f=r.inlineImages,S=f===void 0?!1:f,p=r.recordCanvas,b=p===void 0?!1:p,N=r.maskAllInputs,I=N===void 0?!1:N,P=r.maskTextFn,A=r.maskInputFn,C=r.slimDOM,w=C===void 0?!1:C,H=r.dataURLOptions,X=r.preserveWhiteSpace,Z=r.onSerialize,J=r.onIframeLoad,B=r.iframeLoadTimeout,ne=r.onStylesheetLoad,K=r.stylesheetLoadTimeout,G=r.keepIframeSrcFn,$=G===void 0?function(){return!1}:G,L=r.enableStrictPrivacy,v=L===void 0?!1:L,y=I===!0?{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}:I===!1?{password:!0}:I,T=w===!0||w==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:w==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:w===!1?{}:w;return Se(e,{doc:e,mirror:o,blockClass:a,blockSelector:c,maskTextClass:u,maskTextSelector:m,skipChild:!1,inlineStylesheet:g,maskInputOptions:y,maskTextFn:P,maskInputFn:A,slimDOMOptions:T,dataURLOptions:H,inlineImages:S,recordCanvas:b,preserveWhiteSpace:X,onSerialize:Z,onIframeLoad:J,iframeLoadTimeout:B,onStylesheetLoad:ne,stylesheetLoadTimeout:K,keepIframeSrcFn:$,enableStrictPrivacy:v})}var xt=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function mn(e,t){t===void 0&&(t={});var r=1,n=1;function o(v){var y=v.match(/\n/g);y&&(r+=y.length);var T=v.lastIndexOf(`
2
+ `);n=T===-1?n+v.length:v.length-T}function s(){var v={line:r,column:n};return function(y){return y.position=new a(v),g(),y}}var a=function(){function v(y){this.start=y,this.end={line:r,column:n},this.source=t.source}return v}();a.prototype.content=e;var l=[];function c(v){var y=new Error(t.source+":"+r+":"+n+": "+v);if(y.reason=v,y.filename=t.source,y.line=r,y.column=n,y.source=e,t.silent)l.push(y);else throw y}function i(){var v=m();return{type:"stylesheet",stylesheet:{source:t.source,rules:v,parsingErrors:l}}}function u(){return h(/^{\s*/)}function d(){return h(/^}/)}function m(){var v,y=[];for(g(),f(y);e.length&&e.charAt(0)!=="}"&&(v=$()||L());)v!==!1&&(y.push(v),f(y));return y}function h(v){var y=v.exec(e);if(y){var T=y[0];return o(T),e=e.slice(T.length),y}}function g(){h(/^\s*/)}function f(v){v===void 0&&(v=[]);for(var y;y=S();)y!==!1&&v.push(y),y=S();return v}function S(){var v=s();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var y=2;e.charAt(y)!==""&&(e.charAt(y)!=="*"||e.charAt(y+1)!=="/");)++y;if(y+=2,e.charAt(y-1)==="")return c("End of comment missing");var T=e.slice(2,y-2);return n+=2,o(T),e=e.slice(y),n+=2,v({type:"comment",comment:T})}}function p(){var v=h(/^([^{]+)/);if(v)return le(v[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(y){return y.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(y){return y.replace(/\u200C/g,",")})}function b(){var v=s(),y=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(y){var T=le(y[0]);if(!h(/^:\s*/))return c("property missing ':'");var E=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),R=v({type:"declaration",property:T.replace(xt,""),value:E?le(E[0]).replace(xt,""):""});return h(/^[;\s]*/),R}}function N(){var v=[];if(!u())return c("missing '{'");f(v);for(var y;y=b();)y!==!1&&(v.push(y),f(v)),y=b();return d()?v:c("missing '}'")}function I(){for(var v,y=[],T=s();v=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)y.push(v[1]),h(/^,\s*/);if(y.length)return T({type:"keyframe",values:y,declarations:N()})}function P(){var v=s(),y=h(/^@([-\w]+)?keyframes\s*/);if(y){var T=y[1];if(y=h(/^([-\w]+)\s*/),!y)return c("@keyframes missing name");var E=y[1];if(!u())return c("@keyframes missing '{'");for(var R,j=f();R=I();)j.push(R),j=j.concat(f());return d()?v({type:"keyframes",name:E,vendor:T,keyframes:j}):c("@keyframes missing '}'")}}function A(){var v=s(),y=h(/^@supports *([^{]+)/);if(y){var T=le(y[1]);if(!u())return c("@supports missing '{'");var E=f().concat(m());return d()?v({type:"supports",supports:T,rules:E}):c("@supports missing '}'")}}function C(){var v=s(),y=h(/^@host\s*/);if(y){if(!u())return c("@host missing '{'");var T=f().concat(m());return d()?v({type:"host",rules:T}):c("@host missing '}'")}}function w(){var v=s(),y=h(/^@media *([^{]+)/);if(y){var T=le(y[1]);if(!u())return c("@media missing '{'");var E=f().concat(m());return d()?v({type:"media",media:T,rules:E}):c("@media missing '}'")}}function H(){var v=s(),y=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(y)return v({type:"custom-media",name:le(y[1]),media:le(y[2])})}function X(){var v=s(),y=h(/^@page */);if(y){var T=p()||[];if(!u())return c("@page missing '{'");for(var E=f(),R;R=b();)E.push(R),E=E.concat(f());return d()?v({type:"page",selectors:T,declarations:E}):c("@page missing '}'")}}function Z(){var v=s(),y=h(/^@([-\w]+)?document *([^{]+)/);if(y){var T=le(y[1]),E=le(y[2]);if(!u())return c("@document missing '{'");var R=f().concat(m());return d()?v({type:"document",document:E,vendor:T,rules:R}):c("@document missing '}'")}}function J(){var v=s(),y=h(/^@font-face\s*/);if(y){if(!u())return c("@font-face missing '{'");for(var T=f(),E;E=b();)T.push(E),T=T.concat(f());return d()?v({type:"font-face",declarations:T}):c("@font-face missing '}'")}}var B=G("import"),ne=G("charset"),K=G("namespace");function G(v){var y=new RegExp("^@"+v+"\\s*([^;]+);");return function(){var T=s(),E=h(y);if(E){var R={type:v};return R[v]=E[1].trim(),T(R)}}}function $(){if(e[0]==="@")return P()||w()||H()||A()||B()||ne()||K()||Z()||X()||C()||J()}function L(){var v=s(),y=p();return y?(f(),v({type:"rule",selectors:y,declarations:N()})):c("selector missing")}return et(i())}function le(e){return e?e.replace(/^\s+|\s+$/g,""):""}function et(e,t){for(var r=e&&typeof e.type=="string",n=r?e:t,o=0,s=Object.keys(e);o<s.length;o++){var a=s[o],l=e[a];Array.isArray(l)?l.forEach(function(c){et(c,n)}):l&&typeof l=="object"&&et(l,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Dt={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function pn(e){var t=Dt[e.tagName]?Dt[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function fn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var kt=/([^\\]):hover/,gn=new RegExp(kt.source,"g");function Rt(e,t){var r;if(!(!((r=window.HIG_CONFIGURATION)===null||r===void 0)&&r.enableOnHoverClass))return e;var n=t?.stylesWithHoverClass.get(e);if(n)return n;var o=mn(e,{silent:!0});if(!o.stylesheet)return e;var s=[];if(o.stylesheet.rules.forEach(function(c){"selectors"in c&&(c.selectors||[]).forEach(function(i){kt.test(i)&&s.push(i)})}),s.length===0)return e;var a=new RegExp(s.filter(function(c,i){return s.indexOf(c)===i}).sort(function(c,i){return i.length-c.length}).map(function(c){return fn(c)}).join("|"),"g"),l=e.replace(a,function(c){var i=c.replace(gn,"$1.\\:hover");return c+", "+i});return t?.stylesWithHoverClass.set(e,l),l}function Ot(){var e=new Map;return{stylesWithHoverClass:e}}function yn(e,t){var r=t.doc,n=t.hackCss,o=t.cache;switch(e.type){case k.Document:return r.implementation.createDocument(null,"",null);case k.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case k.Element:var s=pn(e),a;e.isSVG?a=r.createElementNS("http://www.w3.org/2000/svg",s):a=r.createElement(s);var l=function(i){if(!e.attributes.hasOwnProperty(i))return"continue";var u=e.attributes[i];if(s==="option"&&i==="selected"&&u===!1)return"continue";if(u=typeof u=="boolean"||typeof u=="number"?"":u,i.startsWith("rr_")){if(s==="canvas"&&i==="rr_dataURL"){var d=document.createElement("img");d.src=u,d.onload=function(){var C=a.getContext("2d");C&&C.drawImage(d,0,0,d.width,d.height)}}else if(s==="img"&&i==="rr_dataURL"){var m=a;m.currentSrc.startsWith("data:")||(m.setAttribute("rrweb-original-src",e.attributes.src),m.src=u)}if(i==="rr_width")a.style.width=u;else if(i==="rr_height")a.style.height=u;else if(i==="rr_mediaCurrentTime")a.currentTime=e.attributes.rr_mediaCurrentTime;else if(i==="rr_mediaState")switch(u){case"played":a.play().catch(function(C){return console.warn("media playback error",C)});break;case"paused":a.pause();break}}else{var h=s==="textarea"&&i==="value",g=s==="style"&&i==="_cssText";if(g&&n&&(u=Rt(u,o),typeof u=="string")){for(var f=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,S=void 0,p=[],b="https://replay-cors-proxy.highlightrun.workers.dev";(S=f.exec(u))!==null;)S.index===f.lastIndex&&f.lastIndex++,S.forEach(function(C,w){if(w===0){var H=C.slice(5,C.length-2);p.push({originalUrl:H,proxyUrl:H.replace(H,b+"?url="+H)})}});p.forEach(function(C){u=u.replace(C.originalUrl,C.proxyUrl)})}if(h||g){for(var N=r.createTextNode(u),I=0,P=Array.from(a.childNodes);I<P.length;I++){var A=P[I];A.nodeType===a.TEXT_NODE&&a.removeChild(A)}return a.appendChild(N),"continue"}try{if(e.isSVG&&i==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",i,u);else if(i==="onload"||i==="onclick"||i.substring(0,7)==="onmouse")a.setAttribute("_"+i,u);else{if(s==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&i==="content")return a.setAttribute("csp-content",u),"continue";s==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||s==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(s==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",e.attributes.srcset):a.setAttribute(i,u))}}catch{}}};for(var c in e.attributes)l(c);if(e.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a;case k.Text:return r.createTextNode(e.isStyle&&n?Rt(e.textContent,o):e.textContent);case k.CDATA:return r.createCDATASection(e.textContent);case k.Comment:return r.createComment(e.textContent);default:return null}}function je(e,t){var r=t.doc,n=t.mirror,o=t.skipChild,s=o===void 0?!1:o,a=t.hackCss,l=a===void 0?!0:a,c=t.afterAppend,i=t.cache,u=yn(e,{doc:r,hackCss:l,cache:i});if(!u)return null;if(e.rootId&&console.assert(n.getNode(e.rootId)===r,"Target document should have the same root id."),e.type===k.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==k.DocumentType&&(e.childNodes[0].type===k.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=r),n.add(u,e),(e.type===k.Document||e.type===k.Element)&&!s)for(var d=0,m=e.childNodes;d<m.length;d++){var h=m[d],g=je(h,{doc:r,mirror:n,skipChild:!1,hackCss:l,afterAppend:c,cache:i});if(!g){console.warn("Failed to rebuild",h);continue}h.isShadow&&Nt(u)&&u.shadowRoot?u.shadowRoot.appendChild(g):u.appendChild(g),c&&c(g)}return u}function vn(e,t){function r(a){t(a)}for(var n=0,o=e.getIds();n<o.length;n++){var s=o[n];e.has(s)&&r(e.getNode(s))}}function bn(e,t){var r=t.getMeta(e);if(r?.type===k.Element){var n=e;for(var o in r.attributes)if(r.attributes.hasOwnProperty(o)&&o.startsWith("rr_")){var s=r.attributes[o];o==="rr_scrollLeft"&&(n.scrollLeft=s),o==="rr_scrollTop"&&(n.scrollTop=s)}}}function Sn(e,t){var r=t.doc,n=t.onVisit,o=t.hackCss,s=o===void 0?!0:o,a=t.afterAppend,l=t.cache,c=t.mirror,i=c===void 0?new Ke:c,u=je(e,{doc:r,mirror:i,skipChild:!1,hackCss:s,afterAppend:a,cache:l});return vn(i,function(d){n&&n(d),bn(d,i)}),u}function te(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Te=`Please stop import mirror directly. Instead of that,\r
3
+ now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
4
+ or you can use record.mirror to access the mirror instance during recording.`;q.mirror={map:{},getId(){return console.error(Te),-1},getNode(){return console.error(Te),null},removeNodeFromMap(){console.error(Te)},has(){return console.error(Te),!1},reset(){console.error(Te)}},typeof window<"u"&&window.Proxy&&window.Reflect&&(q.mirror=new Proxy(q.mirror,{get(e,t,r){return t==="map"&&console.error(Te),Reflect.get(e,t,r)}}));function Ne(e,t,r={}){let n=null,o=0;return function(s){const a=Date.now();!o&&r.leading===!1&&(o=a);const l=t-(a-o),c=this,i=arguments;l<=0||l>t?(n&&(clearTimeout(n),n=null),o=a,e.apply(c,i)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(c,i)},l))}}function Oe(e,t,r,n,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(a){setTimeout(()=>{r.set.call(this,a)},0),s&&s.set&&s.set.call(this,a)}}),()=>Oe(e,t,s||{},!0)}function pe(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}function tt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function rt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const At=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function ee(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){let r=!1;if(typeof t=="string"){if(e.closest!==void 0)return e.closest("."+t)!==null;r=e.classList.contains(t)}else e.classList.forEach(n=>{t.test(n)&&(r=!0)});return r||ee(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,ee(e.parentNode,t)}function Lt(e,t){return t.getId(e)!==-1}function Ge(e,t){return t.getId(e)===Re}function nt(e,t){if(ke(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?nt(e.parentNode,t):!0:!0}function ot(e){return Boolean(e.changedTouches)}function it(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(t){if(!(0 in arguments))throw new TypeError("1 argument is required");do if(this===t)return!0;while(t=t&&t.parentNode);return!1})}function _t(e){const t={},r=(o,s)=>{const a={value:o,parent:s,children:[]};return t[o.node.id]=a,a},n=[];for(const o of e){const{nextId:s,parentId:a}=o;if(s&&s in t){const l=t[s];if(l.parent){const c=l.parent.children.indexOf(l);l.parent.children.splice(c,0,r(o,l.parent))}else{const c=n.indexOf(l);n.splice(c,0,r(o,null))}continue}if(a in t){const l=t[a];l.children.push(r(o,l));continue}n.push(r(o,null))}return n}function st(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)st(e.children[r],t)}function Ee(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function Ft(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function at(e,t){var r,n;const o=(n=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=o.getBoundingClientRect(),a=at(o,t),l=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}}function Ae(e){return Boolean(e?.shadowRoot)}function we(e,t){const r=e[t[0]];return t.length===1?r:we(r.cssRules[t[1]].cssRules,t.slice(2))}function lt(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function Pt(e){const t=new Set,r=[];for(let n=e.length;n--;){const o=e[n];t.has(o.id)||(r.push(o),t.add(o.id))}return r}var Tn=Object.freeze({__proto__:null,on:te,get _mirror(){return q.mirror},throttle:Ne,hookSetter:Oe,patch:pe,getWindowHeight:tt,getWindowWidth:rt,isCanvasNode:At,isBlocked:ee,isSerialized:Lt,isIgnored:Ge,isAncestorRemoved:nt,isTouchEvent:ot,polyfill:it,queueToResolveTrees:_t,iterateResolveTree:st,isSerializedIframe:Ee,isSerializedStylesheet:Ft,getBaseDimension:at,hasShadowRoot:Ae,getNestedRule:we,getPositionsAndIndex:lt,uniqueTextMutations:Pt}),M=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(M||{}),x=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e))(x||{}),Y=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Y||{}),ce=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ce||{}),fe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(fe||{}),O=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e))(O||{});function Wt(e){return"__ln"in e}class Nn{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&Wt(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&Wt(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;this.length++}removeNode(t){const r=t.__ln;!this.head||(r.previous?(r.previous.next=r.next,r.next&&(r.next.previous=r.previous)):(this.head=r.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const $t=(e,t)=>`${e}@${t}`;class En{constructor(){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=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],r=new Nn,n=l=>{let c=l,i=Re;for(;i===Re;)c=c&&c.nextSibling,i=c&&this.mirror.getId(c);return i},o=l=>{var c,i,u,d,m;const h=l.getRootNode?(c=l.getRootNode())==null?void 0:c.host:null;let g=h;for(;(u=(i=g?.getRootNode)==null?void 0:i.call(g))!=null&&u.host;)g=((m=(d=g?.getRootNode)==null?void 0:d.call(g))==null?void 0:m.host)||null;const f=!this.doc.contains(l)&&(!g||!this.doc.contains(g));if(!l.parentNode||f)return;const S=ke(l.parentNode)?this.mirror.getId(h):this.mirror.getId(l.parentNode),p=n(l);if(S===-1||p===-1)return r.addNode(l);const b=Se(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,enableStrictPrivacy:this.enableStrictPrivacy,onSerialize:N=>{Ee(N,this.mirror)&&this.iframeManager.addIframe(N),Ft(N,this.mirror)&&this.stylesheetManager.addStylesheet(N),Ae(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,document)},onIframeLoad:(N,I)=>{this.iframeManager.attachIframe(N,I,this.mirror),this.shadowDomManager.observeAttachShadow(N)},onStylesheetLoad:(N,I)=>{this.stylesheetManager.attachStylesheet(N,I,this.mirror)}});b&&t.push({parentId:S,nextId:p,node:b})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of Array.from(this.movedSet.values()))ut(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||o(l);for(const l of Array.from(this.addedSet.values()))!dt(this.droppedSet,l)&&!ut(this.removes,l,this.mirror)||dt(this.movedSet,l)?o(l):this.droppedSet.add(l);let s=null;for(;r.length;){let l=null;if(s){const c=this.mirror.getId(s.value.parentNode),i=n(s.value);c!==-1&&i!==-1&&(l=s)}if(!l)for(let c=r.length-1;c>=0;c--){const i=r.get(c);if(i){const u=this.mirror.getId(i.value.parentNode),d=n(i.value);if(u!==-1&&d!==-1){l=i;break}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}s=l.previous,r.removeNode(l.value),o(l.value)}const a={texts:this.texts.map(l=>{let c=l.value;return this.enableStrictPrivacy&&c&&(c=Ct(c)),{id:this.mirror.getId(l.node),value:c}}).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>({id:this.mirror.getId(l.node),attributes:l.attributes})).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=t=>{if(!Ge(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!ee(t.target,this.blockClass)&&r!==t.oldValue&&this.texts.push({value:Ue(t.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(n=Qe({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),ee(t.target,this.blockClass)||n===t.oldValue)return;let o=this.attributes.find(s=>s.node===t.target);if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){const s=this.doc.createElement("span");t.oldValue&&s.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const a=o.attributes.style;for(const l of Array.from(r.style)){const c=r.style.getPropertyValue(l),i=r.style.getPropertyPriority(l);(c!==s.style.getPropertyValue(l)||i!==s.style.getPropertyPriority(l))&&(i===""?a[l]=c:a[l]=[c,i])}for(const l of Array.from(s.style))r.style.getPropertyValue(l)===""&&(a[l]=!1)}else{if(t.target.tagName==="INPUT"){const s=t.target;if(s.type==="password"){o.attributes.value="*".repeat(s.value.length);break}}o.attributes[t.attributeName]=Mt(this.doc,t.target.tagName,t.attributeName,n)}break}case"childList":{t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),o=ke(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);ee(t.target,this.blockClass)||Ge(r,this.mirror)||!Lt(r,this.mirror)||(this.addedSet.has(r)?(ct(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||nt(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[$t(n,o)]?ct(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:ke(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(!(r&&ee(r,this.blockClass))){if(this.mirror.getMeta(t)){if(Ge(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.getMeta(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[$t(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ee(t,this.blockClass)||t.childNodes.forEach(n=>this.genAdds(n))}}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ct(e,t){e.delete(t),t.childNodes.forEach(r=>ct(e,r))}function ut(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return e.some(s=>s.id===o)?!0:ut(e,n,r)}function dt(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:dt(e,r):!1}var wn=Object.defineProperty,Cn=Object.defineProperties,In=Object.getOwnPropertyDescriptors,Vt=Object.getOwnPropertySymbols,Mn=Object.prototype.hasOwnProperty,xn=Object.prototype.propertyIsEnumerable,Ut=(e,t,r)=>t in e?wn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jt=(e,t)=>{for(var r in t||(t={}))Mn.call(t,r)&&Ut(e,r,t[r]);if(Vt)for(var r of Vt(t))xn.call(t,r)&&Ut(e,r,t[r]);return e},Dn=(e,t)=>Cn(e,In(t));const ge=[],Gt=typeof CSSGroupingRule<"u",Bt=typeof CSSMediaRule<"u",zt=typeof CSSSupportsRule<"u",Ht=typeof CSSConditionRule<"u";function Le(e){try{if("composedPath"in e){const 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{return e.target}}function Yt(e,t){var r,n;const o=new En;ge.push(o),o.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const a=(n=(r=window?.Zone)==null?void 0:r.__symbol__)==null?void 0:n.call(r,"MutationObserver");a&&window[a]&&(s=window[a]);const l=new s(o.processMutations.bind(o));return l.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),l}function kn({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],l;const c=Ne(d=>{const m=Date.now()-l;e(a.map(h=>(h.timeOffset-=m,h)),d),a=[],l=null},s),i=Ne(d=>{const m=Le(d),{clientX:h,clientY:g}=ot(d)?d.changedTouches[0]:d;l||(l=Date.now()),a.push({x:h,y:g,id:n.getId(m),timeOffset:Date.now()-l}),c(typeof DragEvent<"u"&&d instanceof DragEvent?x.Drag:d instanceof MouseEvent?x.MouseMove:x.TouchMove)},o,{trailing:!1}),u=[te("mousemove",i,r),te("touchmove",i,r),te("drag",i,r)];return()=>{u.forEach(d=>d())}}function Rn({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],l=c=>i=>{const u=Le(i);if(ee(u,n)||At(u))return;const d=ot(i)?i.changedTouches[0]:i;if(!d)return;const m=r.getId(u),{clientX:h,clientY:g}=d;e({type:Y[c],id:m,x:h,y:g})};return Object.keys(Y).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{const i=c.toLowerCase(),u=l(c);a.push(te(i,u,t))}),()=>{a.forEach(c=>c())}}function Xt({scrollCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){const s=Ne(a=>{const l=Le(a);if(!l||ee(l,n))return;const c=r.getId(l);if(l===t){const i=t.scrollingElement||t.documentElement;e({id:c,x:i.scrollLeft,y:i.scrollTop})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})},o.scroll||100);return te("scroll",s,t)}function On({viewportResizeCb:e}){let t=-1,r=-1;const n=Ne(()=>{const o=tt(),s=rt();(t!==o||r!==s)&&(e({width:Number(s),height:Number(o)}),t=o,r=s)},200);return te("resize",n,window)}function Zt(e,t){const r=jt({},e);return t||delete r.userTriggered,r}const An=["INPUT","TEXTAREA","SELECT"],Kt=new WeakMap;function Ln({inputCb:e,doc:t,mirror:r,blockClass:n,ignoreClass:o,maskInputOptions:s,maskInputFn:a,sampling:l,userTriggeredOnInput:c}){function i(g){let f=Le(g);const S=g.isTrusted;if(f&&f.tagName==="OPTION"&&(f=f.parentElement),!f||!f.tagName||An.indexOf(f.tagName)<0||ee(f,n))return;const p=f.type;if(f.classList.contains(o))return;let b=f.value,N=!1;p==="radio"||p==="checkbox"?N=f.checked:(s[f.tagName.toLowerCase()]||s[p])&&(b=Qe({maskInputOptions:s,tagName:f.tagName,type:p,value:b,maskInputFn:a})),u(f,Zt({text:b,isChecked:N,userTriggered:S},c));const I=f.name;p==="radio"&&I&&N&&t.querySelectorAll(`input[type="radio"][name="${I}"]`).forEach(P=>{P!==f&&u(P,Zt({text:P.value,isChecked:!N,userTriggered:!1},c))})}function u(g,f){const S=Kt.get(g);if(!S||S.text!==f.text||S.isChecked!==f.isChecked){Kt.set(g,f);const p=r.getId(g);e(Dn(jt({},f),{id:p}))}}const d=(l.input==="last"?["change"]:["input","change"]).map(g=>te(g,i,t)),m=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),h=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return m&&m.set&&d.push(...h.map(g=>Oe(g[0],g[1],{set(){i({target:this})}}))),()=>{d.forEach(g=>g())}}function Be(e){const t=[];function r(n,o){if(Gt&&n.parentRule instanceof CSSGroupingRule||Bt&&n.parentRule instanceof CSSMediaRule||zt&&n.parentRule instanceof CSSSupportsRule||Ht&&n.parentRule instanceof CSSConditionRule){const s=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(s)}else{const s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(s)}return o}return r(e,t)}function _n({styleSheetRuleCb:e,mirror:t},{win:r}){const n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(l,c){const i=t.getId(this.ownerNode);return i!==-1&&e({id:i,adds:[{rule:l,index:c}]}),n.apply(this,arguments)};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(l){const c=t.getId(this.ownerNode);return c!==-1&&e({id:c,removes:[{index:l}]}),o.apply(this,arguments)};const s={};Gt?s.CSSGroupingRule=r.CSSGroupingRule:(Bt&&(s.CSSMediaRule=r.CSSMediaRule),Ht&&(s.CSSConditionRule=r.CSSConditionRule),zt&&(s.CSSSupportsRule=r.CSSSupportsRule));const a={};return Object.entries(s).forEach(([l,c])=>{a[l]={insertRule:c.prototype.insertRule,deleteRule:c.prototype.deleteRule},c.prototype.insertRule=function(i,u){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:i,index:[...Be(this),u||0]}]}),a[l].insertRule.apply(this,arguments)},c.prototype.deleteRule=function(i){const u=t.getId(this.parentStyleSheet.ownerNode);return u!==-1&&e({id:u,removes:[{index:[...Be(this),i]}]}),a[l].deleteRule.apply(this,arguments)}}),()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,Object.entries(s).forEach(([l,c])=>{c.prototype.insertRule=a[l].insertRule,c.prototype.deleteRule=a[l].deleteRule})}}function Fn({styleDeclarationCb:e,mirror:t},{win:r}){const n=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(s,a,l){var c,i;const u=t.getId((i=(c=this.parentRule)==null?void 0:c.parentStyleSheet)==null?void 0:i.ownerNode);return u!==-1&&e({id:u,set:{property:s,value:a,priority:l},index:Be(this.parentRule)}),n.apply(this,arguments)};const o=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(s){var a,l;const c=t.getId((l=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:l.ownerNode);return c!==-1&&e({id:c,remove:{property:s},index:Be(this.parentRule)}),o.apply(this,arguments)},()=>{r.CSSStyleDeclaration.prototype.setProperty=n,r.CSSStyleDeclaration.prototype.removeProperty=o}}function Pn({mediaInteractionCb:e,blockClass:t,mirror:r,sampling:n}){const o=a=>Ne(l=>{const c=Le(l);if(!c||ee(c,t))return;const{currentTime:i,volume:u,muted:d}=c;e({type:a,id:r.getId(c),currentTime:i,volume:u,muted:d})},n.media||500),s=[te("play",o(fe.Play)),te("pause",o(fe.Pause)),te("seeked",o(fe.Seeked)),te("volumechange",o(fe.VolumeChange))];return()=>{s.forEach(a=>a())}}function Wn({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,s=r.FontFace;r.FontFace=function(l,c,i){const u=new s(l,c,i);return o.set(u,{family:l,buffer:typeof c!="string",descriptors:i,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),u};const a=pe(t.fonts,"add",function(l){return function(c){return setTimeout(()=>{const i=o.get(c);i&&(e(i),o.delete(c))},0),l.apply(this,[c])}});return n.push(()=>{r.FontFace=s}),n.push(a),()=>{n.forEach(l=>l())}}function $n(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:a,inputCb:l,mediaInteractionCb:c,styleSheetRuleCb:i,styleDeclarationCb:u,canvasMutationCb:d,fontCb:m}=e;e.mutationCb=(...h)=>{t.mutation&&t.mutation(...h),r(...h)},e.mousemoveCb=(...h)=>{t.mousemove&&t.mousemove(...h),n(...h)},e.mouseInteractionCb=(...h)=>{t.mouseInteraction&&t.mouseInteraction(...h),o(...h)},e.scrollCb=(...h)=>{t.scroll&&t.scroll(...h),s(...h)},e.viewportResizeCb=(...h)=>{t.viewportResize&&t.viewportResize(...h),a(...h)},e.inputCb=(...h)=>{t.input&&t.input(...h),l(...h)},e.mediaInteractionCb=(...h)=>{t.mediaInteaction&&t.mediaInteaction(...h),c(...h)},e.styleSheetRuleCb=(...h)=>{t.styleSheetRule&&t.styleSheetRule(...h),i(...h)},e.styleDeclarationCb=(...h)=>{t.styleDeclaration&&t.styleDeclaration(...h),u(...h)},e.canvasMutationCb=(...h)=>{t.canvasMutation&&t.canvasMutation(...h),d(...h)},e.fontCb=(...h)=>{t.font&&t.font(...h),m(...h)}}function Vn(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};$n(e,t);const n=Yt(e,e.doc),o=kn(e),s=Rn(e),a=Xt(e),l=On(e),c=Ln(e),i=Pn(e),u=_n(e,{win:r}),d=Fn(e,{win:r}),m=e.collectFonts?Wn(e):()=>{},h=[];for(const g of e.plugins)h.push(g.observer(g.callback,r,g.options));return()=>{ge.forEach(g=>g.reset()),n.disconnect(),o(),s(),a(),l(),c(),i(),u(),d(),m(),h.forEach(g=>g())}}class Un{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,r,n){var o;this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var jn=Object.defineProperty,Gn=Object.defineProperties,Bn=Object.getOwnPropertyDescriptors,Qt=Object.getOwnPropertySymbols,zn=Object.prototype.hasOwnProperty,Hn=Object.prototype.propertyIsEnumerable,Jt=(e,t,r)=>t in e?jn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qt=(e,t)=>{for(var r in t||(t={}))zn.call(t,r)&&Jt(e,r,t[r]);if(Qt)for(var r of Qt(t))Hn.call(t,r)&&Jt(e,r,t[r]);return e},er=(e,t)=>Gn(e,Bn(t));class Yn{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const r=this;this.restorePatches.push(pe(HTMLElement.prototype,"attachShadow",function(n){return function(){const o=n.apply(this,arguments);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),o}}))}addShadowRoot(t,r){Yt(er(qt({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Xt(er(qt({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}observeAttachShadow(t){if(t.contentWindow){const r=this;this.restorePatches.push(pe(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(){const o=n.apply(this,arguments);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),o}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_e=typeof Uint8Array>"u"?[]:new Uint8Array(256),ze=0;ze<Ce.length;ze++)_e[Ce.charCodeAt(ze)]=ze;var Xn=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=Ce[t[r]>>2],o+=Ce[(t[r]&3)<<4|t[r+1]>>4],o+=Ce[(t[r+1]&15)<<2|t[r+2]>>6],o+=Ce[t[r+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o},Zn=function(e){var t=e.length*.75,r=e.length,n,o=0,s,a,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var i=new ArrayBuffer(t),u=new Uint8Array(i);for(n=0;n<r;n+=4)s=_e[e.charCodeAt(n)],a=_e[e.charCodeAt(n+1)],l=_e[e.charCodeAt(n+2)],c=_e[e.charCodeAt(n+3)],u[o++]=s<<2|a>>4,u[o++]=(a&15)<<4|l>>2,u[o++]=(l&3)<<6|c&63;return i};const tr=new Map;function Kn(e,t){let r=tr.get(e);return r||(r=new Map,tr.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const rr=(e,t,r)=>{if(!e||!(or(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=Kn(r,n);let s=o.indexOf(e);return s===-1&&(s=o.length,o.push(e)),s};function He(e,t,r){if(e instanceof Array)return e.map(n=>He(n,t,r));if(e===null)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){const n=e.constructor.name,o=Xn(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[He(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else if(e instanceof HTMLCanvasElement){const n="HTMLImageElement",o=e.toDataURL();return{rr_type:n,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[He(e.data,t,r),e.width,e.height]};if(or(e,t)||typeof e=="object"){const n=e.constructor.name,o=rr(e,t,r);return{rr_type:n,index:o}}}}return e}const nr=(e,t,r)=>[...e].map(n=>He(n,t,r)),or=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof t[n]=="function");return Boolean(r.find(n=>e instanceof t[n]))};function Qn(e,t,r,n){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of s)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const l=pe(t.CanvasRenderingContext2D.prototype,a,function(c){return function(...i){return ee(this.canvas,r)||setTimeout(()=>{const u=nr([...i],t,this);e(this.canvas,{type:ce["2D"],property:a,args:u})},0),c.apply(this,i)}});o.push(l)}catch{const c=Oe(t.CanvasRenderingContext2D.prototype,a,{set(i){e(this.canvas,{type:ce["2D"],property:a,args:[i],setter:!0})}});o.push(c)}return()=>{o.forEach(a=>a())}}function ir(e,t){const r=[];try{const n=pe(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(s,...a){return ee(this,t)||"__context"in this||(this.__context=s),o.apply(this,[s,...a])}});r.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(n=>n())}}function sr(e,t,r,n,o,s){const a=[],l=Object.getOwnPropertyNames(e);for(const c of l)try{if(typeof e[c]!="function")continue;const i=pe(e,c,function(u){return function(...d){const m=u.apply(this,d);if(rr(m,s,e),!ee(this.canvas,n)){const h=o.getId(this.canvas),g=nr([...d],s,e),f={type:t,property:c,args:g};r(this.canvas,f)}return m}});a.push(i)}catch{const u=Oe(e,c,{set(d){r(this.canvas,{type:t,property:c,args:[d],setter:!0})}});a.push(u)}return a}function Jn(e,t,r,n){const o=[];return o.push(...sr(t.WebGLRenderingContext.prototype,ce.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...sr(t.WebGL2RenderingContext.prototype,ce.WebGL2,e,r,n,t)),()=>{o.forEach(s=>s())}}function qn(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,s=r.length;o<s;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}function eo(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,s=qn(e,o),a=s.indexOf(`
5
+ `,10)+1,l=s.substring(a)+(n?"//# sourceMappingURL="+n:""),c=new Blob([l],{type:"application/javascript"});return URL.createObjectURL(c)}function to(e,t,r){var n;return function(s){return n=n||eo(e,t,r),new Worker(n,s)}}var ro=to("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),ar=Object.getOwnPropertySymbols,no=Object.prototype.hasOwnProperty,oo=Object.prototype.propertyIsEnumerable,io=(e,t)=>{var r={};for(var n in e)no.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ar)for(var n of ar(e))t.indexOf(n)<0&&oo.call(e,n)&&(r[n]=e[n]);return r},so=(e,t,r)=>new Promise((n,o)=>{var s=c=>{try{l(r.next(c))}catch(i){o(i)}},a=c=>{try{l(r.throw(c))}catch(i){o(i)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});class ao{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(a,l){(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(l)};const{sampling:r="all",win:n,blockClass:o,recordCanvas:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,o),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o)}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n){const o=ir(r,n),s=new Map,a=new ro;a.onmessage=d=>{const{id:m}=d.data;if(s.set(m,!1),!("base64"in d.data))return;const{base64:h,type:g,width:f,height:S}=d.data;this.mutationCb({id:m,type:ce["2D"],commands:[{property:"clearRect",args:[0,0,f,S]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:g}]},0,0]}]})};const l=1e3/t;let c=0,i;const u=d=>{if(c&&d-c<l){i=requestAnimationFrame(u);return}c=d,r.document.querySelectorAll(`canvas:not(.${n} *)`).forEach(m=>so(this,null,function*(){var h;const g=this.mirror.getId(m);if(s.get(g))return;if(s.set(g,!0),["webgl","webgl2"].includes(m.__context)){const S=m.getContext(m.__context);((h=S?.getContextAttributes())==null?void 0:h.preserveDrawingBuffer)===!1&&S?.clear(S.COLOR_BUFFER_BIT)}const f=yield createImageBitmap(m);a.postMessage({id:g,bitmap:f,width:m.width,height:m.height},[f])})),i=requestAnimationFrame(u)};i=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(i)}}initCanvasMutationObserver(t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=ir(t,r),o=Qn(this.processMutation.bind(this),t,r,this.mirror),s=Jn(this.processMutation.bind(this),t,r,this.mirror);this.resetObservers=()=>{n(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const o=n.map(a=>io(a,["type"])),{type:s}=n[0];this.mutationCb({id:r,type:s,commands:o}),this.pendingCanvasMutations.delete(t)}}class lo{constructor(t){this.trackedStylesheets=new WeakSet,this.mutationCb=t.mutationCb}addStylesheet(t){this.trackedStylesheets.has(t)||(this.trackedStylesheets.add(t),this.trackStylesheet(t))}trackStylesheet(t){}attachStylesheet(t,r,n){this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[]}),this.addStylesheet(t)}}var co=Object.defineProperty,uo=Object.defineProperties,ho=Object.getOwnPropertyDescriptors,lr=Object.getOwnPropertySymbols,mo=Object.prototype.hasOwnProperty,po=Object.prototype.propertyIsEnumerable,cr=(e,t,r)=>t in e?co(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,oe=(e,t)=>{for(var r in t||(t={}))mo.call(t,r)&&cr(e,r,t[r]);if(lr)for(var r of lr(t))po.call(t,r)&&cr(e,r,t[r]);return e},fo=(e,t)=>uo(e,ho(t));function Q(e){return fo(oe({},e),{timestamp:Date.now()})}let z,Fe;const de=Et();function ye(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="highlight-block",blockSelector:s=null,ignoreClass:a="highlight-ignore",maskTextClass:l="highlight-mask",maskTextSelector:c=null,inlineStylesheet:i=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:m,maskInputFn:h,maskTextFn:g,hooks:f,packFn:S,sampling:p={},mousemoveWait:b,recordCanvas:N=!1,userTriggeredOnInput:I=!1,collectFonts:P=!1,inlineImages:A=!1,plugins:C,keepIframeSrcFn:w=()=>!1,enableStrictPrivacy:H=!1}=e;if(!t)throw new Error("emit function is required");b!==void 0&&p.mousemove===void 0&&(p.mousemove=b),de.reset();const X=u===!0?{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}:d!==void 0?d:{password:!0},Z=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all"}:m||{};it();let J,B=0;const ne=E=>{for(const R of C||[])R.eventProcessor&&(E=R.eventProcessor(E));return S&&(E=S(E)),E};z=(E,R)=>{var j;if(((j=ge[0])==null?void 0:j.isFrozen())&&E.type!==M.FullSnapshot&&!(E.type===M.IncrementalSnapshot&&E.data.source===x.Mutation)&&ge.forEach(_=>_.unfreeze()),t(ne(E),R),E.type===M.FullSnapshot)J=E,B=0;else if(E.type===M.IncrementalSnapshot){if(E.data.source===x.Mutation&&E.data.isAttachIframe)return;B++;const _=n&&B>=n,re=r&&E.timestamp-J.timestamp>r;(_||re)&&Fe(!0)}};const K=E=>{z(Q({type:M.IncrementalSnapshot,data:oe({source:x.Mutation},E)}))},G=E=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.Scroll},E)})),$=E=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.CanvasMutation},E)})),L=new Un({mutationCb:K}),v=new lo({mutationCb:K}),y=new ao({recordCanvas:N,mutationCb:$,win:window,blockClass:o,mirror:de,sampling:p.canvas}),T=new Yn({mutationCb:K,scrollCb:G,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:c,inlineStylesheet:i,maskInputOptions:X,maskTextFn:g,maskInputFn:h,recordCanvas:N,inlineImages:A,sampling:p,slimDOMOptions:Z,iframeManager:L,stylesheetManager:v,canvasManager:y,enableStrictPrivacy:H},mirror:de});Fe=(E=!1)=>{var R,j,_,re;z(Q({type:M.Meta,data:{href:window.location.href,width:rt(),height:tt()}}),E),ge.forEach(W=>W.lock());const F=hn(document,{mirror:de,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:c,inlineStylesheet:i,maskAllInputs:X,maskTextFn:g,slimDOM:Z,recordCanvas:N,inlineImages:A,enableStrictPrivacy:H,onSerialize:W=>{Ee(W,de)&&L.addIframe(W),Ae(W)&&T.addShadowRoot(W.shadowRoot,document)},onIframeLoad:(W,ue)=>{L.attachIframe(W,ue,de),T.observeAttachShadow(W)},onStylesheetLoad:(W,ue)=>{this.stylesheetManager.attachStylesheet(W,ue,this.mirror)},keepIframeSrcFn:w});if(!F)return console.warn("Failed to snapshot the document");z(Q({type:M.FullSnapshot,data:{node:F,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((j=(R=document?.body)==null?void 0:R.parentElement)==null?void 0:j.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((re=(_=document?.body)==null?void 0:_.parentElement)==null?void 0:re.scrollTop)||document?.body.scrollTop||0}}})),ge.forEach(W=>W.unlock())};try{const E=[];E.push(te("DOMContentLoaded",()=>{z(Q({type:M.DomContentLoaded,data:{}}))}));const R=_=>{var re;return Vn({mutationCb:K,mousemoveCb:(F,W)=>z(Q({type:M.IncrementalSnapshot,data:{source:W,positions:F}})),mouseInteractionCb:F=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.MouseInteraction},F)})),scrollCb:G,viewportResizeCb:F=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.ViewportResize},F)})),inputCb:F=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.Input},F)})),mediaInteractionCb:F=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.MediaInteraction},F)})),styleSheetRuleCb:F=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.StyleSheetRule},F)})),styleDeclarationCb:F=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.StyleDeclaration},F)})),canvasMutationCb:$,fontCb:F=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.Font},F)})),blockClass:o,ignoreClass:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:X,inlineStylesheet:i,sampling:p,recordCanvas:N,inlineImages:A,userTriggeredOnInput:I,collectFonts:P,doc:_,maskInputFn:h,maskTextFn:g,blockSelector:s,slimDOMOptions:Z,mirror:de,iframeManager:L,stylesheetManager:v,shadowDomManager:T,canvasManager:y,enableStrictPrivacy:H,plugins:((re=C?.filter(F=>F.observer))==null?void 0:re.map(F=>({observer:F.observer,options:F.options,callback:W=>z(Q({type:M.Plugin,data:{plugin:F.name,payload:W}}))})))||[]},f)};L.addLoadListener(_=>{E.push(R(_.contentDocument))});const j=()=>{Fe(),E.push(R(document))};return document.readyState==="interactive"||document.readyState==="complete"?j():E.push(te("load",()=>{z(Q({type:M.Load,data:{}})),j()},window)),()=>{E.forEach(_=>_())}}catch(E){console.warn(E)}}ye.addCustomEvent=(e,t)=>{!z||z(Q({type:M.Custom,data:{tag:e,payload:t}}))},ye.freezePage=()=>{ge.forEach(e=>e.freeze())},ye.takeFullSnapshot=e=>{if(!Fe)throw new Error("please take full snapshot after start recording");Fe(e)},ye.mirror=de;var D;(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"})(D||(D={}));var go=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function yo(){return new go}function vo(e){const t={},r=/;(?![^(]*\))/g,n=/:(.+)/,o=/\/\*.*?\*\//g;return e.replace(o,"").split(r).forEach(function(s){if(s){const a=s.split(n);a.length>1&&(t[ht(a[0].trim())]=a[1].trim())}}),t}function ur(e){const t=[];for(const r in e){const n=e[r];if(typeof n!="string")continue;const o=No(r);t.push(`${o}: ${n};`)}return t.join(" ")}const bo=/-([a-z])/g,So=/^--[a-zA-Z0-9-]+$/,ht=e=>So.test(e)?e:e.replace(bo,(t,r)=>r?r.toUpperCase():""),To=/\B([A-Z])/g,No=e=>e.replace(To,"-$1").toLowerCase();class ie{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=U.ELEMENT_NODE,this.TEXT_NODE=U.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const t=this.parentNode;if(!t)return null;const r=t.childNodes,n=r.indexOf(this);return r[n+1]||null}contains(t){if(t===this)return!0;for(const r of this.childNodes)if(r.contains(t))return!0;return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Eo(e){return class jr extends e{constructor(){super(...arguments),this.nodeType=U.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=D.Document,this.textContent=null}get documentElement(){return this.childNodes.find(r=>r.RRNodeType===D.Element&&r.tagName==="HTML")||null}get body(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===D.Element&&n.tagName==="BODY"))||null}get head(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===D.Element&&n.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(r){const n=r.RRNodeType;if((n===D.Element||n===D.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===n))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${n===D.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return r.parentElement=null,r.parentNode=this,this.childNodes.push(r),r}insertBefore(r,n){const o=r.RRNodeType;if((o===D.Element||o===D.DocumentType)&&this.childNodes.some(a=>a.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===D.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(n===null)return this.appendChild(r);const s=this.childNodes.indexOf(n);if(s==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(s,0,r),r.parentElement=null,r.parentNode=this,r}removeChild(r){const n=this.childNodes.indexOf(r);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),r.parentElement=null,r.parentNode=null,r}open(){this.childNodes=[]}close(){}write(r){let n;if(r==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?n="-//W3C//DTD XHTML 1.0 Transitional//EN":r==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(n="-//W3C//DTD HTML 4.0 Transitional//EN"),n){const o=this.createDocumentType("html",n,"");this.open(),this.appendChild(o)}}createDocument(r,n,o){return new jr}createDocumentType(r,n,o){const s=new(dr(ie))(r,n,o);return s.ownerDocument=this,s}createElement(r){const n=new(hr(ie))(r);return n.ownerDocument=this,n}createElementNS(r,n){return this.createElement(n)}createTextNode(r){const n=new(mr(ie))(r);return n.ownerDocument=this,n}createComment(r){const n=new(pr(ie))(r);return n.ownerDocument=this,n}createCDATASection(r){const n=new(fr(ie))(r);return n.ownerDocument=this,n}toString(){return"RRDocument"}}}function dr(e){return class extends e{constructor(t,r,n){super(),this.nodeType=U.DOCUMENT_TYPE_NODE,this.RRNodeType=D.DocumentType,this.textContent=null,this.name=t,this.publicId=r,this.systemId=n,this.nodeName=t}toString(){return"RRDocumentType"}}}function hr(e){return class extends e{constructor(t){super(),this.nodeType=U.ELEMENT_NODE,this.RRNodeType=D.Element,this.attributes={},this.shadowRoot=null,this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(r=>t+=r.textContent),t}set textContent(t){this.childNodes=[this.ownerDocument.createTextNode(t)]}get classList(){return new Co(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const t=this.attributes.style?vo(this.attributes.style):{},r=/\B([A-Z])/g;return t.setProperty=(n,o,s)=>{if(r.test(n))return;const a=ht(n);o?t[a]=o:delete t[a],s==="important"&&(t[a]+=" !important"),this.attributes.style=ur(t)},t.removeProperty=n=>{if(r.test(n))return"";const o=ht(n),s=t[o]||"";return delete t[o],this.attributes.style=ur(t),s},t}getAttribute(t){return this.attributes[t]||null}setAttribute(t,r){this.attributes[t]=r}setAttributeNS(t,r,n){this.setAttribute(r,n)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return this.childNodes.push(t),t.parentNode=this,t.parentElement=this,t}insertBefore(t,r){if(r===null)return this.appendChild(t);const n=this.childNodes.indexOf(r);if(n==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(n,0,t),t.parentElement=this,t.parentNode=this,t}removeChild(t){const r=this.childNodes.indexOf(t);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),t.parentElement=null,t.parentNode=null,t}attachShadow(t){const r=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=r,r}dispatchEvent(t){return!0}toString(){let t="";for(const r in this.attributes)t+=`${r}="${this.attributes[r]}" `;return`${this.tagName} ${t}`}}}function wo(e){return class extends e{attachShadow(t){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}function mr(e){return class extends e{constructor(t){super(),this.nodeType=U.TEXT_NODE,this.nodeName="#text",this.RRNodeType=D.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function pr(e){return class extends e{constructor(t){super(),this.nodeType=U.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=D.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function fr(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=U.CDATA_SECTION_NODE,this.RRNodeType=D.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class Co{constructor(t,r){if(this.classes=[],this.add=(...n)=>{for(const o of n){const s=String(o);this.classes.indexOf(s)>=0||this.classes.push(s)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...n)=>{this.classes=this.classes.filter(o=>n.indexOf(o)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){const n=t.trim().split(/\s+/);this.classes.push(...n)}this.onChange=r}}var U;(function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(U||(U={}));const mt={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"};function ae(e,t,r,n){const o=e.childNodes,s=t.childNodes;n=n||t.mirror||t.ownerDocument.mirror,(o.length>0||s.length>0)&&gr(Array.from(o),s,e,r,n);let a=null,l=null;switch(t.RRNodeType){case D.Document:{l=t.scrollData;break}case D.Element:{const c=e,i=t;switch(Io(c,i,n),l=i.scrollData,a=i.inputData,i.tagName){case"AUDIO":case"VIDEO":{const u=e,d=i;d.paused!==void 0&&(d.paused?u.pause():u.play()),d.muted!==void 0&&(u.muted=d.muted),d.volume!==void 0&&(u.volume=d.volume),d.currentTime!==void 0&&(u.currentTime=d.currentTime);break}case"CANVAS":t.canvasMutations.forEach(u=>r.applyCanvas(u.event,u.mutation,e));break;case"STYLE":Mo(c,t.rules);break}if(i.shadowRoot){c.shadowRoot||c.attachShadow({mode:"open"});const u=c.shadowRoot.childNodes,d=i.shadowRoot.childNodes;(u.length>0||d.length>0)&&gr(Array.from(u),d,c.shadowRoot,r,n)}break}case D.Text:case D.Comment:case D.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(l&&r.applyScroll(l,!0),a&&r.applyInput(a),t.nodeName==="IFRAME"){const c=e.contentDocument,i=t;if(c){const u=n.getMeta(i.contentDocument);u&&r.mirror.add(c,Object.assign({},u)),ae(c,i.contentDocument,r,n)}}}function Io(e,t,r){const n=e.attributes,o=t.attributes;for(const s in o){const a=o[s],l=r.getMeta(t);if(l&&"isSVG"in l&&l.isSVG&&mt[s])e.setAttributeNS(mt[s],s,a);else if(t.tagName==="CANVAS"&&s==="rr_dataURL"){const c=document.createElement("img");c.src=a,c.onload=()=>{const i=e.getContext("2d");i&&i.drawImage(c,0,0,c.width,c.height)}}else e.setAttribute(s,a)}for(const{name:s}of Array.from(n))s in o||e.removeAttribute(s);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function gr(e,t,r,n,o){var s,a;let l=0,c=e.length-1,i=0,u=t.length-1,d=e[l],m=e[c],h=t[i],g=t[u],f,S;for(;l<=c&&i<=u;)if(d===void 0)d=e[++l];else if(m===void 0)m=e[--c];else if(n.mirror.getId(d)===o.getId(h))ae(d,h,n,o),d=e[++l],h=t[++i];else if(n.mirror.getId(m)===o.getId(g))ae(m,g,n,o),m=e[--c],g=t[--u];else if(n.mirror.getId(d)===o.getId(g))r.insertBefore(d,m.nextSibling),ae(d,g,n,o),d=e[++l],g=t[--u];else if(n.mirror.getId(m)===o.getId(h))r.insertBefore(m,d),ae(m,h,n,o),m=e[--c],h=t[++i];else{if(!f){f={};for(let p=l;p<=c;p++){const b=e[p];b&&n.mirror.hasNode(b)&&(f[n.mirror.getId(b)]=p)}}if(S=f[o.getId(h)],S){const p=e[S];r.insertBefore(p,d),ae(p,h,n,o),e[S]=void 0}else{const p=pt(h,n.mirror,o);((s=n.mirror.getMeta(r))===null||s===void 0?void 0:s.type)===D.Document&&((a=n.mirror.getMeta(p))===null||a===void 0?void 0:a.type)===D.Element&&r.documentElement&&(r.removeChild(r.documentElement),e[l]=void 0,d=void 0),r.insertBefore(p,d||null),ae(p,h,n,o)}h=t[++i]}if(l>c){const p=t[u+1];let b=null;for(p&&r.childNodes.forEach(N=>{n.mirror.getId(N)===o.getId(p)&&(b=N)});i<=u;++i){const N=pt(t[i],n.mirror,o);r.insertBefore(N,b),ae(N,t[i],n,o)}}else if(i>u)for(;l<=c;l++){const p=e[l];p&&(r.removeChild(p),n.mirror.removeNodeFromMap(p))}}function pt(e,t,r){let n=t.getNode(r.getId(e));const o=r.getMeta(e);if(n!==null)return n;switch(e.RRNodeType){case D.Document:n=new Document;break;case D.DocumentType:n=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case D.Element:{e.tagName.toLowerCase(),o&&"isSVG"in o&&o?.isSVG?n=document.createElementNS(mt.svg,e.tagName.toLowerCase()):n=document.createElement(e.tagName);break}case D.Text:n=document.createTextNode(e.data);break;case D.Comment:n=document.createComment(e.data);break;case D.CDATA:n=document.createCDATASection(e.data);break}return o&&t.add(n,Object.assign({},o)),n}function Pe(e,t){const r=e[t[0]];return t.length===1?r:Pe(r.cssRules[t[1]].cssRules,t.slice(2))}var se;(function(e){e[e.Insert=0]="Insert",e[e.Remove=1]="Remove",e[e.Snapshot=2]="Snapshot",e[e.SetProperty=3]="SetProperty",e[e.RemoveProperty=4]="RemoveProperty"})(se||(se={}));function yr(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function Mo(e,t){const r=e.sheet;t.forEach(n=>{if(n.type===se.Insert)try{if(Array.isArray(n.index)){const{positions:o,index:s}=yr(n.index);Pe(r.cssRules,o).insertRule(n.cssText,s)}else r.insertRule(n.cssText,n.index)}catch{}else if(n.type===se.Remove)try{if(Array.isArray(n.index)){const{positions:o,index:s}=yr(n.index);Pe(r.cssRules,o).deleteRule(s||0)}else r.deleteRule(n.index)}catch{}else n.type===se.SetProperty?Pe(r.cssRules,n.index).style.setProperty(n.property,n.value,n.priority):n.type===se.RemoveProperty&&Pe(r.cssRules,n.index).style.removeProperty(n.property)})}class Ie extends Eo(ie){constructor(t){super(),this._unserializedId=-1,this.mirror=Wo(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,n){return new Ie}createDocumentType(t,r,n){const o=new xo(t,r,n);return o.ownerDocument=this,o}createElement(t){const r=t.toUpperCase();let n;switch(r){case"AUDIO":case"VIDEO":n=new Do(r);break;case"IFRAME":n=new Oo(r,this.mirror);break;case"CANVAS":n=new ko(r);break;case"STYLE":n=new Ro(r);break;default:n=new We(r);break}return n.ownerDocument=this,n}createComment(t){const r=new Lo(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new _o(t);return r.ownerDocument=this,r}createTextNode(t){const r=new Ao(t);return r.ownerDocument=this,r}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const xo=dr(ie);class We extends hr(ie){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Do extends wo(We){}class ko extends We{constructor(){super(...arguments),this.canvasMutations=[]}getContext(){return null}}class Ro extends We{constructor(){super(...arguments),this.rules=[]}}class Oo extends We{constructor(t,r){super(t),this.contentDocument=new Ie,this.contentDocument.mirror=r}}const Ao=mr(ie),Lo=pr(ie),_o=fr(ie);function Fo(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function vr(e,t,r,n){let o;switch(e.nodeType){case U.DOCUMENT_NODE:n&&n.nodeName==="IFRAME"?o=n.contentDocument:(o=t,o.compatMode=e.compatMode);break;case U.DOCUMENT_TYPE_NODE:const a=e;o=t.createDocumentType(a.name,a.publicId,a.systemId);break;case U.ELEMENT_NODE:const l=e,c=Fo(l);o=t.createElement(c);const i=o;for(const{name:u,value:d}of Array.from(l.attributes))i.attributes[u]=d;l.scrollLeft&&(i.scrollLeft=l.scrollLeft),l.scrollTop&&(i.scrollTop=l.scrollTop);break;case U.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case U.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case U.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case U.DOCUMENT_FRAGMENT_NODE:o=n.attachShadow({mode:"open"});break;default:return null}let s=r.getMeta(e);return t instanceof Ie&&(s||(s=br(o,t.unserializedId),r.add(e,s)),t.mirror.add(o,Object.assign({},s))),o}function Po(e,t=yo(),r=new Ie){function n(o,s){const a=vr(o,r,t,s);a!==null&&(s?.nodeName!=="IFRAME"&&o.nodeType!==U.DOCUMENT_FRAGMENT_NODE&&(s?.appendChild(a),a.parentNode=s,a.parentElement=s),o.nodeName==="IFRAME"?n(o.contentDocument,a):(o.nodeType===U.DOCUMENT_NODE||o.nodeType===U.ELEMENT_NODE||o.nodeType===U.DOCUMENT_FRAGMENT_NODE)&&(o.nodeType===U.ELEMENT_NODE&&o.shadowRoot&&n(o.shadowRoot,a),o.childNodes.forEach(l=>n(l,a))))}return n(e,null),r}function Wo(){return new $o}class $o{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var r;if(!t)return-1;const n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function br(e,t){switch(e.RRNodeType){case D.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case D.DocumentType:const r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId};case D.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case D.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case D.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case D.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function Sr(e){return e=e||Object.create(null),{on:function(r,n){(e[r]||(e[r]=[])).push(n)},off:function(r,n){e[r]&&e[r].splice(e[r].indexOf(n)>>>0,1)},emit:function(r,n){(e[r]||[]).slice().map(function(o){o(n)}),(e["*"]||[]).slice().map(function(o){o(r,n)})}}}var Vo=Object.freeze({__proto__:null,default:Sr});function Uo(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const r=e.HTMLElement||e.Element,n=468,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||c,scrollIntoView:r.prototype.scrollIntoView},s=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function a(p){const b=["MSIE ","Trident/","Edge/"];return new RegExp(b.join("|")).test(p)}const l=a(e.navigator.userAgent)?1:0;function c(p,b){this.scrollLeft=p,this.scrollTop=b}function i(p){return .5*(1-Math.cos(Math.PI*p))}function u(p){if(p===null||typeof p!="object"||p.behavior===void 0||p.behavior==="auto"||p.behavior==="instant")return!0;if(typeof p=="object"&&p.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+p.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(p,b){if(b==="Y")return p.clientHeight+l<p.scrollHeight;if(b==="X")return p.clientWidth+l<p.scrollWidth}function m(p,b){const N=e.getComputedStyle(p,null)["overflow"+b];return N==="auto"||N==="scroll"}function h(p){const b=d(p,"Y")&&m(p,"Y"),N=d(p,"X")&&m(p,"X");return b||N}function g(p){for(;p!==t.body&&h(p)===!1;)p=p.parentNode||p.host;return p}function f(p){const b=s();let N,I,P,A=(b-p.startTime)/n;A=A>1?1:A,N=i(A),I=p.startX+(p.x-p.startX)*N,P=p.startY+(p.y-p.startY)*N,p.method.call(p.scrollable,I,P),(I!==p.x||P!==p.y)&&e.requestAnimationFrame(f.bind(e,p))}function S(p,b,N){let I,P,A,C;const w=s();p===t.body?(I=e,P=e.scrollX||e.pageXOffset,A=e.scrollY||e.pageYOffset,C=o.scroll):(I=p,P=p.scrollLeft,A=p.scrollTop,C=c),f({scrollable:I,method:C,startTime:w,startX:P,startY:A,x:b,y:N})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}S.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){o.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}S.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const p=arguments[0].left,b=arguments[0].top;S.call(this,this,typeof p>"u"?this.scrollLeft:~~p,typeof b>"u"?this.scrollTop:~~b)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},r.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){o.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const p=g(this),b=p.getBoundingClientRect(),N=this.getBoundingClientRect();p!==t.body?(S.call(this,p,p.scrollLeft+N.left-b.left,p.scrollTop+N.top-b.top),e.getComputedStyle(p).position!=="fixed"&&e.scrollBy({left:b.left,top:b.top,behavior:"smooth"})):e.scrollBy({left:N.left,top:N.top,behavior:"smooth"})}}class jo{constructor(t=[],r){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=r}addAction(t){const r=this.findActionIndex(t);this.actions.splice(r,0,t)}addActions(t){this.actions=this.actions.concat(t)}replaceActions(t){this.actions.length=0,this.actions.splice(0,0,...t)}start(){this.timeOffset=0;let t=performance.now();const{actions:r}=this,n=this;function o(){const s=performance.now();for(n.timeOffset+=(s-t)*n.speed,t=s;r.length;){const a=r[0];if(n.timeOffset>=a.delay)r.shift(),a.doAction();else break}(r.length>0||n.liveMode)&&(n.raf=requestAnimationFrame(o))}this.raf=requestAnimationFrame(o)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}toggleLiveMode(t){this.liveMode=t}isActive(){return this.raf!==null}findActionIndex(t){let r=0,n=this.actions.length-1;for(;r<=n;){const o=Math.floor((r+n)/2);if(this.actions[o].delay<t.delay)r=o+1;else if(this.actions[o].delay>t.delay)n=o-1;else return o+1}return r}}function ft(e,t){if(e.type===M.IncrementalSnapshot&&e.data.source===x.MouseMove){const r=e.data.positions[0].timeOffset,n=e.timestamp+r;return e.delay=n-t,n-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
3
6
  Copyright (c) Microsoft Corporation.
4
7
 
5
8
  Permission to use, copy, modify, and/or distribute this software for any
@@ -12,19 +15,5 @@ var rrweb=function(e){"use strict";
12
15
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
16
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
17
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var t,r,n,o,i,a,s=function(){return(s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function l(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function u(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(c(arguments[t]));return e}function d(e,t,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(e,t,n),function(){return r.removeEventListener(e,t,n)}}function p(){return{map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,r=e.__sn&&e.__sn.id;delete this.map[r],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}}}e.EventType=void 0,(t=e.EventType||(e.EventType={}))[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",e.IncrementalSource=void 0,(r=e.IncrementalSource||(e.IncrementalSource={}))[r.Mutation=0]="Mutation",r[r.MouseMove=1]="MouseMove",r[r.MouseInteraction=2]="MouseInteraction",r[r.Scroll=3]="Scroll",r[r.ViewportResize=4]="ViewportResize",r[r.Input=5]="Input",r[r.TouchMove=6]="TouchMove",r[r.MediaInteraction=7]="MediaInteraction",r[r.StyleSheetRule=8]="StyleSheetRule",r[r.CanvasMutation=9]="CanvasMutation",r[r.Font=10]="Font",r[r.Log=11]="Log",r[r.Drag=12]="Drag",r[r.StyleDeclaration=13]="StyleDeclaration",e.MouseInteractions=void 0,(n=e.MouseInteractions||(e.MouseInteractions={}))[n.MouseUp=0]="MouseUp",n[n.MouseDown=1]="MouseDown",n[n.Click=2]="Click",n[n.ContextMenu=3]="ContextMenu",n[n.DblClick=4]="DblClick",n[n.Focus=5]="Focus",n[n.Blur=6]="Blur",n[n.TouchStart=7]="TouchStart",n[n.TouchMove_Departed=8]="TouchMove_Departed",n[n.TouchEnd=9]="TouchEnd",n[n.TouchCancel=10]="TouchCancel",function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(o||(o={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(i||(i={})),e.ReplayerEvents=void 0,(a=e.ReplayerEvents||(e.ReplayerEvents={})).Start="start",a.Pause="pause",a.Resume="resume",a.Resize="resize",a.Finish="finish",a.FullsnapshotRebuilded="fullsnapshot-rebuilded",a.LoadStylesheetStart="load-stylesheet-start",a.LoadStylesheetEnd="load-stylesheet-end",a.SkipStart="skip-start",a.SkipEnd="skip-end",a.MouseInteraction="mouse-interaction",a.EventCast="event-cast",a.CustomEvent="custom-event",a.Flush="flush",a.StateChange="state-change",a.PlayBack="play-back";var f="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.";function h(e,t,r){void 0===r&&(r={});var n=null,o=0;return function(i){var a=Date.now();o||!1!==r.leading||(o=a);var s=t-(a-o),l=this,c=arguments;s<=0||s>t?(n&&(clearTimeout(n),n=null),o=a,e.apply(l,c)):n||!1===r.trailing||(n=setTimeout((function(){o=!1===r.leading?0:Date.now(),n=null,e.apply(l,c)}),s))}}function m(e,t,r,n,o){void 0===o&&(o=window);var i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set:function(e){var t=this;setTimeout((function(){r.set.call(t,e)}),0),i&&i.set&&i.set.call(this,e)}}),function(){return m(e,t,i||{},!0)}}function v(e,t,r){try{if(!(t in e))return function(){};var n=e[t],o=r(n);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,function(){e[t]=n}}catch(e){return function(){}}}function y(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function g(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}e.mirror={map:{},getId:function(){return console.error(f),-1},getNode:function(){return console.error(f),null},removeNodeFromMap:function(){console.error(f)},has:function(){return console.error(f),!1},reset:function(){console.error(f)}},"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(e.mirror=new Proxy(e.mirror,{get:function(e,t,r){return"map"===t&&console.error(f),Reflect.get(e,t,r)}}));var b=function(e){try{if(e instanceof HTMLElement)return"CANVAS"===e.tagName}catch(e){return!1}return!1};function S(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var r=!1;if("string"==typeof t){if(void 0!==e.closest)return null!==e.closest("."+t);r=e.classList.contains(t)}else e.classList.forEach((function(e){t.test(e)&&(r=!0)}));return r||S(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,S(e.parentNode,t)}function T(e){return"__sn"in e&&e.__sn.id===j}function x(e,t){if(L(e))return!1;var r=t.getId(e);return!t.has(r)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||x(e.parentNode,t))}function w(e){return Boolean(e.changedTouches)}function E(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1})}var I=function(){function t(){this.reset()}return t.prototype.add=function(e){var t=this.indexes.get(e.parentId),r={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(r.parent=t,t.children[r.id]=r):this.tree[r.id]=r,this.indexes.set(r.id,r)},t.prototype.remove=function(e,t){var r=this,n=this.indexes.get(e.parentId),o=this.indexes.get(e.id),i=function(e){r.removeIdSet.add(e);var n=t.getNode(e);null==n||n.childNodes.forEach((function(e){"__sn"in e&&i(e.__sn.id)}))},a=function(t){r.removeIdSet.add(t.id),Object.values(t.children).forEach((function(e){return a(e)}));var n=r.indexes.get(t.id);if(n){var o=n.parent;o&&(delete n.parent,delete o.children[n.id],r.indexes.delete(e.id))}};o?n?(delete o.parent,delete n.children[o.id],this.indexes.delete(e.id),a(o)):(delete this.tree[o.id],this.indexes.delete(o.id),a(o)):(this.removeNodeMutations.push(e),i(e.id))},t.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},t.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},t.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},t.prototype.input=function(e){this.inputMap.set(e.id,e)},t.prototype.flush=function(){var t,r,n,o,i=this,a=this.tree,s=this.removeNodeMutations,c=this.textMutations,u=this.attributeMutations,d={source:e.IncrementalSource.Mutation,removes:s,texts:c,attributes:u,adds:[]},p=function(e,t){t&&i.removeIdSet.add(e.id),d.texts=d.texts.concat(t?[]:e.texts).filter((function(e){return!i.removeIdSet.has(e.id)})),d.attributes=d.attributes.concat(t?[]:e.attributes).filter((function(e){return!i.removeIdSet.has(e.id)})),i.removeIdSet.has(e.id)||i.removeIdSet.has(e.mutation.parentId)||t?Object.values(e.children).forEach((function(e){return p(e,!0)})):(d.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return p(e,!1)})))};Object.values(a).forEach((function(e){return p(e,!1)}));try{for(var f=l(this.scrollMap.keys()),h=f.next();!h.done;h=f.next()){var m=h.value;this.removeIdSet.has(m)&&this.scrollMap.delete(m)}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=f.return)&&r.call(f)}finally{if(t)throw t.error}}try{for(var v=l(this.inputMap.keys()),y=v.next();!y.done;y=v.next()){m=y.value;this.removeIdSet.has(m)&&this.inputMap.delete(m)}}catch(e){n={error:e}}finally{try{y&&!y.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}var g=new Map(this.scrollMap),b=new Map(this.inputMap);return this.reset(),{mutationData:d,scrollMap:g,inputMap:b}},t.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},t.prototype.idRemoved=function(e){return this.removeIdSet.has(e)},t}();function C(e){var t,r,n={},o=function(e,t){var r={value:e,parent:t,children:[]};return n[e.node.id]=r,r},i=[];try{for(var a=l(e),s=a.next();!s.done;s=a.next()){var c=s.value,u=c.nextId,d=c.parentId;if(u&&u in n){var p=n[u];if(p.parent){var f=p.parent.children.indexOf(p);p.parent.children.splice(f,0,o(c,p.parent))}else{f=i.indexOf(p);i.splice(f,0,o(c,null))}}else if(d in n){var h=n[d];h.children.push(o(c,h))}else i.push(o(c,null))}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return i}function k(e,t){t(e.value);for(var r=e.children.length-1;r>=0;r--)k(e.children[r],t)}function M(e){return"__sn"in e&&(e.__sn.type===O.Element&&"iframe"===e.__sn.tagName)}function N(e,t){var r,n,o=null===(n=null===(r=e.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===n?void 0:n.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};var i=o.getBoundingClientRect(),a=N(o,t),s=i.height/o.clientHeight;return{x:i.x*a.relativeScale+a.x,y:i.y*a.relativeScale+a.y,relativeScale:s,absoluteScale:a.absoluteScale*s}}function R(e){var t;return Boolean(null===(t=e)||void 0===t?void 0:t.shadowRoot)}function _(e){return e=(null==(e=e.replace(/[^ -~]+/g,""))?void 0:e.split(" ").map((function(e){return Math.random().toString(20).substr(2,e.length)})).join(" "))||""}var O,A=Object.freeze({__proto__:null,on:d,createMirror:p,get _mirror(){return e.mirror},throttle:h,hookSetter:m,patch:v,getWindowHeight:y,getWindowWidth:g,isCanvasNode:b,isBlocked:S,isIgnored:T,isAncestorRemoved:x,isTouchEvent:w,polyfill:E,TreeIndex:I,queueToResolveTrees:C,iterateResolveTree:k,isIframeINode:M,getBaseDimension:N,hasShadowRoot:R,obfuscateText:_});function D(e){return e.nodeType===e.ELEMENT_NODE}function L(e){var t,r=null===(t=e)||void 0===t?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===e)}function F(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,i=e.maskInputFn,a=o||"";return(t[r.toLowerCase()]||t[n])&&(a=i?i(a):"*".repeat(a.length)),a}!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"}(O||(O={}));var P=1,W=new RegExp("[^a-z0-9-_:]"),j=-2;function z(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(B).join(""):null}catch(e){return null}}function B(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=z(e.styleSheet)||t}catch(e){}return t}var V=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,U=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,G=/^(data:)([^,]*),(.*)/i;function H(e,t){return(e||"").replace(V,(function(e,r,n,o,i,a){var s,c,u,d=n||i||a,p=r||o||"";if(!d)return e;if(!U.test(d))return"url("+p+d+p+")";if(G.test(d))return"url("+p+d+p+")";if("/"===d[0])return"url("+p+(((u=t).indexOf("//")>-1?u.split("/").slice(0,3).join("/"):u.split("/")[0]).split("?")[0]+d)+p+")";var f=t.split("/"),h=d.split("/");f.pop();try{for(var m=l(h),v=m.next();!v.done;v=m.next()){var y=v.value;"."!==y&&(".."===y?f.pop():f.push(y))}}catch(e){s={error:e}}finally{try{v&&!v.done&&(c=m.return)&&c.call(m)}finally{if(s)throw s.error}}return"url("+p+f.join("/")+p+")"}))}var Y=/^[^ \t\n\r\u000c]+/,X=/^[, \t\n\r\u000c]+/;function q(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function Q(){var e=document.createElement("a");return e.href="",e.href}function $(e,t,r,n){return"src"===r||"href"===r&&n||"xlink:href"===r&&n&&"#"!==n[0]?q(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,o=e.exec(t.substring(r));return o?(n=o[0],r+=n.length,n):""}for(var o=[];n(X),!(r>=t.length);){var i=n(Y);if(","===i.slice(-1))i=q(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=q(e,i);for(var s=!1;;){var l=t.charAt(r);if(""===l){o.push((i+a).trim());break}if(s)")"===l&&(s=!1);else{if(","===l){r+=1,o.push((i+a).trim());break}"("===l&&(s=!0)}a+=l,r+=1}}}return o.join(", ")}(e,n):"style"===r&&n?H(n,Q()):"object"===t&&"data"===r&&n?q(e,n):n:q(e,n)}function K(e,t,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach((function(e){if(t.test(e))return!0}));return!(!r||!e.matches(r))||K(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,K(e.parentNode,t,r)}function J(e,t){var r,n,o,i,a,s,c=t.doc,u=t.blockClass,d=t.blockSelector,p=t.maskTextClass,f=t.maskTextSelector,h=t.inlineStylesheet,m=t.maskInputOptions,v=void 0===m?{}:m,y=t.maskTextFn,g=t.maskInputFn,b=t.recordCanvas,S=t.keepIframeSrcFn,T=t.enableStrictPrivacy;if(c.__sn){var x=c.__sn.id;i=1===x?void 0:x}switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:O.Document,childNodes:[],compatMode:e.compatMode,rootId:i}:{type:O.Document,childNodes:[],rootId:i};case e.DOCUMENT_TYPE_NODE:return{type:O.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:i};case e.ELEMENT_NODE:var w=function(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var o=e.classList[n];if(t.test(o))return!0}return!!r&&e.matches(r)}(e,u,d),E=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return W.test(t)?"div":t}(e),I={};try{for(var C=l(Array.from(e.attributes)),k=C.next();!k.done;k=C.next()){var M=k.value,N=M.name,R=M.value;I[N]=$(c,E,N,R)}}catch(e){r={error:e}}finally{try{k&&!k.done&&(n=C.return)&&n.call(C)}finally{if(r)throw r.error}}if("link"===E&&h){var A,D=Array.from(c.styleSheets).find((function(t){return t.href===e.href}));(A=z(D))&&(delete I.rel,delete I.href,I._cssText=H(A,D.href))}if("style"===E&&e.sheet&&!(e.innerText||e.textContent||"").trim().length)(A=z(e.sheet))&&(I._cssText=H(A,Q()));if("input"===E||"textarea"===E||"select"===E){R=e.value;"radio"!==I.type&&"checkbox"!==I.type&&"submit"!==I.type&&"button"!==I.type&&R?"password"===I.type?I.value="*".repeat(R.length):I.value=F({type:I.type,tagName:E,value:R,maskInputOptions:v,maskInputFn:g}):e.checked&&(I.checked=e.checked)}if("option"===E&&(e.selected&&!v.select?I.selected=!0:delete I.selected),"canvas"===E&&b)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var o=t.getImageData,i="__rrweb_original__"in o?o.__rrweb_original__:o;if(new Uint32Array(i.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(e)||(I.rr_dataURL=e.toDataURL());else if(!("__context"in e)){var L=e.toDataURL(),P=document.createElement("canvas");P.width=e.width,P.height=e.height,L!==P.toDataURL()&&(I.rr_dataURL=L)}if("audio"!==E&&"video"!==E||(I.rr_mediaState=e.paused?"paused":"played",I.rr_mediaCurrentTime=e.currentTime),e.scrollLeft&&(I.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(I.rr_scrollTop=e.scrollTop),w||"img"===E&&T){var j=e.getBoundingClientRect(),B=j.width,V=j.height;I={class:I.class,rr_width:B+"px",rr_height:V+"px"},w=!0}return"iframe"!==E||S(I.src)||(e.contentDocument||(I.rr_src=I.src),delete I.src),{type:O.Element,tagName:E,attributes:I,childNodes:[],isSVG:(s=e,Boolean("svg"===s.tagName||s.ownerSVGElement)||void 0),needBlock:w,rootId:i};case e.TEXT_NODE:var U=e.parentNode&&e.parentNode.tagName,G=e.textContent,Y="STYLE"===U||void 0,X="SCRIPT"===U||void 0,q=!1;if(Y&&G){try{e.nextSibling||e.previousSibling||(null===(o=e.parentNode.sheet)||void 0===o?void 0:o.cssRules)&&(G=(a=e.parentNode.sheet).cssRules?Array.from(a.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){}G=H(G,Q()),q=!0}if(X?(G="SCRIPT_PLACEHOLDER",q=!0):"NOSCRIPT"===U&&(G="",q=!0),!Y&&!X&&K(e,p,f)&&G&&(G=y?y(G):G.replace(/[\S]/g,"*")),T&&!q&&U)!new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]).has(U)&&G&&(G=_(G));return{type:O.Text,textContent:G||"",isStyle:Y,rootId:i};case e.CDATA_SECTION_NODE:return{type:O.CDATA,textContent:"",rootId:i};case e.COMMENT_NODE:return{type:O.Comment,textContent:e.textContent||"",rootId:i};default:return!1}}function Z(e){return void 0===e?"":e.toLowerCase()}function ee(e,t){var r,n,o,i,a,s=t.doc,c=t.map,u=t.blockClass,d=t.blockSelector,p=t.maskTextClass,f=t.maskTextSelector,h=t.skipChild,m=void 0!==h&&h,v=t.inlineStylesheet,y=void 0===v||v,g=t.maskInputOptions,b=void 0===g?{}:g,S=t.maskTextFn,T=t.maskInputFn,x=t.slimDOMOptions,w=t.recordCanvas,E=void 0!==w&&w,I=t.onSerialize,C=t.onIframeLoad,k=t.iframeLoadTimeout,M=void 0===k?5e3:k,N=t.keepIframeSrcFn,R=void 0===N?function(){return!1}:N,_=t.enableStrictPrivacy,A=t.preserveWhiteSpace,F=void 0===A||A,W=J(e,{doc:s,blockClass:u,blockSelector:d,maskTextClass:p,maskTextSelector:f,inlineStylesheet:y,maskInputOptions:b,maskTextFn:S,maskInputFn:T,recordCanvas:E,keepIframeSrcFn:R,enableStrictPrivacy:_});if(!W)return console.warn(e,"not serialized"),null;a="__sn"in e?e.__sn.id:!function(e,t){if(t.comment&&e.type===O.Comment)return!0;if(e.type===O.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Z(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Z(e.attributes.name)||"icon"===Z(e.attributes.rel)||"apple-touch-icon"===Z(e.attributes.rel)||"shortcut icon"===Z(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Z(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Z(e.attributes.property).match(/^(og|twitter|fb):/)||Z(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Z(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Z(e.attributes.name)||"googlebot"===Z(e.attributes.name)||"bingbot"===Z(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Z(e.attributes.name)||"generator"===Z(e.attributes.name)||"framework"===Z(e.attributes.name)||"publisher"===Z(e.attributes.name)||"progid"===Z(e.attributes.name)||Z(e.attributes.property).match(/^article:/)||Z(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Z(e.attributes.name)||"yandex-verification"===Z(e.attributes.name)||"csrf-token"===Z(e.attributes.name)||"p:domain_verify"===Z(e.attributes.name)||"verify-v1"===Z(e.attributes.name)||"verification"===Z(e.attributes.name)||"shopify-checkout-api-token"===Z(e.attributes.name)))return!0}}return!1}(W,x)&&(F||W.type!==O.Text||W.isStyle||W.textContent.replace(/^\s+|\s+$/gm,"").length)?P++:j;var z=Object.assign(W,{id:a});if(e.__sn=z,a===j)return null;c[a]=e,I&&I(e);var B=!m;if(z.type===O.Element){if(B=B&&!z.needBlock,z.needBlock&&"img"===z.tagName){var V=e.cloneNode();V.src="",c[a]=V}delete z.needBlock}if((z.type===O.Document||z.type===O.Element)&&B){x.headWhitespace&&W.type===O.Element&&"head"===W.tagName&&(F=!1);var U={doc:s,map:c,blockClass:u,blockSelector:d,maskTextClass:p,maskTextSelector:f,skipChild:m,inlineStylesheet:y,maskInputOptions:b,maskTextFn:S,maskInputFn:T,slimDOMOptions:x,recordCanvas:E,preserveWhiteSpace:F,onSerialize:I,onIframeLoad:C,iframeLoadTimeout:M,keepIframeSrcFn:R,enableStrictPrivacy:_};try{for(var G=l(Array.from(e.childNodes)),H=G.next();!H.done;H=G.next()){(q=ee(H.value,U))&&z.childNodes.push(q)}}catch(e){r={error:e}}finally{try{H&&!H.done&&(n=G.return)&&n.call(G)}finally{if(r)throw r.error}}if(D(e)&&e.shadowRoot){z.isShadowHost=!0;try{for(var Y=l(Array.from(e.shadowRoot.childNodes)),X=Y.next();!X.done;X=Y.next()){var q;(q=ee(X.value,U))&&(q.isShadow=!0,z.childNodes.push(q))}}catch(e){o={error:e}}finally{try{X&&!X.done&&(i=Y.return)&&i.call(Y)}finally{if(o)throw o.error}}}}return e.parentNode&&L(e.parentNode)&&(z.isShadow=!0),z.type===O.Element&&"iframe"===z.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var o,i=!1;try{o=n.document.readyState}catch(e){return}if("complete"===o){"about:blank"===n.location.href&&"about:blank"!==e.src&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var a=setTimeout((function(){i||(t(),i=!0)}),r);e.addEventListener("load",(function(){clearTimeout(a),i=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&C){var r=ee(t,{doc:t,map:c,blockClass:u,blockSelector:d,maskTextClass:p,maskTextSelector:f,skipChild:!1,inlineStylesheet:y,maskInputOptions:b,maskTextFn:S,maskInputFn:T,slimDOMOptions:x,recordCanvas:E,preserveWhiteSpace:F,onSerialize:I,onIframeLoad:C,iframeLoadTimeout:M,keepIframeSrcFn:R,enableStrictPrivacy:_});r&&C(e,r)}}),M),z}var te=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function re(e,t){void 0===t&&(t={});var r=1,n=1;function o(e){var t=e.match(/\n/g);t&&(r+=t.length);var o=e.lastIndexOf("\n");n=-1===o?n+e.length:e.length-o}function i(){var e={line:r,column:n};return function(t){return t.position=new a(e),h(),t}}var a=function(e){this.start=e,this.end={line:r,column:n},this.source=t.source};a.prototype.content=e;var s=[];function c(o){var i=new Error(t.source+":"+r+":"+n+": "+o);if(i.reason=o,i.filename=t.source,i.line=r,i.column=n,i.source=e,!t.silent)throw i;s.push(i)}function u(){return f(/^{\s*/)}function d(){return f(/^}/)}function p(){var t,r=[];for(h(),m(r);e.length&&"}"!==e.charAt(0)&&(t=C()||k());)!1!==t&&(r.push(t),m(r));return r}function f(t){var r=t.exec(e);if(r){var n=r[0];return o(n),e=e.slice(n.length),r}}function h(){f(/^\s*/)}function m(e){var t;for(void 0===e&&(e=[]);t=v();)!1!==t&&e.push(t),t=v();return e}function v(){var t=i();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var r=2;""!==e.charAt(r)&&("*"!==e.charAt(r)||"/"!==e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return c("End of comment missing");var a=e.slice(2,r-2);return n+=2,o(a),e=e.slice(r),n+=2,t({type:"comment",comment:a})}}function y(){var e=f(/^([^{]+)/);if(e)return ne(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function g(){var e=i(),t=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=ne(t[0]);if(!f(/^:\s*/))return c("property missing ':'");var n=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:r.replace(te,""),value:n?ne(n[0]).replace(te,""):""});return f(/^[;\s]*/),o}}function b(){var e,t=[];if(!u())return c("missing '{'");for(m(t);e=g();)!1!==e&&(t.push(e),m(t)),e=g();return d()?t:c("missing '}'")}function S(){for(var e,t=[],r=i();e=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),f(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:b()})}var T,x=I("import"),w=I("charset"),E=I("namespace");function I(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=i(),n=f(t);if(n){var o={type:e};return o[e]=n[1].trim(),r(o)}}}function C(){if("@"===e[0])return function(){var e=i(),t=f(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=f(/^([-\w]+)\s*/)))return c("@keyframes missing name");var n,o=t[1];if(!u())return c("@keyframes missing '{'");for(var a=m();n=S();)a.push(n),a=a.concat(m());return d()?e({type:"keyframes",name:o,vendor:r,keyframes:a}):c("@keyframes missing '}'")}}()||function(){var e=i(),t=f(/^@media *([^{]+)/);if(t){var r=ne(t[1]);if(!u())return c("@media missing '{'");var n=m().concat(p());return d()?e({type:"media",media:r,rules:n}):c("@media missing '}'")}}()||function(){var e=i(),t=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:ne(t[1]),media:ne(t[2])})}()||function(){var e=i(),t=f(/^@supports *([^{]+)/);if(t){var r=ne(t[1]);if(!u())return c("@supports missing '{'");var n=m().concat(p());return d()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||x()||w()||E()||function(){var e=i(),t=f(/^@([-\w]+)?document *([^{]+)/);if(t){var r=ne(t[1]),n=ne(t[2]);if(!u())return c("@document missing '{'");var o=m().concat(p());return d()?e({type:"document",document:n,vendor:r,rules:o}):c("@document missing '}'")}}()||function(){var e=i();if(f(/^@page */)){var t=y()||[];if(!u())return c("@page missing '{'");for(var r,n=m();r=g();)n.push(r),n=n.concat(m());return d()?e({type:"page",selectors:t,declarations:n}):c("@page missing '}'")}}()||function(){var e=i();if(f(/^@host\s*/)){if(!u())return c("@host missing '{'");var t=m().concat(p());return d()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=i();if(f(/^@font-face\s*/)){if(!u())return c("@font-face missing '{'");for(var t,r=m();t=g();)r.push(t),r=r.concat(m());return d()?e({type:"font-face",declarations:r}):c("@font-face missing '}'")}}()}function k(){var e=i(),t=y();return t?(m(),e({type:"rule",selectors:t,declarations:b()})):c("selector missing")}return function e(t,r){var n,o,i=t&&"string"==typeof t.type,a=i?t:r;try{for(var s=l(Object.keys(t)),c=s.next();!c.done;c=s.next()){var u=c.value,d=t[u];Array.isArray(d)?d.forEach((function(t){e(t,a)})):d&&"object"==typeof d&&e(d,a)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}i&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:r||null});return t}((T=p(),{type:"stylesheet",stylesheet:{source:t.source,rules:T,parsingErrors:s}}))}function ne(e){return e?e.replace(/^\s+|\s+$/g,""):""}var oe={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};var ie=/([^\\]):hover/,ae=new RegExp(ie.source,"g");function se(e,t){var r;if(!(null===(r=window.HIG_CONFIGURATION)||void 0===r?void 0:r.enableOnHoverClass))return e;var n=null==t?void 0:t.stylesWithHoverClass.get(e);if(n)return n;var o=re(e,{silent:!0});if(!o.stylesheet)return e;var i=[];if(o.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){ie.test(e)&&i.push(e)}))})),0===i.length)return e;var a=new RegExp(i.filter((function(e,t){return i.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g"),s=e.replace(a,(function(e){var t=e.replace(ae,"$1.\\:hover");return e+", "+t}));return null==t||t.stylesWithHoverClass.set(e,s),s}function le(){return{stylesWithHoverClass:new Map}}function ce(e,t){var r=t.doc,n=t.hackCss,o=t.cache;switch(e.type){case O.Document:return r.implementation.createDocument(null,"",null);case O.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case O.Element:var i,a=function(e){var t=oe[e.tagName]?oe[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);i=e.isSVG?r.createElementNS("http://www.w3.org/2000/svg",a):r.createElement(a);var s=function(t){var s,c;if(!e.attributes.hasOwnProperty(t))return"continue";var u=e.attributes[t];if("option"===a&&"selected"===t&&!1===u)return"continue";if(u="boolean"==typeof u||"number"==typeof u?"":u,t.startsWith("rr_")){if("canvas"===a&&"rr_dataURL"===t){var d=document.createElement("img");d.src=u,d.onload=function(){var e=i.getContext("2d");e&&e.drawImage(d,0,0,d.width,d.height)}}if("rr_width"===t&&(i.style.width=u),"rr_height"===t&&(i.style.height=u),"rr_mediaCurrentTime"===t&&(i.currentTime=e.attributes.rr_mediaCurrentTime),"rr_mediaState"===t)switch(u){case"played":i.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":i.pause()}}else{var p="textarea"===a&&"value"===t,f="style"===a&&"_cssText"===t;if(f&&n&&"string"==typeof(u=se(u,o))){for(var h=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,m=void 0,v=[];null!==(m=h.exec(u));)m.index===h.lastIndex&&h.lastIndex++,m.forEach((function(e,t){if(0===t){var r=e.slice(5,e.length-2);v.push({originalUrl:r,proxyUrl:r.replace(r,"https://replay-cors-proxy.highlightrun.workers.dev?url="+r)})}}));v.forEach((function(e){u=u.replace(e.originalUrl,e.proxyUrl)}))}if(p||f){var y=r.createTextNode(u);try{for(var g=(s=void 0,l(Array.from(i.childNodes))),b=g.next();!b.done;b=g.next()){var S=b.value;S.nodeType===i.TEXT_NODE&&i.removeChild(S)}}catch(e){s={error:e}}finally{try{b&&!b.done&&(c=g.return)&&c.call(g)}finally{if(s)throw s.error}}return i.appendChild(y),"continue"}try{if(e.isSVG&&"xlink:href"===t)i.setAttributeNS("http://www.w3.org/1999/xlink",t,u);else if("onload"===t||"onclick"===t||"onmouse"===t.substring(0,7))i.setAttribute("_"+t,u);else{if("meta"===a&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"===t)return i.setAttribute("csp-content",u),"continue";"link"===a&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===a&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")||i.setAttribute(t,u)}}catch(e){}}};for(var c in e.attributes)s(c);if(e.isShadowHost)if(i.shadowRoot)for(;i.shadowRoot.firstChild;)i.shadowRoot.removeChild(i.shadowRoot.firstChild);else i.attachShadow({mode:"open"});return i;case O.Text:return r.createTextNode(e.isStyle&&n?se(e.textContent,o):e.textContent);case O.CDATA:return r.createCDATASection(e.textContent);case O.Comment:return r.createComment(e.textContent);default:return null}}function ue(e,t){var r,n,o=t.doc,i=t.map,a=t.skipChild,s=void 0!==a&&a,c=t.hackCss,u=void 0===c||c,d=t.afterAppend,p=t.cache,f=ce(e,{doc:o,hackCss:u,cache:p});if(!f)return null;if(e.rootId&&console.assert(i[e.rootId]===o,"Target document should has the same root id."),e.type===O.Document&&(o.close(),o.open(),"BackCompat"===e.compatMode&&e.childNodes&&e.childNodes[0].type!==O.DocumentType&&(e.childNodes[0].type===O.Element&&"xmlns"in e.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===e.childNodes[0].attributes.xmlns?o.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):o.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),f=o),f.__sn=e,i[e.id]=f,(e.type===O.Document||e.type===O.Element)&&!s)try{for(var h=l(e.childNodes),m=h.next();!m.done;m=h.next()){var v=m.value,y=ue(v,{doc:o,map:i,skipChild:!1,hackCss:u,afterAppend:d,cache:p});y?(v.isShadow&&D(f)&&f.shadowRoot?f.shadowRoot.appendChild(y):f.appendChild(y),d&&d(y)):console.warn("Failed to rebuild",v)}}catch(e){r={error:e}}finally{try{m&&!m.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}return f}function de(e,t){var r=t.doc,n=t.onVisit,o=t.hackCss,i={},a=ue(e,{doc:r,map:i,skipChild:!1,hackCss:void 0===o||o,afterAppend:t.afterAppend,cache:t.cache});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(i,(function(e){n&&n(e),function(e){var t=e.__sn;if(t.type===O.Element){var r=e;for(var n in t.attributes)if(t.attributes.hasOwnProperty(n)&&n.startsWith("rr_")){var o=t.attributes[n];"rr_scrollLeft"===n&&(r.scrollLeft=o),"rr_scrollTop"===n&&(r.scrollTop=o)}}}(e)})),[a,i]}function pe(e){return"__ln"in e}var fe=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&pe(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&pe(e.nextSibling)&&e.nextSibling.__ln.previous){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++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),he=function(e,t){return e+"@"+t};function me(e){return"__sn"in e}var ve=function(){function e(){var e=this;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(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){var t,r,n,o;if(!e.frozen&&!e.locked){for(var i=[],a=new fe,s=function(t){for(var r=t,n=j;n===j;)n=(r=r&&r.nextSibling)&&e.mirror.getId(r);return n},c=function(t){var r,n=t.getRootNode?null===(r=t.getRootNode())||void 0===r?void 0:r.host:null,o=!(e.doc.contains(t)||n instanceof Node&&e.doc.contains(n));if(t.parentNode&&!o){var l=L(t.parentNode)?e.mirror.getId(n):e.mirror.getId(t.parentNode),c=s(t);if(-1===l||-1===c)return a.addNode(t);var u=ee(t,{doc:e.doc,map:e.mirror.map,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas,enableStrictPrivacy:e.enableStrictPrivacy,onSerialize:function(r){M(r)&&e.iframeManager.addIframe(r),R(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,r){e.iframeManager.attachIframe(t,r)}});u&&i.push({parentId:l,nextId:c,node:u})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var u=l(e.movedSet),d=u.next();!d.done;d=u.next()){var p=d.value;ge(e.removes,p,e.mirror)&&!e.movedSet.has(p.parentNode)||c(p)}}catch(e){t={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}try{for(var f=l(e.addedSet),h=f.next();!h.done;h=f.next()){p=h.value;be(e.droppedSet,p)||ge(e.removes,p,e.mirror)?be(e.movedSet,p)?c(p):e.droppedSet.add(p):c(p)}}catch(e){n={error:e}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}for(var m=null;a.length;){var v=null;if(m){var y=e.mirror.getId(m.value.parentNode),g=s(m.value);-1!==y&&-1!==g&&(v=m)}if(!v)for(var b=a.length-1;b>=0;b--){var S=a.get(b);if(S){y=e.mirror.getId(S.value.parentNode),g=s(S.value);if(-1!==y&&-1!==g){v=S;break}}}if(!v){for(;a.head;)a.removeNode(a.head.value);break}m=v.previous,a.removeNode(v.value),c(v.value)}var T={texts:e.texts.map((function(t){var r=t.value;return e.enableStrictPrivacy&&r&&(r=_(r)),{id:e.mirror.getId(t.node),value:r}})).filter((function(t){return e.mirror.has(t.id)})),attributes:e.attributes.map((function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}})).filter((function(t){return e.mirror.has(t.id)})),removes:e.removes,adds:i};(T.texts.length||T.attributes.length||T.removes.length||T.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.emissionCallback(T))}},this.processMutation=function(t){var r,n,o,i;if(!T(t.target))switch(t.type){case"characterData":var a=t.target.textContent;S(t.target,e.blockClass)||a===t.oldValue||e.texts.push({value:K(t.target,e.maskTextClass,e.maskTextSelector)&&a?e.maskTextFn?e.maskTextFn(a):a.replace(/[\S]/g,"*"):a,node:t.target});break;case"attributes":var s=t.target;a=t.target.getAttribute(t.attributeName);if("value"===t.attributeName&&(a=F({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:a,maskInputFn:e.maskInputFn})),S(t.target,e.blockClass)||a===t.oldValue)return;var c=e.attributes.find((function(e){return e.node===t.target}));if(c||(c={node:t.target,attributes:{}},e.attributes.push(c)),"INPUT"===t.target.tagName){var u=t.target;if("password"===u.type){c.attributes.value="*".repeat(u.value.length);break}}if("style"===t.attributeName){var d=e.doc.createElement("span");t.oldValue&&d.setAttribute("style",t.oldValue),void 0!==c.attributes.style&&null!==c.attributes.style||(c.attributes.style={});var p=c.attributes.style;try{for(var f=l(Array.from(s.style)),h=f.next();!h.done;h=f.next()){var m=h.value,v=s.style.getPropertyValue(m),y=s.style.getPropertyPriority(m);v===d.style.getPropertyValue(m)&&y===d.style.getPropertyPriority(m)||(p[m]=""===y?v:[v,y])}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}try{for(var g=l(Array.from(d.style)),b=g.next();!b.done;b=g.next()){m=b.value;""===s.style.getPropertyValue(m)&&(p[m]=!1)}}catch(e){o={error:e}}finally{try{b&&!b.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}}else c.attributes[t.attributeName]=$(e.doc,t.target.tagName,t.attributeName,a);break;case"childList":t.addedNodes.forEach((function(r){return e.genAdds(r,t.target)})),t.removedNodes.forEach((function(r){var n=e.mirror.getId(r),o=L(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);S(t.target,e.blockClass)||T(r)||(e.addedSet.has(r)?(ye(e.addedSet,r),e.droppedSet.add(r)):e.addedSet.has(t.target)&&-1===n||x(t.target,e.mirror)||(e.movedSet.has(r)&&e.movedMap[he(n,o)]?ye(e.movedSet,r):e.removes.push({parentId:o,id:n,isShadow:!!L(t.target)||void 0})),e.mapRemoves.push(r))}))}},this.genAdds=function(t,r){if(!r||!S(r,e.blockClass)){if(me(t)){if(T(t))return;e.movedSet.add(t);var n=null;r&&me(r)&&(n=r.__sn.id),n&&(e.movedMap[he(t.__sn.id,n)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);S(t,e.blockClass)||t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e,t,r,n,o,i,a,s,l,c,u,d,p,f,h,m,v){this.blockClass=t,this.blockSelector=r,this.maskTextClass=n,this.maskTextSelector=o,this.inlineStylesheet=i,this.maskInputOptions=a,this.maskTextFn=s,this.maskInputFn=l,this.recordCanvas=c,this.slimDOMOptions=u,this.enableStrictPrivacy=v,this.emissionCallback=e,this.doc=d,this.mirror=p,this.iframeManager=f,this.shadowDomManager=h,this.canvasManager=m},e.prototype.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},e.prototype.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0,this.canvasManager.lock()},e.prototype.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},e.prototype.reset=function(){this.canvasManager.reset()},e}();function ye(e,t){e.delete(t),t.childNodes.forEach((function(t){return ye(e,t)}))}function ge(e,t,r){var n=t.parentNode;if(!n)return!1;var o=r.getId(n);return!!e.some((function(e){return e.id===o}))||ge(e,n,r)}function be(e,t){var r=t.parentNode;return!!r&&(!!e.has(r)||be(e,r))}var Se=[],Te="undefined"!=typeof CSSGroupingRule,xe="undefined"!=typeof CSSMediaRule,we="undefined"!=typeof CSSSupportsRule,Ee="undefined"!=typeof CSSConditionRule;function Ie(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 Ce(e,t,r,n,o,i,a,s,l,c,u,d,p,f,h,m,v,y){var g,b,S,T=new ve;Se.push(T),T.init(e,r,n,o,i,a,s,l,c,u,d,t,p,f,h,m,y);var x=window.MutationObserver||window.__rrMutationObserver,w=null===(S=null===(b=null===(g=window)||void 0===g?void 0:g.Zone)||void 0===b?void 0:b.__symbol__)||void 0===S?void 0:S.call(b,"MutationObserver");w&&window[w]&&(x=window[w]);var E=new x(T.processMutations.bind(T));return E.observe(v,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),E}function ke(t,r,n,o,i){if(!1===i.mouseInteraction)return function(){};var a=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,s=[];return Object.keys(e.MouseInteractions).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]})).forEach((function(i){var a=i.toLowerCase(),l=function(r){return function(i){var a=Ie(i);if(!S(a,o)&&!b(a)){var s=w(i)?i.changedTouches[0]:i;if(s){var l=n.getId(a),c=s.clientX,u=s.clientY;t({type:e.MouseInteractions[r],id:l,x:c,y:u})}}}}(i);s.push(d(a,l,r))})),function(){s.forEach((function(e){return e()}))}}function Me(e,t,r,n,o){return d("scroll",h((function(o){var i=Ie(o);if(i&&!S(i,n)){var a=r.getId(i);if(i===t){var s=t.scrollingElement||t.documentElement;e({id:a,x:s.scrollLeft,y:s.scrollTop})}else e({id:a,x:i.scrollLeft,y:i.scrollTop})}}),o.scroll||100),t)}function Ne(e,t){var r=s({},e);return t||delete r.userTriggered,r}var Re=["INPUT","TEXTAREA","SELECT"],_e=new WeakMap;function Oe(e){return function(e,t){if(Te&&e.parentRule instanceof CSSGroupingRule||xe&&e.parentRule instanceof CSSMediaRule||we&&e.parentRule instanceof CSSSupportsRule||Ee&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else{r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function Ae(t,r){var n,o;void 0===r&&(r={});var i=t.doc.defaultView;if(!i)return function(){};!function(e,t){var r=e.mutationCb,n=e.mousemoveCb,o=e.mouseInteractionCb,i=e.scrollCb,a=e.viewportResizeCb,s=e.inputCb,l=e.mediaInteractionCb,c=e.styleSheetRuleCb,d=e.styleDeclarationCb,p=e.canvasMutationCb,f=e.fontCb;e.mutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mutation&&t.mutation.apply(t,u(e)),r.apply(void 0,u(e))},e.mousemoveCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.mousemove&&t.mousemove.apply(t,u(e)),n.apply(void 0,u(e))},e.mouseInteractionCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.mouseInteraction&&t.mouseInteraction.apply(t,u(e)),o.apply(void 0,u(e))},e.scrollCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.scroll&&t.scroll.apply(t,u(e)),i.apply(void 0,u(e))},e.viewportResizeCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.viewportResize&&t.viewportResize.apply(t,u(e)),a.apply(void 0,u(e))},e.inputCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.input&&t.input.apply(t,u(e)),s.apply(void 0,u(e))},e.mediaInteractionCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.mediaInteaction&&t.mediaInteaction.apply(t,u(e)),l.apply(void 0,u(e))},e.styleSheetRuleCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.styleSheetRule&&t.styleSheetRule.apply(t,u(e)),c.apply(void 0,u(e))},e.styleDeclarationCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.styleDeclaration&&t.styleDeclaration.apply(t,u(e)),d.apply(void 0,u(e))},e.canvasMutationCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.canvasMutation&&t.canvasMutation.apply(t,u(e)),p.apply(void 0,u(e))},e.fontCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.font&&t.font.apply(t,u(e)),f.apply(void 0,u(e))}}(t,r);var a,p,f,b=Ce(t.mutationCb,t.doc,t.blockClass,t.blockSelector,t.maskTextClass,t.maskTextSelector,t.inlineStylesheet,t.maskInputOptions,t.maskTextFn,t.maskInputFn,t.recordCanvas,t.slimDOMOptions,t.mirror,t.iframeManager,t.shadowDomManager,t.canvasManager,t.doc,t.enableStrictPrivacy),T=function(t,r,n,o){if(!1===r.mousemove)return function(){};var i,a="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],c=h((function(e){var r=Date.now()-i;t(l.map((function(e){return e.timeOffset-=r,e})),e),l=[],i=null}),s),u=h((function(t){var r=Ie(t),n=w(t)?t.changedTouches[0]:t,a=n.clientX,s=n.clientY;i||(i=Date.now()),l.push({x:a,y:s,id:o.getId(r),timeOffset:Date.now()-i}),c("undefined"!=typeof DragEvent&&t instanceof DragEvent?e.IncrementalSource.Drag:t instanceof MouseEvent?e.IncrementalSource.MouseMove:e.IncrementalSource.TouchMove)}),a,{trailing:!1}),p=[d("mousemove",u,n),d("touchmove",u,n),d("drag",u,n)];return function(){p.forEach((function(e){return e()}))}}(t.mousemoveCb,t.sampling,t.doc,t.mirror),x=ke(t.mouseInteractionCb,t.doc,t.mirror,t.blockClass,t.sampling),E=Me(t.scrollCb,t.doc,t.mirror,t.blockClass,t.sampling),I=(a=t.viewportResizeCb,p=-1,f=-1,d("resize",h((function(){var e=y(),t=g();p===e&&f===t||(a({width:Number(t),height:Number(e)}),p=e,f=t)}),200),window)),C=function(e,t,r,n,o,i,a,l,c){function p(e){var r=Ie(e),s=e.isTrusted;if(r&&"OPTION"===r.tagName&&(r=r.parentElement),r&&r.tagName&&!(Re.indexOf(r.tagName)<0)&&!S(r,n)){var l=r.type;if(!r.classList.contains(o)){var u=r.value,d=!1;"radio"===l||"checkbox"===l?d=r.checked:(i[r.tagName.toLowerCase()]||i[l])&&(u=F({maskInputOptions:i,tagName:r.tagName,type:l,value:u,maskInputFn:a})),f(r,Ne({text:u,isChecked:d,userTriggered:s},c));var p=r.name;"radio"===l&&p&&d&&t.querySelectorAll('input[type="radio"][name="'+p+'"]').forEach((function(e){e!==r&&f(e,Ne({text:e.value,isChecked:!d,userTriggered:!1},c))}))}}}function f(t,n){var o=_e.get(t);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){_e.set(t,n);var i=r.getId(t);e(s(s({},n),{id:i}))}}var h=("last"===l.input?["change"]:["input","change"]).map((function(e){return d(e,p,t)})),v=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),y=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return v&&v.set&&h.push.apply(h,u(y.map((function(e){return m(e[0],e[1],{set:function(){p({target:this})}})})))),function(){h.forEach((function(e){return e()}))}}(t.inputCb,t.doc,t.mirror,t.blockClass,t.ignoreClass,t.maskInputOptions,t.maskInputFn,t.sampling,t.userTriggeredOnInput),k=function(e,t,r,n){var o=function(o){return h((function(n){var i=Ie(n);if(i&&!S(i,t)){var a=i,s=a.currentTime,l=a.volume,c=a.muted;e({type:o,id:r.getId(i),currentTime:s,volume:l,muted:c})}}),n.media||500)},i=[d("play",o(0)),d("pause",o(1)),d("seeked",o(2)),d("volumechange",o(3))];return function(){i.forEach((function(e){return e()}))}}(t.mediaInteractionCb,t.blockClass,t.mirror,t.sampling),M=function(e,t,r){var n=t.CSSStyleSheet.prototype.insertRule;t.CSSStyleSheet.prototype.insertRule=function(t,o){var i=r.getId(this.ownerNode);return-1!==i&&e({id:i,adds:[{rule:t,index:o}]}),n.apply(this,arguments)};var o=t.CSSStyleSheet.prototype.deleteRule;t.CSSStyleSheet.prototype.deleteRule=function(t){var n=r.getId(this.ownerNode);return-1!==n&&e({id:n,removes:[{index:t}]}),o.apply(this,arguments)};var i={};Te?i.CSSGroupingRule=t.CSSGroupingRule:(xe&&(i.CSSMediaRule=t.CSSMediaRule),Ee&&(i.CSSConditionRule=t.CSSConditionRule),we&&(i.CSSSupportsRule=t.CSSSupportsRule));var a={};return Object.entries(i).forEach((function(t){var n=c(t,2),o=n[0],i=n[1];a[o]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=function(t,n){var i=r.getId(this.parentStyleSheet.ownerNode);return-1!==i&&e({id:i,adds:[{rule:t,index:u(Oe(this),[n||0])}]}),a[o].insertRule.apply(this,arguments)},i.prototype.deleteRule=function(t){var n=r.getId(this.parentStyleSheet.ownerNode);return-1!==n&&e({id:n,removes:[{index:u(Oe(this),[t])}]}),a[o].deleteRule.apply(this,arguments)}})),function(){t.CSSStyleSheet.prototype.insertRule=n,t.CSSStyleSheet.prototype.deleteRule=o,Object.entries(i).forEach((function(e){var t=c(e,2),r=t[0],n=t[1];n.prototype.insertRule=a[r].insertRule,n.prototype.deleteRule=a[r].deleteRule}))}}(t.styleSheetRuleCb,i,t.mirror),N=function(e,t,r){var n=t.CSSStyleDeclaration.prototype.setProperty;t.CSSStyleDeclaration.prototype.setProperty=function(t,o,i){var a,s,l=r.getId(null===(s=null===(a=this.parentRule)||void 0===a?void 0:a.parentStyleSheet)||void 0===s?void 0:s.ownerNode);return-1!==l&&e({id:l,set:{property:t,value:o,priority:i},index:Oe(this.parentRule)}),n.apply(this,arguments)};var o=t.CSSStyleDeclaration.prototype.removeProperty;return t.CSSStyleDeclaration.prototype.removeProperty=function(t){var n,i,a=r.getId(null===(i=null===(n=this.parentRule)||void 0===n?void 0:n.parentStyleSheet)||void 0===i?void 0:i.ownerNode);return-1!==a&&e({id:a,remove:{property:t},index:Oe(this.parentRule)}),o.apply(this,arguments)},function(){t.CSSStyleDeclaration.prototype.setProperty=n,t.CSSStyleDeclaration.prototype.removeProperty=o}}(t.styleDeclarationCb,i,t.mirror),R=t.collectFonts?function(e,t){var r=t.defaultView;if(!r)return function(){};var n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(e,t,r){var n=new i(e,t,r);return o.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};var a=v(t.fonts,"add",(function(t){return function(r){return setTimeout((function(){var t=o.get(r);t&&(e(t),o.delete(r))}),0),t.apply(this,[r])}}));return n.push((function(){r.FontFace=i})),n.push(a),function(){n.forEach((function(e){return e()}))}}(t.fontCb,t.doc):function(){},_=[];try{for(var O=l(t.plugins),A=O.next();!A.done;A=O.next()){var D=A.value;_.push(D.observer(D.callback,i,D.options))}}catch(e){n={error:e}}finally{try{A&&!A.done&&(o=O.return)&&o.call(O)}finally{if(n)throw n.error}}return function(){Se.forEach((function(e){return e.reset()})),b.disconnect(),T(),x(),E(),I(),C(),k(),M(),N(),R(),_.forEach((function(e){return e()}))}}var De=function(){function e(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}return e.prototype.addIframe=function(e){this.iframes.set(e,!0)},e.prototype.addLoadListener=function(e){this.loadListener=e},e.prototype.attachIframe=function(e,t){var r;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(r=this.loadListener)||void 0===r||r.call(this,e)},e}(),Le=function(){function e(e){this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror}return e.prototype.addShadowRoot=function(e,t){Ce(this.mutationCb,t,this.bypassOptions.blockClass,this.bypassOptions.blockSelector,this.bypassOptions.maskTextClass,this.bypassOptions.maskTextSelector,this.bypassOptions.inlineStylesheet,this.bypassOptions.maskInputOptions,this.bypassOptions.maskTextFn,this.bypassOptions.maskInputFn,this.bypassOptions.recordCanvas,this.bypassOptions.slimDOMOptions,this.mirror,this.bypassOptions.iframeManager,this,this.bypassOptions.canvasManager,e,this.bypassOptions.enableStrictPrivacy),Me(this.scrollCb,e,this.mirror,this.bypassOptions.blockClass,this.bypassOptions.sampling)},e}();for(var Fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),We=0;We<Fe.length;We++)Pe[Fe.charCodeAt(We)]=We;var je=new Map;var ze=function(e,t,r){if(e&&(Ue(e,t)||"object"==typeof e)){var n=function(e,t){var r=je.get(e);return r||(r=new Map,je.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),o=n.indexOf(e);return-1===o&&(o=n.length,n.push(e)),o}};function Be(e,t,r){return e instanceof Array?e.map((function(e){return Be(e,t,r)})):null===e?e: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?{rr_type:e.constructor.name,args:[Object.values(e)]}:e instanceof ArrayBuffer?{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),n=r.length,o="";for(t=0;t<n;t+=3)o+=Fe[r[t]>>2],o+=Fe[(3&r[t])<<4|r[t+1]>>4],o+=Fe[(15&r[t+1])<<2|r[t+2]>>6],o+=Fe[63&r[t+2]];return n%3==2?o=o.substring(0,o.length-1)+"=":n%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e)}:e instanceof DataView?{rr_type:e.constructor.name,args:[Be(e.buffer,t,r),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof ImageData?{rr_type:e.constructor.name,args:[Be(e.data,t,r),e.width,e.height]}:Ue(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:ze(e,t,r)}:e}var Ve=function(e,t,r){return u(e).map((function(e){return Be(e,t,r)}))},Ue=function(e,t){var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(r.find((function(r){return e instanceof t[r]})))};function Ge(e,t,r,n,o,i){var a,s,c=[],d=Object.getOwnPropertyNames(e),p=function(a){try{if("function"!=typeof e[a])return"continue";var s=v(e,a,(function(s){return function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];var d=s.apply(this,l);if(ze(d,i,e),!S(this.canvas,n)){o.getId(this.canvas);var p=Ve(u(l),i,e),f={type:t,property:a,args:p};r(this.canvas,f)}return d}}));c.push(s)}catch(n){var l=m(e,a,{set:function(e){r(this.canvas,{type:t,property:a,args:[e],setter:!0})}});c.push(l)}};try{for(var f=l(d),h=f.next();!h.done;h=f.next()){p(h.value)}}catch(e){a={error:e}}finally{try{h&&!h.done&&(s=f.return)&&s.call(f)}finally{if(a)throw a.error}}return c}var He,Ye,Xe=function(){function e(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)},this.mutationCb=e.mutationCb,this.mirror=e.mirror,!0===e.recordCanvas&&this.initCanvasMutationObserver(e.win,e.blockClass)}return e.prototype.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1},e.prototype.initCanvasMutationObserver=function(e,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=function(e,t){var r=[];try{var n=v(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return S(this,t)||"__context"in this||(this.__context=r),e.apply(this,u([r],n))}}));r.push(n)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){r.forEach((function(e){return e()}))}}(e,t),n=function(e,t,r,n){var i,a,s=[],c=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),d=function(n){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[n])return"continue";var i=v(t.CanvasRenderingContext2D.prototype,n,(function(t){return function(){for(var i=this,a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return S(this.canvas,r)||setTimeout((function(){var t=u(a);if("drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement){var r=t[0],s=r.getContext("2d"),l=null==s?void 0:s.getImageData(0,0,r.width,r.height),c=null==l?void 0:l.data;t[0]=JSON.stringify(c)}e(i.canvas,{type:o["2D"],property:n,args:t})}),0),t.apply(this,a)}}));s.push(i)}catch(r){var a=m(t.CanvasRenderingContext2D.prototype,n,{set:function(t){e(this.canvas,{type:o["2D"],property:n,args:[t],setter:!0})}});s.push(a)}};try{for(var p=l(c),f=p.next();!f.done;f=p.next()){d(f.value)}}catch(e){i={error:e}}finally{try{f&&!f.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}return function(){s.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror),i=function(e,t,r,n){var i=[];return i.push.apply(i,u(Ge(t.WebGLRenderingContext.prototype,o.WebGL,e,r,n,t))),void 0!==t.WebGL2RenderingContext&&i.push.apply(i,u(Ge(t.WebGL2RenderingContext.prototype,o.WebGL2,e,r,n,t))),function(){i.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror);this.resetObservers=function(){r(),n(),i()}},e.prototype.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.startRAFTimestamping=function(){var e=this,t=function(r){e.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)},e.prototype.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach((function(t,r){var n=e.mirror.getId(r);e.flushPendingCanvasMutationFor(r,n)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.flushPendingCanvasMutationFor=function(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((function(e){return e.type,function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["type"])})),o=r[0].type;this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}},e}();function qe(e){return s(s({},e),{timestamp:Date.now()})}var Qe={map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,r=e.__sn&&e.__sn.id;delete this.map[r],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}};function $e(t){void 0===t&&(t={});var r=t.emit,n=t.checkoutEveryNms,o=t.checkoutEveryNth,i=t.blockClass,a=void 0===i?"highlight-block":i,u=t.blockSelector,p=void 0===u?null:u,f=t.ignoreClass,h=void 0===f?"highlight-ignore":f,m=t.maskTextClass,v=void 0===m?"highlight-mask":m,b=t.maskTextSelector,S=void 0===b?null:b,T=t.inlineStylesheet,x=void 0===T||T,w=t.maskAllInputs,I=t.maskInputOptions,C=t.slimDOMOptions,k=t.maskInputFn,N=t.maskTextFn,_=t.hooks,O=t.packFn,A=t.sampling,D=void 0===A?{}:A,L=t.mousemoveWait,F=t.recordCanvas,P=void 0!==F&&F,W=t.userTriggeredOnInput,j=void 0!==W&&W,z=t.collectFonts,B=void 0!==z&&z,V=t.plugins,U=t.keepIframeSrcFn,G=void 0===U?function(){return!1}:U,H=t.enableStrictPrivacy,Y=void 0!==H&&H;if(!r)throw new Error("emit function is required");void 0!==L&&void 0===D.mousemove&&(D.mousemove=L);var X,q=!0===w?{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!==I?I:{password:!0},Q=!0===C||"all"===C?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===C,headMetaDescKeywords:"all"===C}:C||{};E();var $=0;He=function(t,i){var a;if(!(null===(a=Se[0])||void 0===a?void 0:a.isFrozen())||t.type===e.EventType.FullSnapshot||t.type===e.EventType.IncrementalSnapshot&&t.data.source===e.IncrementalSource.Mutation||Se.forEach((function(e){return e.unfreeze()})),r(function(e){var t,r;try{for(var n=l(V||[]),o=n.next();!o.done;o=n.next()){var i=o.value;i.eventProcessor&&(e=i.eventProcessor(e))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return O&&(e=O(e)),e}(t),i),t.type===e.EventType.FullSnapshot)X=t,$=0;else if(t.type===e.EventType.IncrementalSnapshot){if(t.data.source===e.IncrementalSource.Mutation&&t.data.isAttachIframe)return;$++;var s=o&&$>=o,c=n&&t.timestamp-X.timestamp>n;(s||c)&&Ye(!0)}};var K=function(t){He(qe({type:e.EventType.IncrementalSnapshot,data:s({source:e.IncrementalSource.Mutation},t)}))},J=function(t){return He(qe({type:e.EventType.IncrementalSnapshot,data:s({source:e.IncrementalSource.Scroll},t)}))},Z=function(t){return He(qe({type:e.EventType.IncrementalSnapshot,data:s({source:e.IncrementalSource.CanvasMutation},t)}))},te=new De({mutationCb:K}),re=new Xe({recordCanvas:P,mutationCb:Z,win:window,blockClass:a,mirror:Qe}),ne=new Le({mutationCb:K,scrollCb:J,bypassOptions:{blockClass:a,blockSelector:p,maskTextClass:v,maskTextSelector:S,inlineStylesheet:x,maskInputOptions:q,maskTextFn:N,maskInputFn:k,recordCanvas:P,sampling:D,slimDOMOptions:Q,iframeManager:te,canvasManager:re,enableStrictPrivacy:Y},mirror:Qe});Ye=function(t){var r,n,o,i;void 0===t&&(t=!1),He(qe({type:e.EventType.Meta,data:{href:window.location.href,width:g(),height:y()}}),t),Se.forEach((function(e){return e.lock()}));var s=c(function(e,t){var r=t||{},n=r.blockClass,o=void 0===n?"highlight-block":n,i=r.blockSelector,a=void 0===i?null:i,s=r.maskTextClass,l=void 0===s?"highlight-mask":s,c=r.maskTextSelector,u=void 0===c?null:c,d=r.inlineStylesheet,p=void 0===d||d,f=r.recordCanvas,h=void 0!==f&&f,m=r.maskAllInputs,v=void 0!==m&&m,y=r.maskTextFn,g=r.maskInputFn,b=r.slimDOM,S=void 0!==b&&b,T=r.preserveWhiteSpace,x=r.onSerialize,w=r.onIframeLoad,E=r.iframeLoadTimeout,I=r.keepIframeSrcFn,C=void 0===I?function(){return!1}:I,k=r.enableStrictPrivacy,M={};return[ee(e,{doc:e,map:M,blockClass:o,blockSelector:a,maskTextClass:l,maskTextSelector:u,skipChild:!1,inlineStylesheet:p,maskInputOptions:!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}:!1===v?{password:!0}:v,maskTextFn:y,maskInputFn:g,slimDOMOptions:!0===S||"all"===S?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===S,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===S?{}:S,recordCanvas:h,preserveWhiteSpace:T,onSerialize:x,onIframeLoad:w,iframeLoadTimeout:E,keepIframeSrcFn:C,enableStrictPrivacy:void 0!==k&&k}),M]}(document,{blockClass:a,blockSelector:p,maskTextClass:v,maskTextSelector:S,inlineStylesheet:x,maskAllInputs:q,maskTextFn:N,slimDOM:Q,recordCanvas:P,enableStrictPrivacy:Y,onSerialize:function(e){M(e)&&te.addIframe(e),R(e)&&ne.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){te.attachIframe(e,t)},keepIframeSrcFn:G}),2),l=s[0],u=s[1];if(!l)return console.warn("Failed to snapshot the document");Qe.map=u,He(qe({type:e.EventType.FullSnapshot,data:{node:l,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(i=null===(o=null===document||void 0===document?void 0:document.body)||void 0===o?void 0:o.parentElement)||void 0===i?void 0:i.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),Se.forEach((function(e){return e.unlock()}))};try{var oe=[];oe.push(d("DOMContentLoaded",(function(){He(qe({type:e.EventType.DomContentLoaded,data:{}}))})));var ie=function(t){var r;return Ae({mutationCb:K,mousemoveCb:function(t,r){return He(qe({type:e.EventType.IncrementalSnapshot,data:{source:r,positions:t}}))},mouseInteractionCb:function(t){return He(qe({type:e.EventType.IncrementalSnapshot,data:s({source:e.IncrementalSource.MouseInteraction},t)}))},scrollCb:J,viewportResizeCb:function(t){return He(qe({type:e.EventType.IncrementalSnapshot,data:s({source:e.IncrementalSource.ViewportResize},t)}))},inputCb:function(t){return He(qe({type:e.EventType.IncrementalSnapshot,data:s({source:e.IncrementalSource.Input},t)}))},mediaInteractionCb:function(t){return He(qe({type:e.EventType.IncrementalSnapshot,data:s({source:e.IncrementalSource.MediaInteraction},t)}))},styleSheetRuleCb:function(t){return He(qe({type:e.EventType.IncrementalSnapshot,data:s({source:e.IncrementalSource.StyleSheetRule},t)}))},styleDeclarationCb:function(t){return He(qe({type:e.EventType.IncrementalSnapshot,data:s({source:e.IncrementalSource.StyleDeclaration},t)}))},canvasMutationCb:Z,fontCb:function(t){return He(qe({type:e.EventType.IncrementalSnapshot,data:s({source:e.IncrementalSource.Font},t)}))},blockClass:a,ignoreClass:h,maskTextClass:v,maskTextSelector:S,maskInputOptions:q,inlineStylesheet:x,sampling:D,recordCanvas:P,userTriggeredOnInput:j,collectFonts:B,doc:t,maskInputFn:k,maskTextFn:N,blockSelector:p,slimDOMOptions:Q,mirror:Qe,iframeManager:te,shadowDomManager:ne,canvasManager:re,plugins:(null===(r=null==V?void 0:V.filter((function(e){return e.observer})))||void 0===r?void 0:r.map((function(t){return{observer:t.observer,options:t.options,callback:function(r){return He(qe({type:e.EventType.Plugin,data:{plugin:t.name,payload:r}}))}}})))||[],enableStrictPrivacy:Y},_)};te.addLoadListener((function(e){oe.push(ie(e.contentDocument))}));var ae=function(){Ye(),oe.push(ie(document))};return"interactive"===document.readyState||"complete"===document.readyState?ae():oe.push(d("load",(function(){He(qe({type:e.EventType.Load,data:{}})),ae()}),window)),function(){oe.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}function Ke(e){return e=e||Object.create(null),{on:function(t,r){(e[t]||(e[t]=[])).push(r)},off:function(t,r){e[t]&&e[t].splice(e[t].indexOf(r)>>>0,1)},emit:function(t,r){(e[t]||[]).slice().map((function(e){e(r)})),(e["*"]||[]).slice().map((function(e){e(t,r)}))}}}$e.addCustomEvent=function(t,r){He&&He(qe({type:e.EventType.Custom,data:{tag:t,payload:r}}))},$e.freezePage=function(){Se.forEach((function(e){return e.freeze()}))},$e.takeFullSnapshot=function(e){if(!Ye)throw new Error("please take full snapshot after start recording");Ye(e)},$e.mirror=Qe;var Je=Object.freeze({__proto__:null,default:Ke});function Ze(e,t){if(void 0===e&&(e=window),void 0===t&&(t=document),!("scrollBehavior"in t.documentElement.style)||!0===e.__forceSmoothScrollPolyfill__){var r,n=e.HTMLElement||e.Element,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||s,scrollIntoView:n.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(r=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(r)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):o.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?o.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},n.prototype.scroll=n.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==l(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},n.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},n.prototype.scrollIntoView=function(){if(!0!==l(arguments[0])){var r=p(this),n=r.getBoundingClientRect(),i=this.getBoundingClientRect();r!==t.body?(h.call(this,r,r.scrollLeft+i.left-n.left,r.scrollTop+i.top-n.top),"fixed"!==e.getComputedStyle(r).position&&e.scrollBy({left:n.left,top:n.top,behavior:"smooth"})):e.scrollBy({left:i.left,top:i.top,behavior:"smooth"})}else o.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function u(t,r){var n=e.getComputedStyle(t,null)["overflow"+r];return"auto"===n||"scroll"===n}function d(e){var t=c(e,"Y")&&u(e,"Y"),r=c(e,"X")&&u(e,"X");return t||r}function p(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}function f(t){var r,n,o,a,s=(i()-t.startTime)/468;a=s=s>1?1:s,r=.5*(1-Math.cos(Math.PI*a)),n=t.startX+(t.x-t.startX)*r,o=t.startY+(t.y-t.startY)*r,t.method.call(t.scrollable,n,o),n===t.x&&o===t.y||e.requestAnimationFrame(f.bind(e,t))}function h(r,n,a){var l,c,u,d,p=i();r===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=o.scroll):(l=r,c=r.scrollLeft,u=r.scrollTop,d=s),f({scrollable:l,method:d,startTime:p,startX:c,startY:u,x:n,y:a})}}var et,tt=function(){function e(e,t){void 0===e&&(e=[]),this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){this.actions=this.actions.concat(e)},e.prototype.replaceActions=function(e){var t;this.actions.length=0,(t=this.actions).splice.apply(t,u([0,0],e))},e.prototype.start=function(){this.timeOffset=0;var e=performance.now(),t=this.actions,r=this;this.raf=requestAnimationFrame((function n(){var o=performance.now();for(r.timeOffset+=(o-e)*r.speed,e=o;t.length;){var i=t[0];if(!(r.timeOffset>=i.delay))break;t.shift(),i.doAction()}(t.length>0||r.liveMode)&&(r.raf=requestAnimationFrame(n))}))},e.prototype.clear=function(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0},e.prototype.setSpeed=function(e){this.speed=e},e.prototype.toggleLiveMode=function(e){this.liveMode=e},e.prototype.isActive=function(){return null!==this.raf},e.prototype.findActionIndex=function(e){for(var t=0,r=this.actions.length-1;t<=r;){var n=Math.floor((t+r)/2);if(this.actions[n].delay<e.delay)t=n+1;else{if(!(this.actions[n].delay>e.delay))return n+1;r=n-1}}return t},e}();function rt(t,r){if(t.type===e.EventType.IncrementalSnapshot&&t.data.source===e.IncrementalSource.MouseMove){var n=t.data.positions[0].timeOffset,o=t.timestamp+n;return t.delay=o-r,o-r}return t.delay=t.timestamp-r,t.delay}
16
- /*! *****************************************************************************
17
- Copyright (c) Microsoft Corporation.
18
-
19
- Permission to use, copy, modify, and/or distribute this software for any
20
- purpose with or without fee is hereby granted.
21
-
22
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
23
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
24
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
25
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
26
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
27
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
28
- PERFORMANCE OF THIS SOFTWARE.
29
- ***************************************************************************** */function nt(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(et||(et={}));var ot={type:"xstate.init"};function it(e){return void 0===e?[]:[].concat(e)}function at(e){return{type:"xstate.assign",assignment:e}}function st(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function lt(e){return function(t){return e===t}}function ct(e){return"string"==typeof e?{type:e}:e}function ut(e,t){return{value:e,context:t,actions:[],changed:!1,matches:lt(e)}}function dt(e,t,r){var n=t,o=!1;return[e.filter((function(e){if("xstate.assign"===e.type){o=!0;var t=Object.assign({},n);return"function"==typeof e.assignment?t=e.assignment(n,r):Object.keys(e.assignment).forEach((function(o){t[o]="function"==typeof e.assignment[o]?e.assignment[o](n,r):e.assignment[o]})),n=t,!1}return!0})),n,o]}function pt(e,t){void 0===t&&(t={});var r=nt(dt(it(e.states[e.initial].entry).map((function(e){return st(e,t.actions)})),e.context,ot),2),n=r[0],o=r[1],i={config:e,_options:t,initialState:{value:e.initial,actions:n,context:o,matches:lt(e.initial)},transition:function(t,r){var n,o,a="string"==typeof t?{value:t,context:e.context}:t,s=a.value,l=a.context,c=ct(r),u=e.states[s];if(u.on){var d=it(u.on[c.type]);try{for(var p=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(d),f=p.next();!f.done;f=p.next()){var h=f.value;if(void 0===h)return ut(s,l);var m="string"==typeof h?{target:h}:h,v=m.target,y=m.actions,g=void 0===y?[]:y,b=m.cond,S=void 0===v;if((void 0===b?function(){return!0}:b)(l,c)){var T=e.states[null!=v?v:s],x=nt(dt((S?it(g):[].concat(u.exit,g,T.entry).filter((function(e){return e}))).map((function(e){return st(e,i._options.actions)})),l,c),3),w=x[0],E=x[1],I=x[2],C=null!=v?v:s;return{value:C,context:E,actions:w,changed:v!==s||w.length>0||I,matches:lt(C)}}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(o=p.return)&&o.call(p)}finally{if(n)throw n.error}}}return ut(s,l)}};return i}var ft=function(e,t){return e.actions.forEach((function(r){var n=r.exec;return n&&n(e.context,t)}))};function ht(e){var t=e.initialState,r=et.NotStarted,n=new Set,o={_machine:e,send:function(o){r===et.Running&&(t=e.transition(t,o),ft(t,ct(o)),n.forEach((function(e){return e(t)})))},subscribe:function(e){return n.add(e),e(t),{unsubscribe:function(){return n.delete(e)}}},start:function(n){if(n){var i="object"==typeof n?n:{context:e.config.context,value:n};t={value:i.value,actions:[],context:i.context,matches:lt(i.value)}}return r=et.Running,ft(t,ot),o},stop:function(){return r=et.Stopped,n.clear(),o},get state(){return t},get status(){return r}};return o}function mt(t,r){var n=r.getCastFn,o=r.applyEventsSynchronously,i=r.emitter;return ht(pt({id:"player",context:t,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]},REPLACE_EVENTS:{target:"playing",actions:["replaceEvents"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]},REPLACE_EVENTS:{target:"paused",actions:["replaceEvents"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:at({lastPlayedEvent:function(e,t){return"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}}),recordTimeOffset:at((function(e,t){var r=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(r=t.payload.timeOffset),s(s({},e),{timeOffset:r,baselineTime:e.events[0].timestamp+r})})),play:function(t){var r,a,s,c,u,d=t.timer,p=t.events,f=t.baselineTime,h=t.lastPlayedEvent;d.clear();try{for(var m=l(p),v=m.next();!v.done;v=m.next()){rt(v.value,f)}}catch(e){r={error:e}}finally{try{v&&!v.done&&(a=m.return)&&a.call(m)}finally{if(r)throw r.error}}var y=function(t,r){for(var n=t.length-1;n>=0;n--){var o=t[n];if(o.type===e.EventType.Meta&&o.timestamp<=r)return t.slice(n)}return t}(p,f),g=null==h?void 0:h.timestamp;(null==h?void 0:h.type)===e.EventType.IncrementalSnapshot&&h.data.source===e.IncrementalSource.MouseMove&&(g=h.timestamp+(null===(u=h.data.positions[0])||void 0===u?void 0:u.timeOffset)),f<(g||0)&&i.emit(e.ReplayerEvents.PlayBack);var b=new Array,S=new Array,T=function(e){if(g&&g<f&&(e.timestamp<=g||e===h))return"continue";if(e.timestamp<f)b.push(e);else{var t=n(e,!1);S.push({doAction:function(){t()},delay:e.delay})}};try{for(var x=l(y),w=x.next();!w.done;w=x.next()){T(w.value)}}catch(e){s={error:e}}finally{try{w&&!w.done&&(c=x.return)&&c.call(x)}finally{if(s)throw s.error}}o(b),i.emit(e.ReplayerEvents.Flush),d.addActions(S),d.start()},pause:function(e){e.timer.clear()},resetLastPlayedEvent:at((function(e){return s(s({},e),{lastPlayedEvent:null})})),startLive:at({baselineTime:function(e,t){return e.timer.toggleLiveMode(!0),e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now()}}),replaceEvents:at((function(e,t){var r,o,i=e.events,a=e.timer,c=e.baselineTime;if("REPLACE_EVENTS"===t.type){var u=t.payload.events;i.length=0;var d=[],p=function(e){if(rt(e,c),i.push(e),e.timestamp>=a.timeOffset+c){var t=n(e,!1);d.push({doAction:function(){t()},delay:e.delay})}};try{for(var f=l(u),h=f.next();!h.done;h=f.next()){p(h.value)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}a.isActive()&&a.replaceActions(d)}return s(s({},e),{events:i})})),addEvent:at((function(e,t){var r=e.baselineTime,o=e.timer,i=e.events;if("ADD_EVENT"===t.type){var a=t.payload.event;rt(a,r);var l=i.length-1;if(!i[l]||i[l].timestamp<=a.timestamp)i.push(a);else{for(var c=-1,u=0;u<=l;){var d=Math.floor((u+l)/2);i[d].timestamp<=a.timestamp?u=d+1:l=d-1}-1===c&&(c=u),i.splice(c,0,a)}var p=a.timestamp<r,f=n(a,p);p?f():o.isActive()&&o.addAction({doAction:function(){f()},delay:a.delay})}return s(s({},e),{events:i})}))}}))}var vt;function yt(e,t){var r=e[t[0]];return 1===t.length?r:yt(r.cssRules[t[1]].cssRules,t.slice(2))}function gt(e){var t=u(e),r=t.pop();return{positions:t,index:r}}function bt(e,t){var r=t.sheet;r&&e.forEach((function(e){if(e.type===vt.Insert)try{if(Array.isArray(e.index)){var n=gt(e.index),o=n.positions,i=n.index;yt(r.cssRules,o).insertRule(e.cssText,i)}else r.insertRule(e.cssText,e.index)}catch(e){}else if(e.type===vt.Remove)try{if(Array.isArray(e.index)){var a=gt(e.index);o=a.positions,i=a.index;yt(r.cssRules,o).deleteRule(i||0)}else r.deleteRule(e.index)}catch(e){}else if(e.type===vt.Snapshot)!function(e,t){var r;try{var n=Array.from((null===(r=t.sheet)||void 0===r?void 0:r.cssRules)||[]).map((function(e){return e.cssText})),o=Object.entries(n).reverse(),i=n.length;o.forEach((function(r){var n,o=c(r,2),a=o[0],s=o[1],l=e.indexOf(s);if(-1===l||l>i)try{null===(n=t.sheet)||void 0===n||n.deleteRule(Number(a))}catch(e){}i=l})),e.forEach((function(e,r){var n,o,i;try{(null===(o=null===(n=t.sheet)||void 0===n?void 0:n.cssRules[r])||void 0===o?void 0:o.cssText)!==e&&(null===(i=t.sheet)||void 0===i||i.insertRule(e,r))}catch(e){}}))}catch(e){}}(e.cssTexts,t);else if(e.type===vt.SetProperty){yt(r.cssRules,e.index).style.setProperty(e.property,e.value,e.priority)}else if(e.type===vt.RemoveProperty){yt(r.cssRules,e.index).style.removeProperty(e.property)}}))}!function(e){e[e.Insert=0]="Insert",e[e.Remove=1]="Remove",e[e.Snapshot=2]="Snapshot",e[e.SetProperty=3]="SetProperty",e[e.RemoveProperty=4]="RemoveProperty"}(vt||(vt={}));var St=new Map;function Tt(e,t){var r=St.get(e);return r||(r=new Map,St.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var xt=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function wt(e,t){return function(r){if(r&&"object"==typeof r&&"rr_type"in r){if("index"in r){var n=r.rr_type,o=r.index;return Tt(t,n)[o]}if("args"in r){var i=r.rr_type,a=r.args,s=window[i];return new(s.bind.apply(s,u([void 0],a.map(wt(e,t)))))}if("base64"in r)return function(e){var t,r,n,o,i,a=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var c=new ArrayBuffer(a),u=new Uint8Array(c);for(t=0;t<s;t+=4)r=Pe[e.charCodeAt(t)],n=Pe[e.charCodeAt(t+1)],o=Pe[e.charCodeAt(t+2)],i=Pe[e.charCodeAt(t+3)],u[l++]=r<<2|n>>4,u[l++]=(15&n)<<4|o>>2,u[l++]=(3&o)<<6|63&i;return c}(r.base64);if("src"in r){var l=e.get(r.src);if(l)return l;var c=new Image;return c.src=r.src,e.set(r.src,c),c}}else if(Array.isArray(r))return r.map(wt(e,t));return r}}function Et(e){var t=e.mutation,r=e.target,n=e.type,i=e.imageMap,a=e.errorHandler;try{var s=function(e,t){try{return t===o.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch(e){return null}}(r,n);if(!s)return;if(t.setter)return void(s[t.property]=t.args[0]);var l=s[t.property],c=t.args.map(wt(i,s));!function(e,t){if(null==t?void 0:t.constructor){var r=t.constructor.name;if(xt.includes(r)){var n=Tt(e,r);n.includes(t)||n.push(t)}}}(s,l.apply(s,c))}catch(e){a(t,e)}}var It=Ke||Je,Ct={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function kt(t){return t.type==e.EventType.IncrementalSnapshot&&(t.data.source==e.IncrementalSource.TouchMove||t.data.source==e.IncrementalSource.MouseInteraction&&t.data.type==e.MouseInteractions.TouchStart)}var Mt=function(){function t(t,r){var n=this;if(this.mouseTail=null,this.tailPositions=[],this.emitter=It(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=le(),this.imageMap=new Map,this.mirror={map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,r=e.__sn&&e.__sn.id;delete this.map[r],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}},this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,!(null==r?void 0:r.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");var o={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:Ct,inactiveThreshold:.02,inactiveSkipTime:2e3};this.config=Object.assign({},o,r),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(e.ReplayerEvents.Resize,this.handleResize),this.setupDom(),this.treeIndex=new I,this.fragmentParentMap=new Map,this.elementStateMap=new Map,this.virtualStyleRulesMap=new Map,this.emitter.on(e.ReplayerEvents.Flush,(function(){var e,t,r,o,i,a,s=n.treeIndex.flush(),c=s.scrollMap,u=s.inputMap;n.fragmentParentMap.forEach((function(e,t){return n.restoreRealParent(t,e)}));try{for(var d=l(n.virtualStyleRulesMap.keys()),p=d.next();!p.done;p=d.next()){var f=p.value;n.restoreNodeSheet(f)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}n.fragmentParentMap.clear(),n.elementStateMap.clear(),n.virtualStyleRulesMap.clear();try{for(var h=l(c.values()),m=h.next();!m.done;m=h.next()){var v=m.value;n.applyScroll(v,!0)}}catch(e){r={error:e}}finally{try{m&&!m.done&&(o=h.return)&&o.call(h)}finally{if(r)throw r.error}}try{for(var y=l(u.values()),g=y.next();!g.done;g=y.next()){v=g.value;n.applyInput(v)}}catch(e){i={error:e}}finally{try{g&&!g.done&&(a=y.return)&&a.call(y)}finally{if(i)throw i.error}}})),this.emitter.on(e.ReplayerEvents.PlayBack,(function(){n.firstFullSnapshot=null,n.mirror.reset()}));var i=new tt([],(null==r?void 0:r.speed)||o.speed);this.service=mt({events:t.map((function(e){return r&&r.unpackFn?r.unpackFn(e):e})).sort((function(e,t){return e.timestamp-t.timestamp})),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe((function(t){n.emitter.emit(e.ReplayerEvents.StateChange,{player:t})})),this.speedService=ht(pt({id:"speed",context:{normalSpeed:-1,timer:i},initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:function(e,t){"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:at({normalSpeed:function(e){return e.timer.speed}}),restoreSpeed:function(e){e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((function(t){n.emitter.emit(e.ReplayerEvents.StateChange,{speed:t})}));var a=this.service.state.context.events.find((function(t){return t.type===e.EventType.Meta})),s=this.service.state.context.events.find((function(t){return t.type===e.EventType.FullSnapshot}));if(a){var c=a.data,u=c.width,d=c.height;setTimeout((function(){n.emitter.emit(e.ReplayerEvents.Resize,{width:u,height:d})}),0)}s&&setTimeout((function(){n.firstFullSnapshot||(n.firstFullSnapshot=s,n.rebuildFullSnapshot(s),n.iframe.contentWindow.scrollTo(s.data.initialOffset))}),1),this.service.state.context.events.find(kt)&&this.mouse.classList.add("touch-device")}return Object.defineProperty(t.prototype,"timer",{get:function(){return this.service.state.context.timer},enumerable:!1,configurable:!0}),t.prototype.on=function(e,t){return this.emitter.on(e,t),this},t.prototype.off=function(e,t){return this.emitter.off(e,t),this},t.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach((function(r){t.config[r]=e[r]})),this.config.skipInactive||this.backToNormal(),void 0!==e.speed&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),void 0!==e.mouseTail&&(!1===e.mouseTail?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))},t.prototype.getActivityIntervals=function(){var e=this;if(0==this.activityIntervals.length){for(var t=[],r=this.getMetaData(),n=u([{timestamp:r.startTime}],this.service.state.context.events.filter((function(t){return e.isUserInteraction(t)})),[{timestamp:r.endTime}]),o=1;o<n.length;o++){var i=n[o-1],a=n[o];a.timestamp-i.timestamp>1e4?t.push({startTime:i.timestamp,endTime:a.timestamp,duration:a.timestamp-i.timestamp,active:!1}):t.push({startTime:i.timestamp,endTime:a.timestamp,duration:a.timestamp-i.timestamp,active:!0})}var s=[],l=t[0];for(o=1;o<t.length;o++)t[o].active!=t[o-1].active&&(s.push({startTime:l.startTime,endTime:t[o-1].endTime,duration:t[o-1].endTime-l.startTime,active:t[o-1].active}),l=t[o]);l&&t.length>0&&s.push({startTime:l.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-l.startTime,active:t[t.length-1].active}),l=s[0];for(o=1;o<s.length;o++)(!s[o].active&&s[o].duration>this.config.inactiveThreshold*r.totalTime||!s[o-1].active&&s[o-1].duration>this.config.inactiveThreshold*r.totalTime)&&(this.activityIntervals.push({startTime:l.startTime,endTime:s[o-1].endTime,duration:s[o-1].endTime-l.startTime,active:s[o-1].active}),l=s[o]);l&&s.length>0&&this.activityIntervals.push({startTime:l.startTime,endTime:s[s.length-1].endTime,duration:s[s.length-1].endTime-l.startTime,active:s[s.length-1].active})}return this.activityIntervals},t.prototype.getMetaData=function(){var e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}},t.prototype.getCurrentTime=function(){return this.timer.timeOffset+this.getTimeOffset()},t.prototype.getTimeOffset=function(){var e=this.service.state.context;return e.baselineTime-e.events[0].timestamp},t.prototype.getMirror=function(){return this.mirror},t.prototype.play=function(t){var r;void 0===t&&(t=0),this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}}),null===(r=this.iframe.contentDocument)||void 0===r||r.getElementsByTagName("html")[0].classList.remove("rrweb-paused"),this.emitter.emit(e.ReplayerEvents.Start),this.handleInactivity(this.getMetaData().startTime+t,!0)},t.prototype.pause=function(t){var r;void 0===t&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof t&&(this.play(t),this.service.send({type:"PAUSE"})),null===(r=this.iframe.contentDocument)||void 0===r||r.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(e.ReplayerEvents.Pause)},t.prototype.resume=function(t){void 0===t&&(t=0),console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(e.ReplayerEvents.Resume)},t.prototype.startLive=function(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})},t.prototype.addEvent=function(e){var t=this,r=this.config.unpackFn?this.config.unpackFn(e):e;kt(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then((function(){return t.service.send({type:"ADD_EVENT",payload:{event:r}})}))},t.prototype.replaceEvents=function(e){var t,r;try{for(var n=l(e),o=n.next();!o.done;o=n.next()){if(kt(o.value)){this.mouse.classList.add("touch-device");break}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}this.service.send({type:"REPLACE_EVENTS",payload:{events:e}})},t.prototype.enableInteract=function(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"},t.prototype.disableInteract=function(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"},t.prototype.resetCache=function(){this.cache=le()},t.prototype.setupDom=function(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),!1!==this.config.mouseTail&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");var e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(Ze(this.iframe.contentWindow,this.iframe.contentDocument),E(this.iframe.contentWindow))},t.prototype.handleResize=function(e){var t,r;this.iframe.style.display="inherit";try{for(var n=l([this.mouseTail,this.iframe]),o=n.next();!o.done;o=n.next()){var i=o.value;i&&(i.setAttribute("width",String(e.width)),i.setAttribute("height",String(e.height)))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},t.prototype.applyEventsSynchronously=function(t){var r,n;try{for(var o=l(t),i=o.next();!i.done;i=o.next()){var a=i.value;switch(a.type){case e.EventType.DomContentLoaded:case e.EventType.Load:case e.EventType.Custom:continue;case e.EventType.FullSnapshot:case e.EventType.Meta:case e.EventType.Plugin:break;case e.EventType.IncrementalSnapshot:switch(a.data.source){case e.IncrementalSource.MediaInteraction:continue}}this.getCastFn(a,!0)()}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null,!0===this.touchActive?this.mouse.classList.add("touch-active"):!1===this.touchActive&&this.mouse.classList.remove("touch-active"),this.touchActive=null},t.prototype.getCastFn=function(t,r){var n,o=this;switch(void 0===r&&(r=!1),t.type){case e.EventType.DomContentLoaded:case e.EventType.Load:break;case e.EventType.Custom:n=function(){o.emitter.emit(e.ReplayerEvents.CustomEvent,t)};break;case e.EventType.Meta:n=function(){return o.emitter.emit(e.ReplayerEvents.Resize,{width:t.data.width,height:t.data.height})};break;case e.EventType.FullSnapshot:n=function(){if(o.firstFullSnapshot){if(o.firstFullSnapshot===t)return void(o.firstFullSnapshot=!0)}else o.firstFullSnapshot=!0;o.rebuildFullSnapshot(t,r),o.iframe.contentWindow.scrollTo(t.data.initialOffset)};break;case e.EventType.IncrementalSnapshot:n=function(){var n,i;if(o.applyIncremental(t,r),!r&&(o.handleInactivity(t.timestamp),t===o.nextUserInteractionEvent&&(o.nextUserInteractionEvent=null,o.backToNormal()),o.config.skipInactive&&!o.nextUserInteractionEvent)){try{for(var a=l(o.service.state.context.events),s=a.next();!s.done;s=a.next()){var c=s.value;if(!(c.timestamp<=t.timestamp)&&o.isUserInteraction(c)){c.delay-t.delay>1e4*o.speedService.state.context.timer.speed&&(o.nextUserInteractionEvent=c);break}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}if(o.nextUserInteractionEvent){var u=o.nextUserInteractionEvent.delay-t.delay,d={speed:Math.min(Math.round(u/2e3),o.config.maxSpeed)};o.speedService.send({type:"FAST_FORWARD",payload:d}),o.emitter.emit(e.ReplayerEvents.SkipStart,d)}}}}return function(){var i,a;n&&n();try{for(var s=l(o.config.plugins||[]),c=s.next();!c.done;c=s.next()){c.value.handler(t,r,{replayer:o})}}catch(e){i={error:e}}finally{try{c&&!c.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}o.service.send({type:"CAST_EVENT",payload:{event:t}});var u=o.service.state.context.events.length-1;if(t===o.service.state.context.events[u]){var d=function(){u<o.service.state.context.events.length-1||(o.backToNormal(),o.service.send("END"),o.emitter.emit(e.ReplayerEvents.Finish))};t.type===e.EventType.IncrementalSnapshot&&t.data.source===e.IncrementalSource.MouseMove&&t.data.positions.length?setTimeout((function(){d()}),Math.max(0,50-t.data.positions[0].timeOffset)):d()}o.emitter.emit(e.ReplayerEvents.EventCast,t)}},t.prototype.handleInactivity=function(t,r){var n,o;if((t===this.inactiveEndTimestamp||r)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){try{for(var i=l(this.getActivityIntervals()),a=i.next();!a.done;a=i.next()){var s=a.value;if(t>=s.startTime&&t<s.endTime&&!s.active){this.inactiveEndTimestamp=s.endTime;break}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}if(this.inactiveEndTimestamp){var c=this.inactiveEndTimestamp-t,u={speed:c/36e5*this.config.inactiveSkipTime<1e3?c/1e3:Math.round(Math.max(c,36e5)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:u}),this.emitter.emit(e.ReplayerEvents.SkipStart,u)}}},t.prototype.rebuildFullSnapshot=function(t,r){var n,o,i=this;if(void 0===r&&(r=!1),!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};var a=[];this.mirror.map=de(t.data.node,{doc:this.iframe.contentDocument,afterAppend:function(e){i.collectIframeAndAttachDocument(a,e)},cache:this.cache})[1];var s=function(e,t){c.attachDocumentToIframe(e,t),c.newDocumentQueue=c.newDocumentQueue.filter((function(t){return t!==e}))},c=this;try{for(var u=l(a),d=u.next();!d.done;d=u.next()){var p=d.value;s(p.mutationInQueue,p.builtNode)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}var f=this.iframe.contentDocument,h=f.documentElement,m=f.head;this.insertStyleRules(h,m),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(e.ReplayerEvents.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()},t.prototype.insertStyleRules=function(e,t){var r=document.createElement("style");e.insertBefore(r,t);var n,o=(n=this.config.blockClass,["noscript { display: none !important; }","."+n+" { background: currentColor; border-radius: 5px; }","."+n+":hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}"]).concat(this.config.insertStyleRules);this.config.pauseAnimation&&o.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }");for(var i=0;i<o.length;i++)r.sheet.insertRule(o[i],i)},t.prototype.attachDocumentToIframe=function(e,t){var r,n,o=this,i=[];if(!t.contentDocument)for(var a=t.parentNode;a;){if(this.fragmentParentMap.has(a)){var s=a,c=this.fragmentParentMap.get(s);this.restoreRealParent(s,c);break}a=a.parentNode}ue(e.node,{doc:t.contentDocument,map:this.mirror.map,hackCss:!0,skipChild:!1,afterAppend:function(e){if(o.collectIframeAndAttachDocument(i,e),e.__sn.type===O.Element&&"HTML"===e.__sn.tagName.toUpperCase()){var r=t.contentDocument,n=r.documentElement,a=r.head;o.insertStyleRules(n,a)}},cache:this.cache});var u=function(e,t){d.attachDocumentToIframe(e,t),d.newDocumentQueue=d.newDocumentQueue.filter((function(t){return t!==e}))},d=this;try{for(var p=l(i),f=p.next();!f.done;f=p.next()){var h=f.value;u(h.mutationInQueue,h.builtNode)}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}},t.prototype.collectIframeAndAttachDocument=function(e,t){if(M(t)){var r=this.newDocumentQueue.find((function(e){return e.parentId===t.__sn.id}));r&&e.push({mutationInQueue:r,builtNode:t})}},t.prototype.waitForStylesheetLoad=function(){var t,r=this,n=null===(t=this.iframe.contentDocument)||void 0===t?void 0:t.head;if(n){var o,i=new Set,a=this.service.state,s=function(){a=r.service.state};this.emitter.on(e.ReplayerEvents.Start,s),this.emitter.on(e.ReplayerEvents.Pause,s);var l=function(){r.emitter.off(e.ReplayerEvents.Start,s),r.emitter.off(e.ReplayerEvents.Pause,s)};n.querySelectorAll('link[rel="stylesheet"]').forEach((function(t){t.sheet||(i.add(t),t.addEventListener("load",(function(){i.delete(t),0===i.size&&-1!==o&&(a.matches("playing")&&r.play(r.getCurrentTime()),r.emitter.emit(e.ReplayerEvents.LoadStylesheetEnd),o&&clearTimeout(o),l())})))})),i.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(e.ReplayerEvents.LoadStylesheetStart),o=setTimeout((function(){a.matches("playing")&&r.play(r.getCurrentTime()),o=-1,l()}),this.config.loadTimeout))}},t.prototype.hasImageArg=function(e){var t,r;try{for(var n=l(e),o=n.next();!o.done;o=n.next()){var i=o.value;if(i&&"object"==typeof i)if("rr_type"in i&&"args"in i){if(this.hasImageArg(i.args))return!0}else{if("rr_type"in i&&"HTMLImageElement"===i.rr_type)return!0;if(i instanceof Array&&this.hasImageArg(i))return!0}else;}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return!1},t.prototype.getImageArgs=function(e){var t,r,n=[];try{for(var o=l(e),i=o.next();!i.done;i=o.next()){var a=i.value;a&&"object"==typeof a&&("rr_type"in a&&"args"in a?n.push.apply(n,u(this.getImageArgs(a.args))):"rr_type"in a&&"HTMLImageElement"===a.rr_type?n.push(a.src):a instanceof Array&&n.push.apply(n,u(this.getImageArgs(a))))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n},t.prototype.preloadAllImages=function(){var t,r,n=this;this.service.state;var o=function(){n.service.state};this.emitter.on(e.ReplayerEvents.Start,o),this.emitter.on(e.ReplayerEvents.Pause,o);var i=function(t){t.type===e.EventType.IncrementalSnapshot&&t.data.source===e.IncrementalSource.CanvasMutation&&("commands"in t.data?t.data.commands.forEach((function(e){return n.preloadImages(e,t)})):a.preloadImages(t.data,t))},a=this;try{for(var s=l(this.service.state.context.events),c=s.next();!c.done;c=s.next()){i(c.value)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}},t.prototype.preloadImages=function(e,t){var r=this;if("drawImage"!==e.property||"string"!=typeof e.args[0]||this.imageMap.has(t))this.hasImageArg(e.args)&&this.getImageArgs(e.args).forEach((function(e){var t=new Image;t.src=e,r.imageMap.set(e,t)}));else{var n=document.createElement("canvas"),o=n.getContext("2d"),i=null==o?void 0:o.createImageData(n.width,n.height);null==i||i.data,JSON.parse(e.args[0]),null==o||o.putImageData(i,0,0)}},t.prototype.applyIncremental=function(t,r){var n,i,a=this,l=t.data;switch(l.source){case e.IncrementalSource.Mutation:r&&(l.adds.forEach((function(e){return a.treeIndex.add(e)})),l.texts.forEach((function(e){return a.treeIndex.text(e)})),l.attributes.forEach((function(e){return a.treeIndex.attribute(e)})),l.removes.forEach((function(e){return a.treeIndex.remove(e,a.mirror)})));try{this.applyMutation(l,r)}catch(e){this.warn("Exception in mutation "+(e.message||e),l)}break;case e.IncrementalSource.Drag:case e.IncrementalSource.TouchMove:case e.IncrementalSource.MouseMove:if(r){var c=l.positions[l.positions.length-1];this.mousePos={x:c.x,y:c.y,id:c.id,debugData:l}}else l.positions.forEach((function(e){var n={doAction:function(){a.moveAndHover(e.x,e.y,e.id,r,l)},delay:e.timeOffset+t.timestamp-a.service.state.context.baselineTime};a.timer.addAction(n)})),this.timer.addAction({doAction:function(){},delay:t.delay-(null===(n=l.positions[0])||void 0===n?void 0:n.timeOffset)});break;case e.IncrementalSource.MouseInteraction:if(-1===l.id)break;var u=new Event(e.MouseInteractions[l.type].toLowerCase());if(!(T=this.mirror.getNode(l.id)))return this.debugNodeNotFound(l,l.id);this.emitter.emit(e.ReplayerEvents.MouseInteraction,{type:l.type,target:T});var d=this.config.triggerFocus;switch(l.type){case e.MouseInteractions.Blur:"blur"in T&&T.blur();break;case e.MouseInteractions.Focus:d&&T.focus&&T.focus({preventScroll:!0});break;case e.MouseInteractions.Click:case e.MouseInteractions.TouchStart:case e.MouseInteractions.TouchEnd:r?(l.type===e.MouseInteractions.TouchStart?this.touchActive=!0:l.type===e.MouseInteractions.TouchEnd&&(this.touchActive=!1),this.mousePos={x:l.x,y:l.y,id:l.id,debugData:l}):(l.type===e.MouseInteractions.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(l.x,l.y,l.id,r,l),l.type===e.MouseInteractions.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):l.type===e.MouseInteractions.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):l.type===e.MouseInteractions.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case e.MouseInteractions.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:T.dispatchEvent(u)}break;case e.IncrementalSource.Scroll:if(-1===l.id)break;if(r){this.treeIndex.scroll(l);break}this.applyScroll(l,!1);break;case e.IncrementalSource.ViewportResize:this.emitter.emit(e.ReplayerEvents.Resize,{width:l.width,height:l.height});break;case e.IncrementalSource.Input:if(-1===l.id)break;if(r){this.treeIndex.input(l);break}this.applyInput(l);break;case e.IncrementalSource.MediaInteraction:if(!(T=this.mirror.getNode(l.id)))return this.debugNodeNotFound(l,l.id);var p=T;try{l.currentTime&&(p.currentTime=l.currentTime),l.volume&&(p.volume=l.volume),l.muted&&(p.muted=l.muted),1===l.type&&p.pause(),0===l.type&&p.play()}catch(e){this.config.showWarning&&console.warn("Failed to replay media interactions: "+(e.message||e))}break;case e.IncrementalSource.StyleSheetRule:if(!(T=this.mirror.getNode(l.id)))return this.debugNodeNotFound(l,l.id);var f,h=T,m=T.parentNode,v=this.fragmentParentMap.has(m),y=v?null:h.sheet;y||(this.virtualStyleRulesMap.has(T)?f=this.virtualStyleRulesMap.get(T):(f=[],this.virtualStyleRulesMap.set(T,f))),l.adds&&l.adds.forEach((function(e){var t=e.rule,r=e.index;if(y)try{if(Array.isArray(r)){var n=gt(r),o=n.positions,i=n.index;yt(y.cssRules,o).insertRule(t,i)}else{i=void 0===r?void 0:Math.min(r,y.cssRules.length);y.insertRule(t,i)}}catch(e){}else null==f||f.push({cssText:t,index:r,type:vt.Insert})})),l.removes&&l.removes.forEach((function(e){var t=e.index;if(v)null==f||f.push({index:t,type:vt.Remove});else try{if(Array.isArray(t)){var r=gt(t),n=r.positions,o=r.index;yt(y.cssRules,n).deleteRule(o||0)}else null==y||y.deleteRule(t)}catch(e){}}));break;case e.IncrementalSource.StyleDeclaration:if(!(T=this.mirror.getNode(l.id)))return this.debugNodeNotFound(l,l.id);h=T;var g=T.parentNode,b=this.fragmentParentMap.has(g)?null:h.sheet,S=[];if(b||(this.virtualStyleRulesMap.has(T)?S=this.virtualStyleRulesMap.get(T):(S=[],this.virtualStyleRulesMap.set(T,S))),l.set)if(b)yt(b.rules,l.index).style.setProperty(l.set.property,l.set.value,l.set.priority);else S.push(s({type:vt.SetProperty,index:l.index},l.set));if(l.remove)if(b)yt(b.rules,l.index).style.removeProperty(l.remove.property);else S.push(s({type:vt.RemoveProperty,index:l.index},l.remove));break;case e.IncrementalSource.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;var T;if(!(T=this.mirror.getNode(l.id)))return this.debugNodeNotFound(l,l.id);!function(e){var t=e.event,r=e.mutation,n=e.target,i=e.imageMap,a=e.errorHandler;try{var s="commands"in r?r.commands:[r];[o.WebGL,o.WebGL2].includes(r.type)?s.forEach((function(e){Et({mutation:e,type:r.type,target:n,imageMap:i,errorHandler:a})})):s.forEach((function(e){!function(e){var t=e.event,r=e.mutation,n=e.target,o=e.imageMap,i=e.errorHandler;try{var a=n.getContext("2d");if(r.setter)return void(a[r.property]=r.args[0]);var s=a[r.property];if("drawImage"===r.property&&"string"==typeof r.args[0]){var l=o.get(t);r.args[0]=l,s.apply(a,r.args)}else s.apply(a,r.args)}catch(e){i(r,e)}}({event:t,mutation:e,target:n,imageMap:i,errorHandler:a})}))}catch(e){a(r,e)}}({event:t,mutation:l,target:T,imageMap:this.imageMap,errorHandler:this.warnCanvasMutationFailed.bind(this)});break;case e.IncrementalSource.Font:try{var x=new FontFace(l.family,l.buffer?new Uint8Array(JSON.parse(l.fontSource)):l.fontSource,l.descriptors);null===(i=this.iframe.contentDocument)||void 0===i||i.fonts.add(x)}catch(e){this.config.showWarning&&console.warn(e)}}},t.prototype.applyMutation=function(e,t){var r,n,o=this;e.removes.forEach((function(t){var r=o.mirror.getNode(t.id);if(!r){if(e.removes.find((function(e){return e.id===t.parentId})))return;return o.warnNodeNotFound(e,t.id)}o.virtualStyleRulesMap.has(r)&&o.virtualStyleRulesMap.delete(r);var n=o.mirror.getNode(t.parentId);if(!n)return o.warnNodeNotFound(e,t.parentId);if(t.isShadow&&R(n)&&(n=n.shadowRoot),o.mirror.removeNodeFromMap(r),n){var i=null,a="__sn"in n?o.fragmentParentMap.get(n):void 0;a&&a.contains(r)?n=a:o.fragmentParentMap.has(r)&&(i=o.fragmentParentMap.get(r),o.fragmentParentMap.delete(r),r=i);try{n.removeChild(r)}catch(t){if(!(t instanceof DOMException))throw t;o.warn("parent could not remove child in mutation",n,a,r,i,e)}}}));var i=s({},this.legacy_missingNodeRetryMap),a=[],c=function(e){var r,n,s,c;if(!o.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");var u=o.mirror.getNode(e.parentId);if(!u)return e.node.type===O.Document?o.newDocumentQueue.push(e):a.push(e);var d=null;o.iframe.contentDocument.contains?d=o.iframe.contentDocument.contains(u):o.iframe.contentDocument.body.contains&&(d=o.iframe.contentDocument.body.contains(u));var p=(null===(c=(s=u).getElementsByTagName)||void 0===c?void 0:c.call(s,"iframe").length)>0;if(t&&d&&!M(u)&&!p){var f=document.createDocumentFragment();for(o.mirror.map[e.parentId]=f,o.fragmentParentMap.set(f,u),o.storeState(u);u.firstChild;)f.appendChild(u.firstChild);u=f}e.node.isShadow&&R(u)&&(u=u.shadowRoot);var h=null,m=null;if(e.previousId&&(h=o.mirror.getNode(e.previousId)),e.nextId&&(m=o.mirror.getNode(e.nextId)),function(e){var t=null;return e.nextId&&(t=o.mirror.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t}(e))return a.push(e);if(!e.node.rootId||o.mirror.getNode(e.node.rootId)){var v=e.node.rootId?o.mirror.getNode(e.node.rootId):o.iframe.contentDocument;if(M(u))o.attachDocumentToIframe(e,u);else{var y=ue(e.node,{doc:v,map:o.mirror.map,skipChild:!0,hackCss:!0,cache:o.cache});if(-1!==e.previousId&&-1!==e.nextId){if("__sn"in u&&u.__sn.type===O.Element&&"textarea"===u.__sn.tagName&&e.node.type===O.Text)try{for(var g=l(Array.from(u.childNodes)),b=g.next();!b.done;b=g.next()){var S=b.value;S.nodeType===u.TEXT_NODE&&u.removeChild(S)}}catch(e){r={error:e}}finally{try{b&&!b.done&&(n=g.return)&&n.call(g)}finally{if(r)throw r.error}}if(h&&h.nextSibling&&h.nextSibling.parentNode)u.insertBefore(y,h.nextSibling);else if(m&&m.parentNode)u.contains(m)?u.insertBefore(y,m):u.insertBefore(y,null);else{if(u===v)for(;v.firstChild;)v.removeChild(v.firstChild);u.appendChild(y)}if(M(y)){var T=o.newDocumentQueue.find((function(e){return e.parentId===y.__sn.id}));T&&(o.attachDocumentToIframe(T,y),o.newDocumentQueue=o.newDocumentQueue.filter((function(e){return e!==T})))}(e.previousId||e.nextId)&&o.legacy_resolveMissingNode(i,u,y,e)}else i[e.node.id]={node:y,mutation:e}}}};e.adds.forEach((function(e){c(e)}));for(var u=Date.now();a.length;){var d=C(a);if(a.length=0,Date.now()-u>500){this.warn("Timeout in the loop, please check the resolve tree data:",d);break}try{for(var p=(r=void 0,l(d)),f=p.next();!f.done;f=p.next()){var h=f.value;this.mirror.getNode(h.value.parentId)?k(h,(function(e){c(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",h)}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),e.texts.forEach((function(t){var r=o.mirror.getNode(t.id);if(!r){if(e.removes.find((function(e){return e.id===t.id})))return;return o.warnNodeNotFound(e,t.id)}o.fragmentParentMap.has(r)&&(r=o.fragmentParentMap.get(r)),r.textContent=t.value})),e.attributes.forEach((function(t){var r=o.mirror.getNode(t.id);if(!r){if(e.removes.find((function(e){return e.id===t.id})))return;return o.warnNodeNotFound(e,t.id)}for(var n in o.fragmentParentMap.has(r)&&(r=o.fragmentParentMap.get(r)),t.attributes)if("string"==typeof n){var i=t.attributes[n];if(null===i)r.removeAttribute(n);else if("string"==typeof i)try{r.setAttribute(n,i)}catch(e){o.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",e)}else if("style"===n){var a=i,s=r;for(var l in a)if(!1===a[l])s.style.removeProperty(l);else if(a[l]instanceof Array){var c=a[l];s.style.setProperty(l,c[0],c[1])}else{var u=a[l];s.style.setProperty(l,u)}}}}))},t.prototype.applyScroll=function(e,t){var r=this.mirror.getNode(e.id);if(!r)return this.debugNodeNotFound(e,e.id);if(r===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if(r.__sn.type===O.Document)r.defaultView.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{r.scrollTop=e.y,r.scrollLeft=e.x}catch(e){}},t.prototype.applyInput=function(e){var t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(e){}},t.prototype.legacy_resolveMissingNode=function(e,t,r,n){var o=n.previousId,i=n.nextId,a=o&&e[o],s=i&&e[i];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,r),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,r.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}},t.prototype.moveAndHover=function(e,t,r,n,o){var i=this.mirror.getNode(r);if(!i)return this.debugNodeNotFound(o,r);var a=N(i,this.iframe),s=e*a.absoluteScale+a.x,l=t*a.absoluteScale+a.y;this.mouse.style.left=s+"px",this.mouse.style.top=l+"px",n||this.drawMouseTail({x:s,y:l}),this.hoverElements(i)},t.prototype.drawMouseTail=function(e){var t=this;if(this.mouseTail){var r=!0===this.config.mouseTail?Ct:Object.assign({},Ct,this.config.mouseTail),n=r.lineCap,o=r.lineWidth,i=r.strokeStyle,a=r.duration,s=function(){if(t.mouseTail){var e=t.mouseTail.getContext("2d");e&&t.tailPositions.length&&(e.clearRect(0,0,t.mouseTail.width,t.mouseTail.height),e.beginPath(),e.lineWidth=o,e.lineCap=n,e.strokeStyle=i,e.moveTo(t.tailPositions[0].x,t.tailPositions[0].y),t.tailPositions.forEach((function(t){return e.lineTo(t.x,t.y)})),e.stroke())}};this.tailPositions.push(e),s(),setTimeout((function(){t.tailPositions=t.tailPositions.filter((function(t){return t!==e})),s()}),a/this.speedService.state.context.timer.speed)}},t.prototype.hoverElements=function(e){var t;null===(t=this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((function(e){e.classList.remove(":hover")}));for(var r=e;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement},t.prototype.isUserInteraction=function(t){return t.type===e.EventType.IncrementalSnapshot&&(t.data.source>e.IncrementalSource.Mutation&&t.data.source<=e.IncrementalSource.Input)},t.prototype.backToNormal=function(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(e.ReplayerEvents.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))},t.prototype.restoreRealParent=function(e,t){this.mirror.map[t.__sn.id]=t,t.__sn.type===O.Element&&"textarea"===t.__sn.tagName&&e.textContent&&(t.value=e.textContent);try{t.appendChild(e),this.restoreState(t)}catch(e){console.warn(e)}},t.prototype.storeState=function(e){var t,r;if(e&&e.nodeType===e.ELEMENT_NODE){var n=e;(n.scrollLeft||n.scrollTop)&&this.elementStateMap.set(e,{scroll:[n.scrollLeft,n.scrollTop]}),"STYLE"===n.tagName&&function(e,t){var r;try{var n=Array.from((null===(r=e.sheet)||void 0===r?void 0:r.cssRules)||[]).map((function(e){return e.cssText}));t.set(e,[{type:vt.Snapshot,cssTexts:n}])}catch(e){}}(n,this.virtualStyleRulesMap);var o=n.children;try{for(var i=l(Array.from(o)),a=i.next();!a.done;a=i.next()){var s=a.value;this.storeState(s)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}}},t.prototype.restoreState=function(e){var t,r;if(e.nodeType===e.ELEMENT_NODE){var n=e;if(this.elementStateMap.has(e)){var o=this.elementStateMap.get(e);o.scroll&&(n.scrollLeft=o.scroll[0],n.scrollTop=o.scroll[1]),this.elementStateMap.delete(e)}var i=n.children;try{for(var a=l(Array.from(i)),s=a.next();!s.done;s=a.next()){var c=s.value;this.restoreState(c)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}}},t.prototype.restoreNodeSheet=function(e){var t=this.virtualStyleRulesMap.get(e);"STYLE"===e.nodeName&&(t&&bt(t,e))},t.prototype.warnNodeNotFound=function(e,t){this.treeIndex.idRemoved(t)?this.warn("Node with id '"+t+"' was previously removed. ",e):this.warn("Node with id '"+t+"' not found. ",e)},t.prototype.warnCanvasMutationFailed=function(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)},t.prototype.debugNodeNotFound=function(e,t){this.treeIndex.idRemoved(t)?this.debug("[replayer]","Node with id '"+t+"' was previously removed. ",e):this.debug("[replayer]","Node with id '"+t+"' not found. ",e)},t.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showWarning&&console.warn.apply(console,u(["[replayer]"],e))},t.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showDebug&&console.log.apply(console,u(["[replayer]"],e))},t}(),Nt={key:"_sid"},Rt=$e.addCustomEvent,_t=$e.freezePage;return e.Replayer=Mt,e.addCustomEvent=Rt,e.freezePage=_t,e.getRecordSequentialIdPlugin=function(e){var t=e?Object.assign({},Nt,e):Nt,r=0;return{name:"rrweb/sequential-id@1",eventProcessor:function(e){var n;return Object.assign(e,((n={})[t.key]=++r,n)),e},options:t}},e.record=$e,e.utils=A,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
18
+ ***************************************************************************** */function Tr(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(l){o={error:l}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return a}var Me;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Me||(Me={}));var Nr={type:"xstate.init"};function gt(e){return e===void 0?[]:[].concat(e)}function ve(e){return{type:"xstate.assign",assignment:e}}function Er(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function Ye(e){return function(t){return e===t}}function wr(e){return typeof e=="string"?{type:e}:e}function Cr(e,t){return{value:e,context:t,actions:[],changed:!1,matches:Ye(e)}}function Ir(e,t,r){var n=t,o=!1;return[e.filter(function(s){if(s.type==="xstate.assign"){o=!0;var a=Object.assign({},n);return typeof s.assignment=="function"?a=s.assignment(n,r):Object.keys(s.assignment).forEach(function(l){a[l]=typeof s.assignment[l]=="function"?s.assignment[l](n,r):s.assignment[l]}),n=a,!1}return!0}),n,o]}function Mr(e,t){t===void 0&&(t={});var r=Tr(Ir(gt(e.states[e.initial].entry).map(function(a){return Er(a,t.actions)}),e.context,Nr),2),n=r[0],o=r[1],s={config:e,_options:t,initialState:{value:e.initial,actions:n,context:o,matches:Ye(e.initial)},transition:function(a,l){var c,i,u=typeof a=="string"?{value:a,context:e.context}:a,d=u.value,m=u.context,h=wr(l),g=e.states[d];if(g.on){var f=gt(g.on[h.type]);try{for(var S=function($){var L=typeof Symbol=="function"&&Symbol.iterator,v=L&&$[L],y=0;if(v)return v.call($);if($&&typeof $.length=="number")return{next:function(){return $&&y>=$.length&&($=void 0),{value:$&&$[y++],done:!$}}};throw new TypeError(L?"Object is not iterable.":"Symbol.iterator is not defined.")}(f),p=S.next();!p.done;p=S.next()){var b=p.value;if(b===void 0)return Cr(d,m);var N=typeof b=="string"?{target:b}:b,I=N.target,P=N.actions,A=P===void 0?[]:P,C=N.cond,w=C===void 0?function(){return!0}:C,H=I===void 0,X=I??d,Z=e.states[X];if(w(m,h)){var J=Tr(Ir((H?gt(A):[].concat(g.exit,A,Z.entry).filter(function($){return $})).map(function($){return Er($,s._options.actions)}),m,h),3),B=J[0],ne=J[1],K=J[2],G=I??d;return{value:G,context:ne,actions:B,changed:I!==d||B.length>0||K,matches:Ye(G)}}}}catch($){c={error:$}}finally{try{p&&!p.done&&(i=S.return)&&i.call(S)}finally{if(c)throw c.error}}}return Cr(d,m)}};return s}var xr=function(e,t){return e.actions.forEach(function(r){var n=r.exec;return n&&n(e.context,t)})};function Dr(e){var t=e.initialState,r=Me.NotStarted,n=new Set,o={_machine:e,send:function(s){r===Me.Running&&(t=e.transition(t,s),xr(t,wr(s)),n.forEach(function(a){return a(t)}))},subscribe:function(s){return n.add(s),s(t),{unsubscribe:function(){return n.delete(s)}}},start:function(s){if(s){var a=typeof s=="object"?s:{context:e.config.context,value:s};t={value:a.value,actions:[],context:a.context,matches:Ye(a.value)}}return r=Me.Running,xr(t,Nr),o},stop:function(){return r=Me.Stopped,n.clear(),o},get state(){return t},get status(){return r}};return o}var Go=Object.defineProperty,Bo=Object.defineProperties,zo=Object.getOwnPropertyDescriptors,kr=Object.getOwnPropertySymbols,Ho=Object.prototype.hasOwnProperty,Yo=Object.prototype.propertyIsEnumerable,Rr=(e,t,r)=>t in e?Go(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xe=(e,t)=>{for(var r in t||(t={}))Ho.call(t,r)&&Rr(e,r,t[r]);if(kr)for(var r of kr(t))Yo.call(t,r)&&Rr(e,r,t[r]);return e},Ze=(e,t)=>Bo(e,zo(t));function Xo(e,t){for(let r=e.length-1;r>=0;r--){const n=e[r];if(n.type===M.Meta&&n.timestamp<=t)return e.slice(r)}return e}function Zo(e,{getCastFn:t,applyEventsSynchronously:r,emitter:n}){const o=Mr({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]},REPLACE_EVENTS:{target:"playing",actions:["replaceEvents"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]},REPLACE_EVENTS:{target:"paused",actions:["replaceEvents"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:ve({lastPlayedEvent:(s,a)=>a.type==="CAST_EVENT"?a.payload.event:s.lastPlayedEvent}),recordTimeOffset:ve((s,a)=>{let l=s.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(l=a.payload.timeOffset),Ze(Xe({},s),{timeOffset:l,baselineTime:s.events[0].timestamp+l})}),play(s){var a;const{timer:l,events:c,baselineTime:i,lastPlayedEvent:u}=s;l.clear();for(const f of c)ft(f,i);const d=Xo(c,i);let m=u?.timestamp;u?.type===M.IncrementalSnapshot&&u.data.source===x.MouseMove&&(m=u.timestamp+((a=u.data.positions[0])==null?void 0:a.timeOffset)),i<(m||0)&&n.emit(O.PlayBack);const h=new Array,g=new Array;for(const f of d)if(!(m&&m<i&&(f.timestamp<=m||f===u)))if(f.timestamp<i)h.push(f);else{const S=t(f,!1);g.push({doAction:()=>{S()},delay:f.delay})}r(h),n.emit(O.Flush),l.addActions(g),l.start()},pause(s){s.timer.clear()},resetLastPlayedEvent:ve(s=>Ze(Xe({},s),{lastPlayedEvent:null})),startLive:ve({baselineTime:(s,a)=>(s.timer.toggleLiveMode(!0),s.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),replaceEvents:ve((s,a)=>{const{events:l,timer:c,baselineTime:i}=s;if(a.type==="REPLACE_EVENTS"){const{events:u}=a.payload;l.length=0;const d=[];for(const m of u)if(ft(m,i),l.push(m),m.timestamp>=c.timeOffset+i){const h=t(m,!1);d.push({doAction:()=>{h()},delay:m.delay})}c.isActive()&&c.replaceActions(d)}return Ze(Xe({},s),{events:l})}),addEvent:ve((s,a)=>{const{baselineTime:l,timer:c,events:i}=s;if(a.type==="ADD_EVENT"){const{event:u}=a.payload;ft(u,l);let d=i.length-1;if(!i[d]||i[d].timestamp<=u.timestamp)i.push(u);else{let g=-1,f=0;for(;f<=d;){const S=Math.floor((f+d)/2);i[S].timestamp<=u.timestamp?f=S+1:d=S-1}g===-1&&(g=f),i.splice(g,0,u)}const m=u.timestamp<l,h=t(u,m);m?h():c.isActive()&&c.addAction({doAction:()=>{h()},delay:u.delay})}return Ze(Xe({},s),{events:i})})}});return Dr(o)}function Ko(e){const t=Mr({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(r,n)=>{"payload"in n&&r.timer.setSpeed(n.payload.speed)},recordSpeed:ve({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return Dr(t)}const Qo=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }",`.${e} { background: currentColor; border-radius: 5px; }`,`.${e}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`];var Jo=(e,t,r)=>new Promise((n,o)=>{var s=c=>{try{l(r.next(c))}catch(i){o(i)}},a=c=>{try{l(r.throw(c))}catch(i){o(i)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});const Or=new Map;function Ar(e,t){let r=Or.get(e);return r||(r=new Map,Or.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function he(e,t,r){return n=>Jo(this,null,function*(){if(n&&typeof n=="object"&&"rr_type"in n)if(r&&(r.isUnchanged=!1),n.rr_type==="ImageBitmap"&&"args"in n){const o=yield he(e,t,r)(n.args);return yield createImageBitmap.apply(null,o)}else if("index"in n){if(r||t===null)return n;const{rr_type:o,index:s}=n;return Ar(t,o)[s]}else if("args"in n){const{rr_type:o,args:s}=n,a=window[o];return new a(...yield Promise.all(s.map(he(e,t,r))))}else{if("base64"in n)return Zn(n.base64);if("src"in n){const o=e.get(n.src);if(o)return o;{const s=new Image;return s.src=n.src,e.set(n.src,s),s}}else if("data"in n&&n.rr_type==="Blob"){const o=yield Promise.all(n.data.map(he(e,t,r)));return new Blob(o,{type:n.type})}}else if(Array.isArray(n))return yield Promise.all(n.map(he(e,t,r)));return n})}var qo=(e,t,r)=>new Promise((n,o)=>{var s=c=>{try{l(r.next(c))}catch(i){o(i)}},a=c=>{try{l(r.throw(c))}catch(i){o(i)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});function ei(e,t){try{return t===ce.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const ti=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function ri(e,t){if(!(t!=null&&t.constructor))return;const{name:r}=t.constructor;if(!ti.includes(r))return;const n=Ar(e,r);n.includes(t)||n.push(t)}function ni(e){return qo(this,arguments,function*({mutation:t,target:r,type:n,imageMap:o,errorHandler:s}){try{const a=ei(r,n);if(!a)return;if(t.setter){a[t.property]=t.args[0];return}const l=a[t.property],c=yield Promise.all(t.args.map(he(o,a))),i=l.apply(a,c);ri(a,i)}catch(a){s(t,a)}})}var oi=(e,t,r)=>new Promise((n,o)=>{var s=c=>{try{l(r.next(c))}catch(i){o(i)}},a=c=>{try{l(r.throw(c))}catch(i){o(i)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});function ii(e){return oi(this,arguments,function*({event:t,mutation:r,target:n,imageMap:o,errorHandler:s}){try{const a=n.getContext("2d");if(r.setter){a[r.property]=r.args[0];return}const l=a[r.property];if(r.property==="drawImage"&&typeof r.args[0]=="string"){const c=o.get(t);l.apply(a,r.args)}else{const c=yield Promise.all(r.args.map(he(o,a)));l.apply(a,c)}}catch(a){s(r,a)}})}var si=(e,t,r)=>new Promise((n,o)=>{var s=c=>{try{l(r.next(c))}catch(i){o(i)}},a=c=>{try{l(r.throw(c))}catch(i){o(i)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});function Lr(e){return si(this,arguments,function*({event:t,mutation:r,target:n,imageMap:o,canvasEventMap:s,errorHandler:a}){try{const l=s.get(t)||r,c="commands"in l?l.commands:[l];if([ce.WebGL,ce.WebGL2].includes(r.type)){for(let i=0;i<c.length;i++){const u=c[i];yield ni({mutation:u,type:r.type,target:n,imageMap:o,errorHandler:a})}return}for(let i=0;i<c.length;i++){const u=c[i];yield ii({event:t,mutation:u,target:n,imageMap:o,errorHandler:a})}}catch(l){a(r,l)}})}var ai=Object.defineProperty,li=Object.defineProperties,ci=Object.getOwnPropertyDescriptors,_r=Object.getOwnPropertySymbols,ui=Object.prototype.hasOwnProperty,di=Object.prototype.propertyIsEnumerable,Fr=(e,t,r)=>t in e?ai(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xe=(e,t)=>{for(var r in t||(t={}))ui.call(t,r)&&Fr(e,r,t[r]);if(_r)for(var r of _r(t))di.call(t,r)&&Fr(e,r,t[r]);return e},yt=(e,t)=>li(e,ci(t)),vt=(e,t,r)=>new Promise((n,o)=>{var s=c=>{try{l(r.next(c))}catch(i){o(i)}},a=c=>{try{l(r.throw(c))}catch(i){o(i)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});const Pr=10*1e3,Wr=2*1e3,$r=1*1e3,Vr=60*60*1e3,hi=Sr||Vo,bt="[replayer]",St={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Tt(e){return e.type==M.IncrementalSnapshot&&(e.data.source==x.TouchMove||e.data.source==x.MouseInteraction&&e.data.type==Y.TouchStart)}class mi{constructor(t,r){if(this.usingVirtualDom=!1,this.virtualDom=new Ie,this.mouseTail=null,this.tailPositions=[],this.emitter=hi(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=Ot(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=Et(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,!(r!=null&&r.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const n={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:St,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:Wr};this.config=Object.assign({},n,r),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(O.Resize,this.handleResize),this.setupDom(),this.emitter.on(O.Flush,()=>{if(this.usingVirtualDom){const l={mirror:this.mirror,applyCanvas:(c,i,u)=>{Lr({event:c,mutation:i,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this)};if(ae(this.iframe.contentDocument,this.virtualDom,l,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const c in this.legacy_missingNodeRetryMap)try{const i=this.legacy_missingNodeRetryMap[c],u=pt(i.node,this.mirror,this.virtualDom.mirror);ae(u,i.node,l,this.virtualDom.mirror),i.node=u}catch(i){this.config.showWarning&&console.warn(i)}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null}),this.emitter.on(O.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const o=new jo([],r?.speed||n.speed);this.service=Zo({events:t.map(l=>r&&r.unpackFn?r.unpackFn(l):l).sort((l,c)=>l.timestamp-c.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(l=>{this.emitter.emit(O.StateChange,{player:l})}),this.speedService=Ko({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(O.StateChange,{speed:l})});const s=this.service.state.context.events.find(l=>l.type===M.Meta),a=this.service.state.context.events.find(l=>l.type===M.FullSnapshot);if(s){const{width:l,height:c}=s.data;setTimeout(()=>{this.emitter.emit(O.Resize,{width:l,height:c})},0)}a&&setTimeout(()=>{this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),this.iframe.contentWindow.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(Tt)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,r){return this.emitter.on(t,r),this}off(t,r){return this.emitter.off(t,r),this}setConfig(t){Object.keys(t).forEach(r=>{this.config[r]=t[r]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getActivityIntervals(){if(this.activityIntervals.length==0){const t=[],r=this.getMetaData(),n=[{timestamp:r.startTime},...this.service.state.context.events.filter(a=>this.isUserInteraction(a)),{timestamp:r.endTime}];for(let a=1;a<n.length;a++){const l=n[a-1],c=n[a];c.timestamp-l.timestamp>Pr?t.push({startTime:l.timestamp,endTime:c.timestamp,duration:c.timestamp-l.timestamp,active:!1}):t.push({startTime:l.timestamp,endTime:c.timestamp,duration:c.timestamp-l.timestamp,active:!0})}const o=[];let s=t[0];for(let a=1;a<t.length;a++)t[a].active!=t[a-1].active&&(o.push({startTime:s.startTime,endTime:t[a-1].endTime,duration:t[a-1].endTime-s.startTime,active:t[a-1].active}),s=t[a]);s&&t.length>0&&o.push({startTime:s.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-s.startTime,active:t[t.length-1].active}),s=o[0];for(let a=1;a<o.length;a++)(!o[a].active&&o[a].duration>this.config.inactiveThreshold*r.totalTime||!o[a-1].active&&o[a-1].duration>this.config.inactiveThreshold*r.totalTime)&&(this.activityIntervals.push({startTime:s.startTime,endTime:o[a-1].endTime,duration:o[a-1].endTime-s.startTime,active:o[a-1].active}),s=o[a]);s&&o.length>0&&this.activityIntervals.push({startTime:s.startTime,endTime:o[o.length-1].endTime,duration:o[o.length-1].endTime-s.startTime,active:o[o.length-1].active})}return this.activityIntervals}getMetaData(){const t=this.service.state.context.events[0],r=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:r.timestamp,totalTime:r.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:t,events:r}=this.service.state.context;return t-r[0].timestamp}getMirror(){return this.mirror}play(t=0){var r,n;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.remove("rrweb-paused"),this.emitter.emit(O.Start),this.handleInactivity(this.getMetaData().startTime+t,!0)}pause(t){var r,n;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.add("rrweb-paused"),this.emitter.emit(O.Pause)}resume(t=0){console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(O.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const r=this.config.unpackFn?this.config.unpackFn(t):t;Tt(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:r}}))}replaceEvents(t){for(const r of t)if(Tt(r)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events:t}})}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=Ot()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(Uo(this.iframe.contentWindow,this.iframe.contentDocument),it(this.iframe.contentWindow))}handleResize(t){this.iframe.style.display="inherit";for(const r of[this.mouseTail,this.iframe])!r||(r.setAttribute("width",String(t.width)),r.setAttribute("height",String(t.height)))}applyEventsSynchronously(t){for(const r of t){switch(r.type){case M.DomContentLoaded:case M.Load:case M.Custom:continue;case M.FullSnapshot:case M.Meta:case M.Plugin:case M.IncrementalSnapshot:break}this.getCastFn(r,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null}getCastFn(t,r=!1){let n;switch(t.type){case M.DomContentLoaded:case M.Load:break;case M.Custom:n=()=>{this.emitter.emit(O.CustomEvent,t)};break;case M.Meta:n=()=>this.emitter.emit(O.Resize,{width:t.data.width,height:t.data.height});break;case M.FullSnapshot:n=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===t){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(t,r),this.iframe.contentWindow.scrollTo(t.data.initialOffset)};break;case M.IncrementalSnapshot:n=()=>{if(this.applyIncremental(t,r),!r&&(this.handleInactivity(t.timestamp),t===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const o of this.service.state.context.events)if(!(o.timestamp<=t.timestamp)&&this.isUserInteraction(o)){o.delay-t.delay>Pr*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=o);break}if(this.nextUserInteractionEvent){const o=this.nextUserInteractionEvent.delay-t.delay,s={speed:Math.min(Math.round(o/Wr),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:s}),this.emitter.emit(O.SkipStart,s)}}};break}return()=>{n&&n();for(const s of this.config.plugins||[])s.handler(t,r,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:t}});const o=this.service.state.context.events.length-1;if(t===this.service.state.context.events[o]){const s=()=>{o<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(O.Finish))};t.type===M.IncrementalSnapshot&&t.data.source===x.MouseMove&&t.data.positions.length?setTimeout(()=>{s()},Math.max(0,-t.data.positions[0].timeOffset+50)):s()}this.emitter.emit(O.EventCast,t)}}handleInactivity(t,r){if((t===this.inactiveEndTimestamp||r)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const n of this.getActivityIntervals())if(t>=n.startTime&&t<n.endTime&&!n.active){this.inactiveEndTimestamp=n.endTime;break}if(this.inactiveEndTimestamp){const n=this.inactiveEndTimestamp-t,o={speed:n/Vr*this.config.inactiveSkipTime<$r?n/$r:Math.round(Math.max(n,Vr)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:o}),this.emitter.emit(O.SkipStart,o)}}}rebuildFullSnapshot(t,r=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const n=[];Sn(t.data.node,{doc:this.iframe.contentDocument,afterAppend:a=>{this.collectIframeAndAttachDocument(n,a)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:a,builtNode:l}of n)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a);const{documentElement:o,head:s}=this.iframe.contentDocument;this.insertStyleRules(o,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(O.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){const n=Qo(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&n.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,br(o,this.virtualDom.unserializedId)),t.insertBefore(o,r);for(let s=0;s<n.length;s++)o.rules.push({cssText:n[s],type:se.Insert,index:s})}else{const o=document.createElement("style");t.insertBefore(o,r);for(let s=0;s<n.length;s++)o.sheet.insertRule(n[s],s)}}attachDocumentToIframe(t,r){const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[];je(t.node,{doc:r.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:s=>{this.collectIframeAndAttachDocument(o,s);const a=n.getMeta(s);if(a?.type===k.Element&&a?.tagName.toUpperCase()==="HTML"){const{documentElement:l,head:c}=r.contentDocument;this.insertStyleRules(l,c)}},cache:this.cache});for(const{mutationInQueue:s,builtNode:a}of o)this.attachDocumentToIframe(s,a),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==s)}collectIframeAndAttachDocument(t,r){if(Ee(r,this.mirror)){const n=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(r));n&&t.push({mutationInQueue:n,builtNode:r})}}waitForStylesheetLoad(){var t;const r=(t=this.iframe.contentDocument)==null?void 0:t.head;if(r){const n=new Set;let o,s=this.service.state;const a=()=>{s=this.service.state};this.emitter.on(O.Start,a),this.emitter.on(O.Pause,a);const l=()=>{this.emitter.off(O.Start,a),this.emitter.off(O.Pause,a)};r.querySelectorAll('link[rel="stylesheet"]').forEach(c=>{c.sheet||(n.add(c),c.addEventListener("load",()=>{n.delete(c),n.size===0&&o!==-1&&(s.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(O.LoadStylesheetEnd),o&&clearTimeout(o),l())}))}),n.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(O.LoadStylesheetStart),o=setTimeout(()=>{s.matches("playing")&&this.play(this.getCurrentTime()),o=-1,l()},this.config.loadTimeout))}}hasImageArg(t){for(const r of t)if(!(!r||typeof r!="object")){if("rr_type"in r&&"args"in r){if(this.hasImageArg(r.args))return!0}else if("rr_type"in r&&r.rr_type==="HTMLImageElement"||r instanceof Array&&this.hasImageArg(r))return!0}return!1}getImageArgs(t){const r=[];for(const n of t)!n||typeof n!="object"||("rr_type"in n&&"args"in n?r.push(...this.getImageArgs(n.args)):"rr_type"in n&&n.rr_type==="HTMLImageElement"?r.push(n.src):n instanceof Array&&r.push(...this.getImageArgs(n)));return r}preloadAllImages(){return vt(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(O.Start,t),this.emitter.on(O.Pause,t);const r=[];for(const n of this.service.state.context.events)n.type===M.IncrementalSnapshot&&n.data.source===x.CanvasMutation&&(r.push(this.deserializeAndPreloadCanvasEvents(n.data,n)),("commands"in n.data?n.data.commands:[n.data]).forEach(o=>{this.preloadImages(o,n)}));return Promise.all(r)})}preloadImages(t,r){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(r)){const n=document.createElement("canvas"),o=n.getContext("2d"),s=o?.createImageData(n.width,n.height);s?.data,JSON.parse(t.args[0]),o?.putImageData(s,0,0)}}deserializeAndPreloadCanvasEvents(t,r){return vt(this,null,function*(){if(!this.canvasEventMap.has(r)){const n={isUnchanged:!0};if("commands"in t){const o=yield Promise.all(t.commands.map(s=>vt(this,null,function*(){const a=yield Promise.all(s.args.map(he(this.imageMap,null,n)));return yt(xe({},s),{args:a})})));n.isUnchanged===!1&&this.canvasEventMap.set(r,yt(xe({},t),{commands:o}))}else{const o=yield Promise.all(t.args.map(he(this.imageMap,null,n)));n.isUnchanged===!1&&this.canvasEventMap.set(r,yt(xe({},t),{args:o}))}}})}applyIncremental(t,r){var n,o,s,a,l,c;const{data:i}=t;switch(i.source){case x.Mutation:{try{this.applyMutation(i,r)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,i)}break}case x.Drag:case x.TouchMove:case x.MouseMove:if(r){const u=i.positions[i.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:i}}else i.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,r,i)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:t.delay-((n=i.positions[0])==null?void 0:n.timeOffset)});break;case x.MouseInteraction:{if(i.id===-1||r)break;const u=new Event(Y[i.type].toLowerCase()),d=this.mirror.getNode(i.id);if(!d)return this.debugNodeNotFound(i,i.id);this.emitter.emit(O.MouseInteraction,{type:i.type,target:d});const{triggerFocus:m}=this.config;switch(i.type){case Y.Blur:"blur"in d&&d.blur();break;case Y.Focus:m&&d.focus&&d.focus({preventScroll:!0});break;case Y.Click:case Y.TouchStart:case Y.TouchEnd:r?(i.type===Y.TouchStart?this.touchActive=!0:i.type===Y.TouchEnd&&(this.touchActive=!1),this.mousePos={x:i.x,y:i.y,id:i.id,debugData:i}):(i.type===Y.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(i.x,i.y,i.id,r,i),i.type===Y.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):i.type===Y.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):i.type===Y.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case Y.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case x.Scroll:{if(i.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);u.scrollData=i;break}this.applyScroll(i,r);break}case x.ViewportResize:this.emitter.emit(O.Resize,{width:i.width,height:i.height});break;case x.Input:{if(i.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);u.inputData=i;break}this.applyInput(i);break}case x.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(i.id):this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u;try{i.currentTime&&(d.currentTime=i.currentTime),i.volume&&(d.volume=i.volume),i.muted&&(d.muted=i.muted),i.type===fe.Pause&&d.pause(),i.type===fe.Play&&d.play()}catch(m){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${m.message||m}`)}break}case x.StyleSheetRule:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.rules;(o=i.adds)==null||o.forEach(({rule:m,index:h})=>d?.push({cssText:m,index:h,type:se.Insert})),(s=i.removes)==null||s.forEach(({index:m})=>d?.push({index:m,type:se.Remove}))}else{const u=this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.sheet;(a=i.adds)==null||a.forEach(({rule:m,index:h})=>{try{if(Array.isArray(h)){const{positions:g,index:f}=lt(h);we(d.cssRules,g).insertRule(m,f)}else{const g=h===void 0?void 0:Math.min(h,d.cssRules.length);d.insertRule(m,g)}}catch{}}),(l=i.removes)==null||l.forEach(({index:m})=>{try{if(Array.isArray(m)){const{positions:h,index:g}=lt(m);we(d.cssRules,h).deleteRule(g||0)}else d?.deleteRule(m)}catch{}})}break}case x.StyleDeclaration:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.rules;i.set&&d.push(xe({type:se.SetProperty,index:i.index},i.set)),i.remove&&d.push(xe({type:se.RemoveProperty,index:i.index},i.remove))}else{const u=this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.sheet;i.set&&we(d.rules,i.index).style.setProperty(i.set.property,i.set.value,i.set.priority),i.remove&&we(d.rules,i.index).style.removeProperty(i.remove.property)}break}case x.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);u.canvasMutations.push({event:t,mutation:i})}else{const u=this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);Lr({event:t,mutation:i,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case x.Font:{try{const u=new FontFace(i.family,i.buffer?new Uint8Array(JSON.parse(i.fontSource)):i.fontSource,i.descriptors);(c=this.iframe.contentDocument)==null||c.fonts.add(u)}catch(u){this.config.showWarning&&console.warn(u)}break}}}applyMutation(t,r){if(this.config.useVirtualDom&&!this.usingVirtualDom&&r&&(this.usingVirtualDom=!0,Po(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const i in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[i],d=vr(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(i=>{var u;const d=n.getNode(i.id);if(!d)return t.removes.find(h=>h.id===i.parentId)?void 0:this.warnNodeNotFound(t,i.id);let m=n.getNode(i.parentId);if(!m)return this.warnNodeNotFound(t,i.parentId);if(i.isShadow&&Ae(m)&&(m=m.shadowRoot),n.removeNodeFromMap(d),m)try{m.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&m.nodeName==="STYLE"&&((u=m.rules)==null?void 0:u.length)>0&&(m.rules=[])}catch(h){if(h instanceof DOMException)this.warn("parent could not remove child in mutation",m,d,t);else throw h}});const o=xe({},this.legacy_missingNodeRetryMap),s=[],a=i=>{let u=null;return i.nextId&&(u=n.getNode(i.nextId)),i.nextId!==null&&i.nextId!==void 0&&i.nextId!==-1&&!u},l=i=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=n.getNode(i.parentId);if(!d)return i.node.type===k.Document?this.newDocumentQueue.push(i):s.push(i);i.node.isShadow&&(Ae(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let m=null,h=null;if(i.previousId&&(m=n.getNode(i.previousId)),i.nextId&&(h=n.getNode(i.nextId)),a(i))return s.push(i);if(i.node.rootId&&!n.getNode(i.node.rootId))return;const g=i.node.rootId?n.getNode(i.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ee(d,n)){this.attachDocumentToIframe(i,d);return}const f=je(i.node,{doc:g,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache});if(i.previousId===-1||i.nextId===-1){o[i.node.id]={node:f,mutation:i};return}const S=n.getMeta(d);if(S&&S.type===k.Element&&S.tagName==="textarea"&&i.node.type===k.Text){const p=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const b of p)b.nodeType===d.TEXT_NODE&&d.removeChild(b)}if(m&&m.nextSibling&&m.nextSibling.parentNode)d.insertBefore(f,m.nextSibling);else if(h&&h.parentNode)d.contains(h)?d.insertBefore(f,h):d.insertBefore(f,null);else{if(d===g)for(;g.firstChild;)g.removeChild(g.firstChild);d.appendChild(f)}if(this.usingVirtualDom&&f.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),Ee(f,this.mirror)){const p=this.mirror.getId(f),b=this.newDocumentQueue.find(N=>N.parentId===p);b&&(this.attachDocumentToIframe(b,f),this.newDocumentQueue=this.newDocumentQueue.filter(N=>N!==b))}(i.previousId||i.nextId)&&this.legacy_resolveMissingNode(o,d,f,i)};t.adds.forEach(i=>{l(i)});const c=Date.now();for(;s.length;){const i=_t(s);if(s.length=0,Date.now()-c>500){this.warn("Timeout in the loop, please check the resolve tree data:",i);break}for(const u of i)n.getNode(u.value.parentId)?st(u,d=>{l(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(o).length&&Object.assign(this.legacy_missingNodeRetryMap,o),Pt(t.texts).forEach(i=>{var u;const d=n.getNode(i.id);if(!d)return t.removes.find(m=>m.id===i.id)?void 0:this.warnNodeNotFound(t,i.id);if(d.textContent=i.value,this.usingVirtualDom){const m=d.parentNode;((u=m?.rules)==null?void 0:u.length)>0&&(m.rules=[])}}),t.attributes.forEach(i=>{const u=n.getNode(i.id);if(!u)return t.removes.find(d=>d.id===i.id)?void 0:this.warnNodeNotFound(t,i.id);for(const d in i.attributes)if(typeof d=="string"){const m=i.attributes[d];if(m===null)u.removeAttribute(d);else if(typeof m=="string")try{u.setAttribute(d,m)}catch(h){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",h)}else if(d==="style"){const h=m,g=u;for(const f in h)if(h[f]===!1)g.style.removeProperty(f);else if(h[f]instanceof Array){const S=h[f];g.style.setProperty(f,S[0],S[1])}else{const S=h[f];g.style.setProperty(f,S)}}}})}applyScroll(t,r){const n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);const o=this.mirror.getMeta(n);if(n===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else if(o?.type===k.Document)n.defaultView.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else try{n.scrollTop=t.y,n.scrollLeft=t.x}catch{}}applyInput(t){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);try{r.checked=t.isChecked,r.value=t.text}catch{}}legacy_resolveMissingNode(t,r,n,o){const{previousId:s,nextId:a}=o,l=s&&t[s],c=a&&t[a];if(l){const{node:i,mutation:u}=l;r.insertBefore(i,n),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,i,u)}if(c){const{node:i,mutation:u}=c;r.insertBefore(i,n.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,i,u)}}moveAndHover(t,r,n,o,s){const a=this.mirror.getNode(n);if(!a)return this.debugNodeNotFound(s,n);const l=at(a,this.iframe),c=t*l.absoluteScale+l.x,i=r*l.absoluteScale+l.y;this.mouse.style.left=`${c}px`,this.mouse.style.top=`${i}px`,o||this.drawMouseTail({x:c,y:i}),this.hoverElements(a)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:r,lineWidth:n,strokeStyle:o,duration:s}=this.config.mouseTail===!0?St:Object.assign({},St,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const l=this.mouseTail.getContext("2d");!l||!this.tailPositions.length||(l.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),l.beginPath(),l.lineWidth=n,l.lineCap=r,l.strokeStyle=o,l.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(c=>l.lineTo(c.x,c.y)),l.stroke())};this.tailPositions.push(t),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(l=>l!==t),a()},s/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.iframe.contentDocument)==null||r.querySelectorAll(".\\:hover").forEach(o=>{o.classList.remove(":hover")});let n=t;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(t){return t.type!==M.IncrementalSnapshot?!1:t.data.source>x.Mutation&&t.data.source<=x.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(O.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,r){this.warn(`Node with id '${r}' not found. `,t)}warnCanvasMutationFailed(t,r){this.warn("Has error on canvas update",r,"canvas mutation:",t)}debugNodeNotFound(t,r){this.debug(bt,`Node with id '${r}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn(bt,...t)}debug(...t){!this.config.showDebug||console.log(bt,...t)}}const{addCustomEvent:pi}=ye,{freezePage:fi}=ye;return q.EventType=M,q.IncrementalSource=x,q.MouseInteractions=Y,q.Replayer=mi,q.ReplayerEvents=O,q.addCustomEvent=pi,q.freezePage=fi,q.record=ye,q.utils=Tn,Object.defineProperty(q,"__esModule",{value:!0}),q}({});
30
19
  //# sourceMappingURL=rrweb.min.js.map