@amplitude/rrweb-player 2.0.0-alpha.15 → 2.0.0-alpha.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- function e(){}function t(e,t){for(const n in t)e[n]=t[n];return e}function n(e){return e()}function i(){return Object.create(null)}function o(e){e.forEach(n)}function s(e){return"function"==typeof e}function r(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function a(e){const t={};for(const n in e)"$"!==n[0]&&(t[n]=e[n]);return t}function l(e,t){e.appendChild(t)}function c(e,t,n){e.insertBefore(t,n||null)}function u(e){e.parentNode&&e.parentNode.removeChild(e)}function d(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function h(e){return document.createElement(e)}function p(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function f(e){return document.createTextNode(e)}function m(){return f(" ")}function g(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function y(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function v(e,t){t=""+t,e.data!==t&&(e.data=t)}function w(e,t,n,i){null==n?e.style.removeProperty(t):e.style.setProperty(t,n,i?"important":"")}function b(e,t,n){e.classList[n?"add":"remove"](t)}let E;function N(e){E=e}function S(){if(!E)throw new Error("Function called outside component initialization");return E}function T(e){S().$$.on_mount.push(e)}function D(e){S().$$.on_destroy.push(e)}function M(){const e=S();return(t,n,{cancelable:i=!1}={})=>{const o=e.$$.callbacks[t];if(o){const s=function(e,t,{bubbles:n=!1,cancelable:i=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(e,n,i,t),o}(t,n,{cancelable:i});return o.slice().forEach((t=>{t.call(e,s)})),!s.defaultPrevented}return!0}}const C=[],x=[];let R=[];const k=[],A=Promise.resolve();let I=!1;function O(e){R.push(e)}const _=new Set;let $=0;function L(){if(0!==$)return;const e=E;do{try{for(;$<C.length;){const e=C[$];$++,N(e),F(e.$$)}}catch(e){throw C.length=0,$=0,e}for(N(null),C.length=0,$=0;x.length;)x.pop()();for(let e=0;e<R.length;e+=1){const t=R[e];_.has(t)||(_.add(t),t())}R.length=0}while(C.length);for(;k.length;)k.pop()();I=!1,_.clear(),N(e)}function F(e){if(null!==e.fragment){e.update(),o(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(O)}}const P=new Set;let B;function U(){B={r:0,c:[],p:B}}function j(){B.r||o(B.c),B=B.p}function V(e,t){e&&e.i&&(P.delete(e),e.i(t))}function W(e,t,n,i){if(e&&e.o){if(P.has(e))return;P.add(e),B.c.push((()=>{P.delete(e),i&&(n&&e.d(1),i())})),e.o(t)}else i&&i()}function z(e){e&&e.c()}function G(e,t,i,r){const{fragment:a,after_update:l}=e.$$;a&&a.m(t,i),r||O((()=>{const t=e.$$.on_mount.map(n).filter(s);e.$$.on_destroy?e.$$.on_destroy.push(...t):o(t),e.$$.on_mount=[]})),l.forEach(O)}function H(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];R.forEach((i=>-1===e.indexOf(i)?t.push(i):n.push(i))),n.forEach((e=>e())),R=t}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Y(e,t){-1===e.$$.dirty[0]&&(C.push(e),I||(I=!0,A.then(L)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function q(t,n,s,r,a,l,c,d=[-1]){const h=E;N(t);const p=t.$$={fragment:null,ctx:[],props:l,update:e,not_equal:a,bound:i(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(h?h.$$.context:[])),callbacks:i(),dirty:d,skip_bound:!1,root:n.target||h.$$.root};c&&c(p.root);let f=!1;if(p.ctx=s?s(t,n.props||{},((e,n,...i)=>{const o=i.length?i[0]:n;return p.ctx&&a(p.ctx[e],p.ctx[e]=o)&&(!p.skip_bound&&p.bound[e]&&p.bound[e](o),f&&Y(t,e)),n})):[],p.update(),f=!0,o(p.before_update),p.fragment=!!r&&r(p.ctx),n.target){if(n.hydrate){const e=function(e){return Array.from(e.childNodes)}(n.target);p.fragment&&p.fragment.l(e),e.forEach(u)}else p.fragment&&p.fragment.c();n.intro&&V(t.$$.fragment),G(t,n.target,n.anchor,n.customElement),L()}N(h)}class X{$destroy(){H(this,1),this.$destroy=e}$on(t,n){if(!s(n))return e;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const e=i.indexOf(n);-1!==e&&i.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var Q;function J(e){return e.nodeType===e.ELEMENT_NODE}!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"}(Q||(Q={}));class Z{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function K(){return new Z}const ee=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function te(e,t={}){let n=1,i=1;function o(e){const t=e.match(/\n/g);t&&(n+=t.length);const o=e.lastIndexOf("\n");i=-1===o?i+e.length:e.length-o}function s(){const e={line:n,column:i};return t=>(t.position=new r(e),p(),t)}class r{constructor(e){this.start=e,this.end={line:n,column:i},this.source=t.source}}r.prototype.content=e;const a=[];function l(o){const s=new Error(`${t.source||""}:${n}:${i}: ${o}`);if(s.reason=o,s.filename=t.source,s.line=n,s.column=i,s.source=e,!t.silent)throw s;a.push(s)}function c(){return h(/^{\s*/)}function u(){return h(/^}/)}function d(){let t;const n=[];for(p(),f(n);e.length&&"}"!==e.charAt(0)&&(t=T()||D());)t&&(n.push(t),f(n));return n}function h(t){const n=t.exec(e);if(!n)return;const i=n[0];return o(i),e=e.slice(i.length),n}function p(){h(/^\s*/)}function f(e=[]){let t;for(;t=m();)t&&e.push(t),t=m();return e}function m(){const t=s();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return l("End of comment missing");const r=e.slice(2,n-2);return i+=2,o(r),e=e.slice(n),i+=2,t({type:"comment",comment:r})}function g(){for(p();"}"==e[0];)l("extra closing bracket"),e=e.slice(1),p();const t=h(/^(("(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^{])+)/);if(!t)return;const n=t[0].trim().replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(e=>e.replace(/,/g,"‌")));return function(e){const t=[];let n="",i=0,o=0;for(const s of e)"("===s?i++:")"===s?i--:"["===s?o++:"]"===s&&o--,","===s&&0===i&&0===o?(t.push(n),n=""):n+=s;n&&t.push(n);return t}(n).map((e=>e.replace(/\u200C/g,",").trim()))}function y(){const e=s(),t=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;const n=ne(t[0]);if(!h(/^:\s*/))return l("property missing ':'");const i=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:n.replace(ee,""),value:i?ne(i[0]).replace(ee,""):""});return h(/^[;\s]*/),o}function v(){const e=[];if(!c())return l("missing '{'");let t;for(f(e);t=y();)!1!==t&&(e.push(t),f(e)),t=y();return u()?e:l("missing '}'")}function w(){let e;const t=[],n=s();for(;e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:v()})}const b=S("import"),E=S("charset"),N=S("namespace");function S(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return()=>{const n=s(),i=h(t);if(!i)return;const o={type:e};return o[e]=i[1].trim(),n(o)}}function T(){if("@"===e[0])return function(){const e=s();let t=h(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=h(/^([-\w]+)\s*/),!t)return l("@keyframes missing name");const i=t[1];if(!c())return l("@keyframes missing '{'");let o,r=f();for(;o=w();)r.push(o),r=r.concat(f());return u()?e({type:"keyframes",name:i,vendor:n,keyframes:r}):l("@keyframes missing '}'")}()||function(){const e=s(),t=h(/^@media *([^{]+)/);if(!t)return;const n=ne(t[1]);if(!c())return l("@media missing '{'");const i=f().concat(d());return u()?e({type:"media",media:n,rules:i}):l("@media missing '}'")}()||function(){const e=s(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:ne(t[1]),media:ne(t[2])})}()||function(){const e=s(),t=h(/^@supports *([^{]+)/);if(!t)return;const n=ne(t[1]);if(!c())return l("@supports missing '{'");const i=f().concat(d());return u()?e({type:"supports",supports:n,rules:i}):l("@supports missing '}'")}()||b()||E()||N()||function(){const e=s(),t=h(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=ne(t[1]),i=ne(t[2]);if(!c())return l("@document missing '{'");const o=f().concat(d());return u()?e({type:"document",document:i,vendor:n,rules:o}):l("@document missing '}'")}()||function(){const e=s();if(!h(/^@page */))return;const t=g()||[];if(!c())return l("@page missing '{'");let n,i=f();for(;n=y();)i.push(n),i=i.concat(f());return u()?e({type:"page",selectors:t,declarations:i}):l("@page missing '}'")}()||function(){const e=s();if(!h(/^@host\s*/))return;if(!c())return l("@host missing '{'");const t=f().concat(d());return u()?e({type:"host",rules:t}):l("@host missing '}'")}()||function(){const e=s();if(!h(/^@font-face\s*/))return;if(!c())return l("@font-face missing '{'");let t,n=f();for(;t=y();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):l("@font-face missing '}'")}()}function D(){const e=s(),t=g();return t?(f(),e({type:"rule",selectors:t,declarations:v()})):l("selector missing")}return ie(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function ne(e){return e?e.replace(/^\s+|\s+$/g,""):""}function ie(e,t){const n=e&&"string"==typeof e.type,i=n?e:t;for(const t of Object.keys(e)){const n=e[t];Array.isArray(n)?n.forEach((e=>{ie(e,i)})):n&&"object"==typeof n&&ie(n,i)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}const 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"};const se=/([^\\]):hover/,re=new RegExp(se.source,"g");function ae(e,t){const n=null==t?void 0:t.stylesWithHoverClass.get(e);if(n)return n;const i=te(e,{silent:!0});if(!i.stylesheet)return e;const o=[];if(i.stylesheet.rules.forEach((e=>{"selectors"in e&&(e.selectors||[]).forEach((e=>{se.test(e)&&o.push(e)}))})),0===o.length)return e;const s=new RegExp(o.filter(((e,t)=>o.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))).join("|"),"g"),r=e.replace(s,(e=>{const t=e.replace(re,"$1.\\:hover");return`${e}, ${t}`}));return null==t||t.stylesWithHoverClass.set(e,r),r}function le(){return{stylesWithHoverClass:new Map}}function ce(e,t){const{doc:n,hackCss:i,cache:o}=t;switch(e.type){case Q.Document:return n.implementation.createDocument(null,"",null);case Q.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case Q.Element:{const t=function(e){let t=oe[e.tagName]?oe[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);let s;s=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",t):n.createElement(t);const r={};for(const a in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,a))continue;let l=e.attributes[a];if("option"===t&&"selected"===a&&!1===l)continue;if(null===l)continue;if(!0===l&&(l=""),a.startsWith("rr_")){r[a]=l;continue}const c="textarea"===t&&"value"===a,u="style"===t&&"_cssText"===a;if(u&&i&&"string"==typeof l&&(l=ae(l,o)),!c&&!u||"string"!=typeof l)try{if(e.isSVG&&"xlink:href"===a)s.setAttributeNS("http://www.w3.org/1999/xlink",a,l.toString());else if("onload"===a||"onclick"===a||"onmouse"===a.substring(0,7))s.setAttribute("_"+a,l.toString());else{if("meta"===t&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"===a){s.setAttribute("csp-content",l.toString());continue}("link"!==t||"preload"!==e.attributes.rel&&"modulepreload"!==e.attributes.rel||"script"!==e.attributes.as)&&("link"===t&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")||("img"===t&&e.attributes.srcset&&e.attributes.rr_dataURL?s.setAttribute("rrweb-original-srcset",e.attributes.srcset):s.setAttribute(a,l.toString())))}}catch(e){}else{const e=n.createTextNode(l);for(const e of Array.from(s.childNodes))e.nodeType===s.TEXT_NODE&&s.removeChild(e);s.appendChild(e)}}for(const n in r){const i=r[n];if("canvas"===t&&"rr_dataURL"===n){const e=document.createElement("img");e.onload=()=>{const t=s.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=i.toString(),s.RRNodeType&&(s.rr_dataURL=i.toString())}else if("img"===t&&"rr_dataURL"===n){const t=s;t.currentSrc.startsWith("data:")||(t.setAttribute("rrweb-original-src",e.attributes.src),t.src=i.toString())}if("rr_width"===n)s.style.width=i.toString();else if("rr_height"===n)s.style.height=i.toString();else if("rr_mediaCurrentTime"===n&&"number"==typeof i)s.currentTime=i;else if("rr_mediaState"===n)switch(i){case"played":s.play().catch((e=>console.warn("media playback error",e)));break;case"paused":s.pause()}}if(e.isShadowHost)if(s.shadowRoot)for(;s.shadowRoot.firstChild;)s.shadowRoot.removeChild(s.shadowRoot.firstChild);else s.attachShadow({mode:"open"});return s}case Q.Text:return n.createTextNode(e.isStyle&&i?ae(e.textContent,o):e.textContent);case Q.CDATA:return n.createCDATASection(e.textContent);case Q.Comment:return n.createComment(e.textContent);default:return null}}function ue(e,t){const{doc:n,mirror:i,skipChild:o=!1,hackCss:s=!0,afterAppend:r,cache:a}=t;if(i.has(e.id)){const t=i.getNode(e.id);if(function(e,t){return!(!e||!t||e.type!==t.type)&&(e.type===Q.Document?e.compatMode===t.compatMode:e.type===Q.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===Q.Comment||e.type===Q.Text||e.type===Q.CDATA?e.textContent===t.textContent:e.type===Q.Element&&e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock)}(i.getMeta(t),e))return i.getNode(e.id)}let l=ce(e,{doc:n,hackCss:s,cache:a});if(!l)return null;if(e.rootId&&i.getNode(e.rootId)!==n&&i.replace(e.rootId,n),e.type===Q.Document&&(n.close(),n.open(),"BackCompat"===e.compatMode&&e.childNodes&&e.childNodes[0].type!==Q.DocumentType&&(e.childNodes[0].type===Q.Element&&"xmlns"in e.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===e.childNodes[0].attributes.xmlns?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),l=n),i.add(l,e),(e.type===Q.Document||e.type===Q.Element)&&!o)for(const t of e.childNodes){const o=ue(t,{doc:n,mirror:i,skipChild:!1,hackCss:s,afterAppend:r,cache:a});if(o){if(t.isShadow&&J(l)&&l.shadowRoot)l.shadowRoot.appendChild(o);else if(e.type===Q.Document&&t.type==Q.Element){const e=o;let t=null;e.childNodes.forEach((e=>{"BODY"===e.nodeName&&(t=e)})),t?(e.removeChild(t),l.appendChild(o),e.appendChild(t)):l.appendChild(o)}else l.appendChild(o);r&&r(o,t.id)}else console.warn("Failed to rebuild",t)}return l}function de(e,t){const{doc:n,onVisit:i,hackCss:o=!0,afterAppend:s,cache:r,mirror:a=new Z}=t,l=ue(e,{doc:n,mirror:a,skipChild:!1,hackCss:o,afterAppend:s,cache:r});return function(e,t){for(const i of e.getIds())e.has(i)&&(n=e.getNode(i),t(n));var n}(a,(e=>{i&&i(e),function(e,t){const n=t.getMeta(e);if((null==n?void 0:n.type)!==Q.Element)return;const i=e;for(const e in n.attributes){if(!Object.prototype.hasOwnProperty.call(n.attributes,e)||!e.startsWith("rr_"))continue;const t=n.attributes[e];"rr_scrollLeft"===e&&(i.scrollLeft=t),"rr_scrollTop"===e&&(i.scrollTop=t)}}(e,a)})),l}var he=(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))(he||{}),pe=(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[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(pe||{}),fe=(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))(fe||{}),me=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(me||{}),ge=(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.Destroy="destroy",e))(ge||{});const ye="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.";let ve={map:{},getId:()=>(console.error(ye),-1),getNode:()=>(console.error(ye),null),removeNodeFromMap(){console.error(ye)},has:()=>(console.error(ye),!1),reset(){console.error(ye)}};function we(e){const t={},n=(e,n)=>{const i={value:e,parent:n,children:[]};return t[e.node.id]=i,i},i=[];for(const o of e){const{nextId:e,parentId:s}=o;if(e&&e in t){const s=t[e];if(s.parent){const e=s.parent.children.indexOf(s);s.parent.children.splice(e,0,n(o,s.parent))}else{const e=i.indexOf(s);i.splice(e,0,n(o,null))}}else if(s in t){const e=t[s];e.children.push(n(o,e))}else i.push(n(o,null))}return i}function be(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)be(e.children[n],t)}function Ee(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ne(e,t){var n,i;const o=null===(i=null===(n=e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===i?void 0:i.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=o.getBoundingClientRect(),r=Ne(o,t),a=s.height/o.clientHeight;return{x:s.x*r.relativeScale+r.x,y:s.y*r.relativeScale+r.y,relativeScale:a,absoluteScale:r.absoluteScale*a}}function Se(e){return Boolean(null==e?void 0:e.shadowRoot)}function Te(e,t){const n=e[t[0]];return 1===t.length?n:Te(n.cssRules[t[1]].cssRules,t.slice(2))}function De(e){const t=[...e],n=t.pop();return{positions:t,index:n}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ve=new Proxy(ve,{get:(e,t,n)=>("map"===t&&console.error(ye),Reflect.get(e,t,n))})),/[1-9][0-9]{12}/.test(Date.now().toString());class Me{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}
1
+ function e(){}function t(e,t){for(const n in t)e[n]=t[n];return e}function n(e){return e()}function i(){return Object.create(null)}function o(e){e.forEach(n)}function s(e){return"function"==typeof e}function r(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function a(e){const t={};for(const n in e)"$"!==n[0]&&(t[n]=e[n]);return t}function l(e,t){e.appendChild(t)}function c(e,t,n){e.insertBefore(t,n||null)}function u(e){e.parentNode&&e.parentNode.removeChild(e)}function d(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function h(e){return document.createElement(e)}function p(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function f(e){return document.createTextNode(e)}function m(){return f(" ")}function g(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function y(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function v(e,t){t=""+t,e.data!==t&&(e.data=t)}function w(e,t,n,i){null==n?e.style.removeProperty(t):e.style.setProperty(t,n,i?"important":"")}function b(e,t,n){e.classList[n?"add":"remove"](t)}let E;function N(e){E=e}function S(){if(!E)throw new Error("Function called outside component initialization");return E}function T(e){S().$$.on_mount.push(e)}function D(e){S().$$.on_destroy.push(e)}function M(){const e=S();return(t,n,{cancelable:i=!1}={})=>{const o=e.$$.callbacks[t];if(o){const s=function(e,t,{bubbles:n=!1,cancelable:i=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(e,n,i,t),o}(t,n,{cancelable:i});return o.slice().forEach((t=>{t.call(e,s)})),!s.defaultPrevented}return!0}}const C=[],x=[];let R=[];const k=[],A=Promise.resolve();let I=!1;function O(e){R.push(e)}const _=new Set;let $=0;function L(){if(0!==$)return;const e=E;do{try{for(;$<C.length;){const e=C[$];$++,N(e),F(e.$$)}}catch(e){throw C.length=0,$=0,e}for(N(null),C.length=0,$=0;x.length;)x.pop()();for(let e=0;e<R.length;e+=1){const t=R[e];_.has(t)||(_.add(t),t())}R.length=0}while(C.length);for(;k.length;)k.pop()();I=!1,_.clear(),N(e)}function F(e){if(null!==e.fragment){e.update(),o(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(O)}}const P=new Set;let B;function U(){B={r:0,c:[],p:B}}function j(){B.r||o(B.c),B=B.p}function V(e,t){e&&e.i&&(P.delete(e),e.i(t))}function W(e,t,n,i){if(e&&e.o){if(P.has(e))return;P.add(e),B.c.push((()=>{P.delete(e),i&&(n&&e.d(1),i())})),e.o(t)}else i&&i()}function z(e){e&&e.c()}function G(e,t,i,r){const{fragment:a,after_update:l}=e.$$;a&&a.m(t,i),r||O((()=>{const t=e.$$.on_mount.map(n).filter(s);e.$$.on_destroy?e.$$.on_destroy.push(...t):o(t),e.$$.on_mount=[]})),l.forEach(O)}function H(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];R.forEach((i=>-1===e.indexOf(i)?t.push(i):n.push(i))),n.forEach((e=>e())),R=t}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Y(e,t){-1===e.$$.dirty[0]&&(C.push(e),I||(I=!0,A.then(L)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function q(t,n,s,r,a,l,c,d=[-1]){const h=E;N(t);const p=t.$$={fragment:null,ctx:[],props:l,update:e,not_equal:a,bound:i(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(h?h.$$.context:[])),callbacks:i(),dirty:d,skip_bound:!1,root:n.target||h.$$.root};c&&c(p.root);let f=!1;if(p.ctx=s?s(t,n.props||{},((e,n,...i)=>{const o=i.length?i[0]:n;return p.ctx&&a(p.ctx[e],p.ctx[e]=o)&&(!p.skip_bound&&p.bound[e]&&p.bound[e](o),f&&Y(t,e)),n})):[],p.update(),f=!0,o(p.before_update),p.fragment=!!r&&r(p.ctx),n.target){if(n.hydrate){const e=function(e){return Array.from(e.childNodes)}(n.target);p.fragment&&p.fragment.l(e),e.forEach(u)}else p.fragment&&p.fragment.c();n.intro&&V(t.$$.fragment),G(t,n.target,n.anchor,n.customElement),L()}N(h)}class X{$destroy(){H(this,1),this.$destroy=e}$on(t,n){if(!s(n))return e;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const e=i.indexOf(n);-1!==e&&i.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var Q;function J(e){return e.nodeType===e.ELEMENT_NODE}!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"}(Q||(Q={}));class Z{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function K(){return new Z}const ee=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function te(e,t={}){let n=1,i=1;function o(e){const t=e.match(/\n/g);t&&(n+=t.length);const o=e.lastIndexOf("\n");i=-1===o?i+e.length:e.length-o}function s(){const e={line:n,column:i};return t=>(t.position=new r(e),p(),t)}class r{constructor(e){this.start=e,this.end={line:n,column:i},this.source=t.source}}r.prototype.content=e;const a=[];function l(o){const s=new Error(`${t.source||""}:${n}:${i}: ${o}`);if(s.reason=o,s.filename=t.source,s.line=n,s.column=i,s.source=e,!t.silent)throw s;a.push(s)}function c(){return h(/^{\s*/)}function u(){return h(/^}/)}function d(){let t;const n=[];for(p(),f(n);e.length&&"}"!==e.charAt(0)&&(t=T()||D());)t&&(n.push(t),f(n));return n}function h(t){const n=t.exec(e);if(!n)return;const i=n[0];return o(i),e=e.slice(i.length),n}function p(){h(/^\s*/)}function f(e=[]){let t;for(;t=m();)t&&e.push(t),t=m();return e}function m(){const t=s();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return l("End of comment missing");const r=e.slice(2,n-2);return i+=2,o(r),e=e.slice(n),i+=2,t({type:"comment",comment:r})}function g(){for(p();"}"==e[0];)l("extra closing bracket"),e=e.slice(1),p();const t=h(/^(("(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^{])+)/);if(!t)return;const n=t[0].trim().replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(e=>e.replace(/,/g,"‌")));return function(e){const t=[];let n="",i=0,o=0;for(const s of e)"("===s?i++:")"===s?i--:"["===s?o++:"]"===s&&o--,","===s&&0===i&&0===o?(t.push(n),n=""):n+=s;n&&t.push(n);return t}(n).map((e=>e.replace(/\u200C/g,",").trim()))}function y(){const e=s(),t=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;const n=ne(t[0]);if(!h(/^:\s*/))return l("property missing ':'");const i=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:n.replace(ee,""),value:i?ne(i[0]).replace(ee,""):""});return h(/^[;\s]*/),o}function v(){const e=[];if(!c())return l("missing '{'");let t;for(f(e);t=y();)!1!==t&&(e.push(t),f(e)),t=y();return u()?e:l("missing '}'")}function w(){let e;const t=[],n=s();for(;e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:v()})}const b=S("import"),E=S("charset"),N=S("namespace");function S(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return()=>{const n=s(),i=h(t);if(!i)return;const o={type:e};return o[e]=i[1].trim(),n(o)}}function T(){if("@"===e[0])return function(){const e=s();let t=h(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=h(/^([-\w]+)\s*/),!t)return l("@keyframes missing name");const i=t[1];if(!c())return l("@keyframes missing '{'");let o,r=f();for(;o=w();)r.push(o),r=r.concat(f());return u()?e({type:"keyframes",name:i,vendor:n,keyframes:r}):l("@keyframes missing '}'")}()||function(){const e=s(),t=h(/^@media *([^{]+)/);if(!t)return;const n=ne(t[1]);if(!c())return l("@media missing '{'");const i=f().concat(d());return u()?e({type:"media",media:n,rules:i}):l("@media missing '}'")}()||function(){const e=s(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:ne(t[1]),media:ne(t[2])})}()||function(){const e=s(),t=h(/^@supports *([^{]+)/);if(!t)return;const n=ne(t[1]);if(!c())return l("@supports missing '{'");const i=f().concat(d());return u()?e({type:"supports",supports:n,rules:i}):l("@supports missing '}'")}()||b()||E()||N()||function(){const e=s(),t=h(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=ne(t[1]),i=ne(t[2]);if(!c())return l("@document missing '{'");const o=f().concat(d());return u()?e({type:"document",document:i,vendor:n,rules:o}):l("@document missing '}'")}()||function(){const e=s();if(!h(/^@page */))return;const t=g()||[];if(!c())return l("@page missing '{'");let n,i=f();for(;n=y();)i.push(n),i=i.concat(f());return u()?e({type:"page",selectors:t,declarations:i}):l("@page missing '}'")}()||function(){const e=s();if(!h(/^@host\s*/))return;if(!c())return l("@host missing '{'");const t=f().concat(d());return u()?e({type:"host",rules:t}):l("@host missing '}'")}()||function(){const e=s();if(!h(/^@font-face\s*/))return;if(!c())return l("@font-face missing '{'");let t,n=f();for(;t=y();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):l("@font-face missing '}'")}()}function D(){const e=s(),t=g();return t?(f(),e({type:"rule",selectors:t,declarations:v()})):l("selector missing")}return ie(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function ne(e){return e?e.replace(/^\s+|\s+$/g,""):""}function ie(e,t){const n=e&&"string"==typeof e.type,i=n?e:t;for(const t of Object.keys(e)){const n=e[t];Array.isArray(n)?n.forEach((e=>{ie(e,i)})):n&&"object"==typeof n&&ie(n,i)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}const 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"};function se(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const re=/(max|min)-device-(width|height)/,ae=new RegExp(re.source,"g"),le=/([^\\]):hover/,ce=new RegExp(le.source,"g");function ue(e,t){const n=null==t?void 0:t.stylesWithHoverClass.get(e);if(n)return n;const i=te(e,{silent:!0});if(!i.stylesheet)return e;const o=[],s=[];!function e(t){"selectors"in t&&t.selectors&&t.selectors.forEach((e=>{le.test(e)&&o.push(e)})),"media"in t&&t.media&&re.test(t.media)&&s.push(t.media),"rules"in t&&t.rules&&t.rules.forEach(e)}(i.stylesheet);let r=e;if(o.length>0){const e=new RegExp(o.filter(((e,t)=>o.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>se(e))).join("|"),"g");r=r.replace(e,(e=>{const t=e.replace(ce,"$1.\\:hover");return`${e}, ${t}`}))}if(s.length>0){const e=new RegExp(s.filter(((e,t)=>s.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>se(e))).join("|"),"g");r=r.replace(e,(e=>e.replace(ae,"$1-$2")))}return null==t||t.stylesWithHoverClass.set(e,r),r}function de(){return{stylesWithHoverClass:new Map}}function he(e,t){const{doc:n,hackCss:i,cache:o}=t;switch(e.type){case Q.Document:return n.implementation.createDocument(null,"",null);case Q.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case Q.Element:{const t=function(e){let t=oe[e.tagName]?oe[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);let s;s=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",t):n.createElement(t);const r={};for(const a in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,a))continue;let l=e.attributes[a];if("option"===t&&"selected"===a&&!1===l)continue;if(null===l)continue;if(!0===l&&(l=""),a.startsWith("rr_")){r[a]=l;continue}const c="textarea"===t&&"value"===a,u="style"===t&&"_cssText"===a;if(u&&i&&"string"==typeof l&&(l=ue(l,o)),!c&&!u||"string"!=typeof l)try{if(e.isSVG&&"xlink:href"===a)s.setAttributeNS("http://www.w3.org/1999/xlink",a,l.toString());else if("onload"===a||"onclick"===a||"onmouse"===a.substring(0,7))s.setAttribute("_"+a,l.toString());else{if("meta"===t&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"===a){s.setAttribute("csp-content",l.toString());continue}("link"!==t||"preload"!==e.attributes.rel&&"modulepreload"!==e.attributes.rel||"script"!==e.attributes.as)&&("link"===t&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")||("img"===t&&e.attributes.srcset&&e.attributes.rr_dataURL?s.setAttribute("rrweb-original-srcset",e.attributes.srcset):s.setAttribute(a,l.toString())))}}catch(e){}else{const e=n.createTextNode(l);for(const e of Array.from(s.childNodes))e.nodeType===s.TEXT_NODE&&s.removeChild(e);s.appendChild(e)}}for(const n in r){const i=r[n];if("canvas"===t&&"rr_dataURL"===n){const e=document.createElement("img");e.onload=()=>{const t=s.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=i.toString(),s.RRNodeType&&(s.rr_dataURL=i.toString())}else if("img"===t&&"rr_dataURL"===n){const t=s;t.currentSrc.startsWith("data:")||(t.setAttribute("rrweb-original-src",e.attributes.src),t.src=i.toString())}if("rr_width"===n)s.style.width=i.toString();else if("rr_height"===n)s.style.height=i.toString();else if("rr_mediaCurrentTime"===n&&"number"==typeof i)s.currentTime=i;else if("rr_mediaState"===n)switch(i){case"played":s.play().catch((e=>console.warn("media playback error",e)));break;case"paused":s.pause()}}if(e.isShadowHost)if(s.shadowRoot)for(;s.shadowRoot.firstChild;)s.shadowRoot.removeChild(s.shadowRoot.firstChild);else s.attachShadow({mode:"open"});return s}case Q.Text:return n.createTextNode(e.isStyle&&i?ue(e.textContent,o):e.textContent);case Q.CDATA:return n.createCDATASection(e.textContent);case Q.Comment:return n.createComment(e.textContent);default:return null}}function pe(e,t){const{doc:n,mirror:i,skipChild:o=!1,hackCss:s=!0,afterAppend:r,cache:a}=t;if(i.has(e.id)){const t=i.getNode(e.id);if(function(e,t){return!(!e||!t||e.type!==t.type)&&(e.type===Q.Document?e.compatMode===t.compatMode:e.type===Q.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===Q.Comment||e.type===Q.Text||e.type===Q.CDATA?e.textContent===t.textContent:e.type===Q.Element&&e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock)}(i.getMeta(t),e))return i.getNode(e.id)}let l=he(e,{doc:n,hackCss:s,cache:a});if(!l)return null;if(e.rootId&&i.getNode(e.rootId)!==n&&i.replace(e.rootId,n),e.type===Q.Document&&(n.close(),n.open(),"BackCompat"===e.compatMode&&e.childNodes&&e.childNodes[0].type!==Q.DocumentType&&(e.childNodes[0].type===Q.Element&&"xmlns"in e.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===e.childNodes[0].attributes.xmlns?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),l=n),i.add(l,e),(e.type===Q.Document||e.type===Q.Element)&&!o)for(const t of e.childNodes){const o=pe(t,{doc:n,mirror:i,skipChild:!1,hackCss:s,afterAppend:r,cache:a});if(o){if(t.isShadow&&J(l)&&l.shadowRoot)l.shadowRoot.appendChild(o);else if(e.type===Q.Document&&t.type==Q.Element){const e=o;let t=null;e.childNodes.forEach((e=>{"BODY"===e.nodeName&&(t=e)})),t?(e.removeChild(t),l.appendChild(o),e.appendChild(t)):l.appendChild(o)}else l.appendChild(o);r&&r(o,t.id)}else console.warn("Failed to rebuild",t)}return l}function fe(e,t){const{doc:n,onVisit:i,hackCss:o=!0,afterAppend:s,cache:r,mirror:a=new Z}=t,l=pe(e,{doc:n,mirror:a,skipChild:!1,hackCss:o,afterAppend:s,cache:r});return function(e,t){for(const i of e.getIds())e.has(i)&&(n=e.getNode(i),t(n));var n}(a,(e=>{i&&i(e),function(e,t){const n=t.getMeta(e);if((null==n?void 0:n.type)!==Q.Element)return;const i=e;for(const e in n.attributes){if(!Object.prototype.hasOwnProperty.call(n.attributes,e)||!e.startsWith("rr_"))continue;const t=n.attributes[e];"rr_scrollLeft"===e&&(i.scrollLeft=t),"rr_scrollTop"===e&&(i.scrollTop=t)}}(e,a)})),l}var me=(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))(me||{}),ge=(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[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(ge||{}),ye=(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))(ye||{}),ve=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ve||{}),we=(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.Destroy="destroy",e))(we||{});const be="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.";let Ee={map:{},getId:()=>(console.error(be),-1),getNode:()=>(console.error(be),null),removeNodeFromMap(){console.error(be)},has:()=>(console.error(be),!1),reset(){console.error(be)}};function Ne(e){const t={},n=(e,n)=>{const i={value:e,parent:n,children:[]};return t[e.node.id]=i,i},i=[];for(const o of e){const{nextId:e,parentId:s}=o;if(e&&e in t){const s=t[e];if(s.parent){const e=s.parent.children.indexOf(s);s.parent.children.splice(e,0,n(o,s.parent))}else{const e=i.indexOf(s);i.splice(e,0,n(o,null))}}else if(s in t){const e=t[s];e.children.push(n(o,e))}else i.push(n(o,null))}return i}function Se(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)Se(e.children[n],t)}function Te(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function De(e,t){var n,i;const o=null===(i=null===(n=e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===i?void 0:i.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=o.getBoundingClientRect(),r=De(o,t),a=s.height/o.clientHeight;return{x:s.x*r.relativeScale+r.x,y:s.y*r.relativeScale+r.y,relativeScale:a,absoluteScale:r.absoluteScale*a}}function Me(e){return Boolean(null==e?void 0:e.shadowRoot)}function Ce(e,t){const n=e[t[0]];return 1===t.length?n:Ce(n.cssRules[t[1]].cssRules,t.slice(2))}function xe(e){const t=[...e],n=t.pop();return{positions:t,index:n}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ee=new Proxy(Ee,{get:(e,t,n)=>("map"===t&&console.error(be),Reflect.get(e,t,n))})),/[1-9][0-9]{12}/.test(Date.now().toString());class Re{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -12,7 +12,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function Ce(e,t,n,i){return new(n||(n=Promise))((function(o,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}l((i=i.apply(e,t||[])).next())}))}for(var xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Re="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ke=0;ke<xe.length;ke++)Re[xe.charCodeAt(ke)]=ke;var Ae;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"}(Ae||(Ae={}));class Ie{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Oe(e){const t=[];for(const n in e){const i=e[n];if("string"!=typeof i)continue;const o=Pe(n);t.push(`${o}: ${i};`)}return t.join(" ")}const _e=/-([a-z])/g,$e=/^--[a-zA-Z0-9-]+$/,Le=e=>$e.test(e)?e:e.replace(_e,((e,t)=>t?t.toUpperCase():"")),Fe=/\B([A-Z])/g,Pe=e=>e.replace(Fe,"-$1").toLowerCase();class Be{constructor(...e){this.parentElement=null,this.parentNode=null,this.firstChild=null,this.lastChild=null,this.previousSibling=null,this.nextSibling=null,this.ELEMENT_NODE=Xe.ELEMENT_NODE,this.TEXT_NODE=Xe.TEXT_NODE}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Be))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Ue(e){return class extends e{constructor(e,t,n){super(),this.nodeType=Xe.DOCUMENT_TYPE_NODE,this.RRNodeType=Ae.DocumentType,this.name=e,this.publicId=t,this.systemId=n,this.nodeName=e,this.textContent=null}toString(){return"RRDocumentType"}}}function je(e){return class extends e{constructor(e){super(),this.nodeType=Xe.ELEMENT_NODE,this.RRNodeType=Ae.Element,this.attributes={},this.shadowRoot=null,this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach((t=>e+=t.textContent)),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new Ge(this.attributes.class,(e=>{this.attributes.class=e}))}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const e=this.attributes.style?function(e){const t={},n=/:(.+)/;return e.replace(/\/\*.*?\*\//g,"").split(/;(?![^(]*\))/g).forEach((function(e){if(e){const i=e.split(n);i.length>1&&(t[Le(i[0].trim())]=i[1].trim())}})),t}(this.attributes.style):{},t=/\B([A-Z])/g;return e.setProperty=(n,i,o)=>{if(t.test(n))return;const s=Le(n);i?e[s]=i:delete e[s],"important"===o&&(e[s]+=" !important"),this.attributes.style=Oe(e)},e.removeProperty=n=>{if(t.test(n))return"";const i=Le(n),o=e[i]||"";return delete e[i],this.attributes.style=Oe(e),o},e}getAttribute(e){return this.attributes[e]||null}setAttribute(e,t){this.attributes[e]=t}setAttributeNS(e,t,n){this.setAttribute(t,n)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return He(this,e)}insertBefore(e,t){return Ye(this,e,t)}removeChild(e){return qe(this,e)}attachShadow(e){const t=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=t,t}dispatchEvent(e){return!0}toString(){let e="";for(const t in this.attributes)e+=`${t}="${this.attributes[t]}" `;return`${this.tagName} ${e}`}}}function Ve(e){return class extends e{constructor(e){super(),this.nodeType=Xe.TEXT_NODE,this.nodeName="#text",this.RRNodeType=Ae.Text,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function We(e){return class extends e{constructor(e){super(),this.nodeType=Xe.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=Ae.Comment,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function ze(e){return class extends e{constructor(e){super(),this.nodeName="#cdata-section",this.nodeType=Xe.CDATA_SECTION_NODE,this.RRNodeType=Ae.CDATA,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class Ge{constructor(e,t){if(this.classes=[],this.add=(...e)=>{for(const t of e){const e=String(t);this.classes.indexOf(e)>=0||this.classes.push(e)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...e)=>{this.classes=this.classes.filter((t=>-1===e.indexOf(t))),this.onChange&&this.onChange(this.classes.join(" "))},e){const t=e.trim().split(/\s+/);this.classes.push(...t)}this.onChange=t}}function He(e,t){return t.parentNode&&t.parentNode.removeChild(t),e.lastChild?(e.lastChild.nextSibling=t,t.previousSibling=e.lastChild):(e.firstChild=t,t.previousSibling=null),e.lastChild=t,t.nextSibling=null,t.parentNode=e,t.parentElement=e,t.ownerDocument=e.ownerDocument,t}function Ye(e,t,n){if(!n)return He(e,t);if(n.parentNode!==e)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 t===n||(t.parentNode&&t.parentNode.removeChild(t),t.previousSibling=n.previousSibling,n.previousSibling=t,t.nextSibling=n,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,t.parentElement=e,t.parentNode=e,t.ownerDocument=e.ownerDocument),t}function qe(e,t){if(t.parentNode!==e)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return t.previousSibling?t.previousSibling.nextSibling=t.nextSibling:e.firstChild=t.nextSibling,t.nextSibling?t.nextSibling.previousSibling=t.previousSibling:e.lastChild=t.previousSibling,t.previousSibling=null,t.nextSibling=null,t.parentElement=null,t.parentNode=null,t}var Xe;!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"}(Xe||(Xe={}));const Qe={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Je={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"};let Ze=null;function Ke(e,t,n,i=t.mirror||t.ownerDocument.mirror){e=function(e,t,n,i){var o;n.afterAppend&&!Ze&&(Ze=new WeakSet,setTimeout((()=>{Ze=null}),0));if(!nt(e,t)){const s=tt(t,n.mirror,i);null===(o=e.parentNode)||void 0===o||o.replaceChild(s,e),e=s}switch(t.RRNodeType){case Ae.Document:if(!it(e,t,n.mirror,i)){const o=i.getMeta(t);o&&(n.mirror.removeNodeFromMap(e),e.close(),e.open(),n.mirror.add(e,o),null==Ze||Ze.add(e))}break;case Ae.Element:{const o=e,s=t;switch(s.tagName){case"IFRAME":{const o=e.contentDocument;if(!o)break;Ke(o,t.contentDocument,n,i);break}}s.shadowRoot&&(o.shadowRoot||o.attachShadow({mode:"open"}),et(o.shadowRoot,s.shadowRoot,n,i));break}}return e}(e,t,n,i),et(e,t,n,i),function(e,t,n,i){var o;switch(t.RRNodeType){case Ae.Document:{const e=t.scrollData;e&&n.applyScroll(e,!0);break}case Ae.Element:{const o=e,s=t;switch(function(e,t,n){const i=e.attributes,o=t.attributes;for(const i in o){const s=o[i],r=n.getMeta(t);if((null==r?void 0:r.isSVG)&&Qe[i])e.setAttributeNS(Qe[i],i,s);else if("CANVAS"===t.tagName&&"rr_dataURL"===i){const t=document.createElement("img");t.src=s,t.onload=()=>{const n=e.getContext("2d");n&&n.drawImage(t,0,0,t.width,t.height)}}else{if("IFRAME"===t.tagName&&"srcdoc"===i)continue;e.setAttribute(i,s)}}for(const{name:t}of Array.from(i))t in o||e.removeAttribute(t);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}(o,s,i),s.scrollData&&n.applyScroll(s.scrollData,!0),s.inputData&&n.applyInput(s.inputData),s.tagName){case"AUDIO":case"VIDEO":{const t=e,n=s;void 0!==n.paused&&(n.paused?t.pause():t.play()),void 0!==n.muted&&(t.muted=n.muted),void 0!==n.volume&&(t.volume=n.volume),void 0!==n.currentTime&&(t.currentTime=n.currentTime),void 0!==n.playbackRate&&(t.playbackRate=n.playbackRate);break}case"CANVAS":{const i=t;if(null!==i.rr_dataURL){const e=document.createElement("img");e.onload=()=>{const t=o.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=i.rr_dataURL}i.canvasMutations.forEach((t=>n.applyCanvas(t.event,t.mutation,e)));break}case"STYLE":{const e=o.sheet;e&&t.rules.forEach((t=>n.applyStyleSheetMutation(t,e)));break}}break}case Ae.Text:case Ae.Comment:case Ae.CDATA:e.textContent!==t.data&&(e.textContent=t.data)}(null==Ze?void 0:Ze.has(e))&&(Ze.delete(e),null===(o=n.afterAppend)||void 0===o||o.call(n,e,n.mirror.getId(e)))}(e,t,n,i)}function et(e,t,n,i){const o=Array.from(e.childNodes),s=t.childNodes;if(0===o.length&&0===s.length)return;let r,a,l=0,c=o.length-1,u=0,d=s.length-1,h=o[l],p=o[c],f=s[u],m=s[d];for(;l<=c&&u<=d;)if(void 0===h)h=o[++l];else if(void 0===p)p=o[--c];else if(it(h,f,n.mirror,i))h=o[++l],f=s[++u];else if(it(p,m,n.mirror,i))p=o[--c],m=s[--d];else if(it(h,m,n.mirror,i)){try{e.insertBefore(h,p.nextSibling)}catch(e){console.warn(e)}h=o[++l],m=s[--d]}else if(it(p,f,n.mirror,i)){try{e.insertBefore(p,h)}catch(e){console.warn(e)}p=o[--c],f=s[++u]}else{if(!r){r={};for(let e=l;e<=c;e++){const t=o[e];t&&n.mirror.hasNode(t)&&(r[n.mirror.getId(t)]=e)}}a=r[i.getId(f)];const t=o[a];if(void 0!==a&&t&&it(t,f,n.mirror,i)){try{e.insertBefore(t,h)}catch(e){console.warn(e)}o[a]=void 0}else{const t=tt(f,n.mirror,i);"#document"===e.nodeName&&h&&(t.nodeType===t.DOCUMENT_TYPE_NODE&&h.nodeType===h.DOCUMENT_TYPE_NODE||t.nodeType===t.ELEMENT_NODE&&h.nodeType===h.ELEMENT_NODE)&&(e.removeChild(h),n.mirror.removeNodeFromMap(h),h=o[++l]);try{e.insertBefore(t,h||null)}catch(e){console.warn(e)}}f=s[++u]}if(l>c){const t=s[d+1];let o=null;for(t&&(o=n.mirror.getNode(i.getId(t)));u<=d;++u){const t=tt(s[u],n.mirror,i);try{e.insertBefore(t,o)}catch(e){console.warn(e)}}}else if(u>d)for(;l<=c;l++){const t=o[l];if(t&&t.parentNode===e)try{e.removeChild(t),n.mirror.removeNodeFromMap(t)}catch(e){console.warn(e)}}let g=e.firstChild,y=t.firstChild;for(;null!==g&&null!==y;)Ke(g,y,n,i),g=g.nextSibling,y=y.nextSibling}function tt(e,t,n){const i=n.getId(e),o=n.getMeta(e);let s=null;if(i>-1&&(s=t.getNode(i)),null!==s&&nt(s,e))return s;switch(e.RRNodeType){case Ae.Document:s=new Document;break;case Ae.DocumentType:s=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case Ae.Element:{let t=e.tagName.toLowerCase();t=Je[t]||t,s=o&&"isSVG"in o&&(null==o?void 0:o.isSVG)?document.createElementNS(Qe.svg,t):document.createElement(e.tagName);break}case Ae.Text:s=document.createTextNode(e.data);break;case Ae.Comment:s=document.createComment(e.data);break;case Ae.CDATA:s=document.createCDATASection(e.data)}o&&t.add(s,Object.assign({},o));try{null==Ze||Ze.add(s)}catch(e){}return s}function nt(e,t){return e.nodeType===t.nodeType&&(e.nodeType!==e.ELEMENT_NODE||e.tagName.toUpperCase()===t.tagName)}function it(e,t,n,i){const o=n.getId(e),s=i.getId(t);return-1!==o&&o===s&&nt(e,t)}class ot extends(function(e){return class t extends e{constructor(...e){super(e),this.nodeType=Xe.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=Ae.Document,this.textContent=null,this.ownerDocument=this}get documentElement(){return this.childNodes.find((e=>e.RRNodeType===Ae.Element&&"HTML"===e.tagName))||null}get body(){var e;return(null===(e=this.documentElement)||void 0===e?void 0:e.childNodes.find((e=>e.RRNodeType===Ae.Element&&"BODY"===e.tagName)))||null}get head(){var e;return(null===(e=this.documentElement)||void 0===e?void 0:e.childNodes.find((e=>e.RRNodeType===Ae.Element&&"HEAD"===e.tagName)))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){const t=e.RRNodeType;if((t===Ae.Element||t===Ae.DocumentType)&&this.childNodes.some((e=>e.RRNodeType===t)))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${t===Ae.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const n=He(this,e);return n.parentElement=null,n}insertBefore(e,t){const n=e.RRNodeType;if((n===Ae.Element||n===Ae.DocumentType)&&this.childNodes.some((e=>e.RRNodeType===n)))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${n===Ae.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const i=Ye(this,e,t);return i.parentElement=null,i}removeChild(e){return qe(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let t;if('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'===e?t="-//W3C//DTD XHTML 1.0 Transitional//EN":'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'===e&&(t="-//W3C//DTD HTML 4.0 Transitional//EN"),t){const e=this.createDocumentType("html",t,"");this.open(),this.appendChild(e)}}createDocument(e,n,i){return new t}createDocumentType(e,t,n){const i=new(Ue(Be))(e,t,n);return i.ownerDocument=this,i}createElement(e){const t=new(je(Be))(e);return t.ownerDocument=this,t}createElementNS(e,t){return this.createElement(t)}createTextNode(e){const t=new(Ve(Be))(e);return t.ownerDocument=this,t}createComment(e){const t=new(We(Be))(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new(ze(Be))(e);return t.ownerDocument=this,t}toString(){return"RRDocument"}}}(Be)){get unserializedId(){return this._unserializedId--}constructor(e){super(),this.UNSERIALIZED_STARTING_ID=-2,this._unserializedId=this.UNSERIALIZED_STARTING_ID,this.mirror=new gt,this.scrollData=null,e&&(this.mirror=e)}createDocument(e,t,n){return new ot}createDocumentType(e,t,n){const i=new st(e,t,n);return i.ownerDocument=this,i}createElement(e){const t=e.toUpperCase();let n;switch(t){case"AUDIO":case"VIDEO":n=new at(t);break;case"IFRAME":n=new ut(t,this.mirror);break;case"CANVAS":n=new lt(t);break;case"STYLE":n=new ct(t);break;default:n=new rt(t)}return n.ownerDocument=this,n}createComment(e){const t=new ht(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new pt(e);return t.ownerDocument=this,t}createTextNode(e){const t=new dt(e);return t.ownerDocument=this,t}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const st=Ue(Be);class rt extends(je(Be)){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class at extends(function(e){return class extends e{attachShadow(e){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}(rt)){}class lt extends rt{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}}class ct extends rt{constructor(){super(...arguments),this.rules=[]}}class ut extends rt{constructor(e,t){super(e),this.contentDocument=new ot,this.contentDocument.mirror=t}}const dt=Ve(Be),ht=We(Be),pt=ze(Be);function ft(e,t,n,i){let o;switch(e.nodeType){case Xe.DOCUMENT_NODE:i&&"IFRAME"===i.nodeName?o=i.contentDocument:(o=t,o.compatMode=e.compatMode);break;case Xe.DOCUMENT_TYPE_NODE:{const n=e;o=t.createDocumentType(n.name,n.publicId,n.systemId);break}case Xe.ELEMENT_NODE:{const n=e,i=function(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}(n);o=t.createElement(i);const s=o;for(const{name:e,value:t}of Array.from(n.attributes))s.attributes[e]=t;n.scrollLeft&&(s.scrollLeft=n.scrollLeft),n.scrollTop&&(s.scrollTop=n.scrollTop);break}case Xe.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case Xe.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case Xe.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case Xe.DOCUMENT_FRAGMENT_NODE:o=i.attachShadow({mode:"open"});break;default:return null}let s=n.getMeta(e);return t instanceof ot&&(s||(s=yt(o,t.unserializedId),n.add(e,s)),t.mirror.add(o,Object.assign({},s))),o}function mt(e,t=function(){return new Ie}(),n=new ot){return function e(i,o){const s=ft(i,n,t,o);if(null!==s)if("IFRAME"!==(null==o?void 0:o.nodeName)&&i.nodeType!==Xe.DOCUMENT_FRAGMENT_NODE&&(null==o||o.appendChild(s),s.parentNode=o,s.parentElement=o),"IFRAME"===i.nodeName){const t=i.contentDocument;t&&e(t,s)}else i.nodeType!==Xe.DOCUMENT_NODE&&i.nodeType!==Xe.ELEMENT_NODE&&i.nodeType!==Xe.DOCUMENT_FRAGMENT_NODE||(i.nodeType===Xe.ELEMENT_NODE&&i.shadowRoot&&e(i.shadowRoot,s),i.childNodes.forEach((t=>e(t,s))))}(e,null),n}class gt{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function yt(e,t){switch(e.RRNodeType){case Ae.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case Ae.DocumentType:{const n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId}}case Ae.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case Ae.Text:case Ae.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case Ae.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}var vt=Uint8Array,wt=Uint16Array,bt=Uint32Array,Et=new vt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Nt=new vt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),St=new vt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Tt=function(e,t){for(var n=new wt(31),i=0;i<31;++i)n[i]=t+=1<<e[i-1];var o=new bt(n[30]);for(i=1;i<30;++i)for(var s=n[i];s<n[i+1];++s)o[s]=s-n[i]<<5|i;return[n,o]},Dt=Tt(Et,2),Mt=Dt[0],Ct=Dt[1];Mt[28]=258,Ct[258]=28;for(var xt=Tt(Nt,0)[0],Rt=new wt(32768),kt=0;kt<32768;++kt){var At=(43690&kt)>>>1|(21845&kt)<<1;At=(61680&(At=(52428&At)>>>2|(13107&At)<<2))>>>4|(3855&At)<<4,Rt[kt]=((65280&At)>>>8|(255&At)<<8)>>>1}var It=function(e,t,n){for(var i=e.length,o=0,s=new wt(t);o<i;++o)++s[e[o]-1];var r,a=new wt(t);for(o=0;o<t;++o)a[o]=a[o-1]+s[o-1]<<1;if(n){r=new wt(1<<t);var l=15-t;for(o=0;o<i;++o)if(e[o])for(var c=o<<4|e[o],u=t-e[o],d=a[e[o]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)r[Rt[d]>>>l]=c}else for(r=new wt(i),o=0;o<i;++o)r[o]=Rt[a[e[o]-1]++]>>>15-e[o];return r},Ot=new vt(288);for(kt=0;kt<144;++kt)Ot[kt]=8;for(kt=144;kt<256;++kt)Ot[kt]=9;for(kt=256;kt<280;++kt)Ot[kt]=7;for(kt=280;kt<288;++kt)Ot[kt]=8;var _t=new vt(32);for(kt=0;kt<32;++kt)_t[kt]=5;var $t=It(Ot,9,1),Lt=It(_t,5,1),Ft=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},Pt=function(e,t,n){var i=t/8>>0;return(e[i]|e[i+1]<<8)>>>(7&t)&n},Bt=function(e,t){var n=t/8>>0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>>(7&t)},Ut=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var i=new(e instanceof wt?wt:e instanceof bt?bt:vt)(n-t);return i.set(e.subarray(t,n)),i};function jt(e,t){return function(e,t,n){var i=e.length,o=!t||n,s=!n||n.i;n||(n={}),t||(t=new vt(3*i));var r,a=function(e){var n=t.length;if(e>n){var i=new vt(Math.max(2*n,e));i.set(t),t=i}},l=n.f||0,c=n.p||0,u=n.b||0,d=n.l,h=n.d,p=n.m,f=n.n,m=8*i;do{if(!d){n.f=l=Pt(e,c,1);var g=Pt(e,c+1,3);if(c+=3,!g){var y=e[(x=((r=c)/8>>0)+(7&r&&1)+4)-4]|e[x-3]<<8,v=x+y;if(v>i){if(s)throw"unexpected EOF";break}o&&a(u+y),t.set(e.subarray(x,v),u),n.b=u+=y,n.p=c=8*v;continue}if(1==g)d=$t,h=Lt,p=9,f=5;else{if(2!=g)throw"invalid block type";var w=Pt(e,c,31)+257,b=Pt(e,c+10,15)+4,E=w+Pt(e,c+5,31)+1;c+=14;for(var N=new vt(E),S=new vt(19),T=0;T<b;++T)S[St[T]]=Pt(e,c+3*T,7);c+=3*b;var D=Ft(S),M=(1<<D)-1;if(!s&&c+E*(D+7)>m)break;var C=It(S,D,1);for(T=0;T<E;){var x,R=C[Pt(e,c,M)];if(c+=15&R,(x=R>>>4)<16)N[T++]=x;else{var k=0,A=0;for(16==x?(A=3+Pt(e,c,3),c+=2,k=N[T-1]):17==x?(A=3+Pt(e,c,7),c+=3):18==x&&(A=11+Pt(e,c,127),c+=7);A--;)N[T++]=k}}var I=N.subarray(0,w),O=N.subarray(w);p=Ft(I),f=Ft(O),d=It(I,p,1),h=It(O,f,1)}if(c>m)throw"unexpected EOF"}o&&a(u+131072);for(var _=(1<<p)-1,$=(1<<f)-1,L=p+f+18;s||c+L<m;){var F=(k=d[Bt(e,c)&_])>>>4;if((c+=15&k)>m)throw"unexpected EOF";if(!k)throw"invalid length/literal";if(F<256)t[u++]=F;else{if(256==F){d=null;break}var P=F-254;if(F>264){var B=Et[T=F-257];P=Pt(e,c,(1<<B)-1)+Mt[T],c+=B}var U=h[Bt(e,c)&$],j=U>>>4;if(!U)throw"invalid distance";if(c+=15&U,O=xt[j],j>3&&(B=Nt[j],O+=Bt(e,c)&(1<<B)-1,c+=B),c>m)throw"unexpected EOF";o&&a(u+131072);for(var V=u+P;u<V;u+=4)t[u]=t[u-O],t[u+1]=t[u+1-O],t[u+2]=t[u+2-O],t[u+3]=t[u+3-O];u=V}}n.l=d,n.p=c,n.b=u,d&&(l=1,n.m=p,n.d=h,n.n=f)}while(!l);return u==t.length?t:Ut(t,0,u)}((function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"}(e),e.subarray(2,-4)),t)}const Vt=e=>{if("string"!=typeof e)return e;try{const t=JSON.parse(e);if(t.timestamp)return t}catch(e){}try{const t=JSON.parse(function(e,t){var n="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var i=0;i<e.length;){var o=e[i++];o<128||t?n+=String.fromCharCode(o):o<224?n+=String.fromCharCode((31&o)<<6|63&e[i++]):o<240?n+=String.fromCharCode((15&o)<<12|(63&e[i++])<<6|63&e[i++]):(o=((15&o)<<18|(63&e[i++])<<12|(63&e[i++])<<6|63&e[i++])-65536,n+=String.fromCharCode(55296|o>>10,56320|1023&o))}return n}(jt(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new vt(e.length+(e.length>>>1)),o=0,s=function(e){i[o++]=e},r=0;r<n;++r){if(o+5>i.length){var a=new vt(o+8+(n-r<<1));a.set(i),i=a}var l=e.charCodeAt(r);l<128||t?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++r))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return Ut(i,0,o)}(e,!0))));if("v1"===t.v)return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer v1.`)}catch(e){throw console.error(e),new Error("Unknown data format.")}};function Wt(e){return{all:e=e||new Map,on:function(t,n){var i=e.get(t);i?i.push(n):e.set(t,[n])},off:function(t,n){var i=e.get(t);i&&(n?i.splice(i.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var i=e.get(t);i&&i.slice().map((function(e){e(n)})),(i=e.get("*"))&&i.slice().map((function(e){e(t,n)}))}}}var zt=Object.freeze({__proto__:null,default:Wt});const Gt=new Map;function Ht(e,t){let n=Gt.get(e);return n||(n=new Map,Gt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function Yt(e,t,n){return i=>Ce(this,void 0,void 0,(function*(){if(i&&"object"==typeof i&&"rr_type"in i){if(n&&(n.isUnchanged=!1),"ImageBitmap"===i.rr_type&&"args"in i){const o=yield Yt(e,t,n)(i.args);return yield createImageBitmap.apply(null,o)}if("index"in i){if(n||null===t)return i;const{rr_type:e,index:o}=i;return Ht(t,e)[o]}if("args"in i){const{rr_type:o,args:s}=i;return new(0,window[o])(...yield Promise.all(s.map(Yt(e,t,n))))}if("base64"in i)return function(e){var t,n,i,o,s,r=.75*e.length,a=e.length,l=0;"="===e[e.length-1]&&(r--,"="===e[e.length-2]&&r--);var c=new ArrayBuffer(r),u=new Uint8Array(c);for(t=0;t<a;t+=4)n=Re[e.charCodeAt(t)],i=Re[e.charCodeAt(t+1)],o=Re[e.charCodeAt(t+2)],s=Re[e.charCodeAt(t+3)],u[l++]=n<<2|i>>4,u[l++]=(15&i)<<4|o>>2,u[l++]=(3&o)<<6|63&s;return c}(i.base64);if("src"in i){const t=e.get(i.src);if(t)return t;{const t=new Image;return t.src=i.src,e.set(i.src,t),t}}if("data"in i&&"Blob"===i.rr_type){const o=yield Promise.all(i.data.map(Yt(e,t,n)));return new Blob(o,{type:i.type})}}else if(Array.isArray(i)){return yield Promise.all(i.map(Yt(e,t,n)))}return i}))}const qt=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Xt({mutation:e,target:t,type:n,imageMap:i,errorHandler:o}){return Ce(this,void 0,void 0,(function*(){try{const o=function(e,t){try{return t===me.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch(e){return null}}(t,n);if(!o)return;if(e.setter)return void(o[e.property]=e.args[0]);const s=o[e.property],r=yield Promise.all(e.args.map(Yt(i,o)));!function(e,t){if(!(null==t?void 0:t.constructor))return;const{name:n}=t.constructor;if(!qt.includes(n))return;const i=Ht(e,n);i.includes(t)||i.push(t)}(o,s.apply(o,r))}catch(t){o(e,t)}}))}function Qt({event:e,mutation:t,target:n,imageMap:i,canvasEventMap:o,errorHandler:s}){return Ce(this,void 0,void 0,(function*(){try{const r=o.get(e)||t,a="commands"in r?r.commands:[r];if([me.WebGL,me.WebGL2].includes(t.type)){for(let e=0;e<a.length;e++){const o=a[e];yield Xt({mutation:o,type:t.type,target:n,imageMap:i,errorHandler:s})}return}yield function({event:e,mutations:t,target:n,imageMap:i,errorHandler:o}){return Ce(this,void 0,void 0,(function*(){const s=n.getContext("2d");if(!s)return void o(t[0],new Error("Canvas context is null"));const r=t.map((e=>Ce(this,void 0,void 0,(function*(){return Promise.all(e.args.map(Yt(i,s)))}))));(yield Promise.all(r)).forEach(((n,r)=>{const a=t[r];try{if(a.setter)return void(s[a.property]=a.args[0]);const t=s[a.property];"drawImage"===a.property&&"string"==typeof a.args[0]?(i.get(e),t.apply(s,a.args)):t.apply(s,n)}catch(e){o(a,e)}}))}))}({event:e,mutations:a,target:n,imageMap:i,errorHandler:s})}catch(e){s(t,e)}}))}
15
+ ***************************************************************************** */function ke(e,t,n,i){return new(n||(n=Promise))((function(o,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}l((i=i.apply(e,t||[])).next())}))}for(var Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ie="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Oe=0;Oe<Ae.length;Oe++)Ie[Ae.charCodeAt(Oe)]=Oe;var _e;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"}(_e||(_e={}));class $e{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Le(e){const t=[];for(const n in e){const i=e[n];if("string"!=typeof i)continue;const o=je(n);t.push(`${o}: ${i};`)}return t.join(" ")}const Fe=/-([a-z])/g,Pe=/^--[a-zA-Z0-9-]+$/,Be=e=>Pe.test(e)?e:e.replace(Fe,((e,t)=>t?t.toUpperCase():"")),Ue=/\B([A-Z])/g,je=e=>e.replace(Ue,"-$1").toLowerCase();class Ve{constructor(...e){this.parentElement=null,this.parentNode=null,this.firstChild=null,this.lastChild=null,this.previousSibling=null,this.nextSibling=null,this.ELEMENT_NODE=Ze.ELEMENT_NODE,this.TEXT_NODE=Ze.TEXT_NODE}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Ve))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function We(e){return class extends e{constructor(e,t,n){super(),this.nodeType=Ze.DOCUMENT_TYPE_NODE,this.RRNodeType=_e.DocumentType,this.name=e,this.publicId=t,this.systemId=n,this.nodeName=e,this.textContent=null}toString(){return"RRDocumentType"}}}function ze(e){return class extends e{constructor(e){super(),this.nodeType=Ze.ELEMENT_NODE,this.RRNodeType=_e.Element,this.attributes={},this.shadowRoot=null,this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach((t=>e+=t.textContent)),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new qe(this.attributes.class,(e=>{this.attributes.class=e}))}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const e=this.attributes.style?function(e){const t={},n=/:(.+)/;return e.replace(/\/\*.*?\*\//g,"").split(/;(?![^(]*\))/g).forEach((function(e){if(e){const i=e.split(n);i.length>1&&(t[Be(i[0].trim())]=i[1].trim())}})),t}(this.attributes.style):{},t=/\B([A-Z])/g;return e.setProperty=(n,i,o)=>{if(t.test(n))return;const s=Be(n);i?e[s]=i:delete e[s],"important"===o&&(e[s]+=" !important"),this.attributes.style=Le(e)},e.removeProperty=n=>{if(t.test(n))return"";const i=Be(n),o=e[i]||"";return delete e[i],this.attributes.style=Le(e),o},e}getAttribute(e){return this.attributes[e]||null}setAttribute(e,t){this.attributes[e]=t}setAttributeNS(e,t,n){this.setAttribute(t,n)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return Xe(this,e)}insertBefore(e,t){return Qe(this,e,t)}removeChild(e){return Je(this,e)}attachShadow(e){const t=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=t,t}dispatchEvent(e){return!0}toString(){let e="";for(const t in this.attributes)e+=`${t}="${this.attributes[t]}" `;return`${this.tagName} ${e}`}}}function Ge(e){return class extends e{constructor(e){super(),this.nodeType=Ze.TEXT_NODE,this.nodeName="#text",this.RRNodeType=_e.Text,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function He(e){return class extends e{constructor(e){super(),this.nodeType=Ze.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=_e.Comment,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function Ye(e){return class extends e{constructor(e){super(),this.nodeName="#cdata-section",this.nodeType=Ze.CDATA_SECTION_NODE,this.RRNodeType=_e.CDATA,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class qe{constructor(e,t){if(this.classes=[],this.add=(...e)=>{for(const t of e){const e=String(t);this.classes.indexOf(e)>=0||this.classes.push(e)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...e)=>{this.classes=this.classes.filter((t=>-1===e.indexOf(t))),this.onChange&&this.onChange(this.classes.join(" "))},e){const t=e.trim().split(/\s+/);this.classes.push(...t)}this.onChange=t}}function Xe(e,t){return t.parentNode&&t.parentNode.removeChild(t),e.lastChild?(e.lastChild.nextSibling=t,t.previousSibling=e.lastChild):(e.firstChild=t,t.previousSibling=null),e.lastChild=t,t.nextSibling=null,t.parentNode=e,t.parentElement=e,t.ownerDocument=e.ownerDocument,t}function Qe(e,t,n){if(!n)return Xe(e,t);if(n.parentNode!==e)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 t===n||(t.parentNode&&t.parentNode.removeChild(t),t.previousSibling=n.previousSibling,n.previousSibling=t,t.nextSibling=n,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,t.parentElement=e,t.parentNode=e,t.ownerDocument=e.ownerDocument),t}function Je(e,t){if(t.parentNode!==e)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return t.previousSibling?t.previousSibling.nextSibling=t.nextSibling:e.firstChild=t.nextSibling,t.nextSibling?t.nextSibling.previousSibling=t.previousSibling:e.lastChild=t.previousSibling,t.previousSibling=null,t.nextSibling=null,t.parentElement=null,t.parentNode=null,t}var Ze;!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"}(Ze||(Ze={}));const Ke={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},et={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"};let tt=null;function nt(e,t,n,i=t.mirror||t.ownerDocument.mirror){e=function(e,t,n,i){var o;n.afterAppend&&!tt&&(tt=new WeakSet,setTimeout((()=>{tt=null}),0));if(!st(e,t)){const s=ot(t,n.mirror,i);null===(o=e.parentNode)||void 0===o||o.replaceChild(s,e),e=s}switch(t.RRNodeType){case _e.Document:if(!rt(e,t,n.mirror,i)){const o=i.getMeta(t);o&&(n.mirror.removeNodeFromMap(e),e.close(),e.open(),n.mirror.add(e,o),null==tt||tt.add(e))}break;case _e.Element:{const o=e,s=t;switch(s.tagName){case"IFRAME":{const o=e.contentDocument;if(!o)break;nt(o,t.contentDocument,n,i);break}}s.shadowRoot&&(o.shadowRoot||o.attachShadow({mode:"open"}),it(o.shadowRoot,s.shadowRoot,n,i));break}}return e}(e,t,n,i),it(e,t,n,i),function(e,t,n,i){var o;switch(t.RRNodeType){case _e.Document:{const e=t.scrollData;e&&n.applyScroll(e,!0);break}case _e.Element:{const o=e,s=t;switch(function(e,t,n){const i=e.attributes,o=t.attributes;for(const i in o){const s=o[i],r=n.getMeta(t);if((null==r?void 0:r.isSVG)&&Ke[i])e.setAttributeNS(Ke[i],i,s);else if("CANVAS"===t.tagName&&"rr_dataURL"===i){const t=document.createElement("img");t.src=s,t.onload=()=>{const n=e.getContext("2d");n&&n.drawImage(t,0,0,t.width,t.height)}}else{if("IFRAME"===t.tagName&&"srcdoc"===i)continue;e.setAttribute(i,s)}}for(const{name:t}of Array.from(i))t in o||e.removeAttribute(t);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}(o,s,i),s.scrollData&&n.applyScroll(s.scrollData,!0),s.inputData&&n.applyInput(s.inputData),s.tagName){case"AUDIO":case"VIDEO":{const t=e,n=s;void 0!==n.paused&&(n.paused?t.pause():t.play()),void 0!==n.muted&&(t.muted=n.muted),void 0!==n.volume&&(t.volume=n.volume),void 0!==n.currentTime&&(t.currentTime=n.currentTime),void 0!==n.playbackRate&&(t.playbackRate=n.playbackRate);break}case"CANVAS":{const i=t;if(null!==i.rr_dataURL){const e=document.createElement("img");e.onload=()=>{const t=o.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=i.rr_dataURL}i.canvasMutations.forEach((t=>n.applyCanvas(t.event,t.mutation,e)));break}case"STYLE":{const e=o.sheet;e&&t.rules.forEach((t=>n.applyStyleSheetMutation(t,e)));break}}break}case _e.Text:case _e.Comment:case _e.CDATA:e.textContent!==t.data&&(e.textContent=t.data)}(null==tt?void 0:tt.has(e))&&(tt.delete(e),null===(o=n.afterAppend)||void 0===o||o.call(n,e,n.mirror.getId(e)))}(e,t,n,i)}function it(e,t,n,i){const o=Array.from(e.childNodes),s=t.childNodes;if(0===o.length&&0===s.length)return;let r,a,l=0,c=o.length-1,u=0,d=s.length-1,h=o[l],p=o[c],f=s[u],m=s[d];for(;l<=c&&u<=d;)if(void 0===h)h=o[++l];else if(void 0===p)p=o[--c];else if(rt(h,f,n.mirror,i))h=o[++l],f=s[++u];else if(rt(p,m,n.mirror,i))p=o[--c],m=s[--d];else if(rt(h,m,n.mirror,i)){try{e.insertBefore(h,p.nextSibling)}catch(e){console.warn(e)}h=o[++l],m=s[--d]}else if(rt(p,f,n.mirror,i)){try{e.insertBefore(p,h)}catch(e){console.warn(e)}p=o[--c],f=s[++u]}else{if(!r){r={};for(let e=l;e<=c;e++){const t=o[e];t&&n.mirror.hasNode(t)&&(r[n.mirror.getId(t)]=e)}}a=r[i.getId(f)];const t=o[a];if(void 0!==a&&t&&rt(t,f,n.mirror,i)){try{e.insertBefore(t,h)}catch(e){console.warn(e)}o[a]=void 0}else{const t=ot(f,n.mirror,i);"#document"===e.nodeName&&h&&(t.nodeType===t.DOCUMENT_TYPE_NODE&&h.nodeType===h.DOCUMENT_TYPE_NODE||t.nodeType===t.ELEMENT_NODE&&h.nodeType===h.ELEMENT_NODE)&&(e.removeChild(h),n.mirror.removeNodeFromMap(h),h=o[++l]);try{e.insertBefore(t,h||null)}catch(e){console.warn(e)}}f=s[++u]}if(l>c){const t=s[d+1];let o=null;for(t&&(o=n.mirror.getNode(i.getId(t)));u<=d;++u){const t=ot(s[u],n.mirror,i);try{e.insertBefore(t,o)}catch(e){console.warn(e)}}}else if(u>d)for(;l<=c;l++){const t=o[l];if(t&&t.parentNode===e)try{e.removeChild(t),n.mirror.removeNodeFromMap(t)}catch(e){console.warn(e)}}let g=e.firstChild,y=t.firstChild;for(;null!==g&&null!==y;)nt(g,y,n,i),g=g.nextSibling,y=y.nextSibling}function ot(e,t,n){const i=n.getId(e),o=n.getMeta(e);let s=null;if(i>-1&&(s=t.getNode(i)),null!==s&&st(s,e))return s;switch(e.RRNodeType){case _e.Document:s=new Document;break;case _e.DocumentType:s=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case _e.Element:{let t=e.tagName.toLowerCase();t=et[t]||t,s=o&&"isSVG"in o&&(null==o?void 0:o.isSVG)?document.createElementNS(Ke.svg,t):document.createElement(e.tagName);break}case _e.Text:s=document.createTextNode(e.data);break;case _e.Comment:s=document.createComment(e.data);break;case _e.CDATA:s=document.createCDATASection(e.data)}o&&t.add(s,Object.assign({},o));try{null==tt||tt.add(s)}catch(e){}return s}function st(e,t){return e.nodeType===t.nodeType&&(e.nodeType!==e.ELEMENT_NODE||e.tagName.toUpperCase()===t.tagName)}function rt(e,t,n,i){const o=n.getId(e),s=i.getId(t);return-1!==o&&o===s&&st(e,t)}class at extends(function(e){return class t extends e{constructor(...e){super(e),this.nodeType=Ze.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=_e.Document,this.textContent=null,this.ownerDocument=this}get documentElement(){return this.childNodes.find((e=>e.RRNodeType===_e.Element&&"HTML"===e.tagName))||null}get body(){var e;return(null===(e=this.documentElement)||void 0===e?void 0:e.childNodes.find((e=>e.RRNodeType===_e.Element&&"BODY"===e.tagName)))||null}get head(){var e;return(null===(e=this.documentElement)||void 0===e?void 0:e.childNodes.find((e=>e.RRNodeType===_e.Element&&"HEAD"===e.tagName)))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){const t=e.RRNodeType;if((t===_e.Element||t===_e.DocumentType)&&this.childNodes.some((e=>e.RRNodeType===t)))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${t===_e.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const n=Xe(this,e);return n.parentElement=null,n}insertBefore(e,t){const n=e.RRNodeType;if((n===_e.Element||n===_e.DocumentType)&&this.childNodes.some((e=>e.RRNodeType===n)))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${n===_e.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const i=Qe(this,e,t);return i.parentElement=null,i}removeChild(e){return Je(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let t;if('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'===e?t="-//W3C//DTD XHTML 1.0 Transitional//EN":'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'===e&&(t="-//W3C//DTD HTML 4.0 Transitional//EN"),t){const e=this.createDocumentType("html",t,"");this.open(),this.appendChild(e)}}createDocument(e,n,i){return new t}createDocumentType(e,t,n){const i=new(We(Ve))(e,t,n);return i.ownerDocument=this,i}createElement(e){const t=new(ze(Ve))(e);return t.ownerDocument=this,t}createElementNS(e,t){return this.createElement(t)}createTextNode(e){const t=new(Ge(Ve))(e);return t.ownerDocument=this,t}createComment(e){const t=new(He(Ve))(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new(Ye(Ve))(e);return t.ownerDocument=this,t}toString(){return"RRDocument"}}}(Ve)){get unserializedId(){return this._unserializedId--}constructor(e){super(),this.UNSERIALIZED_STARTING_ID=-2,this._unserializedId=this.UNSERIALIZED_STARTING_ID,this.mirror=new wt,this.scrollData=null,e&&(this.mirror=e)}createDocument(e,t,n){return new at}createDocumentType(e,t,n){const i=new lt(e,t,n);return i.ownerDocument=this,i}createElement(e){const t=e.toUpperCase();let n;switch(t){case"AUDIO":case"VIDEO":n=new ut(t);break;case"IFRAME":n=new pt(t,this.mirror);break;case"CANVAS":n=new dt(t);break;case"STYLE":n=new ht(t);break;default:n=new ct(t)}return n.ownerDocument=this,n}createComment(e){const t=new mt(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new gt(e);return t.ownerDocument=this,t}createTextNode(e){const t=new ft(e);return t.ownerDocument=this,t}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const lt=We(Ve);class ct extends(ze(Ve)){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class ut extends(function(e){return class extends e{attachShadow(e){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}(ct)){}class dt extends ct{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}}class ht extends ct{constructor(){super(...arguments),this.rules=[]}}class pt extends ct{constructor(e,t){super(e),this.contentDocument=new at,this.contentDocument.mirror=t}}const ft=Ge(Ve),mt=He(Ve),gt=Ye(Ve);function yt(e,t,n,i){let o;switch(e.nodeType){case Ze.DOCUMENT_NODE:i&&"IFRAME"===i.nodeName?o=i.contentDocument:(o=t,o.compatMode=e.compatMode);break;case Ze.DOCUMENT_TYPE_NODE:{const n=e;o=t.createDocumentType(n.name,n.publicId,n.systemId);break}case Ze.ELEMENT_NODE:{const n=e,i=function(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}(n);o=t.createElement(i);const s=o;for(const{name:e,value:t}of Array.from(n.attributes))s.attributes[e]=t;n.scrollLeft&&(s.scrollLeft=n.scrollLeft),n.scrollTop&&(s.scrollTop=n.scrollTop);break}case Ze.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case Ze.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case Ze.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case Ze.DOCUMENT_FRAGMENT_NODE:o=i.attachShadow({mode:"open"});break;default:return null}let s=n.getMeta(e);return t instanceof at&&(s||(s=bt(o,t.unserializedId),n.add(e,s)),t.mirror.add(o,Object.assign({},s))),o}function vt(e,t=function(){return new $e}(),n=new at){return function e(i,o){const s=yt(i,n,t,o);if(null!==s)if("IFRAME"!==(null==o?void 0:o.nodeName)&&i.nodeType!==Ze.DOCUMENT_FRAGMENT_NODE&&(null==o||o.appendChild(s),s.parentNode=o,s.parentElement=o),"IFRAME"===i.nodeName){const t=i.contentDocument;t&&e(t,s)}else i.nodeType!==Ze.DOCUMENT_NODE&&i.nodeType!==Ze.ELEMENT_NODE&&i.nodeType!==Ze.DOCUMENT_FRAGMENT_NODE||(i.nodeType===Ze.ELEMENT_NODE&&i.shadowRoot&&e(i.shadowRoot,s),i.childNodes.forEach((t=>e(t,s))))}(e,null),n}class wt{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function bt(e,t){switch(e.RRNodeType){case _e.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case _e.DocumentType:{const n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId}}case _e.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case _e.Text:case _e.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case _e.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}var Et=Uint8Array,Nt=Uint16Array,St=Uint32Array,Tt=new Et([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Dt=new Et([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Mt=new Et([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ct=function(e,t){for(var n=new Nt(31),i=0;i<31;++i)n[i]=t+=1<<e[i-1];var o=new St(n[30]);for(i=1;i<30;++i)for(var s=n[i];s<n[i+1];++s)o[s]=s-n[i]<<5|i;return[n,o]},xt=Ct(Tt,2),Rt=xt[0],kt=xt[1];Rt[28]=258,kt[258]=28;for(var At=Ct(Dt,0)[0],It=new Nt(32768),Ot=0;Ot<32768;++Ot){var _t=(43690&Ot)>>>1|(21845&Ot)<<1;_t=(61680&(_t=(52428&_t)>>>2|(13107&_t)<<2))>>>4|(3855&_t)<<4,It[Ot]=((65280&_t)>>>8|(255&_t)<<8)>>>1}var $t=function(e,t,n){for(var i=e.length,o=0,s=new Nt(t);o<i;++o)++s[e[o]-1];var r,a=new Nt(t);for(o=0;o<t;++o)a[o]=a[o-1]+s[o-1]<<1;if(n){r=new Nt(1<<t);var l=15-t;for(o=0;o<i;++o)if(e[o])for(var c=o<<4|e[o],u=t-e[o],d=a[e[o]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)r[It[d]>>>l]=c}else for(r=new Nt(i),o=0;o<i;++o)r[o]=It[a[e[o]-1]++]>>>15-e[o];return r},Lt=new Et(288);for(Ot=0;Ot<144;++Ot)Lt[Ot]=8;for(Ot=144;Ot<256;++Ot)Lt[Ot]=9;for(Ot=256;Ot<280;++Ot)Lt[Ot]=7;for(Ot=280;Ot<288;++Ot)Lt[Ot]=8;var Ft=new Et(32);for(Ot=0;Ot<32;++Ot)Ft[Ot]=5;var Pt=$t(Lt,9,1),Bt=$t(Ft,5,1),Ut=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},jt=function(e,t,n){var i=t/8>>0;return(e[i]|e[i+1]<<8)>>>(7&t)&n},Vt=function(e,t){var n=t/8>>0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>>(7&t)},Wt=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var i=new(e instanceof Nt?Nt:e instanceof St?St:Et)(n-t);return i.set(e.subarray(t,n)),i};function zt(e,t){return function(e,t,n){var i=e.length,o=!t||n,s=!n||n.i;n||(n={}),t||(t=new Et(3*i));var r,a=function(e){var n=t.length;if(e>n){var i=new Et(Math.max(2*n,e));i.set(t),t=i}},l=n.f||0,c=n.p||0,u=n.b||0,d=n.l,h=n.d,p=n.m,f=n.n,m=8*i;do{if(!d){n.f=l=jt(e,c,1);var g=jt(e,c+1,3);if(c+=3,!g){var y=e[(x=((r=c)/8>>0)+(7&r&&1)+4)-4]|e[x-3]<<8,v=x+y;if(v>i){if(s)throw"unexpected EOF";break}o&&a(u+y),t.set(e.subarray(x,v),u),n.b=u+=y,n.p=c=8*v;continue}if(1==g)d=Pt,h=Bt,p=9,f=5;else{if(2!=g)throw"invalid block type";var w=jt(e,c,31)+257,b=jt(e,c+10,15)+4,E=w+jt(e,c+5,31)+1;c+=14;for(var N=new Et(E),S=new Et(19),T=0;T<b;++T)S[Mt[T]]=jt(e,c+3*T,7);c+=3*b;var D=Ut(S),M=(1<<D)-1;if(!s&&c+E*(D+7)>m)break;var C=$t(S,D,1);for(T=0;T<E;){var x,R=C[jt(e,c,M)];if(c+=15&R,(x=R>>>4)<16)N[T++]=x;else{var k=0,A=0;for(16==x?(A=3+jt(e,c,3),c+=2,k=N[T-1]):17==x?(A=3+jt(e,c,7),c+=3):18==x&&(A=11+jt(e,c,127),c+=7);A--;)N[T++]=k}}var I=N.subarray(0,w),O=N.subarray(w);p=Ut(I),f=Ut(O),d=$t(I,p,1),h=$t(O,f,1)}if(c>m)throw"unexpected EOF"}o&&a(u+131072);for(var _=(1<<p)-1,$=(1<<f)-1,L=p+f+18;s||c+L<m;){var F=(k=d[Vt(e,c)&_])>>>4;if((c+=15&k)>m)throw"unexpected EOF";if(!k)throw"invalid length/literal";if(F<256)t[u++]=F;else{if(256==F){d=null;break}var P=F-254;if(F>264){var B=Tt[T=F-257];P=jt(e,c,(1<<B)-1)+Rt[T],c+=B}var U=h[Vt(e,c)&$],j=U>>>4;if(!U)throw"invalid distance";if(c+=15&U,O=At[j],j>3&&(B=Dt[j],O+=Vt(e,c)&(1<<B)-1,c+=B),c>m)throw"unexpected EOF";o&&a(u+131072);for(var V=u+P;u<V;u+=4)t[u]=t[u-O],t[u+1]=t[u+1-O],t[u+2]=t[u+2-O],t[u+3]=t[u+3-O];u=V}}n.l=d,n.p=c,n.b=u,d&&(l=1,n.m=p,n.d=h,n.n=f)}while(!l);return u==t.length?t:Wt(t,0,u)}((function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"}(e),e.subarray(2,-4)),t)}const Gt=e=>{if("string"!=typeof e)return e;try{const t=JSON.parse(e);if(t.timestamp)return t}catch(e){}try{const t=JSON.parse(function(e,t){var n="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var i=0;i<e.length;){var o=e[i++];o<128||t?n+=String.fromCharCode(o):o<224?n+=String.fromCharCode((31&o)<<6|63&e[i++]):o<240?n+=String.fromCharCode((15&o)<<12|(63&e[i++])<<6|63&e[i++]):(o=((15&o)<<18|(63&e[i++])<<12|(63&e[i++])<<6|63&e[i++])-65536,n+=String.fromCharCode(55296|o>>10,56320|1023&o))}return n}(zt(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new Et(e.length+(e.length>>>1)),o=0,s=function(e){i[o++]=e},r=0;r<n;++r){if(o+5>i.length){var a=new Et(o+8+(n-r<<1));a.set(i),i=a}var l=e.charCodeAt(r);l<128||t?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++r))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return Wt(i,0,o)}(e,!0))));if("v1"===t.v)return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer v1.`)}catch(e){throw console.error(e),new Error("Unknown data format.")}};function Ht(e){return{all:e=e||new Map,on:function(t,n){var i=e.get(t);i?i.push(n):e.set(t,[n])},off:function(t,n){var i=e.get(t);i&&(n?i.splice(i.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var i=e.get(t);i&&i.slice().map((function(e){e(n)})),(i=e.get("*"))&&i.slice().map((function(e){e(t,n)}))}}}var Yt=Object.freeze({__proto__:null,default:Ht});const qt=new Map;function Xt(e,t){let n=qt.get(e);return n||(n=new Map,qt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function Qt(e,t,n){return i=>ke(this,void 0,void 0,(function*(){if(i&&"object"==typeof i&&"rr_type"in i){if(n&&(n.isUnchanged=!1),"ImageBitmap"===i.rr_type&&"args"in i){const o=yield Qt(e,t,n)(i.args);return yield createImageBitmap.apply(null,o)}if("index"in i){if(n||null===t)return i;const{rr_type:e,index:o}=i;return Xt(t,e)[o]}if("args"in i){const{rr_type:o,args:s}=i;return new(0,window[o])(...yield Promise.all(s.map(Qt(e,t,n))))}if("base64"in i)return function(e){var t,n,i,o,s,r=.75*e.length,a=e.length,l=0;"="===e[e.length-1]&&(r--,"="===e[e.length-2]&&r--);var c=new ArrayBuffer(r),u=new Uint8Array(c);for(t=0;t<a;t+=4)n=Ie[e.charCodeAt(t)],i=Ie[e.charCodeAt(t+1)],o=Ie[e.charCodeAt(t+2)],s=Ie[e.charCodeAt(t+3)],u[l++]=n<<2|i>>4,u[l++]=(15&i)<<4|o>>2,u[l++]=(3&o)<<6|63&s;return c}(i.base64);if("src"in i){const t=e.get(i.src);if(t)return t;{const t=new Image;return t.src=i.src,e.set(i.src,t),t}}if("data"in i&&"Blob"===i.rr_type){const o=yield Promise.all(i.data.map(Qt(e,t,n)));return new Blob(o,{type:i.type})}}else if(Array.isArray(i)){return yield Promise.all(i.map(Qt(e,t,n)))}return i}))}const Jt=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Zt({mutation:e,target:t,type:n,imageMap:i,errorHandler:o}){return ke(this,void 0,void 0,(function*(){try{const o=function(e,t){try{return t===ve.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch(e){return null}}(t,n);if(!o)return;if(e.setter)return void(o[e.property]=e.args[0]);const s=o[e.property],r=yield Promise.all(e.args.map(Qt(i,o)));!function(e,t){if(!(null==t?void 0:t.constructor))return;const{name:n}=t.constructor;if(!Jt.includes(n))return;const i=Xt(e,n);i.includes(t)||i.push(t)}(o,s.apply(o,r))}catch(t){o(e,t)}}))}function Kt({event:e,mutation:t,target:n,imageMap:i,canvasEventMap:o,errorHandler:s}){return ke(this,void 0,void 0,(function*(){try{const r=o.get(e)||t,a="commands"in r?r.commands:[r];if([ve.WebGL,ve.WebGL2].includes(t.type)){for(let e=0;e<a.length;e++){const o=a[e];yield Zt({mutation:o,type:t.type,target:n,imageMap:i,errorHandler:s})}return}yield function({event:e,mutations:t,target:n,imageMap:i,errorHandler:o}){return ke(this,void 0,void 0,(function*(){const s=n.getContext("2d");if(!s)return void o(t[0],new Error("Canvas context is null"));const r=t.map((e=>ke(this,void 0,void 0,(function*(){return Promise.all(e.args.map(Qt(i,s)))}))));(yield Promise.all(r)).forEach(((n,r)=>{const a=t[r];try{if(a.setter)return void(s[a.property]=a.args[0]);const t=s[a.property];"drawImage"===a.property&&"string"==typeof a.args[0]?(i.get(e),t.apply(s,a.args)):t.apply(s,n)}catch(e){o(a,e)}}))}))}({event:e,mutations:a,target:n,imageMap:i,errorHandler:s})}catch(e){s(t,e)}}))}
16
16
  /*! *****************************************************************************
17
17
  Copyright (c) Microsoft Corporation.
18
18
 
@@ -26,5 +26,5 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
26
26
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
27
27
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
28
28
  PERFORMANCE OF THIS SOFTWARE.
29
- ***************************************************************************** */function Jt(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,s=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return r}var Zt;!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Zt||(Zt={}));var Kt={type:"xstate.init"};function en(e){return void 0===e?[]:[].concat(e)}function tn(e){return{type:"xstate.assign",assignment:e}}function nn(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 on(e){return function(t){return e===t}}function sn(e){return"string"==typeof e?{type:e}:e}function rn(e,t){return{value:e,context:t,actions:[],changed:!1,matches:on(e)}}function an(e,t,n){var i=t,o=!1;return[e.filter((function(e){if("xstate.assign"===e.type){o=!0;var t=Object.assign({},i);return"function"==typeof e.assignment?t=e.assignment(i,n):Object.keys(e.assignment).forEach((function(o){t[o]="function"==typeof e.assignment[o]?e.assignment[o](i,n):e.assignment[o]})),i=t,!1}return!0})),i,o]}function ln(e,t){void 0===t&&(t={});var n=Jt(an(en(e.states[e.initial].entry).map((function(e){return nn(e,t.actions)})),e.context,Kt),2),i=n[0],o=n[1],s={config:e,_options:t,initialState:{value:e.initial,actions:i,context:o,matches:on(e.initial)},transition:function(t,n){var i,o,r="string"==typeof t?{value:t,context:e.context}:t,a=r.value,l=r.context,c=sn(n),u=e.states[a];if(u.on){var d=en(u.on[c.type]);try{for(var h=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(d),p=h.next();!p.done;p=h.next()){var f=p.value;if(void 0===f)return rn(a,l);var m="string"==typeof f?{target:f}:f,g=m.target,y=m.actions,v=void 0===y?[]:y,w=m.cond,b=void 0===w?function(){return!0}:w,E=void 0===g,N=null!=g?g:a,S=e.states[N];if(b(l,c)){var T=Jt(an((E?en(v):[].concat(u.exit,v,S.entry).filter((function(e){return e}))).map((function(e){return nn(e,s._options.actions)})),l,c),3),D=T[0],M=T[1],C=T[2],x=null!=g?g:a;return{value:x,context:M,actions:D,changed:g!==a||D.length>0||C,matches:on(x)}}}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}}return rn(a,l)}};return s}var cn=function(e,t){return e.actions.forEach((function(n){var i=n.exec;return i&&i(e.context,t)}))};function un(e){var t=e.initialState,n=Zt.NotStarted,i=new Set,o={_machine:e,send:function(o){n===Zt.Running&&(t=e.transition(t,o),cn(t,sn(o)),i.forEach((function(e){return e(t)})))},subscribe:function(e){return i.add(e),e(t),{unsubscribe:function(){return i.delete(e)}}},start:function(i){if(i){var s="object"==typeof i?i:{context:e.config.context,value:i};t={value:s.value,actions:[],context:s.context,matches:on(s.value)}}return n=Zt.Running,cn(t,Kt),o},stop:function(){return n=Zt.Stopped,i.clear(),o},get state(){return t},get status(){return n}};return o}class dn{constructor(e=[],t){this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t.speed}addAction(e){const t=!0===this.raf;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const t=this.findActionIndex(e);this.actions.splice(t,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){const e=this.actions[0];if(!(this.timeOffset>=e.delay))break;this.actions.shift(),e.doAction()}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(!0!==this.raf&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return null!==this.raf}findActionIndex(e){let t=0,n=this.actions.length-1;for(;t<=n;){const i=Math.floor((t+n)/2);if(this.actions[i].delay<e.delay)t=i+1;else{if(!(this.actions[i].delay>e.delay))return i+1;n=i-1}}return t}}function hn(e,t){if(e.type===he.IncrementalSnapshot&&e.data.source===pe.MouseMove&&e.data.positions&&e.data.positions.length){const n=e.data.positions[0].timeOffset,i=e.timestamp+n;return e.delay=i-t,i-t}return e.delay=e.timestamp-t,e.delay}function pn(e,{getCastFn:t,applyEventsSynchronously:n,emitter:i}){const o=ln({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"]}}},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"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:tn({lastPlayedEvent:(e,t)=>"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}),recordTimeOffset:tn(((e,t)=>{let n=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(n=t.payload.timeOffset),Object.assign(Object.assign({},e),{timeOffset:n,baselineTime:e.events[0].timestamp+n})})),play(e){var o;const{timer:s,events:r,baselineTime:a,lastPlayedEvent:l}=e;s.clear();for(const e of r)hn(e,a);const c=function(e,t){for(let n=e.length-1;n>=0;n--){const i=e[n];if(i.type===he.Meta&&i.timestamp<=t)return e.slice(n)}return e}(r,a);let u=null==l?void 0:l.timestamp;(null==l?void 0:l.type)===he.IncrementalSnapshot&&l.data.source===pe.MouseMove&&(u=l.timestamp+(null===(o=l.data.positions[0])||void 0===o?void 0:o.timeOffset)),a<(u||0)&&i.emit(ge.PlayBack);const d=new Array;for(const e of c)if(!(u&&u<a&&(e.timestamp<=u||e===l)))if(e.timestamp<a)d.push(e);else{const n=t(e,!1);s.addAction({doAction:()=>{n()},delay:e.delay})}n(d),i.emit(ge.Flush),s.start()},pause(e){e.timer.clear()},resetLastPlayedEvent:tn((e=>Object.assign(Object.assign({},e),{lastPlayedEvent:null}))),startLive:tn({baselineTime:(e,t)=>(e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now())}),addEvent:tn(((e,n)=>{const{baselineTime:i,timer:o,events:s}=e;if("ADD_EVENT"===n.type){const{event:e}=n.payload;hn(e,i);let r=s.length-1;if(!s[r]||s[r].timestamp<=e.timestamp)s.push(e);else{let t=-1,n=0;for(;n<=r;){const t=Math.floor((n+r)/2);s[t].timestamp<=e.timestamp?n=t+1:r=t-1}-1===t&&(t=n),s.splice(t,0,e)}const a=e.timestamp<i,l=t(e,a);a?l():o.isActive()&&o.addAction({doAction:()=>{l()},delay:e.delay})}return Object.assign(Object.assign({},e),{events:s})}))}});return un(o)}function fn(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)return;const n=e.HTMLElement||e.Element,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||a,scrollIntoView:n.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;const s=(r=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(r)?1:0);var r;function a(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+s<e.scrollHeight:"X"===t?e.clientWidth+s<e.scrollWidth:void 0}function u(t,n){const i=e.getComputedStyle(t,null)["overflow"+n];return"auto"===i||"scroll"===i}function d(e){const t=c(e,"Y")&&u(e,"Y"),n=c(e,"X")&&u(e,"X");return t||n}function h(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}function p(t){let n,i,s,r=(o()-t.startTime)/468;var a;r=r>1?1:r,a=r,n=.5*(1-Math.cos(Math.PI*a)),i=t.startX+(t.x-t.startX)*n,s=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,i,s),i===t.x&&s===t.y||e.requestAnimationFrame(p.bind(e,t))}function f(n,s,r){let l,c,u,d;const h=o();n===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(l=n,c=n.scrollLeft,u=n.scrollTop,d=a),p({scrollable:l,method:d,startTime:h,startX:c,startY:u,x:s,y:r})}e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?f.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):f.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])return;if(!0===l(arguments[0])){if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");return void i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}const e=arguments[0].left,t=arguments[0].top;f.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)},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}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},n.prototype.scrollIntoView=function(){if(!0===l(arguments[0]))return void i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0]);const n=h(this),o=n.getBoundingClientRect(),s=this.getBoundingClientRect();n!==t.body?(f.call(this,n,n.scrollLeft+s.left-o.left,n.scrollTop+s.top-o.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})):e.scrollBy({left:s.left,top:s.top,behavior:"smooth"})}}const mn=Wt||zt,gn={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function yn(e){return e.type==he.IncrementalSnapshot&&(e.data.source==pe.TouchMove||e.data.source==pe.MouseInteraction&&e.data.type==fe.TouchStart)}class vn{get timer(){return this.service.state.context.timer}constructor(e,t){if(this.usingVirtualDom=!1,this.virtualDom=new ot,this.mouseTail=null,this.tailPositions=[],this.emitter=mn(),this.legacy_missingNodeRetryMap={},this.cache=le(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=K(),this.styleMirror=new Me,this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.lastMouseDownEvent=null,this.lastSelectionData=null,this.constructedStyleMutations=[],this.adoptedStyleSheets=[],this.handleResize=e=>{this.iframe.style.display="inherit";for(const t of[this.mouseTail,this.iframe])t&&(t.setAttribute("width",String(e.width)),t.setAttribute("height",String(e.height)))},this.applyEventsSynchronously=e=>{for(const t of e){switch(t.type){case he.DomContentLoaded:case he.Load:case he.Custom:continue;case he.FullSnapshot:case he.Meta:case he.Plugin:case he.IncrementalSnapshot:}this.getCastFn(t,!0)()}},this.getCastFn=(e,t=!1)=>{let n;switch(e.type){case he.DomContentLoaded:case he.Load:break;case he.Custom:n=()=>{this.emitter.emit(ge.CustomEvent,e)};break;case he.Meta:n=()=>this.emitter.emit(ge.Resize,{width:e.data.width,height:e.data.height});break;case he.FullSnapshot:n=()=>{var n;if(this.firstFullSnapshot){if(this.firstFullSnapshot===e)return void(this.firstFullSnapshot=!0)}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(e,t),null===(n=this.iframe.contentWindow)||void 0===n||n.scrollTo(e.data.initialOffset),this.styleMirror.reset()};break;case he.IncrementalSnapshot:n=()=>{if(this.applyIncremental(e,t),!t&&this.config.skipInactive&&!this.nextUserInteractionEvent){for(const t of this.service.state.context.events)if(!(t.timestamp<=e.timestamp)&&this.isUserInteraction(t)){t.delay-e.delay>1e4*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=t);break}if(this.nextUserInteractionEvent){const t=this.nextUserInteractionEvent.delay-e.delay;this.play(this.getCurrentTime()+t),this.nextUserInteractionEvent=null}}}}return()=>{n&&n();for(const n of this.config.plugins||[])n.handler&&n.handler(e,t,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:e}});const i=this.service.state.context.events.length-1;if(!this.config.liveMode&&e===this.service.state.context.events[i]){const t=()=>{i<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(ge.Finish))};let n=50;e.type===he.IncrementalSnapshot&&e.data.source===pe.MouseMove&&e.data.positions.length&&(n+=Math.max(0,-e.data.positions[0].timeOffset)),setTimeout(t,n)}this.emitter.emit(ge.EventCast,e)}},!(null==t?void 0:t.liveMode)&&e.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:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:gn,useVirtualDom:!0,logger:console};this.config=Object.assign({},n,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(ge.Resize,this.handleResize),this.setupDom();for(const e of this.config.plugins||[])e.getMirror&&e.getMirror({nodeMirror:this.mirror});this.emitter.on(ge.Flush,(()=>{if(this.usingVirtualDom){const e={mirror:this.mirror,applyCanvas:(e,t,n)=>{Qt({event:e,mutation:t,target:n,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(e,t)=>{e.source===pe.StyleSheetRule?this.applyStyleSheetRule(e,t):e.source===pe.StyleDeclaration&&this.applyStyleDeclaration(e,t)},afterAppend:(e,t)=>{for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(e,{id:t,replayer:this})}};if(this.iframe.contentDocument)try{Ke(this.iframe.contentDocument,this.virtualDom,e,this.virtualDom.mirror)}catch(e){console.warn(e)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const t in this.legacy_missingNodeRetryMap)try{const n=this.legacy_missingNodeRetryMap[t],i=tt(n.node,this.mirror,this.virtualDom.mirror);Ke(i,n.node,e,this.virtualDom.mirror),n.node=i}catch(e){this.warn(e)}this.constructedStyleMutations.forEach((e=>{this.applyStyleSheetMutation(e)})),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach((e=>{this.applyAdoptedStyleSheet(e)})),this.adoptedStyleSheets=[]}if(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,this.lastMouseDownEvent){const[e,t]=this.lastMouseDownEvent;e.dispatchEvent(t)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)})),this.emitter.on(ge.PlayBack,(()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset()}));const i=new dn([],{speed:this.config.speed});this.service=pn({events:e.map((e=>t&&t.unpackFn?t.unpackFn(e):e)).sort(((e,t)=>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((e=>{this.emitter.emit(ge.StateChange,{player:e})})),this.speedService=un(ln({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:(e,t)=>{"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:tn({normalSpeed:e=>e.timer.speed}),restoreSpeed:e=>{e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((e=>{this.emitter.emit(ge.StateChange,{speed:e})}));const o=this.service.state.context.events.find((e=>e.type===he.Meta)),s=this.service.state.context.events.find((e=>e.type===he.FullSnapshot));if(o){const{width:e,height:t}=o.data;setTimeout((()=>{this.emitter.emit(ge.Resize,{width:e,height:t})}),0)}s&&setTimeout((()=>{var e;this.firstFullSnapshot||(this.firstFullSnapshot=s,this.rebuildFullSnapshot(s),null===(e=this.iframe.contentWindow)||void 0===e||e.scrollTo(s.data.initialOffset))}),1),this.service.state.context.events.find(yn)&&this.mouse.classList.add("touch-device")}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach((t=>{e[t],this.config[t]=e[t]})),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"))}getMetaData(){const 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}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,n;this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),null===(n=null===(t=this.iframe.contentDocument)||void 0===t?void 0:t.getElementsByTagName("html")[0])||void 0===n||n.classList.remove("rrweb-paused"),this.emitter.emit(ge.Start)}pause(e){var t,n;void 0===e&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof e&&(this.play(e),this.service.send({type:"PAUSE"})),null===(n=null===(t=this.iframe.contentDocument)||void 0===t?void 0:t.getElementsByTagName("html")[0])||void 0===n||n.classList.add("rrweb-paused"),this.emitter.emit(ge.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(ge.Resume)}destroy(){this.pause(),this.config.root.removeChild(this.wrapper),this.emitter.emit(ge.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const t=this.config.unpackFn?this.config.unpackFn(e):e;yn(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then((()=>this.service.send({type:"ADD_EVENT",payload:{event: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=le()}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),!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");const 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&&(fn(this.iframe.contentWindow,this.iframe.contentDocument),function(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=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const n=[],i=(e,t)=>{this.collectIframeAndAttachDocument(n,e);for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(e,{id:t,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),de(e.data.node,{doc:this.iframe.contentDocument,afterAppend:i,cache:this.cache,mirror:this.mirror}),i(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:e,builtNode:t}of n)this.attachDocumentToIframe(e,t),this.newDocumentQueue=this.newDocumentQueue.filter((t=>t!==e));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(ge.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var n;const i=(o=this.config.blockClass,[`.${o} { background: currentColor }`,"noscript { display: none !important; }"]).concat(this.config.insertStyleRules);var o;if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const n=this.virtualDom.createElement("style");this.virtualDom.mirror.add(n,yt(n,this.virtualDom.unserializedId)),e.insertBefore(n,t),n.rules.push({source:pe.StyleSheetRule,adds:i.map(((e,t)=>({rule:e,index:t})))})}else{const o=document.createElement("style");e.insertBefore(o,t);for(let e=0;e<i.length;e++)null===(n=o.sheet)||void 0===n||n.insertRule(i[e],e)}}attachDocumentToIframe(e,t){const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=(e,o)=>{this.collectIframeAndAttachDocument(i,e);const s=n.getMeta(e);if((null==s?void 0:s.type)===Q.Element&&"HTML"===(null==s?void 0:s.tagName.toUpperCase())){const{documentElement:e,head:n}=t.contentDocument;this.insertStyleRules(e,n)}if(!this.usingVirtualDom)for(const t of this.config.plugins||[])t.onBuild&&t.onBuild(e,{id:o,replayer:this})};ue(e.node,{doc:t.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(t.contentDocument,e.node.id);for(const{mutationInQueue:e,builtNode:t}of i)this.attachDocumentToIframe(e,t),this.newDocumentQueue=this.newDocumentQueue.filter((t=>t!==e))}collectIframeAndAttachDocument(e,t){if(Ee(t,this.mirror)){const n=this.newDocumentQueue.find((e=>e.parentId===this.mirror.getId(t)));n&&e.push({mutationInQueue:n,builtNode:t})}}waitForStylesheetLoad(){var e;const t=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(t){const e=new Set;let n,i=this.service.state;const o=()=>{i=this.service.state};this.emitter.on(ge.Start,o),this.emitter.on(ge.Pause,o);const s=()=>{this.emitter.off(ge.Start,o),this.emitter.off(ge.Pause,o)};t.querySelectorAll('link[rel="stylesheet"]').forEach((t=>{t.sheet||(e.add(t),t.addEventListener("load",(()=>{e.delete(t),0===e.size&&-1!==n&&(i.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(ge.LoadStylesheetEnd),n&&clearTimeout(n),s())})))})),e.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(ge.LoadStylesheetStart),n=setTimeout((()=>{i.matches("playing")&&this.play(this.getCurrentTime()),n=-1,s()}),this.config.loadTimeout))}}preloadAllImages(){return Ce(this,void 0,void 0,(function*(){this.service.state;const e=()=>{this.service.state};this.emitter.on(ge.Start,e),this.emitter.on(ge.Pause,e);const t=[];for(const e of this.service.state.context.events)if(e.type===he.IncrementalSnapshot&&e.data.source===pe.CanvasMutation){t.push(this.deserializeAndPreloadCanvasEvents(e.data,e));("commands"in e.data?e.data.commands:[e.data]).forEach((t=>{this.preloadImages(t,e)}))}return Promise.all(t)}))}preloadImages(e,t){if("drawImage"===e.property&&"string"==typeof e.args[0]&&!this.imageMap.has(t)){const t=document.createElement("canvas"),n=t.getContext("2d"),i=null==n?void 0:n.createImageData(t.width,t.height);null==i||i.data,JSON.parse(e.args[0]),null==n||n.putImageData(i,0,0)}}deserializeAndPreloadCanvasEvents(e,t){return Ce(this,void 0,void 0,(function*(){if(!this.canvasEventMap.has(t)){const n={isUnchanged:!0};if("commands"in e){const i=yield Promise.all(e.commands.map((e=>Ce(this,void 0,void 0,(function*(){const t=yield Promise.all(e.args.map(Yt(this.imageMap,null,n)));return Object.assign(Object.assign({},e),{args:t})})))));!1===n.isUnchanged&&this.canvasEventMap.set(t,Object.assign(Object.assign({},e),{commands:i}))}else{const i=yield Promise.all(e.args.map(Yt(this.imageMap,null,n)));!1===n.isUnchanged&&this.canvasEventMap.set(t,Object.assign(Object.assign({},e),{args:i}))}}}))}applyIncremental(e,t){var n,i,o;const{data:s}=e;switch(s.source){case pe.Mutation:try{this.applyMutation(s,t)}catch(e){this.warn(`Exception in mutation ${e.message||e}`,s)}break;case pe.Drag:case pe.TouchMove:case pe.MouseMove:if(t){const e=s.positions[s.positions.length-1];this.mousePos={x:e.x,y:e.y,id:e.id,debugData:s}}else s.positions.forEach((n=>{const i={doAction:()=>{this.moveAndHover(n.x,n.y,n.id,t,s)},delay:n.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(i)})),this.timer.addAction({doAction(){},delay:e.delay-(null===(n=s.positions[0])||void 0===n?void 0:n.timeOffset)});break;case pe.MouseInteraction:{if(-1===s.id)break;const e=new Event(fe[s.type].toLowerCase()),n=this.mirror.getNode(s.id);if(!n)return this.debugNodeNotFound(s,s.id);this.emitter.emit(ge.MouseInteraction,{type:s.type,target:n});const{triggerFocus:i}=this.config;switch(s.type){case fe.Blur:"blur"in n&&n.blur();break;case fe.Focus:i&&n.focus&&n.focus({preventScroll:!0});break;case fe.Click:case fe.TouchStart:case fe.TouchEnd:case fe.MouseDown:case fe.MouseUp:t?(s.type===fe.TouchStart?this.touchActive=!0:s.type===fe.TouchEnd&&(this.touchActive=!1),s.type===fe.MouseDown?this.lastMouseDownEvent=[n,e]:s.type===fe.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===fe.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,t,s),s.type===fe.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===fe.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===fe.TouchEnd?this.mouse.classList.remove("touch-active"):n.dispatchEvent(e));break;case fe.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:n.dispatchEvent(e)}break}case pe.Scroll:if(-1===s.id)break;if(this.usingVirtualDom){const e=this.virtualDom.mirror.getNode(s.id);if(!e)return this.debugNodeNotFound(s,s.id);e.scrollData=s;break}this.applyScroll(s,t);break;case pe.ViewportResize:this.emitter.emit(ge.Resize,{width:s.width,height:s.height});break;case pe.Input:if(-1===s.id)break;if(this.usingVirtualDom){const e=this.virtualDom.mirror.getNode(s.id);if(!e)return this.debugNodeNotFound(s,s.id);e.inputData=s;break}this.applyInput(s);break;case pe.MediaInteraction:{const e=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!e)return this.debugNodeNotFound(s,s.id);const t=e;try{void 0!==s.currentTime&&(t.currentTime=s.currentTime),void 0!==s.volume&&(t.volume=s.volume),void 0!==s.muted&&(t.muted=s.muted),1===s.type&&t.pause(),0===s.type&&t.play(),4===s.type&&(t.playbackRate=s.playbackRate)}catch(e){this.warn(`Failed to replay media interactions: ${e.message||e}`)}break}case pe.StyleSheetRule:case pe.StyleDeclaration:this.usingVirtualDom?s.styleId?this.constructedStyleMutations.push(s):s.id&&(null===(i=this.virtualDom.mirror.getNode(s.id))||void 0===i||i.rules.push(s)):this.applyStyleSheetMutation(s);break;case pe.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const t=this.virtualDom.mirror.getNode(s.id);if(!t)return this.debugNodeNotFound(s,s.id);t.canvasMutations.push({event:e,mutation:s})}else{const t=this.mirror.getNode(s.id);if(!t)return this.debugNodeNotFound(s,s.id);Qt({event:e,mutation:s,target:t,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break;case pe.Font:try{const e=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);null===(o=this.iframe.contentDocument)||void 0===o||o.fonts.add(e)}catch(e){this.warn(e)}break;case pe.Selection:if(t){this.lastSelectionData=s;break}this.applySelection(s);break;case pe.AdoptedStyleSheet:this.usingVirtualDom?this.adoptedStyleSheets.push(s):this.applyAdoptedStyleSheet(s)}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,mt(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const e in this.legacy_missingNodeRetryMap)try{const t=this.legacy_missingNodeRetryMap[e],n=ft(t.node,this.virtualDom,this.mirror);n&&(t.node=n)}catch(e){this.warn(e)}const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter((t=>!!n.getNode(t.id)||(this.warnNodeNotFound(e,t.id),!1))),e.removes.forEach((t=>{var i;const o=n.getNode(t.id);if(!o)return;let s=n.getNode(t.parentId);if(!s)return this.warnNodeNotFound(e,t.parentId);if(t.isShadow&&Se(s)&&(s=s.shadowRoot),n.removeNodeFromMap(o),s)try{s.removeChild(o),this.usingVirtualDom&&"#text"===o.nodeName&&"STYLE"===s.nodeName&&(null===(i=s.rules)||void 0===i?void 0:i.length)>0&&(s.rules=[])}catch(t){if(!(t instanceof DOMException))throw t;this.warn("parent could not remove child in mutation",s,o,e)}}));const i=Object.assign({},this.legacy_missingNodeRetryMap),o=[],s=e=>{var t,s;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let r=n.getNode(e.parentId);if(!r)return e.node.type===Q.Document?this.newDocumentQueue.push(e):o.push(e);e.node.isShadow&&(Se(r)||r.attachShadow({mode:"open"}),r=r.shadowRoot);let a=null,l=null;if(e.previousId&&(a=n.getNode(e.previousId)),e.nextId&&(l=n.getNode(e.nextId)),(e=>{let t=null;return e.nextId&&(t=n.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t})(e))return o.push(e);if(e.node.rootId&&!n.getNode(e.node.rootId))return;const c=e.node.rootId?n.getNode(e.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ee(r,n))return void this.attachDocumentToIframe(e,r);const u=(e,t)=>{if(!this.usingVirtualDom)for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(e,{id:t,replayer:this})},d=ue(e.node,{doc:c,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:u});if(-1===e.previousId||-1===e.nextId)return void(i[e.node.id]={node:d,mutation:e});const h=n.getMeta(r);if(h&&h.type===Q.Element&&"textarea"===h.tagName&&e.node.type===Q.Text){const e=Array.isArray(r.childNodes)?r.childNodes:Array.from(r.childNodes);for(const t of e)t.nodeType===r.TEXT_NODE&&r.removeChild(t)}else if((null==h?void 0:h.type)===Q.Document){const n=r;e.node.type===Q.DocumentType&&(null===(t=n.childNodes[0])||void 0===t?void 0:t.nodeType)===Node.DOCUMENT_TYPE_NODE&&n.removeChild(n.childNodes[0]),"HTML"===d.nodeName&&n.documentElement&&n.removeChild(n.documentElement)}if(a&&a.nextSibling&&a.nextSibling.parentNode?r.insertBefore(d,a.nextSibling):l&&l.parentNode?r.contains(l)?r.insertBefore(d,l):r.insertBefore(d,null):r.appendChild(d),u(d,e.node.id),this.usingVirtualDom&&"#text"===d.nodeName&&"STYLE"===r.nodeName&&(null===(s=r.rules)||void 0===s?void 0:s.length)>0&&(r.rules=[]),Ee(d,this.mirror)){const e=this.mirror.getId(d),t=this.newDocumentQueue.find((t=>t.parentId===e));t&&(this.attachDocumentToIframe(t,d),this.newDocumentQueue=this.newDocumentQueue.filter((e=>e!==t)))}(e.previousId||e.nextId)&&this.legacy_resolveMissingNode(i,r,d,e)};e.adds.forEach((e=>{s(e)}));const r=Date.now();for(;o.length;){const e=we(o);if(o.length=0,Date.now()-r>500){this.warn("Timeout in the loop, please check the resolve tree data:",e);break}for(const t of e){n.getNode(t.value.parentId)?be(t,(e=>{s(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",t)}}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),function(e){const t=new Set,n=[];for(let i=e.length;i--;){const o=e[i];t.has(o.id)||(n.push(o),t.add(o.id))}return n}(e.texts).forEach((t=>{var i;const o=n.getNode(t.id);if(!o){if(e.removes.find((e=>e.id===t.id)))return;return this.warnNodeNotFound(e,t.id)}if(o.textContent=t.value,this.usingVirtualDom){const e=o.parentNode;(null===(i=null==e?void 0:e.rules)||void 0===i?void 0:i.length)>0&&(e.rules=[])}})),e.attributes.forEach((t=>{const i=n.getNode(t.id);if(!i){if(e.removes.find((e=>e.id===t.id)))return;return this.warnNodeNotFound(e,t.id)}for(const e in t.attributes)if("string"==typeof e){const o=t.attributes[e];if(null===o)i.removeAttribute(e);else if("string"==typeof o)try{if("_cssText"===e&&("LINK"===i.nodeName||"STYLE"===i.nodeName))try{const e=n.getMeta(i);Object.assign(e.attributes,t.attributes);const o=ue(e,{doc:i.ownerDocument,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache}),s=i.nextSibling,r=i.parentNode;if(o&&r){r.removeChild(i),r.insertBefore(o,s),n.replace(t.id,o);break}}catch(e){}i.setAttribute(e,o)}catch(e){this.warn("An error occurred may due to the checkout feature.",e)}else if("style"===e){const e=o,t=i;for(const n in e)if(!1===e[n])t.style.removeProperty(n);else if(e[n]instanceof Array){const i=e[n];t.style.setProperty(n,i[0],i[1])}else{const i=e[n];t.style.setProperty(n,i)}}}}))}applyScroll(e,t){var n,i;const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const s=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)null===(n=this.iframe.contentWindow)||void 0===n||n.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((null==s?void 0:s.type)===Q.Document)null===(i=o.defaultView)||void 0===i||i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{o.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"})}catch(e){}}applyInput(e){const 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){}}applySelection(e){try{const t=new Set,n=e.ranges.map((({start:e,startOffset:n,end:i,endOffset:o})=>{const s=this.mirror.getNode(e),r=this.mirror.getNode(i);if(!s||!r)return;const a=new Range;a.setStart(s,n),a.setEnd(r,o);const l=s.ownerDocument,c=null==l?void 0:l.getSelection();return c&&t.add(c),{range:a,selection:c}}));t.forEach((e=>e.removeAllRanges())),n.forEach((e=>{var t;return e&&(null===(t=e.selection)||void 0===t?void 0:t.addRange(e.range))}))}catch(e){}}applyStyleSheetMutation(e){var t;let n=null;e.styleId?n=this.styleMirror.getStyle(e.styleId):e.id&&(n=(null===(t=this.mirror.getNode(e.id))||void 0===t?void 0:t.sheet)||null),n&&(e.source===pe.StyleSheetRule?this.applyStyleSheetRule(e,n):e.source===pe.StyleDeclaration&&this.applyStyleDeclaration(e,n))}applyStyleSheetRule(e,t){var n,i,o,s;if(null===(n=e.adds)||void 0===n||n.forEach((({rule:e,index:n})=>{try{if(Array.isArray(n)){const{positions:i,index:o}=De(n);Te(t.cssRules,i).insertRule(e,o)}else{const i=void 0===n?void 0:Math.min(n,t.cssRules.length);null==t||t.insertRule(e,i)}}catch(e){}})),null===(i=e.removes)||void 0===i||i.forEach((({index:e})=>{try{if(Array.isArray(e)){const{positions:n,index:i}=De(e);Te(t.cssRules,n).deleteRule(i||0)}else null==t||t.deleteRule(e)}catch(e){}})),e.replace)try{null===(o=t.replace)||void 0===o||o.call(t,e.replace)}catch(e){}if(e.replaceSync)try{null===(s=t.replaceSync)||void 0===s||s.call(t,e.replaceSync)}catch(e){}}applyStyleDeclaration(e,t){if(e.set){Te(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority)}if(e.remove){Te(t.rules,e.index).style.removeProperty(e.remove.property)}}applyAdoptedStyleSheet(e){var t;const n=this.mirror.getNode(e.id);if(!n)return;null===(t=e.styles)||void 0===t||t.forEach((e=>{var t;let i=null,o=null;if(Se(n)?o=(null===(t=n.ownerDocument)||void 0===t?void 0:t.defaultView)||null:"#document"===n.nodeName&&(o=n.defaultView),o)try{i=new o.CSSStyleSheet,this.styleMirror.add(i,e.styleId),this.applyStyleSheetRule({source:pe.StyleSheetRule,adds:e.rules},i)}catch(e){}}));let i=0;const o=(e,t)=>{const n=t.map((e=>this.styleMirror.getStyle(e))).filter((e=>null!==e));Se(e)?e.shadowRoot.adoptedStyleSheets=n:"#document"===e.nodeName&&(e.adoptedStyleSheets=n),n.length!==t.length&&i<10&&(setTimeout((()=>o(e,t)),0+100*i),i++)};o(n,e.styleIds)}legacy_resolveMissingNode(e,t,n,i){const{previousId:o,nextId:s}=i,r=o&&e[o],a=s&&e[s];if(r){const{node:i,mutation:o}=r;t.insertBefore(i,n),delete e[o.node.id],delete this.legacy_missingNodeRetryMap[o.node.id],(o.previousId||o.nextId)&&this.legacy_resolveMissingNode(e,t,i,o)}if(a){const{node:i,mutation:o}=a;t.insertBefore(i,n.nextSibling),delete e[o.node.id],delete this.legacy_missingNodeRetryMap[o.node.id],(o.previousId||o.nextId)&&this.legacy_resolveMissingNode(e,t,i,o)}}moveAndHover(e,t,n,i,o){const s=this.mirror.getNode(n);if(!s)return this.debugNodeNotFound(o,n);const r=Ne(s,this.iframe),a=e*r.absoluteScale+r.x,l=t*r.absoluteScale+r.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${l}px`,i||this.drawMouseTail({x:a,y:l}),this.hoverElements(s)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:t,lineWidth:n,strokeStyle:i,duration:o}=!0===this.config.mouseTail?gn:Object.assign({},gn,this.config.mouseTail),s=()=>{if(!this.mouseTail)return;const e=this.mouseTail.getContext("2d");e&&this.tailPositions.length&&(e.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),e.beginPath(),e.lineWidth=n,e.lineCap=t,e.strokeStyle=i,e.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach((t=>e.lineTo(t.x,t.y))),e.stroke())};this.tailPositions.push(e),s(),setTimeout((()=>{this.tailPositions=this.tailPositions.filter((t=>t!==e)),s()}),o/this.speedService.state.context.timer.speed)}hoverElements(e){var t;null===(t=this.lastHoveredRootNode||this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((e=>{e.classList.remove(":hover")})),this.lastHoveredRootNode=e.getRootNode();let n=e;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(e){return e.type===he.IncrementalSnapshot&&(e.data.source>pe.Mutation&&e.data.source<=pe.Input)}backToNormal(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(ge.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn("[replayer]",...e)}debug(...e){this.config.showDebug&&this.config.logger.log("[replayer]",...e)}}function wn(e){let t="";return Object.keys(e).forEach((n=>{t+=`${n}: ${e[n]};`})),t}function bn(e,t=2){let n=String(e);const i=Math.pow(10,t-1);if(e<i)for(;String(i).length>n.length;)n=`0${e}`;return n}function En(e){if(e<=0)return"00:00";const t=Math.floor(e/36e5);e%=36e5;const n=Math.floor(e/6e4);e%=6e4;const i=Math.floor(e/1e3);return t?`${bn(t)}:${bn(n)}:${bn(i)}`:`${bn(n)}:${bn(i)}`}function Nn(){let e=!1;return["fullscreen","webkitIsFullScreen","mozFullScreen","msFullscreenElement"].forEach((t=>{t in document&&(e=e||Boolean(document[t]))})),e}function Sn(e){return{"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"}[Object.prototype.toString.call(e)]}function Tn(e){return e.type===he.IncrementalSnapshot&&(e.data.source>pe.Mutation&&e.data.source<=pe.Input)}function Dn(t){let n,i,o,s,r,a,d,p,w;return{c(){n=h("div"),i=h("input"),o=m(),s=h("label"),r=m(),a=h("span"),d=f(t[3]),y(i,"type","checkbox"),y(i,"id",t[2]),i.disabled=t[1],y(i,"class","svelte-9brlez"),y(s,"for",t[2]),y(s,"class","svelte-9brlez"),y(a,"class","label svelte-9brlez"),y(n,"class","switch svelte-9brlez"),b(n,"disabled",t[1])},m(e,u){c(e,n,u),l(n,i),i.checked=t[0],l(n,o),l(n,s),l(n,r),l(n,a),l(a,d),p||(w=g(i,"change",t[4]),p=!0)},p(e,[t]){4&t&&y(i,"id",e[2]),2&t&&(i.disabled=e[1]),1&t&&(i.checked=e[0]),4&t&&y(s,"for",e[2]),8&t&&v(d,e[3]),2&t&&b(n,"disabled",e[1])},i:e,o:e,d(e){e&&u(n),p=!1,w()}}}function Mn(e,t,n){let{disabled:i}=t,{checked:o}=t,{id:s}=t,{label:r}=t;return e.$$set=e=>{"disabled"in e&&n(1,i=e.disabled),"checked"in e&&n(0,o=e.checked),"id"in e&&n(2,s=e.id),"label"in e&&n(3,r=e.label)},[o,i,s,r,function(){o=this.checked,n(0,o)}]}class Cn extends X{constructor(e){super(),q(this,e,Mn,Dn,r,{disabled:1,checked:0,id:2,label:3})}}function xn(e,t,n){const i=e.slice();return i[39]=t[n],i}function Rn(e,t,n){const i=e.slice();return i[42]=t[n],i}function kn(e,t,n){const i=e.slice();return i[45]=t[n],i}function An(e){let t,n,i,s,r,a,p,E,N,S,T,D,M,C,R,A,I,O,_,$,L,F,P,B,U,j,Y=En(e[6])+"",q=En(e[8].totalTime)+"",X=e[14],Q=[];for(let t=0;t<X.length;t+=1)Q[t]=In(kn(e,X,t));let J=e[9],Z=[];for(let t=0;t<J.length;t+=1)Z[t]=On(Rn(e,J,t));function K(e,t){return"playing"===e[7]?$n:_n}let ee=K(e),te=ee(e),ne=e[3],ie=[];for(let t=0;t<ne.length;t+=1)ie[t]=Ln(xn(e,ne,t));function oe(t){e[30](t)}let se={id:"skip",disabled:"skipping"===e[10],label:"skip inactive"};return void 0!==e[0]&&(se.checked=e[0]),$=new Cn({props:se}),x.push((()=>function(e,t,n){const i=e.$$.props[t];void 0!==i&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}($,"checked",oe))),{c(){t=h("div"),n=h("div"),i=h("span"),s=f(Y),r=m(),a=h("div"),p=h("div"),E=m();for(let e=0;e<Q.length;e+=1)Q[e].c();N=m();for(let e=0;e<Z.length;e+=1)Z[e].c();S=m(),T=h("div"),D=m(),M=h("span"),C=f(q),R=m(),A=h("div"),I=h("button"),te.c(),O=m();for(let e=0;e<ie.length;e+=1)ie[e].c();_=m(),z($.$$.fragment),F=m(),P=h("button"),P.innerHTML='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><defs><style type="text/css"></style></defs><path d="M916 380c-26.4 0-48-21.6-48-48L868 223.2 613.6 477.6c-18.4\n 18.4-48.8 18.4-68 0-18.4-18.4-18.4-48.8 0-68L800 156 692 156c-26.4\n 0-48-21.6-48-48 0-26.4 21.6-48 48-48l224 0c26.4 0 48 21.6 48 48l0\n 224C964 358.4 942.4 380 916 380zM231.2 860l108.8 0c26.4 0 48 21.6 48\n 48s-21.6 48-48 48l-224 0c-26.4 0-48-21.6-48-48l0-224c0-26.4 21.6-48\n 48-48 26.4 0 48 21.6 48 48L164 792l253.6-253.6c18.4-18.4 48.8-18.4\n 68 0 18.4 18.4 18.4 48.8 0 68L231.2 860z" p-id="1286"></path></svg>',y(i,"class","rr-timeline__time svelte-19ke1iv"),y(p,"class","rr-progress__step svelte-19ke1iv"),w(p,"width",e[13]),y(T,"class","rr-progress__handler svelte-19ke1iv"),w(T,"left",e[13]),y(a,"class","rr-progress svelte-19ke1iv"),b(a,"disabled","skipping"===e[10]),y(M,"class","rr-timeline__time svelte-19ke1iv"),y(n,"class","rr-timeline svelte-19ke1iv"),y(I,"class","svelte-19ke1iv"),y(P,"class","svelte-19ke1iv"),y(A,"class","rr-controller__btns svelte-19ke1iv"),y(t,"class","rr-controller svelte-19ke1iv")},m(o,u){c(o,t,u),l(t,n),l(n,i),l(i,s),l(n,r),l(n,a),l(a,p),e[27](p),l(a,E);for(let e=0;e<Q.length;e+=1)Q[e]&&Q[e].m(a,null);l(a,N);for(let e=0;e<Z.length;e+=1)Z[e]&&Z[e].m(a,null);l(a,S),l(a,T),e[28](a),l(n,D),l(n,M),l(M,C),l(t,R),l(t,A),l(A,I),te.m(I,null),l(A,O);for(let e=0;e<ie.length;e+=1)ie[e]&&ie[e].m(A,null);l(A,_),G($,A,null),l(A,F),l(A,P),B=!0,U||(j=[g(a,"click",e[16]),g(I,"click",e[4]),g(P,"click",e[31])],U=!0)},p(e,t){if((!B||64&t[0])&&Y!==(Y=En(e[6])+"")&&v(s,Y),(!B||8192&t[0])&&w(p,"width",e[13]),16384&t[0]){let n;for(X=e[14],n=0;n<X.length;n+=1){const i=kn(e,X,n);Q[n]?Q[n].p(i,t):(Q[n]=In(i),Q[n].c(),Q[n].m(a,N))}for(;n<Q.length;n+=1)Q[n].d(1);Q.length=X.length}if(512&t[0]){let n;for(J=e[9],n=0;n<J.length;n+=1){const i=Rn(e,J,n);Z[n]?Z[n].p(i,t):(Z[n]=On(i),Z[n].c(),Z[n].m(a,S))}for(;n<Z.length;n+=1)Z[n].d(1);Z.length=J.length}if((!B||8192&t[0])&&w(T,"left",e[13]),(!B||1024&t[0])&&b(a,"disabled","skipping"===e[10]),(!B||256&t[0])&&q!==(q=En(e[8].totalTime)+"")&&v(C,q),ee!==(ee=K(e))&&(te.d(1),te=ee(e),te&&(te.c(),te.m(I,null))),1066&t[0]){let n;for(ne=e[3],n=0;n<ne.length;n+=1){const i=xn(e,ne,n);ie[n]?ie[n].p(i,t):(ie[n]=Ln(i),ie[n].c(),ie[n].m(A,_))}for(;n<ie.length;n+=1)ie[n].d(1);ie.length=ne.length}const n={};var i;1024&t[0]&&(n.disabled="skipping"===e[10]),!L&&1&t[0]&&(L=!0,n.checked=e[0],i=()=>L=!1,k.push(i)),$.$set(n)},i(e){B||(V($.$$.fragment,e),B=!0)},o(e){W($.$$.fragment,e),B=!1},d(n){n&&u(t),e[27](null),d(Q,n),d(Z,n),e[28](null),te.d(),d(ie,n),H($),U=!1,o(j)}}}function In(e){let t,n;return{c(){t=h("div"),y(t,"title",n=e[45].name),w(t,"width",e[45].width),w(t,"height","4px"),w(t,"position","absolute"),w(t,"background",e[45].background),w(t,"left",e[45].position)},m(e,n){c(e,t,n)},p(e,i){16384&i[0]&&n!==(n=e[45].name)&&y(t,"title",n),16384&i[0]&&w(t,"width",e[45].width),16384&i[0]&&w(t,"background",e[45].background),16384&i[0]&&w(t,"left",e[45].position)},d(e){e&&u(t)}}}function On(e){let t,n;return{c(){t=h("div"),y(t,"title",n=e[42].name),w(t,"width","10px"),w(t,"height","5px"),w(t,"position","absolute"),w(t,"top","2px"),w(t,"transform","translate(-50%, -50%)"),w(t,"background",e[42].background),w(t,"left",e[42].position)},m(e,n){c(e,t,n)},p(e,i){512&i[0]&&n!==(n=e[42].name)&&y(t,"title",n),512&i[0]&&w(t,"background",e[42].background),512&i[0]&&w(t,"left",e[42].position)},d(e){e&&u(t)}}}function _n(e){let t,n;return{c(){t=p("svg"),n=p("path"),y(n,"d","M170.65984 896l0-768 640 384zM644.66944\n 512l-388.66944-233.32864 0 466.65728z"),y(t,"class","icon"),y(t,"viewBox","0 0 1024 1024"),y(t,"version","1.1"),y(t,"xmlns","http://www.w3.org/2000/svg"),y(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),y(t,"width","16"),y(t,"height","16")},m(e,i){c(e,t,i),l(t,n)},d(e){e&&u(t)}}}function $n(e){let t,n;return{c(){t=p("svg"),n=p("path"),y(n,"d","M682.65984 128q53.00224 0 90.50112 37.49888t37.49888 90.50112l0\n 512q0 53.00224-37.49888 90.50112t-90.50112\n 37.49888-90.50112-37.49888-37.49888-90.50112l0-512q0-53.00224\n 37.49888-90.50112t90.50112-37.49888zM341.34016 128q53.00224 0\n 90.50112 37.49888t37.49888 90.50112l0 512q0 53.00224-37.49888\n 90.50112t-90.50112\n 37.49888-90.50112-37.49888-37.49888-90.50112l0-512q0-53.00224\n 37.49888-90.50112t90.50112-37.49888zM341.34016 213.34016q-17.67424\n 0-30.16704 12.4928t-12.4928 30.16704l0 512q0 17.67424 12.4928\n 30.16704t30.16704 12.4928 30.16704-12.4928\n 12.4928-30.16704l0-512q0-17.67424-12.4928-30.16704t-30.16704-12.4928zM682.65984\n 213.34016q-17.67424 0-30.16704 12.4928t-12.4928 30.16704l0 512q0\n 17.67424 12.4928 30.16704t30.16704 12.4928 30.16704-12.4928\n 12.4928-30.16704l0-512q0-17.67424-12.4928-30.16704t-30.16704-12.4928z"),y(t,"class","icon"),y(t,"viewBox","0 0 1024 1024"),y(t,"version","1.1"),y(t,"xmlns","http://www.w3.org/2000/svg"),y(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),y(t,"width","16"),y(t,"height","16")},m(e,i){c(e,t,i),l(t,n)},d(e){e&&u(t)}}}function Ln(e){let t,n,i,o,s,r,a=e[39]+"";function d(){return e[29](e[39])}return{c(){t=h("button"),n=f(a),i=f("x"),t.disabled=o="skipping"===e[10],y(t,"class","svelte-19ke1iv"),b(t,"active",e[39]===e[1]&&"skipping"!==e[10])},m(e,o){c(e,t,o),l(t,n),l(t,i),s||(r=g(t,"click",d),s=!0)},p(i,s){e=i,8&s[0]&&a!==(a=e[39]+"")&&v(n,a),1024&s[0]&&o!==(o="skipping"===e[10])&&(t.disabled=o),1034&s[0]&&b(t,"active",e[39]===e[1]&&"skipping"!==e[10])},d(e){e&&u(t),s=!1,r()}}}function Fn(e){let t,n,i=e[2]&&An(e);return{c(){i&&i.c(),t=f("")},m(e,o){i&&i.m(e,o),c(e,t,o),n=!0},p(e,n){e[2]?i?(i.p(e,n),4&n[0]&&V(i,1)):(i=An(e),i.c(),V(i,1),i.m(t.parentNode,t)):i&&(U(),W(i,1,1,(()=>{i=null})),j())},i(e){n||(V(i),n=!0)},o(e){W(i),n=!1},d(e){i&&i.d(e),e&&u(t)}}}function Pn(e,t,n){return(100-(t-n)/(t-e)*100).toFixed(2)}function Bn(e,t,n){const i=M();let o,s,r,a,l,c,u,d,h,p,{replayer:f}=t,{showController:m}=t,{autoPlay:g}=t,{skipInactive:y}=t,{speedOption:v}=t,{speed:w=(v.length?v[0]:1)}=t,{tags:b={}}=t,{inactiveColor:E}=t,N=0,C=null,R=!1,k=null;const A=()=>{C&&(cancelAnimationFrame(C),C=null)},I=()=>{"paused"===o&&(l?(f.play(),l=!1):f.play(N))},O=()=>{"playing"===o&&(f.pause(),R=!1)},_=(e,t)=>{n(6,N=e),R=!1,l=!1;("boolean"==typeof t?t:"playing"===o)?f.play(e):f.pause(e)},$=(e,t,i=!1,o)=>{k=i?{start:e,end:t}:null,n(6,N=e),R=t,c=o,f.play(e)},L=e=>{let t="playing"===o;n(1,w=e),t&&f.pause(),f.setConfig({speed:w}),t&&f.play(N)};var F;T((()=>{n(7,o=f.service.state.value),n(10,s=f.speedService.state.value),f.on("state-change",(e=>{const{player:t,speed:i}=e;if((null==t?void 0:t.value)&&o!==t.value)switch(n(7,o=t.value),o){case"playing":A(),C=requestAnimationFrame((function e(){n(6,N=f.getCurrentTime()),R&&N>=R&&(k?$(k.start,k.end,!0,void 0):(f.pause(),c&&(c(),c=null))),N<u.totalTime&&(C=requestAnimationFrame(e))}));break;case"paused":A()}(null==i?void 0:i.value)&&s!==i.value&&n(10,s=i.value)})),f.on("finish",(()=>{l=!0,c&&(c(),c=null)})),g&&f.play()})),F=()=>{y!==f.config.skipInactive&&f.setConfig({skipInactive:y})},S().$$.after_update.push(F),D((()=>{f.pause(),A()}));return e.$$set=e=>{"replayer"in e&&n(17,f=e.replayer),"showController"in e&&n(2,m=e.showController),"autoPlay"in e&&n(18,g=e.autoPlay),"skipInactive"in e&&n(0,y=e.skipInactive),"speedOption"in e&&n(3,v=e.speedOption),"speed"in e&&n(1,w=e.speed),"tags"in e&&n(19,b=e.tags),"inactiveColor"in e&&n(20,E=e.inactiveColor)},e.$$.update=()=>{if(64&e.$$.dirty[0]&&i("ui-update-current-time",{payload:N}),128&e.$$.dirty[0]&&i("ui-update-player-state",{payload:o}),131072&e.$$.dirty[0]&&n(8,u=f.getMetaData()),320&e.$$.dirty[0]){const e=Math.min(1,N/u.totalTime);n(13,d=100*e+"%"),i("ui-update-progress",{payload:e})}655360&e.$$.dirty[0]&&n(9,h=(()=>{const{context:e}=f.service.state,t=e.events.length,n=e.events[0].timestamp,i=e.events[t-1].timestamp,o=[];return e.events.forEach((e=>{if(e.type===he.Custom){const t={name:e.data.tag,background:b[e.data.tag]||"rgb(73, 80, 246)",position:`${Pn(n,i,e.timestamp)}%`};o.push(t)}})),o})()),1179648&e.$$.dirty[0]&&n(14,p=(()=>{try{const{context:e}=f.service.state,t=e.events.length,n=e.events[0].timestamp,i=e.events[t-1].timestamp,o=function(e){const t=[];let n=e[0].timestamp;for(const i of e)Tn(i)&&(i.timestamp-n>1e4&&t.push([n,i.timestamp]),n=i.timestamp);return t}(e.events),s=(e,t,n,i)=>((i-n)/(t-e)*100).toFixed(2);return o.map((e=>({name:"inactive period",background:E,position:`${Pn(n,i,e[0])}%`,width:`${s(n,i,e[0],e[1])}%`})))}catch(e){return[]}})())},[y,w,m,v,()=>{switch(o){case"playing":O();break;case"paused":I()}},L,N,o,u,h,s,r,a,d,p,i,e=>{if("skipping"===s)return;const t=r.getBoundingClientRect();let n=(e.clientX-t.left)/t.width;n<0?n=0:n>1&&(n=1);const i=u.totalTime*n;_(i)},f,g,b,E,I,O,_,$,()=>{n(0,y=!y)},()=>Promise.resolve().then((()=>{n(8,u=f.getMetaData())})),function(e){x[e?"unshift":"push"]((()=>{a=e,n(12,a)}))},function(e){x[e?"unshift":"push"]((()=>{r=e,n(11,r)}))},e=>L(e),function(e){y=e,n(0,y)},()=>i("fullscreen")]}class Un extends X{constructor(e){super(),q(this,e,Bn,Fn,r,{replayer:17,showController:2,autoPlay:18,skipInactive:0,speedOption:3,speed:1,tags:19,inactiveColor:20,toggle:4,play:21,pause:22,goto:23,playRange:24,setSpeed:5,toggleSkipInactive:25,triggerUpdateMeta:26},null,[-1,-1])}get toggle(){return this.$$.ctx[4]}get play(){return this.$$.ctx[21]}get pause(){return this.$$.ctx[22]}get goto(){return this.$$.ctx[23]}get playRange(){return this.$$.ctx[24]}get setSpeed(){return this.$$.ctx[5]}get toggleSkipInactive(){return this.$$.ctx[25]}get triggerUpdateMeta(){return this.$$.ctx[26]}}function jn(e){let t,n,i={replayer:e[7],showController:e[3],autoPlay:e[1],speedOption:e[2],skipInactive:e[0],tags:e[4],inactiveColor:e[5]};return t=new Un({props:i}),e[32](t),t.$on("fullscreen",e[33]),{c(){z(t.$$.fragment)},m(e,i){G(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.replayer=e[7]),8&n[0]&&(i.showController=e[3]),2&n[0]&&(i.autoPlay=e[1]),4&n[0]&&(i.speedOption=e[2]),1&n[0]&&(i.skipInactive=e[0]),16&n[0]&&(i.tags=e[4]),32&n[0]&&(i.inactiveColor=e[5]),t.$set(i)},i(e){n||(V(t.$$.fragment,e),n=!0)},o(e){W(t.$$.fragment,e),n=!1},d(n){e[32](null),H(t,n)}}}function Vn(e){let t,n,i,o,s=e[7]&&jn(e);return{c(){t=h("div"),n=h("div"),i=m(),s&&s.c(),y(n,"class","rr-player__frame"),y(n,"style",e[11]),y(t,"class","rr-player"),y(t,"style",e[12])},m(r,a){c(r,t,a),l(t,n),e[31](n),l(t,i),s&&s.m(t,null),e[34](t),o=!0},p(e,i){(!o||2048&i[0])&&y(n,"style",e[11]),e[7]?s?(s.p(e,i),128&i[0]&&V(s,1)):(s=jn(e),s.c(),V(s,1),s.m(t,null)):s&&(U(),W(s,1,1,(()=>{s=null})),j()),(!o||4096&i[0])&&y(t,"style",e[12])},i(e){o||(V(s),o=!0)},o(e){W(s),o=!1},d(n){n&&u(t),e[31](null),s&&s.d(),e[34](null)}}}function Wn(e,n,i){let o,{width:s=1024}=n,{height:r=576}=n,{maxScale:l=1}=n,{events:c=[]}=n,{skipInactive:u=!0}=n,{autoPlay:d=!0}=n,{speedOption:h=[1,2,4,8]}=n,{speed:p=1}=n,{showController:f=!0}=n,{tags:m={}}=n,{inactiveColor:g="#D4D4D4"}=n;let y,v,w,b,E,N,S=s,M=r;const C=(e,t)=>{const n=[s/t.width,r/t.height];l&&n.push(l),e.style.transform=`scale(${Math.min(...n)})translate(-50%, -50%)`},R=()=>{var e;y&&(Nn()?document.exitFullscreen?document.exitFullscreen():document.mozExitFullscreen?document.mozExitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen():(e=y).requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen())};T((()=>{if(void 0!==h&&"array"!==Sn(h))throw new Error("speedOption must be array");if(h.forEach((e=>{if("number"!==Sn(e))throw new Error("item of speedOption must be number")})),h.indexOf(p)<0)throw new Error(`speed must be one of speedOption,\n current config:\n {\n ...\n speed: ${p},\n speedOption: [${h.toString()}]\n ...\n }\n `);var e;i(7,o=new vn(c,Object.assign({speed:p,root:v,unpackFn:Vt},n))),o.on("resize",(e=>{C(o.wrapper,e)})),e=()=>{Nn()?setTimeout((()=>{S=s,M=r,i(13,s=y.offsetWidth),i(14,r=y.offsetHeight-(f?80:0)),C(o.wrapper,{width:o.iframe.offsetWidth,height:o.iframe.offsetHeight})}),0):(i(13,s=S),i(14,r=M),C(o.wrapper,{width:o.iframe.offsetWidth,height:o.iframe.offsetHeight}))},document.addEventListener("fullscreenchange",e),document.addEventListener("webkitfullscreenchange",e),document.addEventListener("mozfullscreenchange",e),document.addEventListener("MSFullscreenChange",e),w=()=>{document.removeEventListener("fullscreenchange",e),document.removeEventListener("webkitfullscreenchange",e),document.removeEventListener("mozfullscreenchange",e),document.removeEventListener("MSFullscreenChange",e)}})),D((()=>{w&&w()}));return e.$$set=e=>{i(39,n=t(t({},n),a(e))),"width"in e&&i(13,s=e.width),"height"in e&&i(14,r=e.height),"maxScale"in e&&i(15,l=e.maxScale),"events"in e&&i(16,c=e.events),"skipInactive"in e&&i(0,u=e.skipInactive),"autoPlay"in e&&i(1,d=e.autoPlay),"speedOption"in e&&i(2,h=e.speedOption),"speed"in e&&i(17,p=e.speed),"showController"in e&&i(3,f=e.showController),"tags"in e&&i(4,m=e.tags),"inactiveColor"in e&&i(5,g=e.inactiveColor)},e.$$.update=()=>{24576&e.$$.dirty[0]&&i(11,E=wn({width:`${s}px`,height:`${r}px`})),24584&e.$$.dirty[0]&&i(12,N=wn({width:`${s}px`,height:`${r+(f?80:0)}px`}))},n=a(n),[u,d,h,f,m,g,R,o,y,v,b,E,N,s,r,l,c,p,()=>o.getMirror(),()=>{C(o.wrapper,{width:o.iframe.offsetWidth,height:o.iframe.offsetHeight})},(e,t)=>{switch(o.on(e,t),e){case"ui-update-current-time":case"ui-update-progress":case"ui-update-player-state":b.$on(e,(({detail:e})=>t(e)))}},e=>{o.addEvent(e),b.triggerUpdateMeta()},()=>o.getMetaData(),()=>o,()=>{b.toggle()},e=>{b.setSpeed(e)},()=>{b.toggleSkipInactive()},()=>{b.play()},()=>{b.pause()},(e,t)=>{b.goto(e,t)},(e,t,n=!1,i)=>{b.playRange(e,t,n,i)},function(e){x[e?"unshift":"push"]((()=>{v=e,i(9,v)}))},function(e){x[e?"unshift":"push"]((()=>{b=e,i(10,b)}))},()=>R(),function(e){x[e?"unshift":"push"]((()=>{y=e,i(8,y)}))}]}class zn extends X{constructor(e){super(),q(this,e,Wn,Vn,r,{width:13,height:14,maxScale:15,events:16,skipInactive:0,autoPlay:1,speedOption:2,speed:17,showController:3,tags:4,inactiveColor:5,getMirror:18,triggerResize:19,toggleFullscreen:6,addEventListener:20,addEvent:21,getMetaData:22,getReplayer:23,toggle:24,setSpeed:25,toggleSkipInactive:26,play:27,pause:28,goto:29,playRange:30},null,[-1,-1])}get getMirror(){return this.$$.ctx[18]}get triggerResize(){return this.$$.ctx[19]}get toggleFullscreen(){return this.$$.ctx[6]}get addEventListener(){return this.$$.ctx[20]}get addEvent(){return this.$$.ctx[21]}get getMetaData(){return this.$$.ctx[22]}get getReplayer(){return this.$$.ctx[23]}get toggle(){return this.$$.ctx[24]}get setSpeed(){return this.$$.ctx[25]}get toggleSkipInactive(){return this.$$.ctx[26]}get play(){return this.$$.ctx[27]}get pause(){return this.$$.ctx[28]}get goto(){return this.$$.ctx[29]}get playRange(){return this.$$.ctx[30]}}class Gn extends zn{constructor(e){super({target:e.target,props:e.data||e.props})}}export{Gn as default};
29
+ ***************************************************************************** */function en(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,s=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return r}var tn;!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(tn||(tn={}));var nn={type:"xstate.init"};function on(e){return void 0===e?[]:[].concat(e)}function sn(e){return{type:"xstate.assign",assignment:e}}function rn(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 an(e){return function(t){return e===t}}function ln(e){return"string"==typeof e?{type:e}:e}function cn(e,t){return{value:e,context:t,actions:[],changed:!1,matches:an(e)}}function un(e,t,n){var i=t,o=!1;return[e.filter((function(e){if("xstate.assign"===e.type){o=!0;var t=Object.assign({},i);return"function"==typeof e.assignment?t=e.assignment(i,n):Object.keys(e.assignment).forEach((function(o){t[o]="function"==typeof e.assignment[o]?e.assignment[o](i,n):e.assignment[o]})),i=t,!1}return!0})),i,o]}function dn(e,t){void 0===t&&(t={});var n=en(un(on(e.states[e.initial].entry).map((function(e){return rn(e,t.actions)})),e.context,nn),2),i=n[0],o=n[1],s={config:e,_options:t,initialState:{value:e.initial,actions:i,context:o,matches:an(e.initial)},transition:function(t,n){var i,o,r="string"==typeof t?{value:t,context:e.context}:t,a=r.value,l=r.context,c=ln(n),u=e.states[a];if(u.on){var d=on(u.on[c.type]);try{for(var h=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(d),p=h.next();!p.done;p=h.next()){var f=p.value;if(void 0===f)return cn(a,l);var m="string"==typeof f?{target:f}:f,g=m.target,y=m.actions,v=void 0===y?[]:y,w=m.cond,b=void 0===w?function(){return!0}:w,E=void 0===g,N=null!=g?g:a,S=e.states[N];if(b(l,c)){var T=en(un((E?on(v):[].concat(u.exit,v,S.entry).filter((function(e){return e}))).map((function(e){return rn(e,s._options.actions)})),l,c),3),D=T[0],M=T[1],C=T[2],x=null!=g?g:a;return{value:x,context:M,actions:D,changed:g!==a||D.length>0||C,matches:an(x)}}}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}}return cn(a,l)}};return s}var hn=function(e,t){return e.actions.forEach((function(n){var i=n.exec;return i&&i(e.context,t)}))};function pn(e){var t=e.initialState,n=tn.NotStarted,i=new Set,o={_machine:e,send:function(o){n===tn.Running&&(t=e.transition(t,o),hn(t,ln(o)),i.forEach((function(e){return e(t)})))},subscribe:function(e){return i.add(e),e(t),{unsubscribe:function(){return i.delete(e)}}},start:function(i){if(i){var s="object"==typeof i?i:{context:e.config.context,value:i};t={value:s.value,actions:[],context:s.context,matches:an(s.value)}}return n=tn.Running,hn(t,nn),o},stop:function(){return n=tn.Stopped,i.clear(),o},get state(){return t},get status(){return n}};return o}class fn{constructor(e=[],t){this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t.speed}addAction(e){const t=!0===this.raf;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const t=this.findActionIndex(e);this.actions.splice(t,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){const e=this.actions[0];if(!(this.timeOffset>=e.delay))break;this.actions.shift(),e.doAction()}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(!0!==this.raf&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return null!==this.raf}findActionIndex(e){let t=0,n=this.actions.length-1;for(;t<=n;){const i=Math.floor((t+n)/2);if(this.actions[i].delay<e.delay)t=i+1;else{if(!(this.actions[i].delay>e.delay))return i+1;n=i-1}}return t}}function mn(e,t){if(e.type===me.IncrementalSnapshot&&e.data.source===ge.MouseMove&&e.data.positions&&e.data.positions.length){const n=e.data.positions[0].timeOffset,i=e.timestamp+n;return e.delay=i-t,i-t}return e.delay=e.timestamp-t,e.delay}function gn(e,{getCastFn:t,applyEventsSynchronously:n,emitter:i}){const o=dn({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"]}}},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"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:sn({lastPlayedEvent:(e,t)=>"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}),recordTimeOffset:sn(((e,t)=>{let n=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(n=t.payload.timeOffset),Object.assign(Object.assign({},e),{timeOffset:n,baselineTime:e.events[0].timestamp+n})})),play(e){var o;const{timer:s,events:r,baselineTime:a,lastPlayedEvent:l}=e;s.clear();for(const e of r)mn(e,a);const c=function(e,t){for(let n=e.length-1;n>=0;n--){const i=e[n];if(i.type===me.Meta&&i.timestamp<=t)return e.slice(n)}return e}(r,a);let u=null==l?void 0:l.timestamp;(null==l?void 0:l.type)===me.IncrementalSnapshot&&l.data.source===ge.MouseMove&&(u=l.timestamp+(null===(o=l.data.positions[0])||void 0===o?void 0:o.timeOffset)),a<(u||0)&&i.emit(we.PlayBack);const d=new Array;for(const e of c)if(!(u&&u<a&&(e.timestamp<=u||e===l)))if(e.timestamp<a)d.push(e);else{const n=t(e,!1);s.addAction({doAction:()=>{n()},delay:e.delay})}n(d),i.emit(we.Flush),s.start()},pause(e){e.timer.clear()},resetLastPlayedEvent:sn((e=>Object.assign(Object.assign({},e),{lastPlayedEvent:null}))),startLive:sn({baselineTime:(e,t)=>(e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now())}),addEvent:sn(((e,n)=>{const{baselineTime:i,timer:o,events:s}=e;if("ADD_EVENT"===n.type){const{event:e}=n.payload;mn(e,i);let r=s.length-1;if(!s[r]||s[r].timestamp<=e.timestamp)s.push(e);else{let t=-1,n=0;for(;n<=r;){const t=Math.floor((n+r)/2);s[t].timestamp<=e.timestamp?n=t+1:r=t-1}-1===t&&(t=n),s.splice(t,0,e)}const a=e.timestamp<i,l=t(e,a);a?l():o.isActive()&&o.addAction({doAction:()=>{l()},delay:e.delay})}return Object.assign(Object.assign({},e),{events:s})}))}});return pn(o)}function yn(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)return;const n=e.HTMLElement||e.Element,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||a,scrollIntoView:n.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;const s=(r=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(r)?1:0);var r;function a(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+s<e.scrollHeight:"X"===t?e.clientWidth+s<e.scrollWidth:void 0}function u(t,n){const i=e.getComputedStyle(t,null)["overflow"+n];return"auto"===i||"scroll"===i}function d(e){const t=c(e,"Y")&&u(e,"Y"),n=c(e,"X")&&u(e,"X");return t||n}function h(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}function p(t){let n,i,s,r=(o()-t.startTime)/468;var a;r=r>1?1:r,a=r,n=.5*(1-Math.cos(Math.PI*a)),i=t.startX+(t.x-t.startX)*n,s=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,i,s),i===t.x&&s===t.y||e.requestAnimationFrame(p.bind(e,t))}function f(n,s,r){let l,c,u,d;const h=o();n===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(l=n,c=n.scrollLeft,u=n.scrollTop,d=a),p({scrollable:l,method:d,startTime:h,startX:c,startY:u,x:s,y:r})}e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?f.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):f.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])return;if(!0===l(arguments[0])){if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");return void i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}const e=arguments[0].left,t=arguments[0].top;f.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)},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}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},n.prototype.scrollIntoView=function(){if(!0===l(arguments[0]))return void i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0]);const n=h(this),o=n.getBoundingClientRect(),s=this.getBoundingClientRect();n!==t.body?(f.call(this,n,n.scrollLeft+s.left-o.left,n.scrollTop+s.top-o.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})):e.scrollBy({left:s.left,top:s.top,behavior:"smooth"})}}const vn=Ht||Yt,wn={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function bn(e){return e.type==me.IncrementalSnapshot&&(e.data.source==ge.TouchMove||e.data.source==ge.MouseInteraction&&e.data.type==ye.TouchStart)}class En{get timer(){return this.service.state.context.timer}constructor(e,t){if(this.usingVirtualDom=!1,this.virtualDom=new at,this.mouseTail=null,this.tailPositions=[],this.emitter=vn(),this.legacy_missingNodeRetryMap={},this.cache=de(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=K(),this.styleMirror=new Re,this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.lastMouseDownEvent=null,this.lastSelectionData=null,this.constructedStyleMutations=[],this.adoptedStyleSheets=[],this.handleResize=e=>{this.iframe.style.display="inherit";for(const t of[this.mouseTail,this.iframe])t&&(t.setAttribute("width",String(e.width)),t.setAttribute("height",String(e.height)))},this.applyEventsSynchronously=e=>{for(const t of e){switch(t.type){case me.DomContentLoaded:case me.Load:case me.Custom:continue;case me.FullSnapshot:case me.Meta:case me.Plugin:case me.IncrementalSnapshot:}this.getCastFn(t,!0)()}},this.getCastFn=(e,t=!1)=>{let n;switch(e.type){case me.DomContentLoaded:case me.Load:break;case me.Custom:n=()=>{this.emitter.emit(we.CustomEvent,e)};break;case me.Meta:n=()=>this.emitter.emit(we.Resize,{width:e.data.width,height:e.data.height});break;case me.FullSnapshot:n=()=>{var n;if(this.firstFullSnapshot){if(this.firstFullSnapshot===e)return void(this.firstFullSnapshot=!0)}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(e,t),null===(n=this.iframe.contentWindow)||void 0===n||n.scrollTo(e.data.initialOffset),this.styleMirror.reset()};break;case me.IncrementalSnapshot:n=()=>{if(this.applyIncremental(e,t),!t&&this.config.skipInactive&&!this.nextUserInteractionEvent){for(const t of this.service.state.context.events)if(!(t.timestamp<=e.timestamp)&&this.isUserInteraction(t)){t.delay-e.delay>1e4*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=t);break}if(this.nextUserInteractionEvent){const t=this.nextUserInteractionEvent.delay-e.delay;this.play(this.getCurrentTime()+t),this.nextUserInteractionEvent=null}}}}return()=>{n&&n();for(const n of this.config.plugins||[])n.handler&&n.handler(e,t,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:e}});const i=this.service.state.context.events.length-1;if(!this.config.liveMode&&e===this.service.state.context.events[i]){const t=()=>{i<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(we.Finish))};let n=50;e.type===me.IncrementalSnapshot&&e.data.source===ge.MouseMove&&e.data.positions.length&&(n+=Math.max(0,-e.data.positions[0].timeOffset)),setTimeout(t,n)}this.emitter.emit(we.EventCast,e)}},!(null==t?void 0:t.liveMode)&&e.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:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:wn,useVirtualDom:!0,logger:console};this.config=Object.assign({},n,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(we.Resize,this.handleResize),this.setupDom();for(const e of this.config.plugins||[])e.getMirror&&e.getMirror({nodeMirror:this.mirror});this.emitter.on(we.Flush,(()=>{if(this.usingVirtualDom){const e={mirror:this.mirror,applyCanvas:(e,t,n)=>{Kt({event:e,mutation:t,target:n,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(e,t)=>{e.source===ge.StyleSheetRule?this.applyStyleSheetRule(e,t):e.source===ge.StyleDeclaration&&this.applyStyleDeclaration(e,t)},afterAppend:(e,t)=>{for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(e,{id:t,replayer:this})}};if(this.iframe.contentDocument)try{nt(this.iframe.contentDocument,this.virtualDom,e,this.virtualDom.mirror)}catch(e){console.warn(e)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const t in this.legacy_missingNodeRetryMap)try{const n=this.legacy_missingNodeRetryMap[t],i=ot(n.node,this.mirror,this.virtualDom.mirror);nt(i,n.node,e,this.virtualDom.mirror),n.node=i}catch(e){this.warn(e)}this.constructedStyleMutations.forEach((e=>{this.applyStyleSheetMutation(e)})),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach((e=>{this.applyAdoptedStyleSheet(e)})),this.adoptedStyleSheets=[]}if(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,this.lastMouseDownEvent){const[e,t]=this.lastMouseDownEvent;e.dispatchEvent(t)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)})),this.emitter.on(we.PlayBack,(()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset()}));const i=new fn([],{speed:this.config.speed});this.service=gn({events:e.map((e=>t&&t.unpackFn?t.unpackFn(e):e)).sort(((e,t)=>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((e=>{this.emitter.emit(we.StateChange,{player:e})})),this.speedService=pn(dn({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:(e,t)=>{"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:sn({normalSpeed:e=>e.timer.speed}),restoreSpeed:e=>{e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((e=>{this.emitter.emit(we.StateChange,{speed:e})}));const o=this.service.state.context.events.find((e=>e.type===me.Meta)),s=this.service.state.context.events.find((e=>e.type===me.FullSnapshot));if(o){const{width:e,height:t}=o.data;setTimeout((()=>{this.emitter.emit(we.Resize,{width:e,height:t})}),0)}s&&setTimeout((()=>{var e;this.firstFullSnapshot||(this.firstFullSnapshot=s,this.rebuildFullSnapshot(s),null===(e=this.iframe.contentWindow)||void 0===e||e.scrollTo(s.data.initialOffset))}),1),this.service.state.context.events.find(bn)&&this.mouse.classList.add("touch-device")}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach((t=>{e[t],this.config[t]=e[t]})),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"))}getMetaData(){const 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}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,n;this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),null===(n=null===(t=this.iframe.contentDocument)||void 0===t?void 0:t.getElementsByTagName("html")[0])||void 0===n||n.classList.remove("rrweb-paused"),this.emitter.emit(we.Start)}pause(e){var t,n;void 0===e&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof e&&(this.play(e),this.service.send({type:"PAUSE"})),null===(n=null===(t=this.iframe.contentDocument)||void 0===t?void 0:t.getElementsByTagName("html")[0])||void 0===n||n.classList.add("rrweb-paused"),this.emitter.emit(we.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(we.Resume)}destroy(){this.pause(),this.config.root.removeChild(this.wrapper),this.emitter.emit(we.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const t=this.config.unpackFn?this.config.unpackFn(e):e;bn(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then((()=>this.service.send({type:"ADD_EVENT",payload:{event: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=de()}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),!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");const 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&&(yn(this.iframe.contentWindow,this.iframe.contentDocument),function(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=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const n=[],i=(e,t)=>{this.collectIframeAndAttachDocument(n,e);for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(e,{id:t,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),fe(e.data.node,{doc:this.iframe.contentDocument,afterAppend:i,cache:this.cache,mirror:this.mirror}),i(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:e,builtNode:t}of n)this.attachDocumentToIframe(e,t),this.newDocumentQueue=this.newDocumentQueue.filter((t=>t!==e));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(we.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var n;const i=(o=this.config.blockClass,[`.${o} { background: currentColor }`,"noscript { display: none !important; }"]).concat(this.config.insertStyleRules);var o;if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const n=this.virtualDom.createElement("style");this.virtualDom.mirror.add(n,bt(n,this.virtualDom.unserializedId)),e.insertBefore(n,t),n.rules.push({source:ge.StyleSheetRule,adds:i.map(((e,t)=>({rule:e,index:t})))})}else{const o=document.createElement("style");e.insertBefore(o,t);for(let e=0;e<i.length;e++)null===(n=o.sheet)||void 0===n||n.insertRule(i[e],e)}}attachDocumentToIframe(e,t){const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=(e,o)=>{this.collectIframeAndAttachDocument(i,e);const s=n.getMeta(e);if((null==s?void 0:s.type)===Q.Element&&"HTML"===(null==s?void 0:s.tagName.toUpperCase())){const{documentElement:e,head:n}=t.contentDocument;this.insertStyleRules(e,n)}if(!this.usingVirtualDom)for(const t of this.config.plugins||[])t.onBuild&&t.onBuild(e,{id:o,replayer:this})};pe(e.node,{doc:t.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(t.contentDocument,e.node.id);for(const{mutationInQueue:e,builtNode:t}of i)this.attachDocumentToIframe(e,t),this.newDocumentQueue=this.newDocumentQueue.filter((t=>t!==e))}collectIframeAndAttachDocument(e,t){if(Te(t,this.mirror)){const n=this.newDocumentQueue.find((e=>e.parentId===this.mirror.getId(t)));n&&e.push({mutationInQueue:n,builtNode:t})}}waitForStylesheetLoad(){var e;const t=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(t){const e=new Set;let n,i=this.service.state;const o=()=>{i=this.service.state};this.emitter.on(we.Start,o),this.emitter.on(we.Pause,o);const s=()=>{this.emitter.off(we.Start,o),this.emitter.off(we.Pause,o)};t.querySelectorAll('link[rel="stylesheet"]').forEach((t=>{t.sheet||(e.add(t),t.addEventListener("load",(()=>{e.delete(t),0===e.size&&-1!==n&&(i.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(we.LoadStylesheetEnd),n&&clearTimeout(n),s())})))})),e.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(we.LoadStylesheetStart),n=setTimeout((()=>{i.matches("playing")&&this.play(this.getCurrentTime()),n=-1,s()}),this.config.loadTimeout))}}preloadAllImages(){return ke(this,void 0,void 0,(function*(){this.service.state;const e=()=>{this.service.state};this.emitter.on(we.Start,e),this.emitter.on(we.Pause,e);const t=[];for(const e of this.service.state.context.events)if(e.type===me.IncrementalSnapshot&&e.data.source===ge.CanvasMutation){t.push(this.deserializeAndPreloadCanvasEvents(e.data,e));("commands"in e.data?e.data.commands:[e.data]).forEach((t=>{this.preloadImages(t,e)}))}return Promise.all(t)}))}preloadImages(e,t){if("drawImage"===e.property&&"string"==typeof e.args[0]&&!this.imageMap.has(t)){const t=document.createElement("canvas"),n=t.getContext("2d"),i=null==n?void 0:n.createImageData(t.width,t.height);null==i||i.data,JSON.parse(e.args[0]),null==n||n.putImageData(i,0,0)}}deserializeAndPreloadCanvasEvents(e,t){return ke(this,void 0,void 0,(function*(){if(!this.canvasEventMap.has(t)){const n={isUnchanged:!0};if("commands"in e){const i=yield Promise.all(e.commands.map((e=>ke(this,void 0,void 0,(function*(){const t=yield Promise.all(e.args.map(Qt(this.imageMap,null,n)));return Object.assign(Object.assign({},e),{args:t})})))));!1===n.isUnchanged&&this.canvasEventMap.set(t,Object.assign(Object.assign({},e),{commands:i}))}else{const i=yield Promise.all(e.args.map(Qt(this.imageMap,null,n)));!1===n.isUnchanged&&this.canvasEventMap.set(t,Object.assign(Object.assign({},e),{args:i}))}}}))}applyIncremental(e,t){var n,i,o;const{data:s}=e;switch(s.source){case ge.Mutation:try{this.applyMutation(s,t)}catch(e){this.warn(`Exception in mutation ${e.message||e}`,s)}break;case ge.Drag:case ge.TouchMove:case ge.MouseMove:if(t){const e=s.positions[s.positions.length-1];this.mousePos={x:e.x,y:e.y,id:e.id,debugData:s}}else s.positions.forEach((n=>{const i={doAction:()=>{this.moveAndHover(n.x,n.y,n.id,t,s)},delay:n.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(i)})),this.timer.addAction({doAction(){},delay:e.delay-(null===(n=s.positions[0])||void 0===n?void 0:n.timeOffset)});break;case ge.MouseInteraction:{if(-1===s.id)break;const e=new Event(ye[s.type].toLowerCase()),n=this.mirror.getNode(s.id);if(!n)return this.debugNodeNotFound(s,s.id);this.emitter.emit(we.MouseInteraction,{type:s.type,target:n});const{triggerFocus:i}=this.config;switch(s.type){case ye.Blur:"blur"in n&&n.blur();break;case ye.Focus:i&&n.focus&&n.focus({preventScroll:!0});break;case ye.Click:case ye.TouchStart:case ye.TouchEnd:case ye.MouseDown:case ye.MouseUp:t?(s.type===ye.TouchStart?this.touchActive=!0:s.type===ye.TouchEnd&&(this.touchActive=!1),s.type===ye.MouseDown?this.lastMouseDownEvent=[n,e]:s.type===ye.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===ye.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,t,s),s.type===ye.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===ye.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===ye.TouchEnd?this.mouse.classList.remove("touch-active"):n.dispatchEvent(e));break;case ye.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:n.dispatchEvent(e)}break}case ge.Scroll:if(-1===s.id)break;if(this.usingVirtualDom){const e=this.virtualDom.mirror.getNode(s.id);if(!e)return this.debugNodeNotFound(s,s.id);e.scrollData=s;break}this.applyScroll(s,t);break;case ge.ViewportResize:this.emitter.emit(we.Resize,{width:s.width,height:s.height});break;case ge.Input:if(-1===s.id)break;if(this.usingVirtualDom){const e=this.virtualDom.mirror.getNode(s.id);if(!e)return this.debugNodeNotFound(s,s.id);e.inputData=s;break}this.applyInput(s);break;case ge.MediaInteraction:{const e=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!e)return this.debugNodeNotFound(s,s.id);const t=e;try{void 0!==s.currentTime&&(t.currentTime=s.currentTime),void 0!==s.volume&&(t.volume=s.volume),void 0!==s.muted&&(t.muted=s.muted),1===s.type&&t.pause(),0===s.type&&t.play(),4===s.type&&(t.playbackRate=s.playbackRate)}catch(e){this.warn(`Failed to replay media interactions: ${e.message||e}`)}break}case ge.StyleSheetRule:case ge.StyleDeclaration:this.usingVirtualDom?s.styleId?this.constructedStyleMutations.push(s):s.id&&(null===(i=this.virtualDom.mirror.getNode(s.id))||void 0===i||i.rules.push(s)):this.applyStyleSheetMutation(s);break;case ge.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const t=this.virtualDom.mirror.getNode(s.id);if(!t)return this.debugNodeNotFound(s,s.id);t.canvasMutations.push({event:e,mutation:s})}else{const t=this.mirror.getNode(s.id);if(!t)return this.debugNodeNotFound(s,s.id);Kt({event:e,mutation:s,target:t,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break;case ge.Font:try{const e=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);null===(o=this.iframe.contentDocument)||void 0===o||o.fonts.add(e)}catch(e){this.warn(e)}break;case ge.Selection:if(t){this.lastSelectionData=s;break}this.applySelection(s);break;case ge.AdoptedStyleSheet:this.usingVirtualDom?this.adoptedStyleSheets.push(s):this.applyAdoptedStyleSheet(s)}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,vt(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const e in this.legacy_missingNodeRetryMap)try{const t=this.legacy_missingNodeRetryMap[e],n=yt(t.node,this.virtualDom,this.mirror);n&&(t.node=n)}catch(e){this.warn(e)}const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter((t=>!!n.getNode(t.id)||(this.warnNodeNotFound(e,t.id),!1))),e.removes.forEach((t=>{var i;const o=n.getNode(t.id);if(!o)return;let s=n.getNode(t.parentId);if(!s)return this.warnNodeNotFound(e,t.parentId);if(t.isShadow&&Me(s)&&(s=s.shadowRoot),n.removeNodeFromMap(o),s)try{s.removeChild(o),this.usingVirtualDom&&"#text"===o.nodeName&&"STYLE"===s.nodeName&&(null===(i=s.rules)||void 0===i?void 0:i.length)>0&&(s.rules=[])}catch(t){if(!(t instanceof DOMException))throw t;this.warn("parent could not remove child in mutation",s,o,e)}}));const i=Object.assign({},this.legacy_missingNodeRetryMap),o=[],s=e=>{var t,s;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let r=n.getNode(e.parentId);if(!r)return e.node.type===Q.Document?this.newDocumentQueue.push(e):o.push(e);e.node.isShadow&&(Me(r)||r.attachShadow({mode:"open"}),r=r.shadowRoot);let a=null,l=null;if(e.previousId&&(a=n.getNode(e.previousId)),e.nextId&&(l=n.getNode(e.nextId)),(e=>{let t=null;return e.nextId&&(t=n.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t})(e))return o.push(e);if(e.node.rootId&&!n.getNode(e.node.rootId))return;const c=e.node.rootId?n.getNode(e.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Te(r,n))return void this.attachDocumentToIframe(e,r);const u=(e,t)=>{if(!this.usingVirtualDom)for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(e,{id:t,replayer:this})},d=pe(e.node,{doc:c,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:u});if(-1===e.previousId||-1===e.nextId)return void(i[e.node.id]={node:d,mutation:e});const h=n.getMeta(r);if(h&&h.type===Q.Element&&"textarea"===h.tagName&&e.node.type===Q.Text){const e=Array.isArray(r.childNodes)?r.childNodes:Array.from(r.childNodes);for(const t of e)t.nodeType===r.TEXT_NODE&&r.removeChild(t)}else if((null==h?void 0:h.type)===Q.Document){const n=r;e.node.type===Q.DocumentType&&(null===(t=n.childNodes[0])||void 0===t?void 0:t.nodeType)===Node.DOCUMENT_TYPE_NODE&&n.removeChild(n.childNodes[0]),"HTML"===d.nodeName&&n.documentElement&&n.removeChild(n.documentElement)}if(a&&a.nextSibling&&a.nextSibling.parentNode?r.insertBefore(d,a.nextSibling):l&&l.parentNode?r.contains(l)?r.insertBefore(d,l):r.insertBefore(d,null):r.appendChild(d),u(d,e.node.id),this.usingVirtualDom&&"#text"===d.nodeName&&"STYLE"===r.nodeName&&(null===(s=r.rules)||void 0===s?void 0:s.length)>0&&(r.rules=[]),Te(d,this.mirror)){const e=this.mirror.getId(d),t=this.newDocumentQueue.find((t=>t.parentId===e));t&&(this.attachDocumentToIframe(t,d),this.newDocumentQueue=this.newDocumentQueue.filter((e=>e!==t)))}(e.previousId||e.nextId)&&this.legacy_resolveMissingNode(i,r,d,e)};e.adds.forEach((e=>{s(e)}));const r=Date.now();for(;o.length;){const e=Ne(o);if(o.length=0,Date.now()-r>500){this.warn("Timeout in the loop, please check the resolve tree data:",e);break}for(const t of e){n.getNode(t.value.parentId)?Se(t,(e=>{s(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",t)}}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),function(e){const t=new Set,n=[];for(let i=e.length;i--;){const o=e[i];t.has(o.id)||(n.push(o),t.add(o.id))}return n}(e.texts).forEach((t=>{var i;const o=n.getNode(t.id);if(!o){if(e.removes.find((e=>e.id===t.id)))return;return this.warnNodeNotFound(e,t.id)}if(o.textContent=t.value,this.usingVirtualDom){const e=o.parentNode;(null===(i=null==e?void 0:e.rules)||void 0===i?void 0:i.length)>0&&(e.rules=[])}})),e.attributes.forEach((t=>{const i=n.getNode(t.id);if(!i){if(e.removes.find((e=>e.id===t.id)))return;return this.warnNodeNotFound(e,t.id)}for(const e in t.attributes)if("string"==typeof e){const o=t.attributes[e];if(null===o)i.removeAttribute(e);else if("string"==typeof o)try{if("_cssText"===e&&("LINK"===i.nodeName||"STYLE"===i.nodeName))try{const e=n.getMeta(i);Object.assign(e.attributes,t.attributes);const o=pe(e,{doc:i.ownerDocument,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache}),s=i.nextSibling,r=i.parentNode;if(o&&r){r.removeChild(i),r.insertBefore(o,s),n.replace(t.id,o);break}}catch(e){}i.setAttribute(e,o)}catch(e){this.warn("An error occurred may due to the checkout feature.",e)}else if("style"===e){const e=o,t=i;for(const n in e)if(!1===e[n])t.style.removeProperty(n);else if(e[n]instanceof Array){const i=e[n];t.style.setProperty(n,i[0],i[1])}else{const i=e[n];t.style.setProperty(n,i)}}}}))}applyScroll(e,t){var n,i;const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const s=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)null===(n=this.iframe.contentWindow)||void 0===n||n.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((null==s?void 0:s.type)===Q.Document)null===(i=o.defaultView)||void 0===i||i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{o.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"})}catch(e){}}applyInput(e){const 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){}}applySelection(e){try{const t=new Set,n=e.ranges.map((({start:e,startOffset:n,end:i,endOffset:o})=>{const s=this.mirror.getNode(e),r=this.mirror.getNode(i);if(!s||!r)return;const a=new Range;a.setStart(s,n),a.setEnd(r,o);const l=s.ownerDocument,c=null==l?void 0:l.getSelection();return c&&t.add(c),{range:a,selection:c}}));t.forEach((e=>e.removeAllRanges())),n.forEach((e=>{var t;return e&&(null===(t=e.selection)||void 0===t?void 0:t.addRange(e.range))}))}catch(e){}}applyStyleSheetMutation(e){var t;let n=null;e.styleId?n=this.styleMirror.getStyle(e.styleId):e.id&&(n=(null===(t=this.mirror.getNode(e.id))||void 0===t?void 0:t.sheet)||null),n&&(e.source===ge.StyleSheetRule?this.applyStyleSheetRule(e,n):e.source===ge.StyleDeclaration&&this.applyStyleDeclaration(e,n))}applyStyleSheetRule(e,t){var n,i,o,s;if(null===(n=e.adds)||void 0===n||n.forEach((({rule:e,index:n})=>{try{if(Array.isArray(n)){const{positions:i,index:o}=xe(n);Ce(t.cssRules,i).insertRule(e,o)}else{const i=void 0===n?void 0:Math.min(n,t.cssRules.length);null==t||t.insertRule(e,i)}}catch(e){}})),null===(i=e.removes)||void 0===i||i.forEach((({index:e})=>{try{if(Array.isArray(e)){const{positions:n,index:i}=xe(e);Ce(t.cssRules,n).deleteRule(i||0)}else null==t||t.deleteRule(e)}catch(e){}})),e.replace)try{null===(o=t.replace)||void 0===o||o.call(t,e.replace)}catch(e){}if(e.replaceSync)try{null===(s=t.replaceSync)||void 0===s||s.call(t,e.replaceSync)}catch(e){}}applyStyleDeclaration(e,t){if(e.set){Ce(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority)}if(e.remove){Ce(t.rules,e.index).style.removeProperty(e.remove.property)}}applyAdoptedStyleSheet(e){var t;const n=this.mirror.getNode(e.id);if(!n)return;null===(t=e.styles)||void 0===t||t.forEach((e=>{var t;let i=null,o=null;if(Me(n)?o=(null===(t=n.ownerDocument)||void 0===t?void 0:t.defaultView)||null:"#document"===n.nodeName&&(o=n.defaultView),o)try{i=new o.CSSStyleSheet,this.styleMirror.add(i,e.styleId),this.applyStyleSheetRule({source:ge.StyleSheetRule,adds:e.rules},i)}catch(e){}}));let i=0;const o=(e,t)=>{const n=t.map((e=>this.styleMirror.getStyle(e))).filter((e=>null!==e));Me(e)?e.shadowRoot.adoptedStyleSheets=n:"#document"===e.nodeName&&(e.adoptedStyleSheets=n),n.length!==t.length&&i<10&&(setTimeout((()=>o(e,t)),0+100*i),i++)};o(n,e.styleIds)}legacy_resolveMissingNode(e,t,n,i){const{previousId:o,nextId:s}=i,r=o&&e[o],a=s&&e[s];if(r){const{node:i,mutation:o}=r;t.insertBefore(i,n),delete e[o.node.id],delete this.legacy_missingNodeRetryMap[o.node.id],(o.previousId||o.nextId)&&this.legacy_resolveMissingNode(e,t,i,o)}if(a){const{node:i,mutation:o}=a;t.insertBefore(i,n.nextSibling),delete e[o.node.id],delete this.legacy_missingNodeRetryMap[o.node.id],(o.previousId||o.nextId)&&this.legacy_resolveMissingNode(e,t,i,o)}}moveAndHover(e,t,n,i,o){const s=this.mirror.getNode(n);if(!s)return this.debugNodeNotFound(o,n);const r=De(s,this.iframe),a=e*r.absoluteScale+r.x,l=t*r.absoluteScale+r.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${l}px`,i||this.drawMouseTail({x:a,y:l}),this.hoverElements(s)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:t,lineWidth:n,strokeStyle:i,duration:o}=!0===this.config.mouseTail?wn:Object.assign({},wn,this.config.mouseTail),s=()=>{if(!this.mouseTail)return;const e=this.mouseTail.getContext("2d");e&&this.tailPositions.length&&(e.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),e.beginPath(),e.lineWidth=n,e.lineCap=t,e.strokeStyle=i,e.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach((t=>e.lineTo(t.x,t.y))),e.stroke())};this.tailPositions.push(e),s(),setTimeout((()=>{this.tailPositions=this.tailPositions.filter((t=>t!==e)),s()}),o/this.speedService.state.context.timer.speed)}hoverElements(e){var t;null===(t=this.lastHoveredRootNode||this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((e=>{e.classList.remove(":hover")})),this.lastHoveredRootNode=e.getRootNode();let n=e;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(e){return e.type===me.IncrementalSnapshot&&(e.data.source>ge.Mutation&&e.data.source<=ge.Input)}backToNormal(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(we.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn("[replayer]",...e)}debug(...e){this.config.showDebug&&this.config.logger.log("[replayer]",...e)}}function Nn(e){let t="";return Object.keys(e).forEach((n=>{t+=`${n}: ${e[n]};`})),t}function Sn(e,t=2){let n=String(e);const i=Math.pow(10,t-1);if(e<i)for(;String(i).length>n.length;)n=`0${e}`;return n}function Tn(e){if(e<=0)return"00:00";const t=Math.floor(e/36e5);e%=36e5;const n=Math.floor(e/6e4);e%=6e4;const i=Math.floor(e/1e3);return t?`${Sn(t)}:${Sn(n)}:${Sn(i)}`:`${Sn(n)}:${Sn(i)}`}function Dn(){let e=!1;return["fullscreen","webkitIsFullScreen","mozFullScreen","msFullscreenElement"].forEach((t=>{t in document&&(e=e||Boolean(document[t]))})),e}function Mn(e){return{"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"}[Object.prototype.toString.call(e)]}function Cn(e){return e.type===me.IncrementalSnapshot&&(e.data.source>ge.Mutation&&e.data.source<=ge.Input)}function xn(t){let n,i,o,s,r,a,d,p,w;return{c(){n=h("div"),i=h("input"),o=m(),s=h("label"),r=m(),a=h("span"),d=f(t[3]),y(i,"type","checkbox"),y(i,"id",t[2]),i.disabled=t[1],y(i,"class","svelte-9brlez"),y(s,"for",t[2]),y(s,"class","svelte-9brlez"),y(a,"class","label svelte-9brlez"),y(n,"class","switch svelte-9brlez"),b(n,"disabled",t[1])},m(e,u){c(e,n,u),l(n,i),i.checked=t[0],l(n,o),l(n,s),l(n,r),l(n,a),l(a,d),p||(w=g(i,"change",t[4]),p=!0)},p(e,[t]){4&t&&y(i,"id",e[2]),2&t&&(i.disabled=e[1]),1&t&&(i.checked=e[0]),4&t&&y(s,"for",e[2]),8&t&&v(d,e[3]),2&t&&b(n,"disabled",e[1])},i:e,o:e,d(e){e&&u(n),p=!1,w()}}}function Rn(e,t,n){let{disabled:i}=t,{checked:o}=t,{id:s}=t,{label:r}=t;return e.$$set=e=>{"disabled"in e&&n(1,i=e.disabled),"checked"in e&&n(0,o=e.checked),"id"in e&&n(2,s=e.id),"label"in e&&n(3,r=e.label)},[o,i,s,r,function(){o=this.checked,n(0,o)}]}class kn extends X{constructor(e){super(),q(this,e,Rn,xn,r,{disabled:1,checked:0,id:2,label:3})}}function An(e,t,n){const i=e.slice();return i[39]=t[n],i}function In(e,t,n){const i=e.slice();return i[42]=t[n],i}function On(e,t,n){const i=e.slice();return i[45]=t[n],i}function _n(e){let t,n,i,s,r,a,p,E,N,S,T,D,M,C,R,A,I,O,_,$,L,F,P,B,U,j,Y=Tn(e[6])+"",q=Tn(e[8].totalTime)+"",X=e[14],Q=[];for(let t=0;t<X.length;t+=1)Q[t]=$n(On(e,X,t));let J=e[9],Z=[];for(let t=0;t<J.length;t+=1)Z[t]=Ln(In(e,J,t));function K(e,t){return"playing"===e[7]?Pn:Fn}let ee=K(e),te=ee(e),ne=e[3],ie=[];for(let t=0;t<ne.length;t+=1)ie[t]=Bn(An(e,ne,t));function oe(t){e[30](t)}let se={id:"skip",disabled:"skipping"===e[10],label:"skip inactive"};return void 0!==e[0]&&(se.checked=e[0]),$=new kn({props:se}),x.push((()=>function(e,t,n){const i=e.$$.props[t];void 0!==i&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}($,"checked",oe))),{c(){t=h("div"),n=h("div"),i=h("span"),s=f(Y),r=m(),a=h("div"),p=h("div"),E=m();for(let e=0;e<Q.length;e+=1)Q[e].c();N=m();for(let e=0;e<Z.length;e+=1)Z[e].c();S=m(),T=h("div"),D=m(),M=h("span"),C=f(q),R=m(),A=h("div"),I=h("button"),te.c(),O=m();for(let e=0;e<ie.length;e+=1)ie[e].c();_=m(),z($.$$.fragment),F=m(),P=h("button"),P.innerHTML='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><defs><style type="text/css"></style></defs><path d="M916 380c-26.4 0-48-21.6-48-48L868 223.2 613.6 477.6c-18.4\n 18.4-48.8 18.4-68 0-18.4-18.4-18.4-48.8 0-68L800 156 692 156c-26.4\n 0-48-21.6-48-48 0-26.4 21.6-48 48-48l224 0c26.4 0 48 21.6 48 48l0\n 224C964 358.4 942.4 380 916 380zM231.2 860l108.8 0c26.4 0 48 21.6 48\n 48s-21.6 48-48 48l-224 0c-26.4 0-48-21.6-48-48l0-224c0-26.4 21.6-48\n 48-48 26.4 0 48 21.6 48 48L164 792l253.6-253.6c18.4-18.4 48.8-18.4\n 68 0 18.4 18.4 18.4 48.8 0 68L231.2 860z" p-id="1286"></path></svg>',y(i,"class","rr-timeline__time svelte-19ke1iv"),y(p,"class","rr-progress__step svelte-19ke1iv"),w(p,"width",e[13]),y(T,"class","rr-progress__handler svelte-19ke1iv"),w(T,"left",e[13]),y(a,"class","rr-progress svelte-19ke1iv"),b(a,"disabled","skipping"===e[10]),y(M,"class","rr-timeline__time svelte-19ke1iv"),y(n,"class","rr-timeline svelte-19ke1iv"),y(I,"class","svelte-19ke1iv"),y(P,"class","svelte-19ke1iv"),y(A,"class","rr-controller__btns svelte-19ke1iv"),y(t,"class","rr-controller svelte-19ke1iv")},m(o,u){c(o,t,u),l(t,n),l(n,i),l(i,s),l(n,r),l(n,a),l(a,p),e[27](p),l(a,E);for(let e=0;e<Q.length;e+=1)Q[e]&&Q[e].m(a,null);l(a,N);for(let e=0;e<Z.length;e+=1)Z[e]&&Z[e].m(a,null);l(a,S),l(a,T),e[28](a),l(n,D),l(n,M),l(M,C),l(t,R),l(t,A),l(A,I),te.m(I,null),l(A,O);for(let e=0;e<ie.length;e+=1)ie[e]&&ie[e].m(A,null);l(A,_),G($,A,null),l(A,F),l(A,P),B=!0,U||(j=[g(a,"click",e[16]),g(I,"click",e[4]),g(P,"click",e[31])],U=!0)},p(e,t){if((!B||64&t[0])&&Y!==(Y=Tn(e[6])+"")&&v(s,Y),(!B||8192&t[0])&&w(p,"width",e[13]),16384&t[0]){let n;for(X=e[14],n=0;n<X.length;n+=1){const i=On(e,X,n);Q[n]?Q[n].p(i,t):(Q[n]=$n(i),Q[n].c(),Q[n].m(a,N))}for(;n<Q.length;n+=1)Q[n].d(1);Q.length=X.length}if(512&t[0]){let n;for(J=e[9],n=0;n<J.length;n+=1){const i=In(e,J,n);Z[n]?Z[n].p(i,t):(Z[n]=Ln(i),Z[n].c(),Z[n].m(a,S))}for(;n<Z.length;n+=1)Z[n].d(1);Z.length=J.length}if((!B||8192&t[0])&&w(T,"left",e[13]),(!B||1024&t[0])&&b(a,"disabled","skipping"===e[10]),(!B||256&t[0])&&q!==(q=Tn(e[8].totalTime)+"")&&v(C,q),ee!==(ee=K(e))&&(te.d(1),te=ee(e),te&&(te.c(),te.m(I,null))),1066&t[0]){let n;for(ne=e[3],n=0;n<ne.length;n+=1){const i=An(e,ne,n);ie[n]?ie[n].p(i,t):(ie[n]=Bn(i),ie[n].c(),ie[n].m(A,_))}for(;n<ie.length;n+=1)ie[n].d(1);ie.length=ne.length}const n={};var i;1024&t[0]&&(n.disabled="skipping"===e[10]),!L&&1&t[0]&&(L=!0,n.checked=e[0],i=()=>L=!1,k.push(i)),$.$set(n)},i(e){B||(V($.$$.fragment,e),B=!0)},o(e){W($.$$.fragment,e),B=!1},d(n){n&&u(t),e[27](null),d(Q,n),d(Z,n),e[28](null),te.d(),d(ie,n),H($),U=!1,o(j)}}}function $n(e){let t,n;return{c(){t=h("div"),y(t,"title",n=e[45].name),w(t,"width",e[45].width),w(t,"height","4px"),w(t,"position","absolute"),w(t,"background",e[45].background),w(t,"left",e[45].position)},m(e,n){c(e,t,n)},p(e,i){16384&i[0]&&n!==(n=e[45].name)&&y(t,"title",n),16384&i[0]&&w(t,"width",e[45].width),16384&i[0]&&w(t,"background",e[45].background),16384&i[0]&&w(t,"left",e[45].position)},d(e){e&&u(t)}}}function Ln(e){let t,n;return{c(){t=h("div"),y(t,"title",n=e[42].name),w(t,"width","10px"),w(t,"height","5px"),w(t,"position","absolute"),w(t,"top","2px"),w(t,"transform","translate(-50%, -50%)"),w(t,"background",e[42].background),w(t,"left",e[42].position)},m(e,n){c(e,t,n)},p(e,i){512&i[0]&&n!==(n=e[42].name)&&y(t,"title",n),512&i[0]&&w(t,"background",e[42].background),512&i[0]&&w(t,"left",e[42].position)},d(e){e&&u(t)}}}function Fn(e){let t,n;return{c(){t=p("svg"),n=p("path"),y(n,"d","M170.65984 896l0-768 640 384zM644.66944\n 512l-388.66944-233.32864 0 466.65728z"),y(t,"class","icon"),y(t,"viewBox","0 0 1024 1024"),y(t,"version","1.1"),y(t,"xmlns","http://www.w3.org/2000/svg"),y(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),y(t,"width","16"),y(t,"height","16")},m(e,i){c(e,t,i),l(t,n)},d(e){e&&u(t)}}}function Pn(e){let t,n;return{c(){t=p("svg"),n=p("path"),y(n,"d","M682.65984 128q53.00224 0 90.50112 37.49888t37.49888 90.50112l0\n 512q0 53.00224-37.49888 90.50112t-90.50112\n 37.49888-90.50112-37.49888-37.49888-90.50112l0-512q0-53.00224\n 37.49888-90.50112t90.50112-37.49888zM341.34016 128q53.00224 0\n 90.50112 37.49888t37.49888 90.50112l0 512q0 53.00224-37.49888\n 90.50112t-90.50112\n 37.49888-90.50112-37.49888-37.49888-90.50112l0-512q0-53.00224\n 37.49888-90.50112t90.50112-37.49888zM341.34016 213.34016q-17.67424\n 0-30.16704 12.4928t-12.4928 30.16704l0 512q0 17.67424 12.4928\n 30.16704t30.16704 12.4928 30.16704-12.4928\n 12.4928-30.16704l0-512q0-17.67424-12.4928-30.16704t-30.16704-12.4928zM682.65984\n 213.34016q-17.67424 0-30.16704 12.4928t-12.4928 30.16704l0 512q0\n 17.67424 12.4928 30.16704t30.16704 12.4928 30.16704-12.4928\n 12.4928-30.16704l0-512q0-17.67424-12.4928-30.16704t-30.16704-12.4928z"),y(t,"class","icon"),y(t,"viewBox","0 0 1024 1024"),y(t,"version","1.1"),y(t,"xmlns","http://www.w3.org/2000/svg"),y(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),y(t,"width","16"),y(t,"height","16")},m(e,i){c(e,t,i),l(t,n)},d(e){e&&u(t)}}}function Bn(e){let t,n,i,o,s,r,a=e[39]+"";function d(){return e[29](e[39])}return{c(){t=h("button"),n=f(a),i=f("x"),t.disabled=o="skipping"===e[10],y(t,"class","svelte-19ke1iv"),b(t,"active",e[39]===e[1]&&"skipping"!==e[10])},m(e,o){c(e,t,o),l(t,n),l(t,i),s||(r=g(t,"click",d),s=!0)},p(i,s){e=i,8&s[0]&&a!==(a=e[39]+"")&&v(n,a),1024&s[0]&&o!==(o="skipping"===e[10])&&(t.disabled=o),1034&s[0]&&b(t,"active",e[39]===e[1]&&"skipping"!==e[10])},d(e){e&&u(t),s=!1,r()}}}function Un(e){let t,n,i=e[2]&&_n(e);return{c(){i&&i.c(),t=f("")},m(e,o){i&&i.m(e,o),c(e,t,o),n=!0},p(e,n){e[2]?i?(i.p(e,n),4&n[0]&&V(i,1)):(i=_n(e),i.c(),V(i,1),i.m(t.parentNode,t)):i&&(U(),W(i,1,1,(()=>{i=null})),j())},i(e){n||(V(i),n=!0)},o(e){W(i),n=!1},d(e){i&&i.d(e),e&&u(t)}}}function jn(e,t,n){return(100-(t-n)/(t-e)*100).toFixed(2)}function Vn(e,t,n){const i=M();let o,s,r,a,l,c,u,d,h,p,{replayer:f}=t,{showController:m}=t,{autoPlay:g}=t,{skipInactive:y}=t,{speedOption:v}=t,{speed:w=(v.length?v[0]:1)}=t,{tags:b={}}=t,{inactiveColor:E}=t,N=0,C=null,R=!1,k=null;const A=()=>{C&&(cancelAnimationFrame(C),C=null)},I=()=>{"paused"===o&&(l?(f.play(),l=!1):f.play(N))},O=()=>{"playing"===o&&(f.pause(),R=!1)},_=(e,t)=>{n(6,N=e),R=!1,l=!1;("boolean"==typeof t?t:"playing"===o)?f.play(e):f.pause(e)},$=(e,t,i=!1,o)=>{k=i?{start:e,end:t}:null,n(6,N=e),R=t,c=o,f.play(e)},L=e=>{let t="playing"===o;n(1,w=e),t&&f.pause(),f.setConfig({speed:w}),t&&f.play(N)};var F;T((()=>{n(7,o=f.service.state.value),n(10,s=f.speedService.state.value),f.on("state-change",(e=>{const{player:t,speed:i}=e;if((null==t?void 0:t.value)&&o!==t.value)switch(n(7,o=t.value),o){case"playing":A(),C=requestAnimationFrame((function e(){n(6,N=f.getCurrentTime()),R&&N>=R&&(k?$(k.start,k.end,!0,void 0):(f.pause(),c&&(c(),c=null))),N<u.totalTime&&(C=requestAnimationFrame(e))}));break;case"paused":A()}(null==i?void 0:i.value)&&s!==i.value&&n(10,s=i.value)})),f.on("finish",(()=>{l=!0,c&&(c(),c=null)})),g&&f.play()})),F=()=>{y!==f.config.skipInactive&&f.setConfig({skipInactive:y})},S().$$.after_update.push(F),D((()=>{f.pause(),A()}));return e.$$set=e=>{"replayer"in e&&n(17,f=e.replayer),"showController"in e&&n(2,m=e.showController),"autoPlay"in e&&n(18,g=e.autoPlay),"skipInactive"in e&&n(0,y=e.skipInactive),"speedOption"in e&&n(3,v=e.speedOption),"speed"in e&&n(1,w=e.speed),"tags"in e&&n(19,b=e.tags),"inactiveColor"in e&&n(20,E=e.inactiveColor)},e.$$.update=()=>{if(64&e.$$.dirty[0]&&i("ui-update-current-time",{payload:N}),128&e.$$.dirty[0]&&i("ui-update-player-state",{payload:o}),131072&e.$$.dirty[0]&&n(8,u=f.getMetaData()),320&e.$$.dirty[0]){const e=Math.min(1,N/u.totalTime);n(13,d=100*e+"%"),i("ui-update-progress",{payload:e})}655360&e.$$.dirty[0]&&n(9,h=(()=>{const{context:e}=f.service.state,t=e.events.length,n=e.events[0].timestamp,i=e.events[t-1].timestamp,o=[];return e.events.forEach((e=>{if(e.type===me.Custom){const t={name:e.data.tag,background:b[e.data.tag]||"rgb(73, 80, 246)",position:`${jn(n,i,e.timestamp)}%`};o.push(t)}})),o})()),1179648&e.$$.dirty[0]&&n(14,p=(()=>{try{const{context:e}=f.service.state,t=e.events.length,n=e.events[0].timestamp,i=e.events[t-1].timestamp,o=function(e){const t=[];let n=e[0].timestamp;for(const i of e)Cn(i)&&(i.timestamp-n>1e4&&t.push([n,i.timestamp]),n=i.timestamp);return t}(e.events),s=(e,t,n,i)=>((i-n)/(t-e)*100).toFixed(2);return o.map((e=>({name:"inactive period",background:E,position:`${jn(n,i,e[0])}%`,width:`${s(n,i,e[0],e[1])}%`})))}catch(e){return[]}})())},[y,w,m,v,()=>{switch(o){case"playing":O();break;case"paused":I()}},L,N,o,u,h,s,r,a,d,p,i,e=>{if("skipping"===s)return;const t=r.getBoundingClientRect();let n=(e.clientX-t.left)/t.width;n<0?n=0:n>1&&(n=1);const i=u.totalTime*n;_(i)},f,g,b,E,I,O,_,$,()=>{n(0,y=!y)},()=>Promise.resolve().then((()=>{n(8,u=f.getMetaData())})),function(e){x[e?"unshift":"push"]((()=>{a=e,n(12,a)}))},function(e){x[e?"unshift":"push"]((()=>{r=e,n(11,r)}))},e=>L(e),function(e){y=e,n(0,y)},()=>i("fullscreen")]}class Wn extends X{constructor(e){super(),q(this,e,Vn,Un,r,{replayer:17,showController:2,autoPlay:18,skipInactive:0,speedOption:3,speed:1,tags:19,inactiveColor:20,toggle:4,play:21,pause:22,goto:23,playRange:24,setSpeed:5,toggleSkipInactive:25,triggerUpdateMeta:26},null,[-1,-1])}get toggle(){return this.$$.ctx[4]}get play(){return this.$$.ctx[21]}get pause(){return this.$$.ctx[22]}get goto(){return this.$$.ctx[23]}get playRange(){return this.$$.ctx[24]}get setSpeed(){return this.$$.ctx[5]}get toggleSkipInactive(){return this.$$.ctx[25]}get triggerUpdateMeta(){return this.$$.ctx[26]}}function zn(e){let t,n,i={replayer:e[7],showController:e[3],autoPlay:e[1],speedOption:e[2],skipInactive:e[0],tags:e[4],inactiveColor:e[5]};return t=new Wn({props:i}),e[32](t),t.$on("fullscreen",e[33]),{c(){z(t.$$.fragment)},m(e,i){G(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.replayer=e[7]),8&n[0]&&(i.showController=e[3]),2&n[0]&&(i.autoPlay=e[1]),4&n[0]&&(i.speedOption=e[2]),1&n[0]&&(i.skipInactive=e[0]),16&n[0]&&(i.tags=e[4]),32&n[0]&&(i.inactiveColor=e[5]),t.$set(i)},i(e){n||(V(t.$$.fragment,e),n=!0)},o(e){W(t.$$.fragment,e),n=!1},d(n){e[32](null),H(t,n)}}}function Gn(e){let t,n,i,o,s=e[7]&&zn(e);return{c(){t=h("div"),n=h("div"),i=m(),s&&s.c(),y(n,"class","rr-player__frame"),y(n,"style",e[11]),y(t,"class","rr-player"),y(t,"style",e[12])},m(r,a){c(r,t,a),l(t,n),e[31](n),l(t,i),s&&s.m(t,null),e[34](t),o=!0},p(e,i){(!o||2048&i[0])&&y(n,"style",e[11]),e[7]?s?(s.p(e,i),128&i[0]&&V(s,1)):(s=zn(e),s.c(),V(s,1),s.m(t,null)):s&&(U(),W(s,1,1,(()=>{s=null})),j()),(!o||4096&i[0])&&y(t,"style",e[12])},i(e){o||(V(s),o=!0)},o(e){W(s),o=!1},d(n){n&&u(t),e[31](null),s&&s.d(),e[34](null)}}}function Hn(e,n,i){let o,{width:s=1024}=n,{height:r=576}=n,{maxScale:l=1}=n,{events:c=[]}=n,{skipInactive:u=!0}=n,{autoPlay:d=!0}=n,{speedOption:h=[1,2,4,8]}=n,{speed:p=1}=n,{showController:f=!0}=n,{tags:m={}}=n,{inactiveColor:g="#D4D4D4"}=n;let y,v,w,b,E,N,S=s,M=r;const C=(e,t)=>{const n=[s/t.width,r/t.height];l&&n.push(l),e.style.transform=`scale(${Math.min(...n)})translate(-50%, -50%)`},R=()=>{var e;y&&(Dn()?document.exitFullscreen?document.exitFullscreen():document.mozExitFullscreen?document.mozExitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen():(e=y).requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen())};T((()=>{if(void 0!==h&&"array"!==Mn(h))throw new Error("speedOption must be array");if(h.forEach((e=>{if("number"!==Mn(e))throw new Error("item of speedOption must be number")})),h.indexOf(p)<0)throw new Error(`speed must be one of speedOption,\n current config:\n {\n ...\n speed: ${p},\n speedOption: [${h.toString()}]\n ...\n }\n `);var e;i(7,o=new En(c,Object.assign({speed:p,root:v,unpackFn:Gt},n))),o.on("resize",(e=>{C(o.wrapper,e)})),e=()=>{Dn()?setTimeout((()=>{S=s,M=r,i(13,s=y.offsetWidth),i(14,r=y.offsetHeight-(f?80:0)),C(o.wrapper,{width:o.iframe.offsetWidth,height:o.iframe.offsetHeight})}),0):(i(13,s=S),i(14,r=M),C(o.wrapper,{width:o.iframe.offsetWidth,height:o.iframe.offsetHeight}))},document.addEventListener("fullscreenchange",e),document.addEventListener("webkitfullscreenchange",e),document.addEventListener("mozfullscreenchange",e),document.addEventListener("MSFullscreenChange",e),w=()=>{document.removeEventListener("fullscreenchange",e),document.removeEventListener("webkitfullscreenchange",e),document.removeEventListener("mozfullscreenchange",e),document.removeEventListener("MSFullscreenChange",e)}})),D((()=>{w&&w()}));return e.$$set=e=>{i(39,n=t(t({},n),a(e))),"width"in e&&i(13,s=e.width),"height"in e&&i(14,r=e.height),"maxScale"in e&&i(15,l=e.maxScale),"events"in e&&i(16,c=e.events),"skipInactive"in e&&i(0,u=e.skipInactive),"autoPlay"in e&&i(1,d=e.autoPlay),"speedOption"in e&&i(2,h=e.speedOption),"speed"in e&&i(17,p=e.speed),"showController"in e&&i(3,f=e.showController),"tags"in e&&i(4,m=e.tags),"inactiveColor"in e&&i(5,g=e.inactiveColor)},e.$$.update=()=>{24576&e.$$.dirty[0]&&i(11,E=Nn({width:`${s}px`,height:`${r}px`})),24584&e.$$.dirty[0]&&i(12,N=Nn({width:`${s}px`,height:`${r+(f?80:0)}px`}))},n=a(n),[u,d,h,f,m,g,R,o,y,v,b,E,N,s,r,l,c,p,()=>o.getMirror(),()=>{C(o.wrapper,{width:o.iframe.offsetWidth,height:o.iframe.offsetHeight})},(e,t)=>{switch(o.on(e,t),e){case"ui-update-current-time":case"ui-update-progress":case"ui-update-player-state":b.$on(e,(({detail:e})=>t(e)))}},e=>{o.addEvent(e),b.triggerUpdateMeta()},()=>o.getMetaData(),()=>o,()=>{b.toggle()},e=>{b.setSpeed(e)},()=>{b.toggleSkipInactive()},()=>{b.play()},()=>{b.pause()},(e,t)=>{b.goto(e,t)},(e,t,n=!1,i)=>{b.playRange(e,t,n,i)},function(e){x[e?"unshift":"push"]((()=>{v=e,i(9,v)}))},function(e){x[e?"unshift":"push"]((()=>{b=e,i(10,b)}))},()=>R(),function(e){x[e?"unshift":"push"]((()=>{y=e,i(8,y)}))}]}class Yn extends X{constructor(e){super(),q(this,e,Hn,Gn,r,{width:13,height:14,maxScale:15,events:16,skipInactive:0,autoPlay:1,speedOption:2,speed:17,showController:3,tags:4,inactiveColor:5,getMirror:18,triggerResize:19,toggleFullscreen:6,addEventListener:20,addEvent:21,getMetaData:22,getReplayer:23,toggle:24,setSpeed:25,toggleSkipInactive:26,play:27,pause:28,goto:29,playRange:30},null,[-1,-1])}get getMirror(){return this.$$.ctx[18]}get triggerResize(){return this.$$.ctx[19]}get toggleFullscreen(){return this.$$.ctx[6]}get addEventListener(){return this.$$.ctx[20]}get addEvent(){return this.$$.ctx[21]}get getMetaData(){return this.$$.ctx[22]}get getReplayer(){return this.$$.ctx[23]}get toggle(){return this.$$.ctx[24]}get setSpeed(){return this.$$.ctx[25]}get toggleSkipInactive(){return this.$$.ctx[26]}get play(){return this.$$.ctx[27]}get pause(){return this.$$.ctx[28]}get goto(){return this.$$.ctx[29]}get playRange(){return this.$$.ctx[30]}}class qn extends Yn{constructor(e){super({target:e.target,props:e.data||e.props})}}export{qn as default};
30
30
  //# sourceMappingURL=index.mjs.map