@holostaff/sdk 0.12.0 → 0.12.1
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";var __HolostaffSDK=(()=>{var Us=Object.create;var Tt=Object.defineProperty;var Ws=Object.getOwnPropertyDescriptor;var Vs=Object.getOwnPropertyNames;var Hs=Object.getPrototypeOf,Gs=Object.prototype.hasOwnProperty;var At=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var G=(e,t)=>()=>(e&&(t=e(e=0)),t);var kt=(e,t)=>{for(var n in t)Tt(e,n,{get:t[n],enumerable:!0})},Gr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vs(t))!Gs.call(e,o)&&o!==n&&Tt(e,o,{get:()=>t[o],enumerable:!(r=Ws(t,o))||r.enumerable});return e};var $s=(e,t,n)=>(n=e!=null?Us(Hs(e)):{},Gr(t||!e||!e.__esModule?Tt(n,"default",{value:e,enumerable:!0}):n,e)),zs=e=>Gr(Tt({},"__esModule",{value:!0}),e);function no(e){return e.nodeType===e.ELEMENT_NODE}function ze(e){var t=e?.host;return t?.shadowRoot===e}function Ge(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function na(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function wn(e){try{var t=e.rules||e.cssRules;return t?na(Array.from(t).map(xn).join("")):null}catch{return null}}function xn(e){var t=e.cssText;if(ra(e))try{t=wn(e.styleSheet)||t}catch{}return t}function ra(e){return"styleSheet"in e}function Mt(){return new Tn}function lt(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,i=e.maskInputFn,s=o||"";return(t[n.toLowerCase()]||t[r])&&(i?s=i(s):s="*".repeat(s.length)),s}function oa(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var o=0;o<e.height;o+=n){var i=t.getImageData,s=qr in i?i[qr]:i,l=new Uint32Array(s.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer);if(l.some(function(a){return a!==0}))return!1}return!0}function An(){return ia++}function aa(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return sa.test(t)?"div":t}function la(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function ca(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}function Rt(e,t){return(e||"").replace(da,function(n,r,o,i,s,l){var a=o||s||l,c=r||i||"";if(!a)return n;if(!ua.test(a)||pa.test(a))return"url(".concat(c).concat(a).concat(c,")");if(a[0]==="/")return"url(".concat(c).concat(ca(t)+a).concat(c,")");var d=t.split("/"),u=a.split("/");d.pop();for(var h=0,f=u;h<f.length;h++){var p=f[h];p!=="."&&(p===".."?d.pop():d.push(p))}return"url(".concat(c).concat(d.join("/")).concat(c,")")})}function ma(e,t){if(t.trim()==="")return t;var n=0;function r(c){var d,u=c.exec(t.substring(n));return u?(d=u[0],n+=d.length,d):""}for(var o=[];r(ha),!(n>=t.length);){var i=r(fa);if(i.slice(-1)===",")i=et(e,i.substring(0,i.length-1)),o.push(i);else{var s="";i=et(e,i);for(var l=!1;;){var a=t.charAt(n);if(a===""){o.push((i+s).trim());break}else if(l)a===")"&&(l=!1);else if(a===","){n+=1,o.push((i+s).trim());break}else a==="("&&(l=!0);s+=a,n+=1}}}return o.join(", ")}function et(e,t){if(!t||t.trim()==="")return t;var n=e.createElement("a");return n.href=t,n.href}function ga(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function kn(){var e=document.createElement("a");return e.href="",e.href}function Nn(e,t,n,r){return n==="src"||n==="href"&&r&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r&&r[0]!=="#"||n==="background"&&r&&(t==="table"||t==="td"||t==="th")?et(e,r):n==="srcset"&&r?ma(e,r):n==="style"&&r?Rt(r,kn()):t==="object"&&n==="data"&&r?et(e,r):r}function va(e,t,n){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?e.matches(n):!1}function at(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?at(e.parentNode,t,n):!1;for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?at(e.parentNode,t,n):!1}function Rn(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(r===null)return!1;if(typeof t=="string"){if(r.classList.contains(t)||r.closest(".".concat(t)))return!0}else if(at(r,t,!0))return!0;return!!(n&&(r.matches(n)||r.closest(n)))}function ya(e,t,n){var r=e.contentWindow;if(r){var o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){var s=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(s),o=!0,t()});return}var l="about:blank";if(r.location.href!==l||e.src===l||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function ba(e,t,n){var r=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(i),r=!0,t()})}}function Sa(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,s=t.maskTextClass,l=t.maskTextSelector,a=t.inlineStylesheet,c=t.maskInputOptions,d=c===void 0?{}:c,u=t.maskTextFn,h=t.maskInputFn,f=t.dataURLOptions,p=f===void 0?{}:f,g=t.inlineImages,b=t.recordCanvas,m=t.keepIframeSrcFn,v=t.newlyAddedElement,y=v===void 0?!1:v,E=Ca(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:K.Document,childNodes:[],compatMode:e.compatMode}:{type:K.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:K.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:E};case e.ELEMENT_NODE:return wa(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:d,maskInputFn:h,dataURLOptions:p,inlineImages:g,recordCanvas:b,keepIframeSrcFn:m,newlyAddedElement:y,rootId:E});case e.TEXT_NODE:return Ia(e,{maskTextClass:s,maskTextSelector:l,maskTextFn:u,rootId:E});case e.CDATA_SECTION_NODE:return{type:K.CDATA,textContent:"",rootId:E};case e.COMMENT_NODE:return{type:K.Comment,textContent:e.textContent||"",rootId:E};default:return!1}}function Ca(e,t){if(t.hasNode(e)){var n=t.getId(e);return n===1?void 0:n}}function Ia(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,s=t.rootId,l=e.parentNode&&e.parentNode.tagName,a=e.textContent,c=l==="STYLE"?!0:void 0,d=l==="SCRIPT"?!0:void 0;if(c&&a){try{e.nextSibling||e.previousSibling||!((n=e.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(a=la(e.parentNode.sheet))}catch(u){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(u),e)}a=Rt(a,kn())}return d&&(a="SCRIPT_PLACEHOLDER"),!c&&!d&&a&&Rn(e,r,o)&&(a=i?i(a):a.replace(/[\S]/g,"*")),{type:K.Text,textContent:a||"",isStyle:c,rootId:s}}function wa(e,t){for(var n=t.doc,r=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,s=t.maskInputOptions,l=s===void 0?{}:s,a=t.maskInputFn,c=t.dataURLOptions,d=c===void 0?{}:c,u=t.inlineImages,h=t.recordCanvas,f=t.keepIframeSrcFn,p=t.newlyAddedElement,g=p===void 0?!1:p,b=t.rootId,m=va(e,r,o),v=aa(e),y={},E=e.attributes.length,N=0;N<E;N++){var k=e.attributes[N];y[k.name]=Nn(n,v,k.name,k.value)}if(v==="link"&&i){var O=Array.from(n.styleSheets).find(function(S){return S.href===e.href}),A=null;O&&(A=wn(O)),A&&(delete y.rel,delete y.href,y._cssText=Rt(A,O.href))}if(v==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var A=wn(e.sheet);A&&(y._cssText=Rt(A,kn()))}if(v==="input"||v==="textarea"||v==="select"){var $=e.value,V=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&$?y.value=lt({type:y.type,tagName:v,value:$,maskInputOptions:l,maskInputFn:a}):V&&(y.checked=V)}if(v==="option"&&(e.selected&&!l.select?y.selected=!0:delete y.selected),v==="canvas"&&h){if(e.__context==="2d")oa(e)||(y.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var F=e.toDataURL(d.type,d.quality),U=document.createElement("canvas");U.width=e.width,U.height=e.height;var W=U.toDataURL(d.type,d.quality);F!==W&&(y.rr_dataURL=F)}}if(v==="img"&&u){Qe||(Qe=n.createElement("canvas"),Xr=Qe.getContext("2d"));var R=e,I=R.crossOrigin;R.crossOrigin="anonymous";var w=function(){try{Qe.width=R.naturalWidth,Qe.height=R.naturalHeight,Xr.drawImage(R,0,0),y.rr_dataURL=Qe.toDataURL(d.type,d.quality)}catch(S){console.warn("Cannot inline img src=".concat(R.currentSrc,"! Error: ").concat(S))}I?y.crossOrigin=I:R.removeAttribute("crossorigin")};R.complete&&R.naturalWidth!==0?w():R.onload=w}if((v==="audio"||v==="video")&&(y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime),g||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),m){var x=e.getBoundingClientRect(),T=x.width,C=x.height;y={class:y.class,rr_width:"".concat(T,"px"),rr_height:"".concat(C,"px")}}return v==="iframe"&&!f(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src),{type:K.Element,tagName:v,attributes:y,childNodes:[],isSVG:ga(e)||void 0,needBlock:m,rootId:b}}function ee(e){return e===void 0?"":e.toLowerCase()}function Ea(e,t){if(t.comment&&e.type===K.Comment)return!0;if(e.type===K.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ee(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ee(e.attributes.name)==="application-name"||ee(e.attributes.rel)==="icon"||ee(e.attributes.rel)==="apple-touch-icon"||ee(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&ee(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ee(e.attributes.property).match(/^(og|twitter|fb):/)||ee(e.attributes.name).match(/^(og|twitter):/)||ee(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ee(e.attributes.name)==="robots"||ee(e.attributes.name)==="googlebot"||ee(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ee(e.attributes.name)==="author"||ee(e.attributes.name)==="generator"||ee(e.attributes.name)==="framework"||ee(e.attributes.name)==="publisher"||ee(e.attributes.name)==="progid"||ee(e.attributes.property).match(/^article:/)||ee(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ee(e.attributes.name)==="google-site-verification"||ee(e.attributes.name)==="yandex-verification"||ee(e.attributes.name)==="csrf-token"||ee(e.attributes.name)==="p:domain_verify"||ee(e.attributes.name)==="verify-v1"||ee(e.attributes.name)==="verification"||ee(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function He(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,s=t.maskTextClass,l=t.maskTextSelector,a=t.skipChild,c=a===void 0?!1:a,d=t.inlineStylesheet,u=d===void 0?!0:d,h=t.maskInputOptions,f=h===void 0?{}:h,p=t.maskTextFn,g=t.maskInputFn,b=t.slimDOMOptions,m=t.dataURLOptions,v=m===void 0?{}:m,y=t.inlineImages,E=y===void 0?!1:y,N=t.recordCanvas,k=N===void 0?!1:N,O=t.onSerialize,A=t.onIframeLoad,$=t.iframeLoadTimeout,V=$===void 0?5e3:$,F=t.onStylesheetLoad,U=t.stylesheetLoadTimeout,W=U===void 0?5e3:U,R=t.keepIframeSrcFn,I=R===void 0?function(){return!1}:R,w=t.newlyAddedElement,x=w===void 0?!1:w,T=t.preserveWhiteSpace,C=T===void 0?!0:T,S=Sa(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:f,maskTextFn:p,maskInputFn:g,dataURLOptions:v,inlineImages:E,recordCanvas:k,keepIframeSrcFn:I,newlyAddedElement:x});if(!S)return console.warn(e,"not serialized"),null;var M;r.hasNode(e)?M=r.getId(e):Ea(S,b)||!C&&S.type===K.Text&&!S.isStyle&&!S.textContent.replace(/^\s+|\s+$/gm,"").length?M=$e:M=An();var L=Object.assign(S,{id:M});if(r.add(e,L),M===$e)return null;O&&O(e);var H=!c;if(L.type===K.Element){H=H&&!L.needBlock,delete L.needBlock;var B=e.shadowRoot;B&&Ge(B)&&(L.isShadowHost=!0)}if((L.type===K.Document||L.type===K.Element)&&H){b.headWhitespace&&L.type===K.Element&&L.tagName==="head"&&(C=!1);for(var z={doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:l,skipChild:c,inlineStylesheet:u,maskInputOptions:f,maskTextFn:p,maskInputFn:g,slimDOMOptions:b,dataURLOptions:v,inlineImages:E,recordCanvas:k,preserveWhiteSpace:C,onSerialize:O,onIframeLoad:A,iframeLoadTimeout:V,onStylesheetLoad:F,stylesheetLoadTimeout:W,keepIframeSrcFn:I},P=0,q=Array.from(e.childNodes);P<q.length;P++){var X=q[P],Q=He(X,z);Q&&L.childNodes.push(Q)}if(no(e)&&e.shadowRoot)for(var pe=0,Z=Array.from(e.shadowRoot.childNodes);pe<Z.length;pe++){var X=Z[pe],Q=He(X,z);Q&&(Ge(e.shadowRoot)&&(Q.isShadow=!0),L.childNodes.push(Q))}}return e.parentNode&&ze(e.parentNode)&&Ge(e.parentNode)&&(L.isShadow=!0),L.type===K.Element&&L.tagName==="iframe"&&ya(e,function(){var ce=e.contentDocument;if(ce&&A){var st=He(ce,{doc:ce,mirror:r,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:f,maskTextFn:p,maskInputFn:g,slimDOMOptions:b,dataURLOptions:v,inlineImages:E,recordCanvas:k,preserveWhiteSpace:C,onSerialize:O,onIframeLoad:A,iframeLoadTimeout:V,onStylesheetLoad:F,stylesheetLoadTimeout:W,keepIframeSrcFn:I});st&&A(e,st)}},V),L.type===K.Element&&L.tagName==="link"&&L.attributes.rel==="stylesheet"&&ba(e,function(){if(F){var ce=He(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:f,maskTextFn:p,maskInputFn:g,slimDOMOptions:b,dataURLOptions:v,inlineImages:E,recordCanvas:k,preserveWhiteSpace:C,onSerialize:O,onIframeLoad:A,iframeLoadTimeout:V,onStylesheetLoad:F,stylesheetLoadTimeout:W,keepIframeSrcFn:I});ce&&F(e,ce)}},W),L}function ro(e,t){var n=t||{},r=n.mirror,o=r===void 0?new Tn:r,i=n.blockClass,s=i===void 0?"rr-block":i,l=n.blockSelector,a=l===void 0?null:l,c=n.maskTextClass,d=c===void 0?"rr-mask":c,u=n.maskTextSelector,h=u===void 0?null:u,f=n.inlineStylesheet,p=f===void 0?!0:f,g=n.inlineImages,b=g===void 0?!1:g,m=n.recordCanvas,v=m===void 0?!1:m,y=n.maskAllInputs,E=y===void 0?!1:y,N=n.maskTextFn,k=n.maskInputFn,O=n.slimDOM,A=O===void 0?!1:O,$=n.dataURLOptions,V=n.preserveWhiteSpace,F=n.onSerialize,U=n.onIframeLoad,W=n.iframeLoadTimeout,R=n.onStylesheetLoad,I=n.stylesheetLoadTimeout,w=n.keepIframeSrcFn,x=w===void 0?function(){return!1}:w,T=E===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:E===!1?{password:!0}:E,C=A===!0||A==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:A==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:A===!1?{}:A;return He(e,{doc:e,mirror:o,blockClass:s,blockSelector:a,maskTextClass:d,maskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:T,maskTextFn:N,maskInputFn:k,slimDOMOptions:C,dataURLOptions:$,inlineImages:b,recordCanvas:v,preserveWhiteSpace:V,onSerialize:F,onIframeLoad:U,iframeLoadTimeout:W,onStylesheetLoad:R,stylesheetLoadTimeout:I,keepIframeSrcFn:x,newlyAddedElement:!1})}function xa(e,t){t===void 0&&(t={});var n=1,r=1;function o(C){var S=C.match(/\n/g);S&&(n+=S.length);var M=C.lastIndexOf(`
|
|
2
|
-
`);r=M===-1?r+C.length:C.length-M}function i(){var C={line:n,column:r};return function(S){return S.position=new s(C),p(),S}}var s=(function(){function C(S){this.start=S,this.end={line:n,column:r},this.source=t.source}return C})();s.prototype.content=e;var l=[];function a(C){var S=new Error("".concat(t.source||"",":").concat(n,":").concat(r,": ").concat(C));if(S.reason=C,S.filename=t.source,S.line=n,S.column=r,S.source=e,t.silent)l.push(S);else throw S}function c(){var C=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:C,parsingErrors:l}}}function d(){return f(/^{\s*/)}function u(){return f(/^}/)}function h(){var C,S=[];for(p(),g(S);e.length&&e.charAt(0)!=="}"&&(C=x()||T());)C!==!1&&(S.push(C),g(S));return S}function f(C){var S=C.exec(e);if(S){var M=S[0];return o(M),e=e.slice(M.length),S}}function p(){f(/^\s*/)}function g(C){C===void 0&&(C=[]);for(var S;S=b();)S!==!1&&C.push(S),S=b();return C}function b(){var C=i();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var S=2;e.charAt(S)!==""&&(e.charAt(S)!=="*"||e.charAt(S+1)!=="/");)++S;if(S+=2,e.charAt(S-1)==="")return a("End of comment missing");var M=e.slice(2,S-2);return r+=2,o(M),e=e.slice(S),r+=2,C({type:"comment",comment:M})}}function m(){var C=f(/^([^{]+)/);if(C)return Ae(C[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(S){return S.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(S){return S.replace(/\u200C/g,",")})}function v(){var C=i(),S=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(S){var M=Ae(S[0]);if(!f(/^:\s*/))return a("property missing ':'");var L=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),H=C({type:"declaration",property:M.replace(Qr,""),value:L?Ae(L[0]).replace(Qr,""):""});return f(/^[;\s]*/),H}}function y(){var C=[];if(!d())return a("missing '{'");g(C);for(var S;S=v();)S!==!1&&(C.push(S),g(C)),S=v();return u()?C:a("missing '}'")}function E(){for(var C,S=[],M=i();C=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)S.push(C[1]),f(/^,\s*/);if(S.length)return M({type:"keyframe",values:S,declarations:y()})}function N(){var C=i(),S=f(/^@([-\w]+)?keyframes\s*/);if(S){var M=S[1];if(S=f(/^([-\w]+)\s*/),!S)return a("@keyframes missing name");var L=S[1];if(!d())return a("@keyframes missing '{'");for(var H,B=g();H=E();)B.push(H),B=B.concat(g());return u()?C({type:"keyframes",name:L,vendor:M,keyframes:B}):a("@keyframes missing '}'")}}function k(){var C=i(),S=f(/^@supports *([^{]+)/);if(S){var M=Ae(S[1]);if(!d())return a("@supports missing '{'");var L=g().concat(h());return u()?C({type:"supports",supports:M,rules:L}):a("@supports missing '}'")}}function O(){var C=i(),S=f(/^@host\s*/);if(S){if(!d())return a("@host missing '{'");var M=g().concat(h());return u()?C({type:"host",rules:M}):a("@host missing '}'")}}function A(){var C=i(),S=f(/^@media *([^{]+)/);if(S){var M=Ae(S[1]);if(!d())return a("@media missing '{'");var L=g().concat(h());return u()?C({type:"media",media:M,rules:L}):a("@media missing '}'")}}function $(){var C=i(),S=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(S)return C({type:"custom-media",name:Ae(S[1]),media:Ae(S[2])})}function V(){var C=i(),S=f(/^@page */);if(S){var M=m()||[];if(!d())return a("@page missing '{'");for(var L=g(),H;H=v();)L.push(H),L=L.concat(g());return u()?C({type:"page",selectors:M,declarations:L}):a("@page missing '}'")}}function F(){var C=i(),S=f(/^@([-\w]+)?document *([^{]+)/);if(S){var M=Ae(S[1]),L=Ae(S[2]);if(!d())return a("@document missing '{'");var H=g().concat(h());return u()?C({type:"document",document:L,vendor:M,rules:H}):a("@document missing '}'")}}function U(){var C=i(),S=f(/^@font-face\s*/);if(S){if(!d())return a("@font-face missing '{'");for(var M=g(),L;L=v();)M.push(L),M=M.concat(g());return u()?C({type:"font-face",declarations:M}):a("@font-face missing '}'")}}var W=w("import"),R=w("charset"),I=w("namespace");function w(C){var S=new RegExp("^@"+C+"\\s*([^;]+);");return function(){var M=i(),L=f(S);if(L){var H={type:C};return H[C]=L[1].trim(),M(H)}}}function x(){if(e[0]==="@")return N()||A()||$()||k()||W()||R()||I()||F()||V()||O()||U()}function T(){var C=i(),S=m();return S?(g(),C({type:"rule",selectors:S,declarations:y()})):a("selector missing")}return En(c())}function Ae(e){return e?e.replace(/^\s+|\s+$/g,""):""}function En(e,t){for(var n=e&&typeof e.type=="string",r=n?e:t,o=0,i=Object.keys(e);o<i.length;o++){var s=i[o],l=e[s];Array.isArray(l)?l.forEach(function(a){En(a,r)}):l&&typeof l=="object"&&En(l,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}function Ta(e){var t=eo[e.tagName]?eo[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function Aa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function to(e,t){var n=t?.stylesWithHoverClass.get(e);if(n)return n;var r=xa(e,{silent:!0});if(!r.stylesheet)return e;var o=[];if(r.stylesheet.rules.forEach(function(l){"selectors"in l&&(l.selectors||[]).forEach(function(a){oo.test(a)&&o.push(a)})}),o.length===0)return e;var i=new RegExp(o.filter(function(l,a){return o.indexOf(l)===a}).sort(function(l,a){return a.length-l.length}).map(function(l){return Aa(l)}).join("|"),"g"),s=e.replace(i,function(l){var a=l.replace(ka,"$1.\\:hover");return"".concat(l,", ").concat(a)});return t?.stylesWithHoverClass.set(e,s),s}function Mn(){var e=new Map;return{stylesWithHoverClass:e}}function Na(e,t){var n=t.doc,r=t.hackCss,o=t.cache;switch(e.type){case K.Document:return n.implementation.createDocument(null,"",null);case K.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case K.Element:{var i=Ta(e),s;e.isSVG?s=n.createElementNS("http://www.w3.org/2000/svg",i):s=n.createElement(i);var l={};for(var a in e.attributes)if(Object.prototype.hasOwnProperty.call(e.attributes,a)){var c=e.attributes[a];if(!(i==="option"&&a==="selected"&&c===!1)){if(c===!0&&(c=""),a.startsWith("rr_")){l[a]=c;continue}var d=i==="textarea"&&a==="value",u=i==="style"&&a==="_cssText";if(u&&r&&typeof c=="string"&&(c=to(c,o)),(d||u)&&typeof c=="string"){for(var h=n.createTextNode(c),f=0,p=Array.from(s.childNodes);f<p.length;f++){var g=p[f];g.nodeType===s.TEXT_NODE&&s.removeChild(g)}s.appendChild(h);continue}try{if(e.isSVG&&a==="xlink:href")s.setAttributeNS("http://www.w3.org/1999/xlink",a,c.toString());else if(a==="onload"||a==="onclick"||a.substring(0,7)==="onmouse")s.setAttribute("_"+a,c.toString());else if(i==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&a==="content"){s.setAttribute("csp-content",c.toString());continue}else i==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||i==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(i==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?s.setAttribute("rrweb-original-srcset",e.attributes.srcset):s.setAttribute(a,c.toString()))}catch{}}}var b=function(v){var y=l[v];if(i==="canvas"&&v==="rr_dataURL"){var E=document.createElement("img");E.onload=function(){var k=s.getContext("2d");k&&k.drawImage(E,0,0,E.width,E.height)},E.src=y.toString(),s.RRNodeType&&(s.rr_dataURL=y.toString())}else if(i==="img"&&v==="rr_dataURL"){var N=s;N.currentSrc.startsWith("data:")||(N.setAttribute("rrweb-original-src",e.attributes.src),N.src=y.toString())}if(v==="rr_width")s.style.width=y.toString();else if(v==="rr_height")s.style.height=y.toString();else if(v==="rr_mediaCurrentTime"&&typeof y=="number")s.currentTime=y;else if(v==="rr_mediaState")switch(y){case"played":s.play().catch(function(k){return console.warn("media playback error",k)});break;case"paused":s.pause();break}};for(var m in l)b(m);if(e.isShadowHost)if(!s.shadowRoot)s.attachShadow({mode:"open"});else for(;s.shadowRoot.firstChild;)s.shadowRoot.removeChild(s.shadowRoot.firstChild);return s}case K.Text:return n.createTextNode(e.isStyle&&r?to(e.textContent,o):e.textContent);case K.CDATA:return n.createCDATASection(e.textContent);case K.Comment:return n.createComment(e.textContent);default:return null}}function tt(e,t){var n=t.doc,r=t.mirror,o=t.skipChild,i=o===void 0?!1:o,s=t.hackCss,l=s===void 0?!0:s,a=t.afterAppend,c=t.cache,d=Na(e,{doc:n,hackCss:l,cache:c});if(!d)return null;if(e.rootId&&r.getNode(e.rootId)!==n&&r.replace(e.rootId,n),e.type===K.Document&&(n.close(),n.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==K.DocumentType&&(e.childNodes[0].type===K.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),d=n),r.add(d,e),(e.type===K.Document||e.type===K.Element)&&!i)for(var u=0,h=e.childNodes;u<h.length;u++){var f=h[u],p=tt(f,{doc:n,mirror:r,skipChild:!1,hackCss:l,afterAppend:a,cache:c});if(!p){console.warn("Failed to rebuild",f);continue}f.isShadow&&no(d)&&d.shadowRoot?d.shadowRoot.appendChild(p):d.appendChild(p),a&&a(p,f.id)}return d}function Ra(e,t){function n(s){t(s)}for(var r=0,o=e.getIds();r<o.length;r++){var i=o[r];e.has(i)&&n(e.getNode(i))}}function Ma(e,t){var n=t.getMeta(e);if(n?.type===K.Element){var r=e;for(var o in n.attributes)if(Object.prototype.hasOwnProperty.call(n.attributes,o)&&o.startsWith("rr_")){var i=n.attributes[o];o==="rr_scrollLeft"&&(r.scrollLeft=i),o==="rr_scrollTop"&&(r.scrollTop=i)}}}function io(e,t){var n=t.doc,r=t.onVisit,o=t.hackCss,i=o===void 0?!0:o,s=t.afterAppend,l=t.cache,a=t.mirror,c=a===void 0?new Tn:a,d=tt(e,{doc:n,mirror:c,skipChild:!1,hackCss:i,afterAppend:s,cache:l});return Ra(c,function(u){r&&r(u),Ma(u,c)}),d}var K,Tn,qr,ia,sa,$e,Qe,Xr,da,ua,pa,fa,ha,Qr,eo,oo,ka,ke=G(()=>{(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(K||(K={}));Tn=(function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){var r=this.getNode(t);if(r){var o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e})();qr="__rrweb_original__";ia=1,sa=new RegExp("[^a-z0-9-_:]"),$e=-2;da=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ua=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,pa=/^(data:)([^,]*),(.*)/i;fa=/^[^ \t\n\r\u000c]+/,ha=/^[, \t\n\r\u000c]+/;Qr=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;eo={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"};oo=/([^\\]):hover/,ka=new RegExp(oo.source,"g")});var _n={};kt(_n,{StyleSheetMirror:()=>Ke,_mirror:()=>ct,getBaseDimension:()=>_t,getNestedRule:()=>Ye,getPositionsAndIndex:()=>Ft,getWindowHeight:()=>dt,getWindowWidth:()=>ut,hasShadowRoot:()=>xe,hookSetter:()=>_e,isAncestorRemoved:()=>Ot,isBlocked:()=>te,isIgnored:()=>pt,isSerialized:()=>On,isSerializedIframe:()=>Ne,isSerializedStylesheet:()=>ht,isTouchEvent:()=>Dt,iterateResolveTree:()=>Lt,on:()=>le,patch:()=>me,polyfill:()=>ft,queueToResolveTrees:()=>Dn,throttle:()=>je,uniqueTextMutations:()=>Ln});function le(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}function je(e,t,n={}){let r=null,o=0;return function(...i){let s=Date.now();!o&&n.leading===!1&&(o=s);let l=t-(s-o),a=this;l<=0||l>t?(r&&(clearTimeout(r),r=null),o=s,e.apply(a,i)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(a,i)},l))}}function _e(e,t,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(s){setTimeout(()=>{n.set.call(this,s)},0),i&&i.set&&i.set.call(this,s)}}),()=>_e(e,t,i||{},!0)}function me(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function dt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ut(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function te(e,t,n,r){if(!e)return!1;let o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;if(typeof t=="string"){if(o.classList.contains(t)||r&&o.closest("."+t)!==null)return!0}else if(at(o,t,r))return!0;return!!(n&&(e.matches(n)||r&&o.closest(n)!==null))}function On(e,t){return t.getId(e)!==-1}function pt(e,t){return t.getId(e)===$e}function Ot(e,t){if(ze(e))return!1;let n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Ot(e.parentNode,t):!0:!0}function Dt(e){return!!e.changedTouches}function ft(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=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Dn(e){let t={},n=(o,i)=>{let s={value:o,parent:i,children:[]};return t[o.node.id]=s,s},r=[];for(let o of e){let{nextId:i,parentId:s}=o;if(i&&i in t){let l=t[i];if(l.parent){let a=l.parent.children.indexOf(l);l.parent.children.splice(a,0,n(o,l.parent))}else{let a=r.indexOf(l);r.splice(a,0,n(o,null))}continue}if(s in t){let l=t[s];l.children.push(n(o,l));continue}r.push(n(o,null))}return r}function Lt(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)Lt(e.children[n],t)}function Ne(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function ht(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function _t(e,t){var n,r;let o=(r=(n=e.ownerDocument)===null||n===void 0?void 0:n.defaultView)===null||r===void 0?void 0:r.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};let i=o.getBoundingClientRect(),s=_t(o,t),l=i.height/o.clientHeight;return{x:i.x*s.relativeScale+s.x,y:i.y*s.relativeScale+s.y,relativeScale:l,absoluteScale:s.absoluteScale*l}}function xe(e){return!!e?.shadowRoot}function Ye(e,t){let n=e[t[0]];return t.length===1?n:Ye(n.cssRules[t[1]].cssRules,t.slice(2))}function Ft(e){let t=[...e],n=t.pop();return{positions:t,index:n}}function Ln(e){let t=new Set,n=[];for(let r=e.length;r--;){let o=e[r];t.has(o.id)||(n.push(o),t.add(o.id))}return n}var nt,ct,Ke,ge=G(()=>{ke();nt=`Please stop import mirror directly. Instead of that,\r
|
|
1
|
+
"use strict";var __HolostaffSDK=(()=>{var Us=Object.create;var Tt=Object.defineProperty;var Ws=Object.getOwnPropertyDescriptor;var Vs=Object.getOwnPropertyNames;var Hs=Object.getPrototypeOf,Gs=Object.prototype.hasOwnProperty;var At=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var G=(e,t)=>()=>(e&&(t=e(e=0)),t);var kt=(e,t)=>{for(var n in t)Tt(e,n,{get:t[n],enumerable:!0})},Gr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vs(t))!Gs.call(e,o)&&o!==n&&Tt(e,o,{get:()=>t[o],enumerable:!(r=Ws(t,o))||r.enumerable});return e};var $s=(e,t,n)=>(n=e!=null?Us(Hs(e)):{},Gr(t||!e||!e.__esModule?Tt(n,"default",{value:e,enumerable:!0}):n,e)),zs=e=>Gr(Tt({},"__esModule",{value:!0}),e);function no(e){return e.nodeType===e.ELEMENT_NODE}function ze(e){var t=e?.host;return t?.shadowRoot===e}function Ge(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function na(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function wn(e){try{var t=e.rules||e.cssRules;return t?na(Array.from(t).map(xn).join("")):null}catch{return null}}function xn(e){var t=e.cssText;if(ra(e))try{t=wn(e.styleSheet)||t}catch{}return t}function ra(e){return"styleSheet"in e}function Mt(){return new Tn}function lt(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,i=e.maskInputFn,s=o||"";return(t[n.toLowerCase()]||t[r])&&(i?s=i(s):s="*".repeat(s.length)),s}function oa(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var o=0;o<e.height;o+=n){var i=t.getImageData,s=qr in i?i[qr]:i,l=new Uint32Array(s.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer);if(l.some(function(a){return a!==0}))return!1}return!0}function An(){return ia++}function aa(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return sa.test(t)?"div":t}function la(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function ca(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}function Rt(e,t){return(e||"").replace(da,function(n,r,o,i,s,l){var a=o||s||l,c=r||i||"";if(!a)return n;if(!ua.test(a)||pa.test(a))return"url(".concat(c).concat(a).concat(c,")");if(a[0]==="/")return"url(".concat(c).concat(ca(t)+a).concat(c,")");var d=t.split("/"),u=a.split("/");d.pop();for(var h=0,f=u;h<f.length;h++){var p=f[h];p!=="."&&(p===".."?d.pop():d.push(p))}return"url(".concat(c).concat(d.join("/")).concat(c,")")})}function ma(e,t){if(t.trim()==="")return t;var n=0;function r(c){var d,u=c.exec(t.substring(n));return u?(d=u[0],n+=d.length,d):""}for(var o=[];r(ha),!(n>=t.length);){var i=r(fa);if(i.slice(-1)===",")i=et(e,i.substring(0,i.length-1)),o.push(i);else{var s="";i=et(e,i);for(var l=!1;;){var a=t.charAt(n);if(a===""){o.push((i+s).trim());break}else if(l)a===")"&&(l=!1);else if(a===","){n+=1,o.push((i+s).trim());break}else a==="("&&(l=!0);s+=a,n+=1}}}return o.join(", ")}function et(e,t){if(!t||t.trim()==="")return t;var n=e.createElement("a");return n.href=t,n.href}function ga(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function kn(){var e=document.createElement("a");return e.href="",e.href}function Nn(e,t,n,r){return n==="src"||n==="href"&&r&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r&&r[0]!=="#"||n==="background"&&r&&(t==="table"||t==="td"||t==="th")?et(e,r):n==="srcset"&&r?ma(e,r):n==="style"&&r?Rt(r,kn()):t==="object"&&n==="data"&&r?et(e,r):r}function va(e,t,n){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?e.matches(n):!1}function at(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?at(e.parentNode,t,n):!1;for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?at(e.parentNode,t,n):!1}function Rn(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(r===null)return!1;if(typeof t=="string"){if(r.classList.contains(t)||r.closest(".".concat(t)))return!0}else if(at(r,t,!0))return!0;return!!(n&&(r.matches(n)||r.closest(n)))}function ya(e,t,n){var r=e.contentWindow;if(r){var o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){var s=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(s),o=!0,t()});return}var l="about:blank";if(r.location.href!==l||e.src===l||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function ba(e,t,n){var r=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(i),r=!0,t()})}}function Sa(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,s=t.maskTextClass,l=t.maskTextSelector,a=t.inlineStylesheet,c=t.maskInputOptions,d=c===void 0?{}:c,u=t.maskTextFn,h=t.maskInputFn,f=t.dataURLOptions,p=f===void 0?{}:f,m=t.inlineImages,b=t.recordCanvas,g=t.keepIframeSrcFn,v=t.newlyAddedElement,y=v===void 0?!1:v,E=Ca(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:K.Document,childNodes:[],compatMode:e.compatMode}:{type:K.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:K.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:E};case e.ELEMENT_NODE:return wa(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:d,maskInputFn:h,dataURLOptions:p,inlineImages:m,recordCanvas:b,keepIframeSrcFn:g,newlyAddedElement:y,rootId:E});case e.TEXT_NODE:return Ia(e,{maskTextClass:s,maskTextSelector:l,maskTextFn:u,rootId:E});case e.CDATA_SECTION_NODE:return{type:K.CDATA,textContent:"",rootId:E};case e.COMMENT_NODE:return{type:K.Comment,textContent:e.textContent||"",rootId:E};default:return!1}}function Ca(e,t){if(t.hasNode(e)){var n=t.getId(e);return n===1?void 0:n}}function Ia(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,s=t.rootId,l=e.parentNode&&e.parentNode.tagName,a=e.textContent,c=l==="STYLE"?!0:void 0,d=l==="SCRIPT"?!0:void 0;if(c&&a){try{e.nextSibling||e.previousSibling||!((n=e.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(a=la(e.parentNode.sheet))}catch(u){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(u),e)}a=Rt(a,kn())}return d&&(a="SCRIPT_PLACEHOLDER"),!c&&!d&&a&&Rn(e,r,o)&&(a=i?i(a):a.replace(/[\S]/g,"*")),{type:K.Text,textContent:a||"",isStyle:c,rootId:s}}function wa(e,t){for(var n=t.doc,r=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,s=t.maskInputOptions,l=s===void 0?{}:s,a=t.maskInputFn,c=t.dataURLOptions,d=c===void 0?{}:c,u=t.inlineImages,h=t.recordCanvas,f=t.keepIframeSrcFn,p=t.newlyAddedElement,m=p===void 0?!1:p,b=t.rootId,g=va(e,r,o),v=aa(e),y={},E=e.attributes.length,N=0;N<E;N++){var k=e.attributes[N];y[k.name]=Nn(n,v,k.name,k.value)}if(v==="link"&&i){var O=Array.from(n.styleSheets).find(function(S){return S.href===e.href}),A=null;O&&(A=wn(O)),A&&(delete y.rel,delete y.href,y._cssText=Rt(A,O.href))}if(v==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var A=wn(e.sheet);A&&(y._cssText=Rt(A,kn()))}if(v==="input"||v==="textarea"||v==="select"){var $=e.value,V=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&$?y.value=lt({type:y.type,tagName:v,value:$,maskInputOptions:l,maskInputFn:a}):V&&(y.checked=V)}if(v==="option"&&(e.selected&&!l.select?y.selected=!0:delete y.selected),v==="canvas"&&h){if(e.__context==="2d")oa(e)||(y.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var F=e.toDataURL(d.type,d.quality),U=document.createElement("canvas");U.width=e.width,U.height=e.height;var W=U.toDataURL(d.type,d.quality);F!==W&&(y.rr_dataURL=F)}}if(v==="img"&&u){Qe||(Qe=n.createElement("canvas"),Xr=Qe.getContext("2d"));var R=e,I=R.crossOrigin;R.crossOrigin="anonymous";var w=function(){try{Qe.width=R.naturalWidth,Qe.height=R.naturalHeight,Xr.drawImage(R,0,0),y.rr_dataURL=Qe.toDataURL(d.type,d.quality)}catch(S){console.warn("Cannot inline img src=".concat(R.currentSrc,"! Error: ").concat(S))}I?y.crossOrigin=I:R.removeAttribute("crossorigin")};R.complete&&R.naturalWidth!==0?w():R.onload=w}if((v==="audio"||v==="video")&&(y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime),m||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),g){var x=e.getBoundingClientRect(),T=x.width,C=x.height;y={class:y.class,rr_width:"".concat(T,"px"),rr_height:"".concat(C,"px")}}return v==="iframe"&&!f(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src),{type:K.Element,tagName:v,attributes:y,childNodes:[],isSVG:ga(e)||void 0,needBlock:g,rootId:b}}function ee(e){return e===void 0?"":e.toLowerCase()}function Ea(e,t){if(t.comment&&e.type===K.Comment)return!0;if(e.type===K.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ee(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ee(e.attributes.name)==="application-name"||ee(e.attributes.rel)==="icon"||ee(e.attributes.rel)==="apple-touch-icon"||ee(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&ee(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ee(e.attributes.property).match(/^(og|twitter|fb):/)||ee(e.attributes.name).match(/^(og|twitter):/)||ee(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ee(e.attributes.name)==="robots"||ee(e.attributes.name)==="googlebot"||ee(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ee(e.attributes.name)==="author"||ee(e.attributes.name)==="generator"||ee(e.attributes.name)==="framework"||ee(e.attributes.name)==="publisher"||ee(e.attributes.name)==="progid"||ee(e.attributes.property).match(/^article:/)||ee(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ee(e.attributes.name)==="google-site-verification"||ee(e.attributes.name)==="yandex-verification"||ee(e.attributes.name)==="csrf-token"||ee(e.attributes.name)==="p:domain_verify"||ee(e.attributes.name)==="verify-v1"||ee(e.attributes.name)==="verification"||ee(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function He(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,s=t.maskTextClass,l=t.maskTextSelector,a=t.skipChild,c=a===void 0?!1:a,d=t.inlineStylesheet,u=d===void 0?!0:d,h=t.maskInputOptions,f=h===void 0?{}:h,p=t.maskTextFn,m=t.maskInputFn,b=t.slimDOMOptions,g=t.dataURLOptions,v=g===void 0?{}:g,y=t.inlineImages,E=y===void 0?!1:y,N=t.recordCanvas,k=N===void 0?!1:N,O=t.onSerialize,A=t.onIframeLoad,$=t.iframeLoadTimeout,V=$===void 0?5e3:$,F=t.onStylesheetLoad,U=t.stylesheetLoadTimeout,W=U===void 0?5e3:U,R=t.keepIframeSrcFn,I=R===void 0?function(){return!1}:R,w=t.newlyAddedElement,x=w===void 0?!1:w,T=t.preserveWhiteSpace,C=T===void 0?!0:T,S=Sa(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:f,maskTextFn:p,maskInputFn:m,dataURLOptions:v,inlineImages:E,recordCanvas:k,keepIframeSrcFn:I,newlyAddedElement:x});if(!S)return console.warn(e,"not serialized"),null;var M;r.hasNode(e)?M=r.getId(e):Ea(S,b)||!C&&S.type===K.Text&&!S.isStyle&&!S.textContent.replace(/^\s+|\s+$/gm,"").length?M=$e:M=An();var L=Object.assign(S,{id:M});if(r.add(e,L),M===$e)return null;O&&O(e);var H=!c;if(L.type===K.Element){H=H&&!L.needBlock,delete L.needBlock;var B=e.shadowRoot;B&&Ge(B)&&(L.isShadowHost=!0)}if((L.type===K.Document||L.type===K.Element)&&H){b.headWhitespace&&L.type===K.Element&&L.tagName==="head"&&(C=!1);for(var z={doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:l,skipChild:c,inlineStylesheet:u,maskInputOptions:f,maskTextFn:p,maskInputFn:m,slimDOMOptions:b,dataURLOptions:v,inlineImages:E,recordCanvas:k,preserveWhiteSpace:C,onSerialize:O,onIframeLoad:A,iframeLoadTimeout:V,onStylesheetLoad:F,stylesheetLoadTimeout:W,keepIframeSrcFn:I},P=0,q=Array.from(e.childNodes);P<q.length;P++){var X=q[P],Q=He(X,z);Q&&L.childNodes.push(Q)}if(no(e)&&e.shadowRoot)for(var pe=0,Z=Array.from(e.shadowRoot.childNodes);pe<Z.length;pe++){var X=Z[pe],Q=He(X,z);Q&&(Ge(e.shadowRoot)&&(Q.isShadow=!0),L.childNodes.push(Q))}}return e.parentNode&&ze(e.parentNode)&&Ge(e.parentNode)&&(L.isShadow=!0),L.type===K.Element&&L.tagName==="iframe"&&ya(e,function(){var ce=e.contentDocument;if(ce&&A){var st=He(ce,{doc:ce,mirror:r,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:f,maskTextFn:p,maskInputFn:m,slimDOMOptions:b,dataURLOptions:v,inlineImages:E,recordCanvas:k,preserveWhiteSpace:C,onSerialize:O,onIframeLoad:A,iframeLoadTimeout:V,onStylesheetLoad:F,stylesheetLoadTimeout:W,keepIframeSrcFn:I});st&&A(e,st)}},V),L.type===K.Element&&L.tagName==="link"&&L.attributes.rel==="stylesheet"&&ba(e,function(){if(F){var ce=He(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:f,maskTextFn:p,maskInputFn:m,slimDOMOptions:b,dataURLOptions:v,inlineImages:E,recordCanvas:k,preserveWhiteSpace:C,onSerialize:O,onIframeLoad:A,iframeLoadTimeout:V,onStylesheetLoad:F,stylesheetLoadTimeout:W,keepIframeSrcFn:I});ce&&F(e,ce)}},W),L}function ro(e,t){var n=t||{},r=n.mirror,o=r===void 0?new Tn:r,i=n.blockClass,s=i===void 0?"rr-block":i,l=n.blockSelector,a=l===void 0?null:l,c=n.maskTextClass,d=c===void 0?"rr-mask":c,u=n.maskTextSelector,h=u===void 0?null:u,f=n.inlineStylesheet,p=f===void 0?!0:f,m=n.inlineImages,b=m===void 0?!1:m,g=n.recordCanvas,v=g===void 0?!1:g,y=n.maskAllInputs,E=y===void 0?!1:y,N=n.maskTextFn,k=n.maskInputFn,O=n.slimDOM,A=O===void 0?!1:O,$=n.dataURLOptions,V=n.preserveWhiteSpace,F=n.onSerialize,U=n.onIframeLoad,W=n.iframeLoadTimeout,R=n.onStylesheetLoad,I=n.stylesheetLoadTimeout,w=n.keepIframeSrcFn,x=w===void 0?function(){return!1}:w,T=E===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:E===!1?{password:!0}:E,C=A===!0||A==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:A==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:A===!1?{}:A;return He(e,{doc:e,mirror:o,blockClass:s,blockSelector:a,maskTextClass:d,maskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:T,maskTextFn:N,maskInputFn:k,slimDOMOptions:C,dataURLOptions:$,inlineImages:b,recordCanvas:v,preserveWhiteSpace:V,onSerialize:F,onIframeLoad:U,iframeLoadTimeout:W,onStylesheetLoad:R,stylesheetLoadTimeout:I,keepIframeSrcFn:x,newlyAddedElement:!1})}function xa(e,t){t===void 0&&(t={});var n=1,r=1;function o(C){var S=C.match(/\n/g);S&&(n+=S.length);var M=C.lastIndexOf(`
|
|
2
|
+
`);r=M===-1?r+C.length:C.length-M}function i(){var C={line:n,column:r};return function(S){return S.position=new s(C),p(),S}}var s=(function(){function C(S){this.start=S,this.end={line:n,column:r},this.source=t.source}return C})();s.prototype.content=e;var l=[];function a(C){var S=new Error("".concat(t.source||"",":").concat(n,":").concat(r,": ").concat(C));if(S.reason=C,S.filename=t.source,S.line=n,S.column=r,S.source=e,t.silent)l.push(S);else throw S}function c(){var C=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:C,parsingErrors:l}}}function d(){return f(/^{\s*/)}function u(){return f(/^}/)}function h(){var C,S=[];for(p(),m(S);e.length&&e.charAt(0)!=="}"&&(C=x()||T());)C!==!1&&(S.push(C),m(S));return S}function f(C){var S=C.exec(e);if(S){var M=S[0];return o(M),e=e.slice(M.length),S}}function p(){f(/^\s*/)}function m(C){C===void 0&&(C=[]);for(var S;S=b();)S!==!1&&C.push(S),S=b();return C}function b(){var C=i();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var S=2;e.charAt(S)!==""&&(e.charAt(S)!=="*"||e.charAt(S+1)!=="/");)++S;if(S+=2,e.charAt(S-1)==="")return a("End of comment missing");var M=e.slice(2,S-2);return r+=2,o(M),e=e.slice(S),r+=2,C({type:"comment",comment:M})}}function g(){var C=f(/^([^{]+)/);if(C)return Ae(C[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(S){return S.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(S){return S.replace(/\u200C/g,",")})}function v(){var C=i(),S=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(S){var M=Ae(S[0]);if(!f(/^:\s*/))return a("property missing ':'");var L=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),H=C({type:"declaration",property:M.replace(Qr,""),value:L?Ae(L[0]).replace(Qr,""):""});return f(/^[;\s]*/),H}}function y(){var C=[];if(!d())return a("missing '{'");m(C);for(var S;S=v();)S!==!1&&(C.push(S),m(C)),S=v();return u()?C:a("missing '}'")}function E(){for(var C,S=[],M=i();C=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)S.push(C[1]),f(/^,\s*/);if(S.length)return M({type:"keyframe",values:S,declarations:y()})}function N(){var C=i(),S=f(/^@([-\w]+)?keyframes\s*/);if(S){var M=S[1];if(S=f(/^([-\w]+)\s*/),!S)return a("@keyframes missing name");var L=S[1];if(!d())return a("@keyframes missing '{'");for(var H,B=m();H=E();)B.push(H),B=B.concat(m());return u()?C({type:"keyframes",name:L,vendor:M,keyframes:B}):a("@keyframes missing '}'")}}function k(){var C=i(),S=f(/^@supports *([^{]+)/);if(S){var M=Ae(S[1]);if(!d())return a("@supports missing '{'");var L=m().concat(h());return u()?C({type:"supports",supports:M,rules:L}):a("@supports missing '}'")}}function O(){var C=i(),S=f(/^@host\s*/);if(S){if(!d())return a("@host missing '{'");var M=m().concat(h());return u()?C({type:"host",rules:M}):a("@host missing '}'")}}function A(){var C=i(),S=f(/^@media *([^{]+)/);if(S){var M=Ae(S[1]);if(!d())return a("@media missing '{'");var L=m().concat(h());return u()?C({type:"media",media:M,rules:L}):a("@media missing '}'")}}function $(){var C=i(),S=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(S)return C({type:"custom-media",name:Ae(S[1]),media:Ae(S[2])})}function V(){var C=i(),S=f(/^@page */);if(S){var M=g()||[];if(!d())return a("@page missing '{'");for(var L=m(),H;H=v();)L.push(H),L=L.concat(m());return u()?C({type:"page",selectors:M,declarations:L}):a("@page missing '}'")}}function F(){var C=i(),S=f(/^@([-\w]+)?document *([^{]+)/);if(S){var M=Ae(S[1]),L=Ae(S[2]);if(!d())return a("@document missing '{'");var H=m().concat(h());return u()?C({type:"document",document:L,vendor:M,rules:H}):a("@document missing '}'")}}function U(){var C=i(),S=f(/^@font-face\s*/);if(S){if(!d())return a("@font-face missing '{'");for(var M=m(),L;L=v();)M.push(L),M=M.concat(m());return u()?C({type:"font-face",declarations:M}):a("@font-face missing '}'")}}var W=w("import"),R=w("charset"),I=w("namespace");function w(C){var S=new RegExp("^@"+C+"\\s*([^;]+);");return function(){var M=i(),L=f(S);if(L){var H={type:C};return H[C]=L[1].trim(),M(H)}}}function x(){if(e[0]==="@")return N()||A()||$()||k()||W()||R()||I()||F()||V()||O()||U()}function T(){var C=i(),S=g();return S?(m(),C({type:"rule",selectors:S,declarations:y()})):a("selector missing")}return En(c())}function Ae(e){return e?e.replace(/^\s+|\s+$/g,""):""}function En(e,t){for(var n=e&&typeof e.type=="string",r=n?e:t,o=0,i=Object.keys(e);o<i.length;o++){var s=i[o],l=e[s];Array.isArray(l)?l.forEach(function(a){En(a,r)}):l&&typeof l=="object"&&En(l,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}function Ta(e){var t=eo[e.tagName]?eo[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function Aa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function to(e,t){var n=t?.stylesWithHoverClass.get(e);if(n)return n;var r=xa(e,{silent:!0});if(!r.stylesheet)return e;var o=[];if(r.stylesheet.rules.forEach(function(l){"selectors"in l&&(l.selectors||[]).forEach(function(a){oo.test(a)&&o.push(a)})}),o.length===0)return e;var i=new RegExp(o.filter(function(l,a){return o.indexOf(l)===a}).sort(function(l,a){return a.length-l.length}).map(function(l){return Aa(l)}).join("|"),"g"),s=e.replace(i,function(l){var a=l.replace(ka,"$1.\\:hover");return"".concat(l,", ").concat(a)});return t?.stylesWithHoverClass.set(e,s),s}function Mn(){var e=new Map;return{stylesWithHoverClass:e}}function Na(e,t){var n=t.doc,r=t.hackCss,o=t.cache;switch(e.type){case K.Document:return n.implementation.createDocument(null,"",null);case K.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case K.Element:{var i=Ta(e),s;e.isSVG?s=n.createElementNS("http://www.w3.org/2000/svg",i):s=n.createElement(i);var l={};for(var a in e.attributes)if(Object.prototype.hasOwnProperty.call(e.attributes,a)){var c=e.attributes[a];if(!(i==="option"&&a==="selected"&&c===!1)){if(c===!0&&(c=""),a.startsWith("rr_")){l[a]=c;continue}var d=i==="textarea"&&a==="value",u=i==="style"&&a==="_cssText";if(u&&r&&typeof c=="string"&&(c=to(c,o)),(d||u)&&typeof c=="string"){for(var h=n.createTextNode(c),f=0,p=Array.from(s.childNodes);f<p.length;f++){var m=p[f];m.nodeType===s.TEXT_NODE&&s.removeChild(m)}s.appendChild(h);continue}try{if(e.isSVG&&a==="xlink:href")s.setAttributeNS("http://www.w3.org/1999/xlink",a,c.toString());else if(a==="onload"||a==="onclick"||a.substring(0,7)==="onmouse")s.setAttribute("_"+a,c.toString());else if(i==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&a==="content"){s.setAttribute("csp-content",c.toString());continue}else i==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||i==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(i==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?s.setAttribute("rrweb-original-srcset",e.attributes.srcset):s.setAttribute(a,c.toString()))}catch{}}}var b=function(v){var y=l[v];if(i==="canvas"&&v==="rr_dataURL"){var E=document.createElement("img");E.onload=function(){var k=s.getContext("2d");k&&k.drawImage(E,0,0,E.width,E.height)},E.src=y.toString(),s.RRNodeType&&(s.rr_dataURL=y.toString())}else if(i==="img"&&v==="rr_dataURL"){var N=s;N.currentSrc.startsWith("data:")||(N.setAttribute("rrweb-original-src",e.attributes.src),N.src=y.toString())}if(v==="rr_width")s.style.width=y.toString();else if(v==="rr_height")s.style.height=y.toString();else if(v==="rr_mediaCurrentTime"&&typeof y=="number")s.currentTime=y;else if(v==="rr_mediaState")switch(y){case"played":s.play().catch(function(k){return console.warn("media playback error",k)});break;case"paused":s.pause();break}};for(var g in l)b(g);if(e.isShadowHost)if(!s.shadowRoot)s.attachShadow({mode:"open"});else for(;s.shadowRoot.firstChild;)s.shadowRoot.removeChild(s.shadowRoot.firstChild);return s}case K.Text:return n.createTextNode(e.isStyle&&r?to(e.textContent,o):e.textContent);case K.CDATA:return n.createCDATASection(e.textContent);case K.Comment:return n.createComment(e.textContent);default:return null}}function tt(e,t){var n=t.doc,r=t.mirror,o=t.skipChild,i=o===void 0?!1:o,s=t.hackCss,l=s===void 0?!0:s,a=t.afterAppend,c=t.cache,d=Na(e,{doc:n,hackCss:l,cache:c});if(!d)return null;if(e.rootId&&r.getNode(e.rootId)!==n&&r.replace(e.rootId,n),e.type===K.Document&&(n.close(),n.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==K.DocumentType&&(e.childNodes[0].type===K.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),d=n),r.add(d,e),(e.type===K.Document||e.type===K.Element)&&!i)for(var u=0,h=e.childNodes;u<h.length;u++){var f=h[u],p=tt(f,{doc:n,mirror:r,skipChild:!1,hackCss:l,afterAppend:a,cache:c});if(!p){console.warn("Failed to rebuild",f);continue}f.isShadow&&no(d)&&d.shadowRoot?d.shadowRoot.appendChild(p):d.appendChild(p),a&&a(p,f.id)}return d}function Ra(e,t){function n(s){t(s)}for(var r=0,o=e.getIds();r<o.length;r++){var i=o[r];e.has(i)&&n(e.getNode(i))}}function Ma(e,t){var n=t.getMeta(e);if(n?.type===K.Element){var r=e;for(var o in n.attributes)if(Object.prototype.hasOwnProperty.call(n.attributes,o)&&o.startsWith("rr_")){var i=n.attributes[o];o==="rr_scrollLeft"&&(r.scrollLeft=i),o==="rr_scrollTop"&&(r.scrollTop=i)}}}function io(e,t){var n=t.doc,r=t.onVisit,o=t.hackCss,i=o===void 0?!0:o,s=t.afterAppend,l=t.cache,a=t.mirror,c=a===void 0?new Tn:a,d=tt(e,{doc:n,mirror:c,skipChild:!1,hackCss:i,afterAppend:s,cache:l});return Ra(c,function(u){r&&r(u),Ma(u,c)}),d}var K,Tn,qr,ia,sa,$e,Qe,Xr,da,ua,pa,fa,ha,Qr,eo,oo,ka,ke=G(()=>{(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(K||(K={}));Tn=(function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){var r=this.getNode(t);if(r){var o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e})();qr="__rrweb_original__";ia=1,sa=new RegExp("[^a-z0-9-_:]"),$e=-2;da=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ua=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,pa=/^(data:)([^,]*),(.*)/i;fa=/^[^ \t\n\r\u000c]+/,ha=/^[, \t\n\r\u000c]+/;Qr=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;eo={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"};oo=/([^\\]):hover/,ka=new RegExp(oo.source,"g")});var _n={};kt(_n,{StyleSheetMirror:()=>Ke,_mirror:()=>ct,getBaseDimension:()=>_t,getNestedRule:()=>Ye,getPositionsAndIndex:()=>Ft,getWindowHeight:()=>dt,getWindowWidth:()=>ut,hasShadowRoot:()=>xe,hookSetter:()=>_e,isAncestorRemoved:()=>Ot,isBlocked:()=>te,isIgnored:()=>pt,isSerialized:()=>On,isSerializedIframe:()=>Ne,isSerializedStylesheet:()=>ht,isTouchEvent:()=>Dt,iterateResolveTree:()=>Lt,on:()=>le,patch:()=>me,polyfill:()=>ft,queueToResolveTrees:()=>Dn,throttle:()=>je,uniqueTextMutations:()=>Ln});function le(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}function je(e,t,n={}){let r=null,o=0;return function(...i){let s=Date.now();!o&&n.leading===!1&&(o=s);let l=t-(s-o),a=this;l<=0||l>t?(r&&(clearTimeout(r),r=null),o=s,e.apply(a,i)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(a,i)},l))}}function _e(e,t,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(s){setTimeout(()=>{n.set.call(this,s)},0),i&&i.set&&i.set.call(this,s)}}),()=>_e(e,t,i||{},!0)}function me(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function dt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ut(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function te(e,t,n,r){if(!e)return!1;let o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;if(typeof t=="string"){if(o.classList.contains(t)||r&&o.closest("."+t)!==null)return!0}else if(at(o,t,r))return!0;return!!(n&&(e.matches(n)||r&&o.closest(n)!==null))}function On(e,t){return t.getId(e)!==-1}function pt(e,t){return t.getId(e)===$e}function Ot(e,t){if(ze(e))return!1;let n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Ot(e.parentNode,t):!0:!0}function Dt(e){return!!e.changedTouches}function ft(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=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Dn(e){let t={},n=(o,i)=>{let s={value:o,parent:i,children:[]};return t[o.node.id]=s,s},r=[];for(let o of e){let{nextId:i,parentId:s}=o;if(i&&i in t){let l=t[i];if(l.parent){let a=l.parent.children.indexOf(l);l.parent.children.splice(a,0,n(o,l.parent))}else{let a=r.indexOf(l);r.splice(a,0,n(o,null))}continue}if(s in t){let l=t[s];l.children.push(n(o,l));continue}r.push(n(o,null))}return r}function Lt(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)Lt(e.children[n],t)}function Ne(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function ht(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function _t(e,t){var n,r;let o=(r=(n=e.ownerDocument)===null||n===void 0?void 0:n.defaultView)===null||r===void 0?void 0:r.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};let i=o.getBoundingClientRect(),s=_t(o,t),l=i.height/o.clientHeight;return{x:i.x*s.relativeScale+s.x,y:i.y*s.relativeScale+s.y,relativeScale:l,absoluteScale:s.absoluteScale*l}}function xe(e){return!!e?.shadowRoot}function Ye(e,t){let n=e[t[0]];return t.length===1?n:Ye(n.cssRules[t[1]].cssRules,t.slice(2))}function Ft(e){let t=[...e],n=t.pop();return{positions:t,index:n}}function Ln(e){let t=new Set,n=[];for(let r=e.length;r--;){let o=e[r];t.has(o.id)||(n.push(o),t.add(o.id))}return n}var nt,ct,Ke,ge=G(()=>{ke();nt=`Please stop import mirror directly. Instead of that,\r
|
|
3
3
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
4
|
-
or you can use record.mirror to access the mirror instance during recording.`,ct={map:{},getId(){return console.error(nt),-1},getNode(){return console.error(nt),null},removeNodeFromMap(){console.error(nt)},has(){return console.error(nt),!1},reset(){console.error(nt)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(ct=new Proxy(ct,{get(e,t,n){return t==="map"&&console.error(nt),Reflect.get(e,t,n)}}));Ke=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var n;return(n=this.styleIDMap.get(t))!==null&&n!==void 0?n:-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}});var _,D,re,ve,Y,ye=G(()=>{_=(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))(_||{}),D=(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))(D||{}),re=(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))(re||{}),ve=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ve||{}),Y=(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))(Y||{})});function so(e){return"__ln"in e}function Bn(e,t){e.delete(t),t.childNodes.forEach(n=>Bn(e,n))}function lo(e,t,n){return e.length===0?!1:uo(e,t,n)}function uo(e,t,n){let{parentNode:r}=t;if(!r)return!1;let o=n.getId(r);return e.some(i=>i.id===o)?!0:uo(e,r,n)}function co(e,t){return e.size===0?!1:po(e,t)}function po(e,t){let{parentNode:n}=t;return n?e.has(n)?!0:po(e,n):!1}var Fn,ao,Bt,fo=G(()=>{ke();ge();Fn=class{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){let n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&so(t.previousSibling)){let r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&so(t.nextSibling)&&t.nextSibling.__ln.previous){let r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;this.length++}removeNode(t){let n=t.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next&&(n.next.previous=n.previous)):(this.head=n.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}},ao=(e,t)=>`${e}@${t}`,Bt=class{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let t=[],n=new Fn,r=l=>{let a=l,c=$e;for(;c===$e;)a=a&&a.nextSibling,c=a&&this.mirror.getId(a);return c},o=l=>{var a,c,d,u;let h=null;((c=(a=l.getRootNode)===null||a===void 0?void 0:a.call(l))===null||c===void 0?void 0:c.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&l.getRootNode().host&&(h=l.getRootNode().host);let f=h;for(;((u=(d=f?.getRootNode)===null||d===void 0?void 0:d.call(f))===null||u===void 0?void 0:u.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&f.getRootNode().host;)f=f.getRootNode().host;let p=!this.doc.contains(l)&&(!f||!this.doc.contains(f));if(!l.parentNode||p)return;let g=ze(l.parentNode)?this.mirror.getId(h):this.mirror.getId(l.parentNode),b=r(l);if(g===-1||b===-1)return n.addNode(l);let m=He(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:v=>{Ne(v,this.mirror)&&this.iframeManager.addIframe(v),ht(v,this.mirror)&&this.stylesheetManager.trackLinkElement(v),xe(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,this.doc)},onIframeLoad:(v,y)=>{this.iframeManager.attachIframe(v,y),this.shadowDomManager.observeAttachShadow(v)},onStylesheetLoad:(v,y)=>{this.stylesheetManager.attachLinkElement(v,y)}});m&&t.push({parentId:g,nextId:b,node:m})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of Array.from(this.movedSet.values()))lo(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||o(l);for(let l of Array.from(this.addedSet.values()))!co(this.droppedSet,l)&&!lo(this.removes,l,this.mirror)||co(this.movedSet,l)?o(l):this.droppedSet.add(l);let i=null;for(;n.length;){let l=null;if(i){let a=this.mirror.getId(i.value.parentNode),c=r(i.value);a!==-1&&c!==-1&&(l=i)}if(!l)for(let a=n.length-1;a>=0;a--){let c=n.get(a);if(c){let d=this.mirror.getId(c.value.parentNode);if(r(c.value)===-1)continue;if(d!==-1){l=c;break}else{let h=c.value;if(h.parentNode&&h.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let f=h.parentNode.host;if(this.mirror.getId(f)!==-1){l=c;break}}}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}i=l.previous,n.removeNode(l.value),o(l.value)}let s={texts:this.texts.map(l=>({id:this.mirror.getId(l.node),value:l.value})).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>({id:this.mirror.getId(l.node),attributes:l.attributes})).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!s.texts.length&&!s.attributes.length&&!s.removes.length&&!s.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(s))},this.processMutation=t=>{if(!pt(t.target,this.mirror))switch(t.type){case"characterData":{let n=t.target.textContent;!te(t.target,this.blockClass,this.blockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:Rn(t.target,this.maskTextClass,this.maskTextSelector)&&n?this.maskTextFn?this.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{let n=t.target,r=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(r=lt({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),te(t.target,this.blockClass,this.blockSelector,!1)||r===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);if(n.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(r))if(!n.contentDocument)t.attributeName="rr_src";else return;if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){let i=this.doc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});let s=o.attributes.style;for(let l of Array.from(n.style)){let a=n.style.getPropertyValue(l),c=n.style.getPropertyPriority(l);(a!==i.style.getPropertyValue(l)||c!==i.style.getPropertyPriority(l))&&(c===""?s[l]=a:s[l]=[a,c])}for(let l of Array.from(i.style))n.style.getPropertyValue(l)===""&&(s[l]=!1)}else o.attributes[t.attributeName]=Nn(this.doc,n.tagName,t.attributeName,r);break}case"childList":{if(te(t.target,this.blockClass,this.blockSelector,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{let r=this.mirror.getId(n),o=ze(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);te(t.target,this.blockClass,this.blockSelector,!1)||pt(n,this.mirror)||!On(n,this.mirror)||(this.addedSet.has(n)?(Bn(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||Ot(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[ao(r,o)]?Bn(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:ze(t.target)&&Ge(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(this.mirror.hasNode(t)){if(pt(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[ao(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);te(t,this.blockClass,this.blockSelector,!1)||t.childNodes.forEach(r=>this.genAdds(r))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(n=>{this[n]=t[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}});function mt(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch{return e.target}}function Pn(e,t){var n,r;let o=new Bt;Be.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver,s=(r=(n=window?.Zone)===null||n===void 0?void 0:n.__symbol__)===null||r===void 0?void 0:r.call(n,"MutationObserver");s&&window[s]&&(i=window[s]);let l=new i(o.processMutations.bind(o));return l.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),l}function Oa({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,s=[],l,a=je(u=>{let h=Date.now()-l;e(s.map(f=>(f.timeOffset-=h,f)),u),s=[],l=null},i),c=je(u=>{let h=mt(u),{clientX:f,clientY:p}=Dt(u)?u.changedTouches[0]:u;l||(l=Date.now()),s.push({x:f,y:p,id:r.getId(h),timeOffset:Date.now()-l}),a(typeof DragEvent<"u"&&u instanceof DragEvent?D.Drag:u instanceof MouseEvent?D.MouseMove:D.TouchMove)},o,{trailing:!1}),d=[le("mousemove",c,n),le("touchmove",c,n),le("drag",c,n)];return()=>{d.forEach(u=>u())}}function Da({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){if(i.mouseInteraction===!1)return()=>{};let s=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,l=[],a=c=>d=>{let u=mt(d);if(te(u,r,o,!0))return;let h=Dt(d)?d.changedTouches[0]:d;if(!h)return;let f=n.getId(u),{clientX:p,clientY:g}=h;e({type:re[c],id:f,x:p,y:g})};return Object.keys(re).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{let d=c.toLowerCase(),u=a(c);l.push(le(d,u,t))}),()=>{l.forEach(c=>c())}}function Un({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){let s=je(l=>{let a=mt(l);if(!a||te(a,r,o,!0))return;let c=n.getId(a);if(a===t){let d=t.scrollingElement||t.documentElement;e({id:c,x:d.scrollLeft,y:d.scrollTop})}else e({id:c,x:a.scrollLeft,y:a.scrollTop})},i.scroll||100);return le("scroll",s,t)}function La({viewportResizeCb:e}){let t=-1,n=-1,r=je(()=>{let o=dt(),i=ut();(t!==o||n!==i)&&(e({width:Number(i),height:Number(o)}),t=o,n=i)},200);return le("resize",r,window)}function ho(e,t){let n=Object.assign({},e);return t||delete n.userTriggered,n}function Fa({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,ignoreClass:i,maskInputOptions:s,maskInputFn:l,sampling:a,userTriggeredOnInput:c}){function d(m){let v=mt(m),y=m.isTrusted;if(v&&v.tagName==="OPTION"&&(v=v.parentElement),!v||!v.tagName||_a.indexOf(v.tagName)<0||te(v,r,o,!0))return;let E=v.type;if(v.classList.contains(i))return;let N=v.value,k=!1;E==="radio"||E==="checkbox"?k=v.checked:(s[v.tagName.toLowerCase()]||s[E])&&(N=lt({maskInputOptions:s,tagName:v.tagName,type:E,value:N,maskInputFn:l})),u(v,ho({text:N,isChecked:k,userTriggered:y},c));let O=v.name;E==="radio"&&O&&k&&t.querySelectorAll(`input[type="radio"][name="${O}"]`).forEach(A=>{A!==v&&u(A,ho({text:A.value,isChecked:!k,userTriggered:!1},c))})}function u(m,v){let y=mo.get(m);if(!y||y.text!==v.text||y.isChecked!==v.isChecked){mo.set(m,v);let E=n.getId(m);e(Object.assign(Object.assign({},v),{id:E}))}}let f=(a.input==="last"?["change"]:["input","change"]).map(m=>le(m,d,t)),p=t.defaultView;if(!p)return()=>{f.forEach(m=>m())};let g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),b=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&f.push(...b.map(m=>_e(m[0],m[1],{set(){d({target:this})}},!1,p))),()=>{f.forEach(m=>m())}}function Pt(e){let t=[];function n(r,o){if(go&&r.parentRule instanceof CSSGroupingRule||vo&&r.parentRule instanceof CSSMediaRule||yo&&r.parentRule instanceof CSSSupportsRule||bo&&r.parentRule instanceof CSSConditionRule){let s=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(s)}else if(r.parentStyleSheet){let s=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(s)}return o}return n(e,t)}function Fe(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function Ba({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){let o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(d,u){let{id:h,styleId:f}=Fe(this,t,n.styleMirror);return(h&&h!==-1||f&&f!==-1)&&e({id:h,styleId:f,adds:[{rule:d,index:u}]}),o.apply(this,[d,u])};let i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(d){let{id:u,styleId:h}=Fe(this,t,n.styleMirror);return(u&&u!==-1||h&&h!==-1)&&e({id:u,styleId:h,removes:[{index:d}]}),i.apply(this,[d])};let s;r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=function(d){let{id:u,styleId:h}=Fe(this,t,n.styleMirror);return(u&&u!==-1||h&&h!==-1)&&e({id:u,styleId:h,replace:d}),s.apply(this,[d])});let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=function(d){let{id:u,styleId:h}=Fe(this,t,n.styleMirror);return(u&&u!==-1||h&&h!==-1)&&e({id:u,styleId:h,replaceSync:d}),l.apply(this,[d])});let a={};go?a.CSSGroupingRule=r.CSSGroupingRule:(vo&&(a.CSSMediaRule=r.CSSMediaRule),bo&&(a.CSSConditionRule=r.CSSConditionRule),yo&&(a.CSSSupportsRule=r.CSSSupportsRule));let c={};return Object.entries(a).forEach(([d,u])=>{c[d]={insertRule:u.prototype.insertRule,deleteRule:u.prototype.deleteRule},u.prototype.insertRule=function(h,f){let{id:p,styleId:g}=Fe(this.parentStyleSheet,t,n.styleMirror);return(p&&p!==-1||g&&g!==-1)&&e({id:p,styleId:g,adds:[{rule:h,index:[...Pt(this),f||0]}]}),c[d].insertRule.apply(this,[h,f])},u.prototype.deleteRule=function(h){let{id:f,styleId:p}=Fe(this.parentStyleSheet,t,n.styleMirror);return(f&&f!==-1||p&&p!==-1)&&e({id:f,styleId:p,removes:[{index:[...Pt(this),h]}]}),c[d].deleteRule.apply(this,[h])}}),()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,s&&(r.CSSStyleSheet.prototype.replace=s),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([d,u])=>{u.prototype.insertRule=c[d].insertRule,u.prototype.deleteRule=c[d].deleteRule})}}function Wn({mirror:e,stylesheetManager:t},n){var r,o,i;let s=null;n.nodeName==="#document"?s=e.getId(n):s=e.getId(n.host);let l=n.nodeName==="#document"?(r=n.defaultView)===null||r===void 0?void 0:r.Document:(i=(o=n.ownerDocument)===null||o===void 0?void 0:o.defaultView)===null||i===void 0?void 0:i.ShadowRoot,a=Object.getOwnPropertyDescriptor(l?.prototype,"adoptedStyleSheets");return s===null||s===-1||!l||!a?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var c;return(c=a.get)===null||c===void 0?void 0:c.call(this)},set(c){var d;let u=(d=a.set)===null||d===void 0?void 0:d.call(this,c);if(s!==null&&s!==-1)try{t.adoptStyleSheets(c,s)}catch{}return u}}),()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})}function Pa({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(l,a,c){var d;if(n.has(l))return i.apply(this,[l,a,c]);let{id:u,styleId:h}=Fe((d=this.parentRule)===null||d===void 0?void 0:d.parentStyleSheet,t,r.styleMirror);return(u&&u!==-1||h&&h!==-1)&&e({id:u,styleId:h,set:{property:l,value:a,priority:c},index:Pt(this.parentRule)}),i.apply(this,[l,a,c])};let s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(l){var a;if(n.has(l))return s.apply(this,[l]);let{id:c,styleId:d}=Fe((a=this.parentRule)===null||a===void 0?void 0:a.parentStyleSheet,t,r.styleMirror);return(c&&c!==-1||d&&d!==-1)&&e({id:c,styleId:d,remove:{property:l},index:Pt(this.parentRule)}),s.apply(this,[l])},()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s}}function Ua({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o}){let i=l=>je(a=>{let c=mt(a);if(!c||te(c,t,n,!0))return;let{currentTime:d,volume:u,muted:h,playbackRate:f}=c;e({type:l,id:r.getId(c),currentTime:d,volume:u,muted:h,playbackRate:f})},o.media||500),s=[le("play",i(0)),le("pause",i(1)),le("seeked",i(2)),le("volumechange",i(3)),le("ratechange",i(4))];return()=>{s.forEach(l=>l())}}function Wa({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(a,c,d){let u=new i(a,c,d);return o.set(u,{family:a,buffer:typeof c!="string",descriptors:d,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),u};let s=me(t.fonts,"add",function(l){return function(a){return setTimeout(()=>{let c=o.get(a);c&&(e(c),o.delete(a))},0),l.apply(this,[a])}});return r.push(()=>{n.FontFace=i}),r.push(s),()=>{r.forEach(l=>l())}}function Va(e){let{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:i}=e,s=!0,l=()=>{let a=t.getSelection();if(!a||s&&a?.isCollapsed)return;s=a.isCollapsed||!1;let c=[],d=a.rangeCount||0;for(let u=0;u<d;u++){let h=a.getRangeAt(u),{startContainer:f,startOffset:p,endContainer:g,endOffset:b}=h;te(f,r,o,!0)||te(g,r,o,!0)||c.push({start:n.getId(f),startOffset:p,end:n.getId(g),endOffset:b})}i({ranges:c})};return l(),le("selectionchange",l)}function Ha(e,t){let{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:s,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:c,styleDeclarationCb:d,canvasMutationCb:u,fontCb:h,selectionCb:f}=e;e.mutationCb=(...p)=>{t.mutation&&t.mutation(...p),n(...p)},e.mousemoveCb=(...p)=>{t.mousemove&&t.mousemove(...p),r(...p)},e.mouseInteractionCb=(...p)=>{t.mouseInteraction&&t.mouseInteraction(...p),o(...p)},e.scrollCb=(...p)=>{t.scroll&&t.scroll(...p),i(...p)},e.viewportResizeCb=(...p)=>{t.viewportResize&&t.viewportResize(...p),s(...p)},e.inputCb=(...p)=>{t.input&&t.input(...p),l(...p)},e.mediaInteractionCb=(...p)=>{t.mediaInteaction&&t.mediaInteaction(...p),a(...p)},e.styleSheetRuleCb=(...p)=>{t.styleSheetRule&&t.styleSheetRule(...p),c(...p)},e.styleDeclarationCb=(...p)=>{t.styleDeclaration&&t.styleDeclaration(...p),d(...p)},e.canvasMutationCb=(...p)=>{t.canvasMutation&&t.canvasMutation(...p),u(...p)},e.fontCb=(...p)=>{t.font&&t.font(...p),h(...p)},e.selectionCb=(...p)=>{t.selection&&t.selection(...p),f(...p)}}function So(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};Ha(e,t);let r=Pn(e,e.doc),o=Oa(e),i=Da(e),s=Un(e),l=La(e),a=Fa(e),c=Ua(e),d=Ba(e,{win:n}),u=Wn(e,e.doc),h=Pa(e,{win:n}),f=e.collectFonts?Wa(e):()=>{},p=Va(e),g=[];for(let b of e.plugins)g.push(b.observer(b.callback,n,b.options));return()=>{Be.forEach(b=>b.reset()),r.disconnect(),o(),i(),s(),l(),a(),c(),d(),u(),h(),f(),p(),g.forEach(b=>b())}}var Be,go,vo,yo,bo,_a,mo,Vn=G(()=>{ke();ge();ye();fo();Be=[],go=typeof CSSGroupingRule<"u",vo=typeof CSSMediaRule<"u",yo=typeof CSSSupportsRule<"u",bo=typeof CSSConditionRule<"u";_a=["INPUT","TEXTAREA","SELECT"],mo=new WeakMap});var gt,Co=G(()=>{gt=class{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,o){let i=r||this.getIdToRemoteIdMap(t),s=o||this.getRemoteIdToIdMap(t),l=i.get(n);return l||(l=this.generateIdFn(),i.set(n,l),s.set(l,n)),l}getIds(t,n){let r=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return n.map(i=>this.getId(t,i,r,o))}getRemoteId(t,n,r){let o=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;let i=o.get(n);return i||-1}getRemoteIds(t,n){let r=this.getRemoteIdToIdMap(t);return n.map(o=>this.getRemoteId(t,o,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}}});var Ut,Io=G(()=>{ke();Co();ye();Ut=class{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new gt(An),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new gt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){var r;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(r=this.loadListener)===null||r===void 0||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){if(t.data.type==="rrweb"){if(!t.source)return;let r=this.crossOriginIframeMap.get(t.source);if(!r)return;let o=this.transformCrossOriginEvent(r,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}}transformCrossOriginEvent(t,n){var r;switch(n.type){case _.FullSnapshot:return this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t),{timestamp:n.timestamp,type:_.IncrementalSnapshot,data:{source:D.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case _.Meta:case _.Load:case _.DomContentLoaded:return!1;case _.Plugin:return n;case _.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case _.IncrementalSnapshot:switch(n.data.source){case D.Mutation:return n.data.adds.forEach(o=>{this.replaceIds(o,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(o.node,t)}),n.data.removes.forEach(o=>{this.replaceIds(o,t,["parentId","id"])}),n.data.attributes.forEach(o=>{this.replaceIds(o,t,["id"])}),n.data.texts.forEach(o=>{this.replaceIds(o,t,["id"])}),n;case D.Drag:case D.TouchMove:case D.MouseMove:return n.data.positions.forEach(o=>{this.replaceIds(o,t,["id"])}),n;case D.ViewportResize:return!1;case D.MediaInteraction:case D.MouseInteraction:case D.Scroll:case D.CanvasMutation:case D.Input:return this.replaceIds(n.data,t,["id"]),n;case D.StyleSheetRule:case D.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case D.Font:return n;case D.Selection:return n.data.ranges.forEach(o=>{this.replaceIds(o,t,["start","end"])}),n;case D.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),(r=n.data.styles)===null||r===void 0||r.forEach(o=>{this.replaceStyleIds(o,t,["styleId"])}),n}}}replace(t,n,r,o){for(let i of o)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=t.getIds(r,n[i]):n[i]=t.getId(r,n[i]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}}});var Wt,wo=G(()=>{Vn();ge();ke();Wt=class{constructor(t){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;let n=this;this.restorePatches.push(me(Element.prototype,"attachShadow",function(r){return function(o){let i=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,this.ownerDocument),i}}))}addShadowRoot(t,n){Ge(t)&&(this.shadowDoms.has(t)||(this.shadowDoms.add(t),Pn(Object.assign(Object.assign({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Un(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),Wn({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)},0)))}observeAttachShadow(t){if(t.contentWindow){let n=this;this.restorePatches.push(me(t.contentWindow.HTMLElement.prototype,"attachShadow",function(r){return function(o){let i=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,t.contentDocument),i}}))}}reset(){this.restorePatches.forEach(t=>t()),this.shadowDoms=new WeakSet}}});function Eo(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function be(e,t,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function l(d){try{c(r.next(d))}catch(u){s(u)}}function a(d){try{c(r.throw(d))}catch(u){s(u)}}function c(d){d.done?i(d.value):o(d.value).then(l,a)}c((r=r.apply(e,t||[])).next())})}var Ze=G(()=>{});var rt,yt,vt,xo,To,Hn=G(()=>{rt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",yt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(vt=0;vt<rt.length;vt++)yt[rt.charCodeAt(vt)]=vt;xo=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=rt[t[n]>>2],o+=rt[(t[n]&3)<<4|t[n+1]>>4],o+=rt[(t[n+1]&15)<<2|t[n+2]>>6],o+=rt[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o},To=function(e){var t=e.length*.75,n=e.length,r,o=0,i,s,l,a;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var c=new ArrayBuffer(t),d=new Uint8Array(c);for(r=0;r<n;r+=4)i=yt[e.charCodeAt(r)],s=yt[e.charCodeAt(r+1)],l=yt[e.charCodeAt(r+2)],a=yt[e.charCodeAt(r+3)],d[o++]=i<<2|s>>4,d[o++]=(s&15)<<4|l>>2,d[o++]=(l&3)<<6|a&63;return c}});function Ga(e,t){let n=Ao.get(e);return n||(n=new Map,Ao.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function Vt(e,t,n){if(e instanceof Array)return e.map(r=>Vt(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let r=e.constructor.name,o=xo(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Vt(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){let r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Vt(e.data,t,n),e.width,e.height]};if(ko(e,t)||typeof e=="object"){let r=e.constructor.name,o=Gn(e,t,n);return{rr_type:r,index:o}}}}return e}var Ao,Gn,Ht,ko,$n=G(()=>{Hn();Ao=new Map;Gn=(e,t,n)=>{if(!e||!(ko(e,t)||typeof e=="object"))return;let r=e.constructor.name,o=Ga(n,r),i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};Ht=(e,t,n)=>[...e].map(r=>Vt(r,t,n)),ko=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(o=>typeof t[o]=="function").find(o=>e instanceof t[o])});function No(e,t,n,r){let o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of i)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;let l=me(t.CanvasRenderingContext2D.prototype,s,function(a){return function(...c){return te(this.canvas,n,r,!0)||setTimeout(()=>{let d=Ht([...c],t,this);e(this.canvas,{type:ve["2D"],property:s,args:d})},0),a.apply(this,c)}});o.push(l)}catch{let a=_e(t.CanvasRenderingContext2D.prototype,s,{set(c){e(this.canvas,{type:ve["2D"],property:s,args:[c],setter:!0})}});o.push(a)}return()=>{o.forEach(s=>s())}}var Ro=G(()=>{ye();ge();$n()});function zn(e,t,n){let r=[];try{let o=me(e.HTMLCanvasElement.prototype,"getContext",function(i){return function(s,...l){return te(this,t,n,!0)||"__context"in this||(this.__context=s),i.apply(this,[s,...l])}});r.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(o=>o())}}var Mo=G(()=>{ge()});function Oo(e,t,n,r,o,i,s){let l=[],a=Object.getOwnPropertyNames(e);for(let c of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if(typeof e[c]!="function")continue;let d=me(e,c,function(u){return function(...h){let f=u.apply(this,h);if(Gn(f,s,this),!te(this.canvas,r,o,!0)){let p=Ht([...h],s,this),g={type:t,property:c,args:p};n(this.canvas,g)}return f}});l.push(d)}catch{let u=_e(e,c,{set(h){n(this.canvas,{type:t,property:c,args:[h],setter:!0})}});l.push(u)}return l}function Do(e,t,n,r,o){let i=[];return i.push(...Oo(t.WebGLRenderingContext.prototype,ve.WebGL,e,n,r,o,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...Oo(t.WebGL2RenderingContext.prototype,ve.WebGL2,e,n,r,o,t)),()=>{i.forEach(s=>s())}}var Lo=G(()=>{ye();ge();$n()});var Kn,_o,Fo=G(()=>{Kn=null;try{_o=typeof module<"u"&&typeof module.require=="function"&&module.require("worker_threads")||typeof __non_webpack_require__=="function"&&__non_webpack_require__("worker_threads")||typeof At=="function"&&At("worker_threads"),Kn=_o.Worker}catch{}});function $a(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}function Bo(e,t,n){var r=t===void 0?null:t,o=n===void 0?!1:n,i=$a(e,o),s=i.indexOf(`
|
|
4
|
+
or you can use record.mirror to access the mirror instance during recording.`,ct={map:{},getId(){return console.error(nt),-1},getNode(){return console.error(nt),null},removeNodeFromMap(){console.error(nt)},has(){return console.error(nt),!1},reset(){console.error(nt)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(ct=new Proxy(ct,{get(e,t,n){return t==="map"&&console.error(nt),Reflect.get(e,t,n)}}));Ke=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var n;return(n=this.styleIDMap.get(t))!==null&&n!==void 0?n:-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}});var _,D,re,ve,Y,ye=G(()=>{_=(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))(_||{}),D=(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))(D||{}),re=(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))(re||{}),ve=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ve||{}),Y=(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))(Y||{})});function so(e){return"__ln"in e}function Bn(e,t){e.delete(t),t.childNodes.forEach(n=>Bn(e,n))}function lo(e,t,n){return e.length===0?!1:uo(e,t,n)}function uo(e,t,n){let{parentNode:r}=t;if(!r)return!1;let o=n.getId(r);return e.some(i=>i.id===o)?!0:uo(e,r,n)}function co(e,t){return e.size===0?!1:po(e,t)}function po(e,t){let{parentNode:n}=t;return n?e.has(n)?!0:po(e,n):!1}var Fn,ao,Bt,fo=G(()=>{ke();ge();Fn=class{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){let n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&so(t.previousSibling)){let r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&so(t.nextSibling)&&t.nextSibling.__ln.previous){let r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;this.length++}removeNode(t){let n=t.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next&&(n.next.previous=n.previous)):(this.head=n.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}},ao=(e,t)=>`${e}@${t}`,Bt=class{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let t=[],n=new Fn,r=l=>{let a=l,c=$e;for(;c===$e;)a=a&&a.nextSibling,c=a&&this.mirror.getId(a);return c},o=l=>{var a,c,d,u;let h=null;((c=(a=l.getRootNode)===null||a===void 0?void 0:a.call(l))===null||c===void 0?void 0:c.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&l.getRootNode().host&&(h=l.getRootNode().host);let f=h;for(;((u=(d=f?.getRootNode)===null||d===void 0?void 0:d.call(f))===null||u===void 0?void 0:u.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&f.getRootNode().host;)f=f.getRootNode().host;let p=!this.doc.contains(l)&&(!f||!this.doc.contains(f));if(!l.parentNode||p)return;let m=ze(l.parentNode)?this.mirror.getId(h):this.mirror.getId(l.parentNode),b=r(l);if(m===-1||b===-1)return n.addNode(l);let g=He(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:v=>{Ne(v,this.mirror)&&this.iframeManager.addIframe(v),ht(v,this.mirror)&&this.stylesheetManager.trackLinkElement(v),xe(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,this.doc)},onIframeLoad:(v,y)=>{this.iframeManager.attachIframe(v,y),this.shadowDomManager.observeAttachShadow(v)},onStylesheetLoad:(v,y)=>{this.stylesheetManager.attachLinkElement(v,y)}});g&&t.push({parentId:m,nextId:b,node:g})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of Array.from(this.movedSet.values()))lo(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||o(l);for(let l of Array.from(this.addedSet.values()))!co(this.droppedSet,l)&&!lo(this.removes,l,this.mirror)||co(this.movedSet,l)?o(l):this.droppedSet.add(l);let i=null;for(;n.length;){let l=null;if(i){let a=this.mirror.getId(i.value.parentNode),c=r(i.value);a!==-1&&c!==-1&&(l=i)}if(!l)for(let a=n.length-1;a>=0;a--){let c=n.get(a);if(c){let d=this.mirror.getId(c.value.parentNode);if(r(c.value)===-1)continue;if(d!==-1){l=c;break}else{let h=c.value;if(h.parentNode&&h.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let f=h.parentNode.host;if(this.mirror.getId(f)!==-1){l=c;break}}}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}i=l.previous,n.removeNode(l.value),o(l.value)}let s={texts:this.texts.map(l=>({id:this.mirror.getId(l.node),value:l.value})).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>({id:this.mirror.getId(l.node),attributes:l.attributes})).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!s.texts.length&&!s.attributes.length&&!s.removes.length&&!s.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(s))},this.processMutation=t=>{if(!pt(t.target,this.mirror))switch(t.type){case"characterData":{let n=t.target.textContent;!te(t.target,this.blockClass,this.blockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:Rn(t.target,this.maskTextClass,this.maskTextSelector)&&n?this.maskTextFn?this.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{let n=t.target,r=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(r=lt({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),te(t.target,this.blockClass,this.blockSelector,!1)||r===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);if(n.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(r))if(!n.contentDocument)t.attributeName="rr_src";else return;if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){let i=this.doc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});let s=o.attributes.style;for(let l of Array.from(n.style)){let a=n.style.getPropertyValue(l),c=n.style.getPropertyPriority(l);(a!==i.style.getPropertyValue(l)||c!==i.style.getPropertyPriority(l))&&(c===""?s[l]=a:s[l]=[a,c])}for(let l of Array.from(i.style))n.style.getPropertyValue(l)===""&&(s[l]=!1)}else o.attributes[t.attributeName]=Nn(this.doc,n.tagName,t.attributeName,r);break}case"childList":{if(te(t.target,this.blockClass,this.blockSelector,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{let r=this.mirror.getId(n),o=ze(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);te(t.target,this.blockClass,this.blockSelector,!1)||pt(n,this.mirror)||!On(n,this.mirror)||(this.addedSet.has(n)?(Bn(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||Ot(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[ao(r,o)]?Bn(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:ze(t.target)&&Ge(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(this.mirror.hasNode(t)){if(pt(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[ao(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);te(t,this.blockClass,this.blockSelector,!1)||t.childNodes.forEach(r=>this.genAdds(r))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(n=>{this[n]=t[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}});function mt(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch{return e.target}}function Pn(e,t){var n,r;let o=new Bt;Be.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver,s=(r=(n=window?.Zone)===null||n===void 0?void 0:n.__symbol__)===null||r===void 0?void 0:r.call(n,"MutationObserver");s&&window[s]&&(i=window[s]);let l=new i(o.processMutations.bind(o));return l.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),l}function Oa({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,s=[],l,a=je(u=>{let h=Date.now()-l;e(s.map(f=>(f.timeOffset-=h,f)),u),s=[],l=null},i),c=je(u=>{let h=mt(u),{clientX:f,clientY:p}=Dt(u)?u.changedTouches[0]:u;l||(l=Date.now()),s.push({x:f,y:p,id:r.getId(h),timeOffset:Date.now()-l}),a(typeof DragEvent<"u"&&u instanceof DragEvent?D.Drag:u instanceof MouseEvent?D.MouseMove:D.TouchMove)},o,{trailing:!1}),d=[le("mousemove",c,n),le("touchmove",c,n),le("drag",c,n)];return()=>{d.forEach(u=>u())}}function Da({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){if(i.mouseInteraction===!1)return()=>{};let s=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,l=[],a=c=>d=>{let u=mt(d);if(te(u,r,o,!0))return;let h=Dt(d)?d.changedTouches[0]:d;if(!h)return;let f=n.getId(u),{clientX:p,clientY:m}=h;e({type:re[c],id:f,x:p,y:m})};return Object.keys(re).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{let d=c.toLowerCase(),u=a(c);l.push(le(d,u,t))}),()=>{l.forEach(c=>c())}}function Un({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){let s=je(l=>{let a=mt(l);if(!a||te(a,r,o,!0))return;let c=n.getId(a);if(a===t){let d=t.scrollingElement||t.documentElement;e({id:c,x:d.scrollLeft,y:d.scrollTop})}else e({id:c,x:a.scrollLeft,y:a.scrollTop})},i.scroll||100);return le("scroll",s,t)}function La({viewportResizeCb:e}){let t=-1,n=-1,r=je(()=>{let o=dt(),i=ut();(t!==o||n!==i)&&(e({width:Number(i),height:Number(o)}),t=o,n=i)},200);return le("resize",r,window)}function ho(e,t){let n=Object.assign({},e);return t||delete n.userTriggered,n}function Fa({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,ignoreClass:i,maskInputOptions:s,maskInputFn:l,sampling:a,userTriggeredOnInput:c}){function d(g){let v=mt(g),y=g.isTrusted;if(v&&v.tagName==="OPTION"&&(v=v.parentElement),!v||!v.tagName||_a.indexOf(v.tagName)<0||te(v,r,o,!0))return;let E=v.type;if(v.classList.contains(i))return;let N=v.value,k=!1;E==="radio"||E==="checkbox"?k=v.checked:(s[v.tagName.toLowerCase()]||s[E])&&(N=lt({maskInputOptions:s,tagName:v.tagName,type:E,value:N,maskInputFn:l})),u(v,ho({text:N,isChecked:k,userTriggered:y},c));let O=v.name;E==="radio"&&O&&k&&t.querySelectorAll(`input[type="radio"][name="${O}"]`).forEach(A=>{A!==v&&u(A,ho({text:A.value,isChecked:!k,userTriggered:!1},c))})}function u(g,v){let y=mo.get(g);if(!y||y.text!==v.text||y.isChecked!==v.isChecked){mo.set(g,v);let E=n.getId(g);e(Object.assign(Object.assign({},v),{id:E}))}}let f=(a.input==="last"?["change"]:["input","change"]).map(g=>le(g,d,t)),p=t.defaultView;if(!p)return()=>{f.forEach(g=>g())};let m=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),b=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&f.push(...b.map(g=>_e(g[0],g[1],{set(){d({target:this})}},!1,p))),()=>{f.forEach(g=>g())}}function Pt(e){let t=[];function n(r,o){if(go&&r.parentRule instanceof CSSGroupingRule||vo&&r.parentRule instanceof CSSMediaRule||yo&&r.parentRule instanceof CSSSupportsRule||bo&&r.parentRule instanceof CSSConditionRule){let s=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(s)}else if(r.parentStyleSheet){let s=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(s)}return o}return n(e,t)}function Fe(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function Ba({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){let o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(d,u){let{id:h,styleId:f}=Fe(this,t,n.styleMirror);return(h&&h!==-1||f&&f!==-1)&&e({id:h,styleId:f,adds:[{rule:d,index:u}]}),o.apply(this,[d,u])};let i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(d){let{id:u,styleId:h}=Fe(this,t,n.styleMirror);return(u&&u!==-1||h&&h!==-1)&&e({id:u,styleId:h,removes:[{index:d}]}),i.apply(this,[d])};let s;r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=function(d){let{id:u,styleId:h}=Fe(this,t,n.styleMirror);return(u&&u!==-1||h&&h!==-1)&&e({id:u,styleId:h,replace:d}),s.apply(this,[d])});let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=function(d){let{id:u,styleId:h}=Fe(this,t,n.styleMirror);return(u&&u!==-1||h&&h!==-1)&&e({id:u,styleId:h,replaceSync:d}),l.apply(this,[d])});let a={};go?a.CSSGroupingRule=r.CSSGroupingRule:(vo&&(a.CSSMediaRule=r.CSSMediaRule),bo&&(a.CSSConditionRule=r.CSSConditionRule),yo&&(a.CSSSupportsRule=r.CSSSupportsRule));let c={};return Object.entries(a).forEach(([d,u])=>{c[d]={insertRule:u.prototype.insertRule,deleteRule:u.prototype.deleteRule},u.prototype.insertRule=function(h,f){let{id:p,styleId:m}=Fe(this.parentStyleSheet,t,n.styleMirror);return(p&&p!==-1||m&&m!==-1)&&e({id:p,styleId:m,adds:[{rule:h,index:[...Pt(this),f||0]}]}),c[d].insertRule.apply(this,[h,f])},u.prototype.deleteRule=function(h){let{id:f,styleId:p}=Fe(this.parentStyleSheet,t,n.styleMirror);return(f&&f!==-1||p&&p!==-1)&&e({id:f,styleId:p,removes:[{index:[...Pt(this),h]}]}),c[d].deleteRule.apply(this,[h])}}),()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,s&&(r.CSSStyleSheet.prototype.replace=s),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([d,u])=>{u.prototype.insertRule=c[d].insertRule,u.prototype.deleteRule=c[d].deleteRule})}}function Wn({mirror:e,stylesheetManager:t},n){var r,o,i;let s=null;n.nodeName==="#document"?s=e.getId(n):s=e.getId(n.host);let l=n.nodeName==="#document"?(r=n.defaultView)===null||r===void 0?void 0:r.Document:(i=(o=n.ownerDocument)===null||o===void 0?void 0:o.defaultView)===null||i===void 0?void 0:i.ShadowRoot,a=Object.getOwnPropertyDescriptor(l?.prototype,"adoptedStyleSheets");return s===null||s===-1||!l||!a?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var c;return(c=a.get)===null||c===void 0?void 0:c.call(this)},set(c){var d;let u=(d=a.set)===null||d===void 0?void 0:d.call(this,c);if(s!==null&&s!==-1)try{t.adoptStyleSheets(c,s)}catch{}return u}}),()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})}function Pa({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(l,a,c){var d;if(n.has(l))return i.apply(this,[l,a,c]);let{id:u,styleId:h}=Fe((d=this.parentRule)===null||d===void 0?void 0:d.parentStyleSheet,t,r.styleMirror);return(u&&u!==-1||h&&h!==-1)&&e({id:u,styleId:h,set:{property:l,value:a,priority:c},index:Pt(this.parentRule)}),i.apply(this,[l,a,c])};let s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(l){var a;if(n.has(l))return s.apply(this,[l]);let{id:c,styleId:d}=Fe((a=this.parentRule)===null||a===void 0?void 0:a.parentStyleSheet,t,r.styleMirror);return(c&&c!==-1||d&&d!==-1)&&e({id:c,styleId:d,remove:{property:l},index:Pt(this.parentRule)}),s.apply(this,[l])},()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s}}function Ua({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o}){let i=l=>je(a=>{let c=mt(a);if(!c||te(c,t,n,!0))return;let{currentTime:d,volume:u,muted:h,playbackRate:f}=c;e({type:l,id:r.getId(c),currentTime:d,volume:u,muted:h,playbackRate:f})},o.media||500),s=[le("play",i(0)),le("pause",i(1)),le("seeked",i(2)),le("volumechange",i(3)),le("ratechange",i(4))];return()=>{s.forEach(l=>l())}}function Wa({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(a,c,d){let u=new i(a,c,d);return o.set(u,{family:a,buffer:typeof c!="string",descriptors:d,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),u};let s=me(t.fonts,"add",function(l){return function(a){return setTimeout(()=>{let c=o.get(a);c&&(e(c),o.delete(a))},0),l.apply(this,[a])}});return r.push(()=>{n.FontFace=i}),r.push(s),()=>{r.forEach(l=>l())}}function Va(e){let{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:i}=e,s=!0,l=()=>{let a=t.getSelection();if(!a||s&&a?.isCollapsed)return;s=a.isCollapsed||!1;let c=[],d=a.rangeCount||0;for(let u=0;u<d;u++){let h=a.getRangeAt(u),{startContainer:f,startOffset:p,endContainer:m,endOffset:b}=h;te(f,r,o,!0)||te(m,r,o,!0)||c.push({start:n.getId(f),startOffset:p,end:n.getId(m),endOffset:b})}i({ranges:c})};return l(),le("selectionchange",l)}function Ha(e,t){let{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:s,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:c,styleDeclarationCb:d,canvasMutationCb:u,fontCb:h,selectionCb:f}=e;e.mutationCb=(...p)=>{t.mutation&&t.mutation(...p),n(...p)},e.mousemoveCb=(...p)=>{t.mousemove&&t.mousemove(...p),r(...p)},e.mouseInteractionCb=(...p)=>{t.mouseInteraction&&t.mouseInteraction(...p),o(...p)},e.scrollCb=(...p)=>{t.scroll&&t.scroll(...p),i(...p)},e.viewportResizeCb=(...p)=>{t.viewportResize&&t.viewportResize(...p),s(...p)},e.inputCb=(...p)=>{t.input&&t.input(...p),l(...p)},e.mediaInteractionCb=(...p)=>{t.mediaInteaction&&t.mediaInteaction(...p),a(...p)},e.styleSheetRuleCb=(...p)=>{t.styleSheetRule&&t.styleSheetRule(...p),c(...p)},e.styleDeclarationCb=(...p)=>{t.styleDeclaration&&t.styleDeclaration(...p),d(...p)},e.canvasMutationCb=(...p)=>{t.canvasMutation&&t.canvasMutation(...p),u(...p)},e.fontCb=(...p)=>{t.font&&t.font(...p),h(...p)},e.selectionCb=(...p)=>{t.selection&&t.selection(...p),f(...p)}}function So(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};Ha(e,t);let r=Pn(e,e.doc),o=Oa(e),i=Da(e),s=Un(e),l=La(e),a=Fa(e),c=Ua(e),d=Ba(e,{win:n}),u=Wn(e,e.doc),h=Pa(e,{win:n}),f=e.collectFonts?Wa(e):()=>{},p=Va(e),m=[];for(let b of e.plugins)m.push(b.observer(b.callback,n,b.options));return()=>{Be.forEach(b=>b.reset()),r.disconnect(),o(),i(),s(),l(),a(),c(),d(),u(),h(),f(),p(),m.forEach(b=>b())}}var Be,go,vo,yo,bo,_a,mo,Vn=G(()=>{ke();ge();ye();fo();Be=[],go=typeof CSSGroupingRule<"u",vo=typeof CSSMediaRule<"u",yo=typeof CSSSupportsRule<"u",bo=typeof CSSConditionRule<"u";_a=["INPUT","TEXTAREA","SELECT"],mo=new WeakMap});var gt,Co=G(()=>{gt=class{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,o){let i=r||this.getIdToRemoteIdMap(t),s=o||this.getRemoteIdToIdMap(t),l=i.get(n);return l||(l=this.generateIdFn(),i.set(n,l),s.set(l,n)),l}getIds(t,n){let r=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return n.map(i=>this.getId(t,i,r,o))}getRemoteId(t,n,r){let o=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;let i=o.get(n);return i||-1}getRemoteIds(t,n){let r=this.getRemoteIdToIdMap(t);return n.map(o=>this.getRemoteId(t,o,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}}});var Ut,Io=G(()=>{ke();Co();ye();Ut=class{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new gt(An),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new gt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){var r;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(r=this.loadListener)===null||r===void 0||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){if(t.data.type==="rrweb"){if(!t.source)return;let r=this.crossOriginIframeMap.get(t.source);if(!r)return;let o=this.transformCrossOriginEvent(r,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}}transformCrossOriginEvent(t,n){var r;switch(n.type){case _.FullSnapshot:return this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t),{timestamp:n.timestamp,type:_.IncrementalSnapshot,data:{source:D.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case _.Meta:case _.Load:case _.DomContentLoaded:return!1;case _.Plugin:return n;case _.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case _.IncrementalSnapshot:switch(n.data.source){case D.Mutation:return n.data.adds.forEach(o=>{this.replaceIds(o,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(o.node,t)}),n.data.removes.forEach(o=>{this.replaceIds(o,t,["parentId","id"])}),n.data.attributes.forEach(o=>{this.replaceIds(o,t,["id"])}),n.data.texts.forEach(o=>{this.replaceIds(o,t,["id"])}),n;case D.Drag:case D.TouchMove:case D.MouseMove:return n.data.positions.forEach(o=>{this.replaceIds(o,t,["id"])}),n;case D.ViewportResize:return!1;case D.MediaInteraction:case D.MouseInteraction:case D.Scroll:case D.CanvasMutation:case D.Input:return this.replaceIds(n.data,t,["id"]),n;case D.StyleSheetRule:case D.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case D.Font:return n;case D.Selection:return n.data.ranges.forEach(o=>{this.replaceIds(o,t,["start","end"])}),n;case D.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),(r=n.data.styles)===null||r===void 0||r.forEach(o=>{this.replaceStyleIds(o,t,["styleId"])}),n}}}replace(t,n,r,o){for(let i of o)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=t.getIds(r,n[i]):n[i]=t.getId(r,n[i]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}}});var Wt,wo=G(()=>{Vn();ge();ke();Wt=class{constructor(t){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;let n=this;this.restorePatches.push(me(Element.prototype,"attachShadow",function(r){return function(o){let i=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,this.ownerDocument),i}}))}addShadowRoot(t,n){Ge(t)&&(this.shadowDoms.has(t)||(this.shadowDoms.add(t),Pn(Object.assign(Object.assign({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Un(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),Wn({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)},0)))}observeAttachShadow(t){if(t.contentWindow){let n=this;this.restorePatches.push(me(t.contentWindow.HTMLElement.prototype,"attachShadow",function(r){return function(o){let i=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,t.contentDocument),i}}))}}reset(){this.restorePatches.forEach(t=>t()),this.shadowDoms=new WeakSet}}});function Eo(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function be(e,t,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function l(d){try{c(r.next(d))}catch(u){s(u)}}function a(d){try{c(r.throw(d))}catch(u){s(u)}}function c(d){d.done?i(d.value):o(d.value).then(l,a)}c((r=r.apply(e,t||[])).next())})}var Ze=G(()=>{});var rt,yt,vt,xo,To,Hn=G(()=>{rt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",yt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(vt=0;vt<rt.length;vt++)yt[rt.charCodeAt(vt)]=vt;xo=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=rt[t[n]>>2],o+=rt[(t[n]&3)<<4|t[n+1]>>4],o+=rt[(t[n+1]&15)<<2|t[n+2]>>6],o+=rt[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o},To=function(e){var t=e.length*.75,n=e.length,r,o=0,i,s,l,a;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var c=new ArrayBuffer(t),d=new Uint8Array(c);for(r=0;r<n;r+=4)i=yt[e.charCodeAt(r)],s=yt[e.charCodeAt(r+1)],l=yt[e.charCodeAt(r+2)],a=yt[e.charCodeAt(r+3)],d[o++]=i<<2|s>>4,d[o++]=(s&15)<<4|l>>2,d[o++]=(l&3)<<6|a&63;return c}});function Ga(e,t){let n=Ao.get(e);return n||(n=new Map,Ao.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function Vt(e,t,n){if(e instanceof Array)return e.map(r=>Vt(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let r=e.constructor.name,o=xo(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Vt(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){let r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Vt(e.data,t,n),e.width,e.height]};if(ko(e,t)||typeof e=="object"){let r=e.constructor.name,o=Gn(e,t,n);return{rr_type:r,index:o}}}}return e}var Ao,Gn,Ht,ko,$n=G(()=>{Hn();Ao=new Map;Gn=(e,t,n)=>{if(!e||!(ko(e,t)||typeof e=="object"))return;let r=e.constructor.name,o=Ga(n,r),i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};Ht=(e,t,n)=>[...e].map(r=>Vt(r,t,n)),ko=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(o=>typeof t[o]=="function").find(o=>e instanceof t[o])});function No(e,t,n,r){let o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of i)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;let l=me(t.CanvasRenderingContext2D.prototype,s,function(a){return function(...c){return te(this.canvas,n,r,!0)||setTimeout(()=>{let d=Ht([...c],t,this);e(this.canvas,{type:ve["2D"],property:s,args:d})},0),a.apply(this,c)}});o.push(l)}catch{let a=_e(t.CanvasRenderingContext2D.prototype,s,{set(c){e(this.canvas,{type:ve["2D"],property:s,args:[c],setter:!0})}});o.push(a)}return()=>{o.forEach(s=>s())}}var Ro=G(()=>{ye();ge();$n()});function zn(e,t,n){let r=[];try{let o=me(e.HTMLCanvasElement.prototype,"getContext",function(i){return function(s,...l){return te(this,t,n,!0)||"__context"in this||(this.__context=s),i.apply(this,[s,...l])}});r.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(o=>o())}}var Mo=G(()=>{ge()});function Oo(e,t,n,r,o,i,s){let l=[],a=Object.getOwnPropertyNames(e);for(let c of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if(typeof e[c]!="function")continue;let d=me(e,c,function(u){return function(...h){let f=u.apply(this,h);if(Gn(f,s,this),!te(this.canvas,r,o,!0)){let p=Ht([...h],s,this),m={type:t,property:c,args:p};n(this.canvas,m)}return f}});l.push(d)}catch{let u=_e(e,c,{set(h){n(this.canvas,{type:t,property:c,args:[h],setter:!0})}});l.push(u)}return l}function Do(e,t,n,r,o){let i=[];return i.push(...Oo(t.WebGLRenderingContext.prototype,ve.WebGL,e,n,r,o,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...Oo(t.WebGL2RenderingContext.prototype,ve.WebGL2,e,n,r,o,t)),()=>{i.forEach(s=>s())}}var Lo=G(()=>{ye();ge();$n()});var Kn,_o,Fo=G(()=>{Kn=null;try{_o=typeof module<"u"&&typeof module.require=="function"&&module.require("worker_threads")||typeof __non_webpack_require__=="function"&&__non_webpack_require__("worker_threads")||typeof At=="function"&&At("worker_threads"),Kn=_o.Worker}catch{}});function $a(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}function Bo(e,t,n){var r=t===void 0?null:t,o=n===void 0?!1:n,i=$a(e,o),s=i.indexOf(`
|
|
5
5
|
`,10)+1,l=i.substring(s)+(r?"//# sourceMappingURL="+r:"");return function(c){return new Kn(l,Object.assign({},c,{eval:!0}))}}var Po=G(()=>{Fo()});function za(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o<i;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}function Ka(e,t,n){var r=t===void 0?null:t,o=n===void 0?!1:n,i=za(e,o),s=i.indexOf(`
|
|
6
|
-
`,10)+1,l=i.substring(s)+(r?"//# sourceMappingURL="+r:""),a=new Blob([l],{type:"application/javascript"});return URL.createObjectURL(a)}function Uo(e,t,n){var r;return function(i){return r=r||Ka(e,t,n),new Worker(r,i)}}var Wo=G(()=>{});function Vo(){return ja}var ja,Ho=G(()=>{ja=Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"});function Go(e,t,n){return Vo()?Bo(e,t,n):Uo(e,t,n)}var $o=G(()=>{Po();Wo();Ho()});var zo,Ko=G(()=>{$o();zo=Go("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",null,!1)});var Gt,jo=G(()=>{Ze();ge();ye();Ro();Mo();Lo();Ko();Gt=class{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(a,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(c)};let{sampling:n="all",win:r,blockClass:o,blockSelector:i,recordCanvas:s,dataURLOptions:l}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&n==="all"&&this.initCanvasMutationObserver(r,o,i),s&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,o,i,{dataURLOptions:l})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,n,r,o,i){let s=zn(n,r,o),l=new Map,a=new zo;a.onmessage=p=>{let{id:g}=p.data;if(l.set(g,!1),!("base64"in p.data))return;let{base64:b,type:m,width:v,height:y}=p.data;this.mutationCb({id:g,type:ve["2D"],commands:[{property:"clearRect",args:[0,0,v,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:b}],type:m}]},0,0]}]})};let c=1e3/t,d=0,u,h=()=>{let p=[];return n.document.querySelectorAll("canvas").forEach(g=>{te(g,r,o,!0)||p.push(g)}),p},f=p=>{if(d&&p-d<c){u=requestAnimationFrame(f);return}d=p,h().forEach(g=>be(this,void 0,void 0,function*(){var b;let m=this.mirror.getId(g);if(l.get(m))return;if(l.set(m,!0),["webgl","webgl2"].includes(g.__context)){let y=g.getContext(g.__context);((b=y?.getContextAttributes())===null||b===void 0?void 0:b.preserveDrawingBuffer)===!1&&y?.clear(y.COLOR_BUFFER_BIT)}let v=yield createImageBitmap(g);a.postMessage({id:m,bitmap:v,width:g.width,height:g.height,dataURLOptions:i.dataURLOptions},[v])})),u=requestAnimationFrame(f)};u=requestAnimationFrame(f),this.resetObservers=()=>{s(),cancelAnimationFrame(u)}}initCanvasMutationObserver(t,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let o=zn(t,n,r),i=No(this.processMutation.bind(this),t,n,r),s=Do(this.processMutation.bind(this),t,n,r,this.mirror);this.resetObservers=()=>{o(),i(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=n=>{this.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{let r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;let o=r.map(s=>Eo(s,["type"])),{type:i}=r[0];this.mutationCb({id:n,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}}});var $t,Yo=G(()=>{ke();ge();$t=class{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Ke,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;let r={id:n,styleIds:[]},o=[];for(let i of t){let s;if(this.styleMirror.has(i))s=this.styleMirror.getId(i);else{s=this.styleMirror.add(i);let l=Array.from(i.rules||CSSRule);o.push({styleId:s,rules:l.map((a,c)=>({rule:xn(a),index:c}))})}r.styleIds.push(s)}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}});function ae(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}function Re(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:s="rr-ignore",maskTextClass:l="rr-mask",maskTextSelector:a=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:u,slimDOMOptions:h,maskInputFn:f,maskTextFn:p,hooks:g,packFn:b,sampling:m={},dataURLOptions:v={},mousemoveWait:y,recordCanvas:E=!1,recordCrossOriginIframes:N=!1,userTriggeredOnInput:k=!1,collectFonts:O=!1,inlineImages:A=!1,plugins:$,keepIframeSrcFn:V=()=>!1,ignoreCSSAttributes:F=new Set([])}=e,U=N?window.parent===window:!0,W=!1;if(!U)try{window.parent.document,W=!1}catch{W=!0}if(U&&!t)throw new Error("emit function is required");y!==void 0&&m.mousemove===void 0&&(m.mousemove=y),Ce.reset();let R=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:u!==void 0?u:{password:!0},I=h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:h==="all",headMetaDescKeywords:h==="all"}:h||{};ft();let w,x=0,T=P=>{for(let q of $||[])q.eventProcessor&&(P=q.eventProcessor(P));return b&&(P=b(P)),P};oe=(P,q)=>{var X;if(!((X=Be[0])===null||X===void 0)&&X.isFrozen()&&P.type!==_.FullSnapshot&&!(P.type===_.IncrementalSnapshot&&P.data.source===D.Mutation)&&Be.forEach(Q=>Q.unfreeze()),U)t?.(T(P),q);else if(W){let Q={type:"rrweb",event:T(P),isCheckout:q};window.parent.postMessage(Q,"*")}if(P.type===_.FullSnapshot)w=P,x=0;else if(P.type===_.IncrementalSnapshot){if(P.data.source===D.Mutation&&P.data.isAttachIframe)return;x++;let Q=r&&x>=r,pe=n&&P.timestamp-w.timestamp>n;(Q||pe)&&zt(!0)}};let C=P=>{oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.Mutation},P)}))},S=P=>oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.Scroll},P)})),M=P=>oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.CanvasMutation},P)})),L=P=>oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.AdoptedStyleSheet},P)})),H=new $t({mutationCb:C,adoptedStyleSheetCb:L}),B=new Ut({mirror:Ce,mutationCb:C,stylesheetManager:H,recordCrossOriginIframes:N,wrappedEmit:oe});for(let P of $||[])P.getMirror&&P.getMirror({nodeMirror:Ce,crossOriginIframeMirror:B.crossOriginIframeMirror,crossOriginIframeStyleMirror:B.crossOriginIframeStyleMirror});jn=new Gt({recordCanvas:E,mutationCb:M,win:window,blockClass:o,blockSelector:i,mirror:Ce,sampling:m.canvas,dataURLOptions:v});let z=new Wt({mutationCb:C,scrollCb:S,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:a,inlineStylesheet:c,maskInputOptions:R,dataURLOptions:v,maskTextFn:p,maskInputFn:f,recordCanvas:E,inlineImages:A,sampling:m,slimDOMOptions:I,iframeManager:B,stylesheetManager:H,canvasManager:jn,keepIframeSrcFn:V},mirror:Ce});zt=(P=!1)=>{var q,X,Q,pe,Z,ce;oe(ae({type:_.Meta,data:{href:window.location.href,width:ut(),height:dt()}}),P),H.reset(),Be.forEach(se=>se.lock());let st=ro(document,{mirror:Ce,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:a,inlineStylesheet:c,maskAllInputs:R,maskTextFn:p,slimDOM:I,dataURLOptions:v,recordCanvas:E,inlineImages:A,onSerialize:se=>{Ne(se,Ce)&&B.addIframe(se),ht(se,Ce)&&H.trackLinkElement(se),xe(se)&&z.addShadowRoot(se.shadowRoot,document)},onIframeLoad:(se,mn)=>{B.attachIframe(se,mn),z.observeAttachShadow(se)},onStylesheetLoad:(se,mn)=>{H.attachLinkElement(se,mn)},keepIframeSrcFn:V});if(!st)return console.warn("Failed to snapshot the document");oe(ae({type:_.FullSnapshot,data:{node:st,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((X=(q=document?.body)===null||q===void 0?void 0:q.parentElement)===null||X===void 0?void 0:X.scrollLeft)||((Q=document?.body)===null||Q===void 0?void 0:Q.scrollLeft)||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((Z=(pe=document?.body)===null||pe===void 0?void 0:pe.parentElement)===null||Z===void 0?void 0:Z.scrollTop)||((ce=document?.body)===null||ce===void 0?void 0:ce.scrollTop)||0}}})),Be.forEach(se=>se.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&H.adoptStyleSheets(document.adoptedStyleSheets,Ce.getId(document))};try{let P=[];P.push(le("DOMContentLoaded",()=>{oe(ae({type:_.DomContentLoaded,data:{}}))}));let q=Q=>{var pe;return So({mutationCb:C,mousemoveCb:(Z,ce)=>oe(ae({type:_.IncrementalSnapshot,data:{source:ce,positions:Z}})),mouseInteractionCb:Z=>oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.MouseInteraction},Z)})),scrollCb:S,viewportResizeCb:Z=>oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.ViewportResize},Z)})),inputCb:Z=>oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.Input},Z)})),mediaInteractionCb:Z=>oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.MediaInteraction},Z)})),styleSheetRuleCb:Z=>oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.StyleSheetRule},Z)})),styleDeclarationCb:Z=>oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.StyleDeclaration},Z)})),canvasMutationCb:M,fontCb:Z=>oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.Font},Z)})),selectionCb:Z=>{oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.Selection},Z)}))},blockClass:o,ignoreClass:s,maskTextClass:l,maskTextSelector:a,maskInputOptions:R,inlineStylesheet:c,sampling:m,recordCanvas:E,inlineImages:A,userTriggeredOnInput:k,collectFonts:O,doc:Q,maskInputFn:f,maskTextFn:p,keepIframeSrcFn:V,blockSelector:i,slimDOMOptions:I,dataURLOptions:v,mirror:Ce,iframeManager:B,stylesheetManager:H,shadowDomManager:z,canvasManager:jn,ignoreCSSAttributes:F,plugins:((pe=$?.filter(Z=>Z.observer))===null||pe===void 0?void 0:pe.map(Z=>({observer:Z.observer,options:Z.options,callback:ce=>oe(ae({type:_.Plugin,data:{plugin:Z.name,payload:ce}}))})))||[]},g)};B.addLoadListener(Q=>{P.push(q(Q.contentDocument))});let X=()=>{zt(),P.push(q(document)),Kt=!0};return document.readyState==="interactive"||document.readyState==="complete"?X():P.push(le("load",()=>{oe(ae({type:_.Load,data:{}})),X()},window)),()=>{P.forEach(Q=>Q()),Kt=!1}}catch(P){console.warn(P)}}var oe,zt,jn,Kt,Ce,Yn=G(()=>{ke();Vn();ge();ye();Io();wo();jo();Yo();Kt=!1,Ce=Mt();Re.addCustomEvent=(e,t)=>{if(!Kt)throw new Error("please add custom event after start recording");oe(ae({type:_.Custom,data:{tag:e,payload:t}}))};Re.freezePage=()=>{Be.forEach(e=>e.freeze())};Re.takeFullSnapshot=e=>{if(!Kt)throw new Error("please take full snapshot after start recording");zt(e)};Re.mirror=Ce});function Za(){return new Ya}function Ja(e){let t={},n=/;(?![^(]*\))/g,r=/:(.+)/,o=/\/\*.*?\*\//g;return e.replace(o,"").split(n).forEach(function(i){if(i){let s=i.split(r);s.length>1&&(t[Zn(s[0].trim())]=s[1].trim())}}),t}function Zo(e){let t=[];for(let n in e){let r=e[n];if(typeof r!="string")continue;let o=el(n);t.push(`${o}: ${r};`)}return t.join(" ")}function tl(e){return class qo extends e{constructor(){super(...arguments),this.nodeType=ne.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=j.Document,this.textContent=null}get documentElement(){return this.childNodes.find(n=>n.RRNodeType===j.Element&&n.tagName==="HTML")||null}get body(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(r=>r.RRNodeType===j.Element&&r.tagName==="BODY"))||null}get head(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(r=>r.RRNodeType===j.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(n){let r=n.RRNodeType;if((r===j.Element||r===j.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${r===j.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return n.parentElement=null,n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,r){let o=n.RRNodeType;if((o===j.Element||o===j.DocumentType)&&this.childNodes.some(s=>s.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===j.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(r===null)return this.appendChild(n);let i=this.childNodes.indexOf(r);if(i==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(i,0,n),n.parentElement=null,n.parentNode=this,n}removeChild(n){let r=this.childNodes.indexOf(n);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),n.parentElement=null,n.parentNode=null,n}open(){this.childNodes=[]}close(){}write(n){let r;if(n==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?r="-//W3C//DTD XHTML 1.0 Transitional//EN":n==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(r="-//W3C//DTD HTML 4.0 Transitional//EN"),r){let o=this.createDocumentType("html",r,"");this.open(),this.appendChild(o)}}createDocument(n,r,o){return new qo}createDocumentType(n,r,o){let i=new(Xo(Se))(n,r,o);return i.ownerDocument=this,i}createElement(n){let r=new(Qo(Se))(n);return r.ownerDocument=this,r}createElementNS(n,r){return this.createElement(r)}createTextNode(n){let r=new(ei(Se))(n);return r.ownerDocument=this,r}createComment(n){let r=new(ti(Se))(n);return r.ownerDocument=this,r}createCDATASection(n){let r=new(ni(Se))(n);return r.ownerDocument=this,r}toString(){return"RRDocument"}}}function Xo(e){return class extends e{constructor(n,r,o){super(),this.nodeType=ne.DOCUMENT_TYPE_NODE,this.RRNodeType=j.DocumentType,this.textContent=null,this.name=n,this.publicId=r,this.systemId=o,this.nodeName=n}toString(){return"RRDocumentType"}}}function Qo(e){return class extends e{constructor(n){super(),this.nodeType=ne.ELEMENT_NODE,this.RRNodeType=j.Element,this.attributes={},this.shadowRoot=null,this.tagName=n.toUpperCase(),this.nodeName=n.toUpperCase()}get textContent(){let n="";return this.childNodes.forEach(r=>n+=r.textContent),n}set textContent(n){this.childNodes=[this.ownerDocument.createTextNode(n)]}get classList(){return new Jn(this.attributes.class,n=>{this.attributes.class=n})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){let n=this.attributes.style?Ja(this.attributes.style):{},r=/\B([A-Z])/g;return n.setProperty=(o,i,s)=>{if(r.test(o))return;let l=Zn(o);i?n[l]=i:delete n[l],s==="important"&&(n[l]+=" !important"),this.attributes.style=Zo(n)},n.removeProperty=o=>{if(r.test(o))return"";let i=Zn(o),s=n[i]||"";return delete n[i],this.attributes.style=Zo(n),s},n}getAttribute(n){return this.attributes[n]||null}setAttribute(n,r){this.attributes[n]=r}setAttributeNS(n,r,o){this.setAttribute(r,o)}removeAttribute(n){delete this.attributes[n]}appendChild(n){return this.childNodes.push(n),n.parentNode=this,n.parentElement=this,n}insertBefore(n,r){if(r===null)return this.appendChild(n);let o=this.childNodes.indexOf(r);if(o==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(o,0,n),n.parentElement=this,n.parentNode=this,n}removeChild(n){let r=this.childNodes.indexOf(n);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),n.parentElement=null,n.parentNode=null,n}attachShadow(n){let r=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=r,r}dispatchEvent(n){return!0}toString(){let n="";for(let r in this.attributes)n+=`${r}="${this.attributes[r]}" `;return`${this.tagName} ${n}`}}}function nl(e){return class extends e{attachShadow(n){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}function ei(e){return class extends e{constructor(n){super(),this.nodeType=ne.TEXT_NODE,this.nodeName="#text",this.RRNodeType=j.Text,this.data=n}get textContent(){return this.data}set textContent(n){this.data=n}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function ti(e){return class extends e{constructor(n){super(),this.nodeType=ne.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=j.Comment,this.data=n}get textContent(){return this.data}set textContent(n){this.data=n}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function ni(e){return class extends e{constructor(n){super(),this.nodeName="#cdata-section",this.nodeType=ne.CDATA_SECTION_NODE,this.RRNodeType=j.CDATA,this.data=n}get textContent(){return this.data}set textContent(n){this.data=n}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}function Ie(e,t,n,r){let o=e.childNodes,i=t.childNodes;r=r||t.mirror||t.ownerDocument.mirror,(o.length>0||i.length>0)&&Jo(Array.from(o),i,e,n,r);let s=null,l=null;switch(t.RRNodeType){case j.Document:{l=t.scrollData;break}case j.Element:{let a=e,c=t;switch(ol(a,c,r),l=c.scrollData,s=c.inputData,c.tagName){case"AUDIO":case"VIDEO":{let d=e,u=c;u.paused!==void 0&&(u.paused?d.pause():d.play()),u.muted!==void 0&&(d.muted=u.muted),u.volume!==void 0&&(d.volume=u.volume),u.currentTime!==void 0&&(d.currentTime=u.currentTime),u.playbackRate!==void 0&&(d.playbackRate=u.playbackRate);break}case"CANVAS":{let d=t;if(d.rr_dataURL!==null){let u=document.createElement("img");u.onload=()=>{let h=a.getContext("2d");h&&h.drawImage(u,0,0,u.width,u.height)},u.src=d.rr_dataURL}d.canvasMutations.forEach(u=>n.applyCanvas(u.event,u.mutation,e))}break;case"STYLE":{let d=a.sheet;d&&t.rules.forEach(u=>n.applyStyleSheetMutation(u,d))}break}if(c.shadowRoot){a.shadowRoot||a.attachShadow({mode:"open"});let d=a.shadowRoot.childNodes,u=c.shadowRoot.childNodes;(d.length>0||u.length>0)&&Jo(Array.from(d),u,a.shadowRoot,n,r)}break}case j.Text:case j.Comment:case j.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(l&&n.applyScroll(l,!0),s&&n.applyInput(s),t.nodeName==="IFRAME"){let a=e.contentDocument,c=t;if(a){let d=r.getMeta(c.contentDocument);d&&n.mirror.add(a,Object.assign({},d)),Ie(a,c.contentDocument,n,r)}}}function ol(e,t,n){let r=e.attributes,o=t.attributes;for(let i in o){let s=o[i],l=n.getMeta(t);if(l&&"isSVG"in l&&l.isSVG&&qn[i])e.setAttributeNS(qn[i],i,s);else if(t.tagName==="CANVAS"&&i==="rr_dataURL"){let a=document.createElement("img");a.src=s,a.onload=()=>{let c=e.getContext("2d");c&&c.drawImage(a,0,0,a.width,a.height)}}else e.setAttribute(i,s)}for(let{name:i}of Array.from(r))i in o||e.removeAttribute(i);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function Jo(e,t,n,r,o){var i;let s=0,l=e.length-1,a=0,c=t.length-1,d=e[s],u=e[l],h=t[a],f=t[c],p,g;for(;s<=l&&a<=c;){let b=r.mirror.getId(d),m=r.mirror.getId(u),v=o.getId(h),y=o.getId(f);if(d===void 0)d=e[++s];else if(u===void 0)u=e[--l];else if(b!==-1&&b===v)Ie(d,h,r,o),d=e[++s],h=t[++a];else if(m!==-1&&m===y)Ie(u,f,r,o),u=e[--l],f=t[--c];else if(b!==-1&&b===y)n.insertBefore(d,u.nextSibling),Ie(d,f,r,o),d=e[++s],f=t[--c];else if(m!==-1&&m===v)n.insertBefore(u,d),Ie(u,h,r,o),u=e[--l],h=t[++a];else{if(!p){p={};for(let E=s;E<=l;E++){let N=e[E];N&&r.mirror.hasNode(N)&&(p[r.mirror.getId(N)]=E)}}if(g=p[o.getId(h)],g){let E=e[g];n.insertBefore(E,d),Ie(E,h,r,o),e[g]=void 0}else{let E=jt(h,r.mirror,o);n.nodeName==="#document"&&((i=r.mirror.getMeta(E))===null||i===void 0?void 0:i.type)===j.Element&&n.documentElement&&(n.removeChild(n.documentElement),e[s]=void 0,d=void 0),n.insertBefore(E,d||null),Ie(E,h,r,o)}h=t[++a]}}if(s>l){let b=t[c+1],m=null;for(b&&n.childNodes.forEach(v=>{r.mirror.getId(v)===o.getId(b)&&(m=v)});a<=c;++a){let v=jt(t[a],r.mirror,o);n.insertBefore(v,m),Ie(v,t[a],r,o)}}else if(a>c)for(;s<=l;s++){let b=e[s];b&&(n.removeChild(b),r.mirror.removeNodeFromMap(b))}}function jt(e,t,n){let r=n.getId(e),o=n.getMeta(e),i=null;if(r>-1&&(i=t.getNode(r)),i!==null)return i;switch(e.RRNodeType){case j.Document:i=new Document;break;case j.DocumentType:i=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case j.Element:{let s=e.tagName.toLowerCase();s=rl[s]||s,o&&"isSVG"in o&&o?.isSVG?i=document.createElementNS(qn.svg,s):i=document.createElement(e.tagName);break}case j.Text:i=document.createTextNode(e.data);break;case j.Comment:i=document.createComment(e.data);break;case j.CDATA:i=document.createCDATASection(e.data);break}return o&&t.add(i,Object.assign({},o)),i}function cl(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function rr(e,t,n,r){let o;switch(e.nodeType){case ne.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?o=r.contentDocument:(o=t,o.compatMode=e.compatMode);break;case ne.DOCUMENT_TYPE_NODE:{let s=e;o=t.createDocumentType(s.name,s.publicId,s.systemId);break}case ne.ELEMENT_NODE:{let s=e,l=cl(s);o=t.createElement(l);let a=o;for(let{name:c,value:d}of Array.from(s.attributes))a.attributes[c]=d;s.scrollLeft&&(a.scrollLeft=s.scrollLeft),s.scrollTop&&(a.scrollTop=s.scrollTop);break}case ne.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case ne.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case ne.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case ne.DOCUMENT_FRAGMENT_NODE:o=r.attachShadow({mode:"open"});break;default:return null}let i=n.getMeta(e);return t instanceof Je&&(i||(i=or(o,t.unserializedId),n.add(e,i)),t.mirror.add(o,Object.assign({},i))),o}function ri(e,t=Za(),n=new Je){function r(o,i){let s=rr(o,n,t,i);if(s!==null)if(i?.nodeName!=="IFRAME"&&o.nodeType!==ne.DOCUMENT_FRAGMENT_NODE&&(i?.appendChild(s),s.parentNode=i,s.parentElement=i),o.nodeName==="IFRAME"){let l=o.contentDocument;l&&r(l,s)}else(o.nodeType===ne.DOCUMENT_NODE||o.nodeType===ne.ELEMENT_NODE||o.nodeType===ne.DOCUMENT_FRAGMENT_NODE)&&(o.nodeType===ne.ELEMENT_NODE&&o.shadowRoot&&r(o.shadowRoot,s),o.childNodes.forEach(l=>r(l,s)))}return r(e,null),n}function dl(){return new nr}function or(e,t){switch(e.RRNodeType){case j.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case j.DocumentType:{let n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId}}case j.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case j.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case j.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case j.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}var j,Ya,qa,Xa,Zn,Qa,el,Se,Jn,ne,qn,rl,Je,il,qe,Xn,Qn,er,tr,sl,al,ll,nr,oi=G(()=>{(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"})(j||(j={}));Ya=(function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){var r=this.getNode(t);if(r){var o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e})();qa=/-([a-z])/g,Xa=/^--[a-zA-Z0-9-]+$/,Zn=e=>Xa.test(e)?e:e.replace(qa,(t,n)=>n?n.toUpperCase():""),Qa=/\B([A-Z])/g,el=e=>e.replace(Qa,"-$1").toLowerCase(),Se=class{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=ne.ELEMENT_NODE,this.TEXT_NODE=ne.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes,r=n.indexOf(this);return n[r+1]||null}contains(t){if(t===this)return!0;for(let n of this.childNodes)if(n.contains(t))return!0;return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,n){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};Jn=class{constructor(t,n){if(this.classes=[],this.add=(...r)=>{for(let o of r){let i=String(o);this.classes.indexOf(i)>=0||this.classes.push(i)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...r)=>{this.classes=this.classes.filter(o=>r.indexOf(o)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){let r=t.trim().split(/\s+/);this.classes.push(...r)}this.onChange=n}};(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"})(ne||(ne={}));qn={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},rl={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"};Je=class e extends tl(Se){constructor(t){super(),this.UNSERIALIZED_STARTING_ID=-2,this._unserializedId=this.UNSERIALIZED_STARTING_ID,this.mirror=dl(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,n,r){return new e}createDocumentType(t,n,r){let o=new il(t,n,r);return o.ownerDocument=this,o}createElement(t){let n=t.toUpperCase(),r;switch(n){case"AUDIO":case"VIDEO":r=new Xn(n);break;case"IFRAME":r=new tr(n,this.mirror);break;case"CANVAS":r=new Qn(n);break;case"STYLE":r=new er(n);break;default:r=new qe(n);break}return r.ownerDocument=this,r}createComment(t){let n=new al(t);return n.ownerDocument=this,n}createCDATASection(t){let n=new ll(t);return n.ownerDocument=this,n}createTextNode(t){let n=new sl(t);return n.ownerDocument=this,n}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}},il=Xo(Se),qe=class extends Qo(Se){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}},Xn=class extends nl(qe){},Qn=class extends qe{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}},er=class extends qe{constructor(){super(...arguments),this.rules=[]}},tr=class extends qe{constructor(t,n){super(t),this.contentDocument=new Je,this.contentDocument.mirror=n}},sl=ei(Se),al=ti(Se),ll=ni(Se);nr=class{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var n;if(!t)return-1;let r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){let r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){let r=this.getNode(t);if(r){let o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}});var ii,si,ai=G(()=>{Yn();({addCustomEvent:ii}=Re),{freezePage:si}=Re});function mi(e,t){t===void 0&&(t={});var n=Sl();n.p(e);var r=Cl(e,t,2,4);return wl(r,t),Il(r,r.length-4,n.d()),r}function gi(e,t){return gl((El(e),e.subarray(2,-4)),t)}function qt(e,t){var n=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var r=new de(e.length+(e.length>>>1)),o=0,i=function(c){r[o++]=c},s=0;s<n;++s){if(o+5>r.length){var l=new de(o+8+(n-s<<1));l.set(r),r=l}var a=e.charCodeAt(s);a<128||t?i(a):a<2048?(i(192|a>>>6),i(128|a&63)):a>55295&&a<57344?(a=65536+(a&1047552)|e.charCodeAt(++s)&1023,i(240|a>>>18),i(128|a>>>12&63),i(128|a>>>6&63),i(128|a&63)):(i(224|a>>>12),i(128|a>>>6&63),i(128|a&63))}return fr(r,0,o)}function Xt(e,t){var n="";if(!t&&typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var r=0;r<e.length;){var o=e[r++];o<128||t?n+=String.fromCharCode(o):o<224?n+=String.fromCharCode((o&31)<<6|e[r++]&63):o<240?n+=String.fromCharCode((o&15)<<12|(e[r++]&63)<<6|e[r++]&63):(o=((o&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,n+=String.fromCharCode(55296|o>>10,56320|o&1023))}return n}var de,he,Ct,Zt,Jt,lr,ui,pi,fi,cr,hi,ul,li,dr,Me,J,Te,Pe,J,J,J,J,It,J,pl,fl,hl,ml,ir,we,sr,pr,fr,gl,Oe,bt,ar,ur,ci,St,Yt,di,vl,yl,bl,Sl,Cl,Il,wl,El,hr=G(()=>{de=Uint8Array,he=Uint16Array,Ct=Uint32Array,Zt=new de([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]),Jt=new de([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]),lr=new de([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ui=function(e,t){for(var n=new he(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var o=new Ct(n[30]),r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)o[i]=i-n[r]<<5|r;return[n,o]},pi=ui(Zt,2),fi=pi[0],cr=pi[1];fi[28]=258,cr[258]=28;hi=ui(Jt,0),ul=hi[0],li=hi[1],dr=new he(32768);for(J=0;J<32768;++J)Me=(J&43690)>>>1|(J&21845)<<1,Me=(Me&52428)>>>2|(Me&13107)<<2,Me=(Me&61680)>>>4|(Me&3855)<<4,dr[J]=((Me&65280)>>>8|(Me&255)<<8)>>>1;Te=(function(e,t,n){for(var r=e.length,o=0,i=new he(t);o<r;++o)++i[e[o]-1];var s=new he(t);for(o=0;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;var l;if(n){l=new he(1<<t);var a=15-t;for(o=0;o<r;++o)if(e[o])for(var c=o<<4|e[o],d=t-e[o],u=s[e[o]-1]++<<d,h=u|(1<<d)-1;u<=h;++u)l[dr[u]>>>a]=c}else for(l=new he(r),o=0;o<r;++o)l[o]=dr[s[e[o]-1]++]>>>15-e[o];return l}),Pe=new de(288);for(J=0;J<144;++J)Pe[J]=8;for(J=144;J<256;++J)Pe[J]=9;for(J=256;J<280;++J)Pe[J]=7;for(J=280;J<288;++J)Pe[J]=8;It=new de(32);for(J=0;J<32;++J)It[J]=5;pl=Te(Pe,9,0),fl=Te(Pe,9,1),hl=Te(It,5,0),ml=Te(It,5,1),ir=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},we=function(e,t,n){var r=t/8>>0;return(e[r]|e[r+1]<<8)>>>(t&7)&n},sr=function(e,t){var n=t/8>>0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>>(t&7)},pr=function(e){return(e/8>>0)+(e&7&&1)},fr=function(e,t,n){(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof he?he:e instanceof Ct?Ct:de)(n-t);return r.set(e.subarray(t,n)),r},gl=function(e,t,n){var r=e.length,o=!t||n,i=!n||n.i;n||(n={}),t||(t=new de(r*3));var s=function(P){var q=t.length;if(P>q){var X=new de(Math.max(q*2,P));X.set(t),t=X}},l=n.f||0,a=n.p||0,c=n.b||0,d=n.l,u=n.d,h=n.m,f=n.n,p=r*8;do{if(!d){n.f=l=we(e,a,1);var g=we(e,a+1,3);if(a+=3,g)if(g==1)d=fl,u=ml,h=9,f=5;else if(g==2){var y=we(e,a,31)+257,E=we(e,a+10,15)+4,N=y+we(e,a+5,31)+1;a+=14;for(var k=new de(N),O=new de(19),A=0;A<E;++A)O[lr[A]]=we(e,a+A*3,7);a+=E*3;var $=ir(O),V=(1<<$)-1;if(!i&&a+N*($+7)>p)break;for(var F=Te(O,$,1),A=0;A<N;){var U=F[we(e,a,V)];a+=U&15;var b=U>>>4;if(b<16)k[A++]=b;else{var W=0,R=0;for(b==16?(R=3+we(e,a,3),a+=2,W=k[A-1]):b==17?(R=3+we(e,a,7),a+=3):b==18&&(R=11+we(e,a,127),a+=7);R--;)k[A++]=W}}var I=k.subarray(0,y),w=k.subarray(y);h=ir(I),f=ir(w),d=Te(I,h,1),u=Te(w,f,1)}else throw"invalid block type";else{var b=pr(a)+4,m=e[b-4]|e[b-3]<<8,v=b+m;if(v>r){if(i)throw"unexpected EOF";break}o&&s(c+m),t.set(e.subarray(b,v),c),n.b=c+=m,n.p=a=v*8;continue}if(a>p)throw"unexpected EOF"}o&&s(c+131072);for(var x=(1<<h)-1,T=(1<<f)-1,C=h+f+18;i||a+C<p;){var W=d[sr(e,a)&x],S=W>>>4;if(a+=W&15,a>p)throw"unexpected EOF";if(!W)throw"invalid length/literal";if(S<256)t[c++]=S;else if(S==256){d=null;break}else{var M=S-254;if(S>264){var A=S-257,L=Zt[A];M=we(e,a,(1<<L)-1)+fi[A],a+=L}var H=u[sr(e,a)&T],B=H>>>4;if(!H)throw"invalid distance";a+=H&15;var w=ul[B];if(B>3){var L=Jt[B];w+=sr(e,a)&(1<<L)-1,a+=L}if(a>p)throw"unexpected EOF";o&&s(c+131072);for(var z=c+M;c<z;c+=4)t[c]=t[c-w],t[c+1]=t[c+1-w],t[c+2]=t[c+2-w],t[c+3]=t[c+3-w];c=z}}n.l=d,n.p=a,n.b=c,d&&(l=1,n.m=h,n.d=u,n.n=f)}while(!l);return c==t.length?t:fr(t,0,c)},Oe=function(e,t,n){n<<=t&7;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},bt=function(e,t,n){n<<=t&7;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},ar=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var o=n.length,i=n.slice();if(!o)return[new de(0),0];if(o==1){var s=new de(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort(function(N,k){return N.f-k.f}),n.push({s:-1,f:25001});var l=n[0],a=n[1],c=0,d=1,u=2;for(n[0]={s:-1,f:l.f+a.f,l,r:a};d!=o-1;)l=n[n[c].f<n[u].f?c++:u++],a=n[c!=d&&n[c].f<n[u].f?c++:u++],n[d++]={s:-1,f:l.f+a.f,l,r:a};for(var h=i[0].s,r=1;r<o;++r)i[r].s>h&&(h=i[r].s);var f=new he(h+1),p=ur(n[d-1],f,0);if(p>t){var r=0,g=0,b=p-t,m=1<<b;for(i.sort(function(k,O){return f[O.s]-f[k.s]||k.f-O.f});r<o;++r){var v=i[r].s;if(f[v]>t)g+=m-(1<<p-f[v]),f[v]=t;else break}for(g>>>=b;g>0;){var y=i[r].s;f[y]<t?g-=1<<t-f[y]++-1:++r}for(;r>=0&&g;--r){var E=i[r].s;f[E]==t&&(--f[E],++g)}p=t}return[new de(f),p]},ur=function(e,t,n){return e.s==-1?Math.max(ur(e.l,t,n+1),ur(e.r,t,n+1)):t[e.s]=n},ci=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new he(++t),r=0,o=e[0],i=1,s=function(a){n[r++]=a},l=1;l<=t;++l)if(e[l]==o&&l!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(o),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(o);i=1,o=e[l]}return[n.subarray(0,r),t]},St=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Yt=function(e,t,n){var r=n.length,o=pr(t+2);e[o]=r&255,e[o+1]=r>>>8,e[o+2]=e[o]^255,e[o+3]=e[o+1]^255;for(var i=0;i<r;++i)e[o+i+4]=n[i];return(o+4+r)*8},di=function(e,t,n,r,o,i,s,l,a,c,d){Oe(t,d++,n),++o[256];for(var u=ar(o,15),h=u[0],f=u[1],p=ar(i,15),g=p[0],b=p[1],m=ci(h),v=m[0],y=m[1],E=ci(g),N=E[0],k=E[1],O=new he(19),A=0;A<v.length;++A)O[v[A]&31]++;for(var A=0;A<N.length;++A)O[N[A]&31]++;for(var $=ar(O,7),V=$[0],F=$[1],U=19;U>4&&!V[lr[U-1]];--U);var W=c+5<<3,R=St(o,Pe)+St(i,It)+s,I=St(o,h)+St(i,g)+s+14+3*U+St(O,V)+(2*O[16]+3*O[17]+7*O[18]);if(W<=R&&W<=I)return Yt(t,d,e.subarray(a,a+c));var w,x,T,C;if(Oe(t,d,1+(I<R)),d+=2,I<R){w=Te(h,f,0),x=h,T=Te(g,b,0),C=g;var S=Te(V,F,0);Oe(t,d,y-257),Oe(t,d+5,k-1),Oe(t,d+10,U-4),d+=14;for(var A=0;A<U;++A)Oe(t,d+3*A,V[lr[A]]);d+=3*U;for(var M=[v,N],L=0;L<2;++L)for(var H=M[L],A=0;A<H.length;++A){var B=H[A]&31;Oe(t,d,S[B]),d+=V[B],B>15&&(Oe(t,d,H[A]>>>5&127),d+=H[A]>>>12)}}else w=pl,x=Pe,T=hl,C=It;for(var A=0;A<l;++A)if(r[A]>255){var B=r[A]>>>18&31;bt(t,d,w[B+257]),d+=x[B+257],B>7&&(Oe(t,d,r[A]>>>23&31),d+=Zt[B]);var z=r[A]&31;bt(t,d,T[z]),d+=C[z],z>3&&(bt(t,d,r[A]>>>5&8191),d+=Jt[z])}else bt(t,d,w[r[A]]),d+=x[r[A]];return bt(t,d,w[256]),d+x[256]},vl=new Ct([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),yl=new de(0),bl=function(e,t,n,r,o,i){var s=e.length,l=new de(r+s+5*(1+Math.floor(s/7e3))+o),a=l.subarray(r,l.length-o),c=0;if(!t||s<8)for(var d=0;d<=s;d+=65535){var u=d+65535;u<s?c=Yt(a,c,e.subarray(d,u)):(a[d]=i,c=Yt(a,c,e.subarray(d,s)))}else{for(var h=vl[t-1],f=h>>>13,p=h&8191,g=(1<<n)-1,b=new he(32768),m=new he(g+1),v=Math.ceil(n/3),y=2*v,E=function(se){return(e[se]^e[se+1]<<v^e[se+2]<<y)&g},N=new Ct(25e3),k=new he(288),O=new he(32),A=0,$=0,d=0,V=0,F=0,U=0;d<s;++d){var W=E(d),R=d&32767,I=m[W];if(b[R]=I,m[W]=R,F<=d){var w=s-d;if((A>7e3||V>24576)&&w>423){c=di(e,a,0,N,k,O,$,V,U,d-U,c),V=A=$=0,U=d;for(var x=0;x<286;++x)k[x]=0;for(var x=0;x<30;++x)O[x]=0}var T=2,C=0,S=p,M=R-I&32767;if(w>2&&W==E(d-M))for(var L=Math.min(f,w)-1,H=Math.min(32767,d),B=Math.min(258,w);M<=H&&--S&&R!=I;){if(e[d+T]==e[d+T-M]){for(var z=0;z<B&&e[d+z]==e[d+z-M];++z);if(z>T){if(T=z,C=M,z>L)break;for(var P=Math.min(M,z-2),q=0,x=0;x<P;++x){var X=d-M+x+32768&32767,Q=b[X],pe=X-Q+32768&32767;pe>q&&(q=pe,I=X)}}}R=I,I=b[R],M+=R-I+32768&32767}if(C){N[V++]=268435456|cr[T]<<18|li[C];var Z=cr[T]&31,ce=li[C]&31;$+=Zt[Z]+Jt[ce],++k[257+Z],++O[ce],F=d+T,++A}else N[V++]=e[d],++k[e[d]]}}c=di(e,a,i,N,k,O,$,V,U,d-U,c),i||(c=Yt(a,c,yl))}return fr(l,0,r+pr(c)+o)},Sl=function(){var e=1,t=0;return{p:function(n){for(var r=e,o=t,i=n.length,s=0;s!=i;){for(var l=Math.min(s+5552,i);s<l;++s)r+=n[s],o+=r;r%=65521,o%=65521}e=r,t=o},d:function(){return(e>>>8<<16|(t&255)<<8|t>>>8)+((e&255)<<23)*2}}},Cl=function(e,t,n,r,o){return bl(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,n,r,!o)},Il=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},wl=function(e,t){var n=t.level,r=n==0?0:n<6?1:n==9?3:2;e[0]=120,e[1]=r<<6|(r?32-2*r:1)},El=function(e){if((e[0]&15)!=8||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(e[1]&32)throw"invalid zlib data: preset dictionaries not supported"}});var yi,bi=G(()=>{hr();yi=e=>{let t=Object.assign(Object.assign({},e),{v:"v1"});return Xt(mi(qt(JSON.stringify(t))),!0)}});var Si,Ci=G(()=>{hr();Si=e=>{if(typeof e!="string")return e;try{let t=JSON.parse(e);if(t.timestamp)return t}catch{}try{let t=JSON.parse(Xt(gi(qt(e,!0))));if(t.v==="v1")return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer ${"v1"}.`)}catch(t){throw console.error(t),new Error("Unknown data format.")}}});var Ue,xl,Ii,Tl,mr,wi=G(()=>{Ue=class{constructor(t){this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){let t=this.lineNumber||"",n=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${t}:${n})`:`${this.fileName}:${t}:${n}`}},xl=/(^|@)\S+:\d+/,Ii=/^\s*at .*(\S+:\d+|\(native\))/m,Tl=/^(eval@)?(\[native code])?$/,mr={parse:function(e){if(!e)return[];if(typeof e.stacktrace<"u"||typeof e["opera#sourceloc"]<"u")return this.parseOpera(e);if(e.stack&&e.stack.match(Ii))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(e.indexOf(":")===-1)return[e];let n=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!n)throw new Error(`Cannot parse given url: ${e}`);return[n[1],n[2]||void 0,n[3]||void 0]},parseV8OrIE:function(e){return e.stack.split(`
|
|
6
|
+
`,10)+1,l=i.substring(s)+(r?"//# sourceMappingURL="+r:""),a=new Blob([l],{type:"application/javascript"});return URL.createObjectURL(a)}function Uo(e,t,n){var r;return function(i){return r=r||Ka(e,t,n),new Worker(r,i)}}var Wo=G(()=>{});function Vo(){return ja}var ja,Ho=G(()=>{ja=Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"});function Go(e,t,n){return Vo()?Bo(e,t,n):Uo(e,t,n)}var $o=G(()=>{Po();Wo();Ho()});var zo,Ko=G(()=>{$o();zo=Go("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",null,!1)});var Gt,jo=G(()=>{Ze();ge();ye();Ro();Mo();Lo();Ko();Gt=class{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(a,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(c)};let{sampling:n="all",win:r,blockClass:o,blockSelector:i,recordCanvas:s,dataURLOptions:l}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&n==="all"&&this.initCanvasMutationObserver(r,o,i),s&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,o,i,{dataURLOptions:l})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,n,r,o,i){let s=zn(n,r,o),l=new Map,a=new zo;a.onmessage=p=>{let{id:m}=p.data;if(l.set(m,!1),!("base64"in p.data))return;let{base64:b,type:g,width:v,height:y}=p.data;this.mutationCb({id:m,type:ve["2D"],commands:[{property:"clearRect",args:[0,0,v,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:b}],type:g}]},0,0]}]})};let c=1e3/t,d=0,u,h=()=>{let p=[];return n.document.querySelectorAll("canvas").forEach(m=>{te(m,r,o,!0)||p.push(m)}),p},f=p=>{if(d&&p-d<c){u=requestAnimationFrame(f);return}d=p,h().forEach(m=>be(this,void 0,void 0,function*(){var b;let g=this.mirror.getId(m);if(l.get(g))return;if(l.set(g,!0),["webgl","webgl2"].includes(m.__context)){let y=m.getContext(m.__context);((b=y?.getContextAttributes())===null||b===void 0?void 0:b.preserveDrawingBuffer)===!1&&y?.clear(y.COLOR_BUFFER_BIT)}let v=yield createImageBitmap(m);a.postMessage({id:g,bitmap:v,width:m.width,height:m.height,dataURLOptions:i.dataURLOptions},[v])})),u=requestAnimationFrame(f)};u=requestAnimationFrame(f),this.resetObservers=()=>{s(),cancelAnimationFrame(u)}}initCanvasMutationObserver(t,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let o=zn(t,n,r),i=No(this.processMutation.bind(this),t,n,r),s=Do(this.processMutation.bind(this),t,n,r,this.mirror);this.resetObservers=()=>{o(),i(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=n=>{this.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{let r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;let o=r.map(s=>Eo(s,["type"])),{type:i}=r[0];this.mutationCb({id:n,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}}});var $t,Yo=G(()=>{ke();ge();$t=class{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Ke,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;let r={id:n,styleIds:[]},o=[];for(let i of t){let s;if(this.styleMirror.has(i))s=this.styleMirror.getId(i);else{s=this.styleMirror.add(i);let l=Array.from(i.rules||CSSRule);o.push({styleId:s,rules:l.map((a,c)=>({rule:xn(a),index:c}))})}r.styleIds.push(s)}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}});function ae(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}function Re(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:s="rr-ignore",maskTextClass:l="rr-mask",maskTextSelector:a=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:u,slimDOMOptions:h,maskInputFn:f,maskTextFn:p,hooks:m,packFn:b,sampling:g={},dataURLOptions:v={},mousemoveWait:y,recordCanvas:E=!1,recordCrossOriginIframes:N=!1,userTriggeredOnInput:k=!1,collectFonts:O=!1,inlineImages:A=!1,plugins:$,keepIframeSrcFn:V=()=>!1,ignoreCSSAttributes:F=new Set([])}=e,U=N?window.parent===window:!0,W=!1;if(!U)try{window.parent.document,W=!1}catch{W=!0}if(U&&!t)throw new Error("emit function is required");y!==void 0&&g.mousemove===void 0&&(g.mousemove=y),Ce.reset();let R=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:u!==void 0?u:{password:!0},I=h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:h==="all",headMetaDescKeywords:h==="all"}:h||{};ft();let w,x=0,T=P=>{for(let q of $||[])q.eventProcessor&&(P=q.eventProcessor(P));return b&&(P=b(P)),P};oe=(P,q)=>{var X;if(!((X=Be[0])===null||X===void 0)&&X.isFrozen()&&P.type!==_.FullSnapshot&&!(P.type===_.IncrementalSnapshot&&P.data.source===D.Mutation)&&Be.forEach(Q=>Q.unfreeze()),U)t?.(T(P),q);else if(W){let Q={type:"rrweb",event:T(P),isCheckout:q};window.parent.postMessage(Q,"*")}if(P.type===_.FullSnapshot)w=P,x=0;else if(P.type===_.IncrementalSnapshot){if(P.data.source===D.Mutation&&P.data.isAttachIframe)return;x++;let Q=r&&x>=r,pe=n&&P.timestamp-w.timestamp>n;(Q||pe)&&zt(!0)}};let C=P=>{oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.Mutation},P)}))},S=P=>oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.Scroll},P)})),M=P=>oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.CanvasMutation},P)})),L=P=>oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.AdoptedStyleSheet},P)})),H=new $t({mutationCb:C,adoptedStyleSheetCb:L}),B=new Ut({mirror:Ce,mutationCb:C,stylesheetManager:H,recordCrossOriginIframes:N,wrappedEmit:oe});for(let P of $||[])P.getMirror&&P.getMirror({nodeMirror:Ce,crossOriginIframeMirror:B.crossOriginIframeMirror,crossOriginIframeStyleMirror:B.crossOriginIframeStyleMirror});jn=new Gt({recordCanvas:E,mutationCb:M,win:window,blockClass:o,blockSelector:i,mirror:Ce,sampling:g.canvas,dataURLOptions:v});let z=new Wt({mutationCb:C,scrollCb:S,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:a,inlineStylesheet:c,maskInputOptions:R,dataURLOptions:v,maskTextFn:p,maskInputFn:f,recordCanvas:E,inlineImages:A,sampling:g,slimDOMOptions:I,iframeManager:B,stylesheetManager:H,canvasManager:jn,keepIframeSrcFn:V},mirror:Ce});zt=(P=!1)=>{var q,X,Q,pe,Z,ce;oe(ae({type:_.Meta,data:{href:window.location.href,width:ut(),height:dt()}}),P),H.reset(),Be.forEach(se=>se.lock());let st=ro(document,{mirror:Ce,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:a,inlineStylesheet:c,maskAllInputs:R,maskTextFn:p,slimDOM:I,dataURLOptions:v,recordCanvas:E,inlineImages:A,onSerialize:se=>{Ne(se,Ce)&&B.addIframe(se),ht(se,Ce)&&H.trackLinkElement(se),xe(se)&&z.addShadowRoot(se.shadowRoot,document)},onIframeLoad:(se,mn)=>{B.attachIframe(se,mn),z.observeAttachShadow(se)},onStylesheetLoad:(se,mn)=>{H.attachLinkElement(se,mn)},keepIframeSrcFn:V});if(!st)return console.warn("Failed to snapshot the document");oe(ae({type:_.FullSnapshot,data:{node:st,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((X=(q=document?.body)===null||q===void 0?void 0:q.parentElement)===null||X===void 0?void 0:X.scrollLeft)||((Q=document?.body)===null||Q===void 0?void 0:Q.scrollLeft)||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((Z=(pe=document?.body)===null||pe===void 0?void 0:pe.parentElement)===null||Z===void 0?void 0:Z.scrollTop)||((ce=document?.body)===null||ce===void 0?void 0:ce.scrollTop)||0}}})),Be.forEach(se=>se.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&H.adoptStyleSheets(document.adoptedStyleSheets,Ce.getId(document))};try{let P=[];P.push(le("DOMContentLoaded",()=>{oe(ae({type:_.DomContentLoaded,data:{}}))}));let q=Q=>{var pe;return So({mutationCb:C,mousemoveCb:(Z,ce)=>oe(ae({type:_.IncrementalSnapshot,data:{source:ce,positions:Z}})),mouseInteractionCb:Z=>oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.MouseInteraction},Z)})),scrollCb:S,viewportResizeCb:Z=>oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.ViewportResize},Z)})),inputCb:Z=>oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.Input},Z)})),mediaInteractionCb:Z=>oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.MediaInteraction},Z)})),styleSheetRuleCb:Z=>oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.StyleSheetRule},Z)})),styleDeclarationCb:Z=>oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.StyleDeclaration},Z)})),canvasMutationCb:M,fontCb:Z=>oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.Font},Z)})),selectionCb:Z=>{oe(ae({type:_.IncrementalSnapshot,data:Object.assign({source:D.Selection},Z)}))},blockClass:o,ignoreClass:s,maskTextClass:l,maskTextSelector:a,maskInputOptions:R,inlineStylesheet:c,sampling:g,recordCanvas:E,inlineImages:A,userTriggeredOnInput:k,collectFonts:O,doc:Q,maskInputFn:f,maskTextFn:p,keepIframeSrcFn:V,blockSelector:i,slimDOMOptions:I,dataURLOptions:v,mirror:Ce,iframeManager:B,stylesheetManager:H,shadowDomManager:z,canvasManager:jn,ignoreCSSAttributes:F,plugins:((pe=$?.filter(Z=>Z.observer))===null||pe===void 0?void 0:pe.map(Z=>({observer:Z.observer,options:Z.options,callback:ce=>oe(ae({type:_.Plugin,data:{plugin:Z.name,payload:ce}}))})))||[]},m)};B.addLoadListener(Q=>{P.push(q(Q.contentDocument))});let X=()=>{zt(),P.push(q(document)),Kt=!0};return document.readyState==="interactive"||document.readyState==="complete"?X():P.push(le("load",()=>{oe(ae({type:_.Load,data:{}})),X()},window)),()=>{P.forEach(Q=>Q()),Kt=!1}}catch(P){console.warn(P)}}var oe,zt,jn,Kt,Ce,Yn=G(()=>{ke();Vn();ge();ye();Io();wo();jo();Yo();Kt=!1,Ce=Mt();Re.addCustomEvent=(e,t)=>{if(!Kt)throw new Error("please add custom event after start recording");oe(ae({type:_.Custom,data:{tag:e,payload:t}}))};Re.freezePage=()=>{Be.forEach(e=>e.freeze())};Re.takeFullSnapshot=e=>{if(!Kt)throw new Error("please take full snapshot after start recording");zt(e)};Re.mirror=Ce});function Za(){return new Ya}function Ja(e){let t={},n=/;(?![^(]*\))/g,r=/:(.+)/,o=/\/\*.*?\*\//g;return e.replace(o,"").split(n).forEach(function(i){if(i){let s=i.split(r);s.length>1&&(t[Zn(s[0].trim())]=s[1].trim())}}),t}function Zo(e){let t=[];for(let n in e){let r=e[n];if(typeof r!="string")continue;let o=el(n);t.push(`${o}: ${r};`)}return t.join(" ")}function tl(e){return class qo extends e{constructor(){super(...arguments),this.nodeType=ne.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=j.Document,this.textContent=null}get documentElement(){return this.childNodes.find(n=>n.RRNodeType===j.Element&&n.tagName==="HTML")||null}get body(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(r=>r.RRNodeType===j.Element&&r.tagName==="BODY"))||null}get head(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(r=>r.RRNodeType===j.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(n){let r=n.RRNodeType;if((r===j.Element||r===j.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${r===j.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return n.parentElement=null,n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,r){let o=n.RRNodeType;if((o===j.Element||o===j.DocumentType)&&this.childNodes.some(s=>s.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===j.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(r===null)return this.appendChild(n);let i=this.childNodes.indexOf(r);if(i==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(i,0,n),n.parentElement=null,n.parentNode=this,n}removeChild(n){let r=this.childNodes.indexOf(n);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),n.parentElement=null,n.parentNode=null,n}open(){this.childNodes=[]}close(){}write(n){let r;if(n==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?r="-//W3C//DTD XHTML 1.0 Transitional//EN":n==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(r="-//W3C//DTD HTML 4.0 Transitional//EN"),r){let o=this.createDocumentType("html",r,"");this.open(),this.appendChild(o)}}createDocument(n,r,o){return new qo}createDocumentType(n,r,o){let i=new(Xo(Se))(n,r,o);return i.ownerDocument=this,i}createElement(n){let r=new(Qo(Se))(n);return r.ownerDocument=this,r}createElementNS(n,r){return this.createElement(r)}createTextNode(n){let r=new(ei(Se))(n);return r.ownerDocument=this,r}createComment(n){let r=new(ti(Se))(n);return r.ownerDocument=this,r}createCDATASection(n){let r=new(ni(Se))(n);return r.ownerDocument=this,r}toString(){return"RRDocument"}}}function Xo(e){return class extends e{constructor(n,r,o){super(),this.nodeType=ne.DOCUMENT_TYPE_NODE,this.RRNodeType=j.DocumentType,this.textContent=null,this.name=n,this.publicId=r,this.systemId=o,this.nodeName=n}toString(){return"RRDocumentType"}}}function Qo(e){return class extends e{constructor(n){super(),this.nodeType=ne.ELEMENT_NODE,this.RRNodeType=j.Element,this.attributes={},this.shadowRoot=null,this.tagName=n.toUpperCase(),this.nodeName=n.toUpperCase()}get textContent(){let n="";return this.childNodes.forEach(r=>n+=r.textContent),n}set textContent(n){this.childNodes=[this.ownerDocument.createTextNode(n)]}get classList(){return new Jn(this.attributes.class,n=>{this.attributes.class=n})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){let n=this.attributes.style?Ja(this.attributes.style):{},r=/\B([A-Z])/g;return n.setProperty=(o,i,s)=>{if(r.test(o))return;let l=Zn(o);i?n[l]=i:delete n[l],s==="important"&&(n[l]+=" !important"),this.attributes.style=Zo(n)},n.removeProperty=o=>{if(r.test(o))return"";let i=Zn(o),s=n[i]||"";return delete n[i],this.attributes.style=Zo(n),s},n}getAttribute(n){return this.attributes[n]||null}setAttribute(n,r){this.attributes[n]=r}setAttributeNS(n,r,o){this.setAttribute(r,o)}removeAttribute(n){delete this.attributes[n]}appendChild(n){return this.childNodes.push(n),n.parentNode=this,n.parentElement=this,n}insertBefore(n,r){if(r===null)return this.appendChild(n);let o=this.childNodes.indexOf(r);if(o==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(o,0,n),n.parentElement=this,n.parentNode=this,n}removeChild(n){let r=this.childNodes.indexOf(n);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),n.parentElement=null,n.parentNode=null,n}attachShadow(n){let r=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=r,r}dispatchEvent(n){return!0}toString(){let n="";for(let r in this.attributes)n+=`${r}="${this.attributes[r]}" `;return`${this.tagName} ${n}`}}}function nl(e){return class extends e{attachShadow(n){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}function ei(e){return class extends e{constructor(n){super(),this.nodeType=ne.TEXT_NODE,this.nodeName="#text",this.RRNodeType=j.Text,this.data=n}get textContent(){return this.data}set textContent(n){this.data=n}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function ti(e){return class extends e{constructor(n){super(),this.nodeType=ne.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=j.Comment,this.data=n}get textContent(){return this.data}set textContent(n){this.data=n}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function ni(e){return class extends e{constructor(n){super(),this.nodeName="#cdata-section",this.nodeType=ne.CDATA_SECTION_NODE,this.RRNodeType=j.CDATA,this.data=n}get textContent(){return this.data}set textContent(n){this.data=n}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}function Ie(e,t,n,r){let o=e.childNodes,i=t.childNodes;r=r||t.mirror||t.ownerDocument.mirror,(o.length>0||i.length>0)&&Jo(Array.from(o),i,e,n,r);let s=null,l=null;switch(t.RRNodeType){case j.Document:{l=t.scrollData;break}case j.Element:{let a=e,c=t;switch(ol(a,c,r),l=c.scrollData,s=c.inputData,c.tagName){case"AUDIO":case"VIDEO":{let d=e,u=c;u.paused!==void 0&&(u.paused?d.pause():d.play()),u.muted!==void 0&&(d.muted=u.muted),u.volume!==void 0&&(d.volume=u.volume),u.currentTime!==void 0&&(d.currentTime=u.currentTime),u.playbackRate!==void 0&&(d.playbackRate=u.playbackRate);break}case"CANVAS":{let d=t;if(d.rr_dataURL!==null){let u=document.createElement("img");u.onload=()=>{let h=a.getContext("2d");h&&h.drawImage(u,0,0,u.width,u.height)},u.src=d.rr_dataURL}d.canvasMutations.forEach(u=>n.applyCanvas(u.event,u.mutation,e))}break;case"STYLE":{let d=a.sheet;d&&t.rules.forEach(u=>n.applyStyleSheetMutation(u,d))}break}if(c.shadowRoot){a.shadowRoot||a.attachShadow({mode:"open"});let d=a.shadowRoot.childNodes,u=c.shadowRoot.childNodes;(d.length>0||u.length>0)&&Jo(Array.from(d),u,a.shadowRoot,n,r)}break}case j.Text:case j.Comment:case j.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(l&&n.applyScroll(l,!0),s&&n.applyInput(s),t.nodeName==="IFRAME"){let a=e.contentDocument,c=t;if(a){let d=r.getMeta(c.contentDocument);d&&n.mirror.add(a,Object.assign({},d)),Ie(a,c.contentDocument,n,r)}}}function ol(e,t,n){let r=e.attributes,o=t.attributes;for(let i in o){let s=o[i],l=n.getMeta(t);if(l&&"isSVG"in l&&l.isSVG&&qn[i])e.setAttributeNS(qn[i],i,s);else if(t.tagName==="CANVAS"&&i==="rr_dataURL"){let a=document.createElement("img");a.src=s,a.onload=()=>{let c=e.getContext("2d");c&&c.drawImage(a,0,0,a.width,a.height)}}else e.setAttribute(i,s)}for(let{name:i}of Array.from(r))i in o||e.removeAttribute(i);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function Jo(e,t,n,r,o){var i;let s=0,l=e.length-1,a=0,c=t.length-1,d=e[s],u=e[l],h=t[a],f=t[c],p,m;for(;s<=l&&a<=c;){let b=r.mirror.getId(d),g=r.mirror.getId(u),v=o.getId(h),y=o.getId(f);if(d===void 0)d=e[++s];else if(u===void 0)u=e[--l];else if(b!==-1&&b===v)Ie(d,h,r,o),d=e[++s],h=t[++a];else if(g!==-1&&g===y)Ie(u,f,r,o),u=e[--l],f=t[--c];else if(b!==-1&&b===y)n.insertBefore(d,u.nextSibling),Ie(d,f,r,o),d=e[++s],f=t[--c];else if(g!==-1&&g===v)n.insertBefore(u,d),Ie(u,h,r,o),u=e[--l],h=t[++a];else{if(!p){p={};for(let E=s;E<=l;E++){let N=e[E];N&&r.mirror.hasNode(N)&&(p[r.mirror.getId(N)]=E)}}if(m=p[o.getId(h)],m){let E=e[m];n.insertBefore(E,d),Ie(E,h,r,o),e[m]=void 0}else{let E=jt(h,r.mirror,o);n.nodeName==="#document"&&((i=r.mirror.getMeta(E))===null||i===void 0?void 0:i.type)===j.Element&&n.documentElement&&(n.removeChild(n.documentElement),e[s]=void 0,d=void 0),n.insertBefore(E,d||null),Ie(E,h,r,o)}h=t[++a]}}if(s>l){let b=t[c+1],g=null;for(b&&n.childNodes.forEach(v=>{r.mirror.getId(v)===o.getId(b)&&(g=v)});a<=c;++a){let v=jt(t[a],r.mirror,o);n.insertBefore(v,g),Ie(v,t[a],r,o)}}else if(a>c)for(;s<=l;s++){let b=e[s];b&&(n.removeChild(b),r.mirror.removeNodeFromMap(b))}}function jt(e,t,n){let r=n.getId(e),o=n.getMeta(e),i=null;if(r>-1&&(i=t.getNode(r)),i!==null)return i;switch(e.RRNodeType){case j.Document:i=new Document;break;case j.DocumentType:i=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case j.Element:{let s=e.tagName.toLowerCase();s=rl[s]||s,o&&"isSVG"in o&&o?.isSVG?i=document.createElementNS(qn.svg,s):i=document.createElement(e.tagName);break}case j.Text:i=document.createTextNode(e.data);break;case j.Comment:i=document.createComment(e.data);break;case j.CDATA:i=document.createCDATASection(e.data);break}return o&&t.add(i,Object.assign({},o)),i}function cl(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function rr(e,t,n,r){let o;switch(e.nodeType){case ne.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?o=r.contentDocument:(o=t,o.compatMode=e.compatMode);break;case ne.DOCUMENT_TYPE_NODE:{let s=e;o=t.createDocumentType(s.name,s.publicId,s.systemId);break}case ne.ELEMENT_NODE:{let s=e,l=cl(s);o=t.createElement(l);let a=o;for(let{name:c,value:d}of Array.from(s.attributes))a.attributes[c]=d;s.scrollLeft&&(a.scrollLeft=s.scrollLeft),s.scrollTop&&(a.scrollTop=s.scrollTop);break}case ne.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case ne.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case ne.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case ne.DOCUMENT_FRAGMENT_NODE:o=r.attachShadow({mode:"open"});break;default:return null}let i=n.getMeta(e);return t instanceof Je&&(i||(i=or(o,t.unserializedId),n.add(e,i)),t.mirror.add(o,Object.assign({},i))),o}function ri(e,t=Za(),n=new Je){function r(o,i){let s=rr(o,n,t,i);if(s!==null)if(i?.nodeName!=="IFRAME"&&o.nodeType!==ne.DOCUMENT_FRAGMENT_NODE&&(i?.appendChild(s),s.parentNode=i,s.parentElement=i),o.nodeName==="IFRAME"){let l=o.contentDocument;l&&r(l,s)}else(o.nodeType===ne.DOCUMENT_NODE||o.nodeType===ne.ELEMENT_NODE||o.nodeType===ne.DOCUMENT_FRAGMENT_NODE)&&(o.nodeType===ne.ELEMENT_NODE&&o.shadowRoot&&r(o.shadowRoot,s),o.childNodes.forEach(l=>r(l,s)))}return r(e,null),n}function dl(){return new nr}function or(e,t){switch(e.RRNodeType){case j.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case j.DocumentType:{let n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId}}case j.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case j.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case j.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case j.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}var j,Ya,qa,Xa,Zn,Qa,el,Se,Jn,ne,qn,rl,Je,il,qe,Xn,Qn,er,tr,sl,al,ll,nr,oi=G(()=>{(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"})(j||(j={}));Ya=(function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){var r=this.getNode(t);if(r){var o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e})();qa=/-([a-z])/g,Xa=/^--[a-zA-Z0-9-]+$/,Zn=e=>Xa.test(e)?e:e.replace(qa,(t,n)=>n?n.toUpperCase():""),Qa=/\B([A-Z])/g,el=e=>e.replace(Qa,"-$1").toLowerCase(),Se=class{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=ne.ELEMENT_NODE,this.TEXT_NODE=ne.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes,r=n.indexOf(this);return n[r+1]||null}contains(t){if(t===this)return!0;for(let n of this.childNodes)if(n.contains(t))return!0;return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,n){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};Jn=class{constructor(t,n){if(this.classes=[],this.add=(...r)=>{for(let o of r){let i=String(o);this.classes.indexOf(i)>=0||this.classes.push(i)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...r)=>{this.classes=this.classes.filter(o=>r.indexOf(o)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){let r=t.trim().split(/\s+/);this.classes.push(...r)}this.onChange=n}};(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"})(ne||(ne={}));qn={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},rl={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"};Je=class e extends tl(Se){constructor(t){super(),this.UNSERIALIZED_STARTING_ID=-2,this._unserializedId=this.UNSERIALIZED_STARTING_ID,this.mirror=dl(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,n,r){return new e}createDocumentType(t,n,r){let o=new il(t,n,r);return o.ownerDocument=this,o}createElement(t){let n=t.toUpperCase(),r;switch(n){case"AUDIO":case"VIDEO":r=new Xn(n);break;case"IFRAME":r=new tr(n,this.mirror);break;case"CANVAS":r=new Qn(n);break;case"STYLE":r=new er(n);break;default:r=new qe(n);break}return r.ownerDocument=this,r}createComment(t){let n=new al(t);return n.ownerDocument=this,n}createCDATASection(t){let n=new ll(t);return n.ownerDocument=this,n}createTextNode(t){let n=new sl(t);return n.ownerDocument=this,n}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}},il=Xo(Se),qe=class extends Qo(Se){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}},Xn=class extends nl(qe){},Qn=class extends qe{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}},er=class extends qe{constructor(){super(...arguments),this.rules=[]}},tr=class extends qe{constructor(t,n){super(t),this.contentDocument=new Je,this.contentDocument.mirror=n}},sl=ei(Se),al=ti(Se),ll=ni(Se);nr=class{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var n;if(!t)return-1;let r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){let r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){let r=this.getNode(t);if(r){let o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}});var ii,si,ai=G(()=>{Yn();({addCustomEvent:ii}=Re),{freezePage:si}=Re});function mi(e,t){t===void 0&&(t={});var n=Sl();n.p(e);var r=Cl(e,t,2,4);return wl(r,t),Il(r,r.length-4,n.d()),r}function gi(e,t){return gl((El(e),e.subarray(2,-4)),t)}function qt(e,t){var n=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var r=new de(e.length+(e.length>>>1)),o=0,i=function(c){r[o++]=c},s=0;s<n;++s){if(o+5>r.length){var l=new de(o+8+(n-s<<1));l.set(r),r=l}var a=e.charCodeAt(s);a<128||t?i(a):a<2048?(i(192|a>>>6),i(128|a&63)):a>55295&&a<57344?(a=65536+(a&1047552)|e.charCodeAt(++s)&1023,i(240|a>>>18),i(128|a>>>12&63),i(128|a>>>6&63),i(128|a&63)):(i(224|a>>>12),i(128|a>>>6&63),i(128|a&63))}return fr(r,0,o)}function Xt(e,t){var n="";if(!t&&typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var r=0;r<e.length;){var o=e[r++];o<128||t?n+=String.fromCharCode(o):o<224?n+=String.fromCharCode((o&31)<<6|e[r++]&63):o<240?n+=String.fromCharCode((o&15)<<12|(e[r++]&63)<<6|e[r++]&63):(o=((o&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,n+=String.fromCharCode(55296|o>>10,56320|o&1023))}return n}var de,he,Ct,Zt,Jt,lr,ui,pi,fi,cr,hi,ul,li,dr,Me,J,Te,Pe,J,J,J,J,It,J,pl,fl,hl,ml,ir,we,sr,pr,fr,gl,Oe,bt,ar,ur,ci,St,Yt,di,vl,yl,bl,Sl,Cl,Il,wl,El,hr=G(()=>{de=Uint8Array,he=Uint16Array,Ct=Uint32Array,Zt=new de([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]),Jt=new de([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]),lr=new de([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ui=function(e,t){for(var n=new he(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var o=new Ct(n[30]),r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)o[i]=i-n[r]<<5|r;return[n,o]},pi=ui(Zt,2),fi=pi[0],cr=pi[1];fi[28]=258,cr[258]=28;hi=ui(Jt,0),ul=hi[0],li=hi[1],dr=new he(32768);for(J=0;J<32768;++J)Me=(J&43690)>>>1|(J&21845)<<1,Me=(Me&52428)>>>2|(Me&13107)<<2,Me=(Me&61680)>>>4|(Me&3855)<<4,dr[J]=((Me&65280)>>>8|(Me&255)<<8)>>>1;Te=(function(e,t,n){for(var r=e.length,o=0,i=new he(t);o<r;++o)++i[e[o]-1];var s=new he(t);for(o=0;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;var l;if(n){l=new he(1<<t);var a=15-t;for(o=0;o<r;++o)if(e[o])for(var c=o<<4|e[o],d=t-e[o],u=s[e[o]-1]++<<d,h=u|(1<<d)-1;u<=h;++u)l[dr[u]>>>a]=c}else for(l=new he(r),o=0;o<r;++o)l[o]=dr[s[e[o]-1]++]>>>15-e[o];return l}),Pe=new de(288);for(J=0;J<144;++J)Pe[J]=8;for(J=144;J<256;++J)Pe[J]=9;for(J=256;J<280;++J)Pe[J]=7;for(J=280;J<288;++J)Pe[J]=8;It=new de(32);for(J=0;J<32;++J)It[J]=5;pl=Te(Pe,9,0),fl=Te(Pe,9,1),hl=Te(It,5,0),ml=Te(It,5,1),ir=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},we=function(e,t,n){var r=t/8>>0;return(e[r]|e[r+1]<<8)>>>(t&7)&n},sr=function(e,t){var n=t/8>>0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>>(t&7)},pr=function(e){return(e/8>>0)+(e&7&&1)},fr=function(e,t,n){(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof he?he:e instanceof Ct?Ct:de)(n-t);return r.set(e.subarray(t,n)),r},gl=function(e,t,n){var r=e.length,o=!t||n,i=!n||n.i;n||(n={}),t||(t=new de(r*3));var s=function(P){var q=t.length;if(P>q){var X=new de(Math.max(q*2,P));X.set(t),t=X}},l=n.f||0,a=n.p||0,c=n.b||0,d=n.l,u=n.d,h=n.m,f=n.n,p=r*8;do{if(!d){n.f=l=we(e,a,1);var m=we(e,a+1,3);if(a+=3,m)if(m==1)d=fl,u=ml,h=9,f=5;else if(m==2){var y=we(e,a,31)+257,E=we(e,a+10,15)+4,N=y+we(e,a+5,31)+1;a+=14;for(var k=new de(N),O=new de(19),A=0;A<E;++A)O[lr[A]]=we(e,a+A*3,7);a+=E*3;var $=ir(O),V=(1<<$)-1;if(!i&&a+N*($+7)>p)break;for(var F=Te(O,$,1),A=0;A<N;){var U=F[we(e,a,V)];a+=U&15;var b=U>>>4;if(b<16)k[A++]=b;else{var W=0,R=0;for(b==16?(R=3+we(e,a,3),a+=2,W=k[A-1]):b==17?(R=3+we(e,a,7),a+=3):b==18&&(R=11+we(e,a,127),a+=7);R--;)k[A++]=W}}var I=k.subarray(0,y),w=k.subarray(y);h=ir(I),f=ir(w),d=Te(I,h,1),u=Te(w,f,1)}else throw"invalid block type";else{var b=pr(a)+4,g=e[b-4]|e[b-3]<<8,v=b+g;if(v>r){if(i)throw"unexpected EOF";break}o&&s(c+g),t.set(e.subarray(b,v),c),n.b=c+=g,n.p=a=v*8;continue}if(a>p)throw"unexpected EOF"}o&&s(c+131072);for(var x=(1<<h)-1,T=(1<<f)-1,C=h+f+18;i||a+C<p;){var W=d[sr(e,a)&x],S=W>>>4;if(a+=W&15,a>p)throw"unexpected EOF";if(!W)throw"invalid length/literal";if(S<256)t[c++]=S;else if(S==256){d=null;break}else{var M=S-254;if(S>264){var A=S-257,L=Zt[A];M=we(e,a,(1<<L)-1)+fi[A],a+=L}var H=u[sr(e,a)&T],B=H>>>4;if(!H)throw"invalid distance";a+=H&15;var w=ul[B];if(B>3){var L=Jt[B];w+=sr(e,a)&(1<<L)-1,a+=L}if(a>p)throw"unexpected EOF";o&&s(c+131072);for(var z=c+M;c<z;c+=4)t[c]=t[c-w],t[c+1]=t[c+1-w],t[c+2]=t[c+2-w],t[c+3]=t[c+3-w];c=z}}n.l=d,n.p=a,n.b=c,d&&(l=1,n.m=h,n.d=u,n.n=f)}while(!l);return c==t.length?t:fr(t,0,c)},Oe=function(e,t,n){n<<=t&7;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},bt=function(e,t,n){n<<=t&7;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},ar=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var o=n.length,i=n.slice();if(!o)return[new de(0),0];if(o==1){var s=new de(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort(function(N,k){return N.f-k.f}),n.push({s:-1,f:25001});var l=n[0],a=n[1],c=0,d=1,u=2;for(n[0]={s:-1,f:l.f+a.f,l,r:a};d!=o-1;)l=n[n[c].f<n[u].f?c++:u++],a=n[c!=d&&n[c].f<n[u].f?c++:u++],n[d++]={s:-1,f:l.f+a.f,l,r:a};for(var h=i[0].s,r=1;r<o;++r)i[r].s>h&&(h=i[r].s);var f=new he(h+1),p=ur(n[d-1],f,0);if(p>t){var r=0,m=0,b=p-t,g=1<<b;for(i.sort(function(k,O){return f[O.s]-f[k.s]||k.f-O.f});r<o;++r){var v=i[r].s;if(f[v]>t)m+=g-(1<<p-f[v]),f[v]=t;else break}for(m>>>=b;m>0;){var y=i[r].s;f[y]<t?m-=1<<t-f[y]++-1:++r}for(;r>=0&&m;--r){var E=i[r].s;f[E]==t&&(--f[E],++m)}p=t}return[new de(f),p]},ur=function(e,t,n){return e.s==-1?Math.max(ur(e.l,t,n+1),ur(e.r,t,n+1)):t[e.s]=n},ci=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new he(++t),r=0,o=e[0],i=1,s=function(a){n[r++]=a},l=1;l<=t;++l)if(e[l]==o&&l!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(o),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(o);i=1,o=e[l]}return[n.subarray(0,r),t]},St=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Yt=function(e,t,n){var r=n.length,o=pr(t+2);e[o]=r&255,e[o+1]=r>>>8,e[o+2]=e[o]^255,e[o+3]=e[o+1]^255;for(var i=0;i<r;++i)e[o+i+4]=n[i];return(o+4+r)*8},di=function(e,t,n,r,o,i,s,l,a,c,d){Oe(t,d++,n),++o[256];for(var u=ar(o,15),h=u[0],f=u[1],p=ar(i,15),m=p[0],b=p[1],g=ci(h),v=g[0],y=g[1],E=ci(m),N=E[0],k=E[1],O=new he(19),A=0;A<v.length;++A)O[v[A]&31]++;for(var A=0;A<N.length;++A)O[N[A]&31]++;for(var $=ar(O,7),V=$[0],F=$[1],U=19;U>4&&!V[lr[U-1]];--U);var W=c+5<<3,R=St(o,Pe)+St(i,It)+s,I=St(o,h)+St(i,m)+s+14+3*U+St(O,V)+(2*O[16]+3*O[17]+7*O[18]);if(W<=R&&W<=I)return Yt(t,d,e.subarray(a,a+c));var w,x,T,C;if(Oe(t,d,1+(I<R)),d+=2,I<R){w=Te(h,f,0),x=h,T=Te(m,b,0),C=m;var S=Te(V,F,0);Oe(t,d,y-257),Oe(t,d+5,k-1),Oe(t,d+10,U-4),d+=14;for(var A=0;A<U;++A)Oe(t,d+3*A,V[lr[A]]);d+=3*U;for(var M=[v,N],L=0;L<2;++L)for(var H=M[L],A=0;A<H.length;++A){var B=H[A]&31;Oe(t,d,S[B]),d+=V[B],B>15&&(Oe(t,d,H[A]>>>5&127),d+=H[A]>>>12)}}else w=pl,x=Pe,T=hl,C=It;for(var A=0;A<l;++A)if(r[A]>255){var B=r[A]>>>18&31;bt(t,d,w[B+257]),d+=x[B+257],B>7&&(Oe(t,d,r[A]>>>23&31),d+=Zt[B]);var z=r[A]&31;bt(t,d,T[z]),d+=C[z],z>3&&(bt(t,d,r[A]>>>5&8191),d+=Jt[z])}else bt(t,d,w[r[A]]),d+=x[r[A]];return bt(t,d,w[256]),d+x[256]},vl=new Ct([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),yl=new de(0),bl=function(e,t,n,r,o,i){var s=e.length,l=new de(r+s+5*(1+Math.floor(s/7e3))+o),a=l.subarray(r,l.length-o),c=0;if(!t||s<8)for(var d=0;d<=s;d+=65535){var u=d+65535;u<s?c=Yt(a,c,e.subarray(d,u)):(a[d]=i,c=Yt(a,c,e.subarray(d,s)))}else{for(var h=vl[t-1],f=h>>>13,p=h&8191,m=(1<<n)-1,b=new he(32768),g=new he(m+1),v=Math.ceil(n/3),y=2*v,E=function(se){return(e[se]^e[se+1]<<v^e[se+2]<<y)&m},N=new Ct(25e3),k=new he(288),O=new he(32),A=0,$=0,d=0,V=0,F=0,U=0;d<s;++d){var W=E(d),R=d&32767,I=g[W];if(b[R]=I,g[W]=R,F<=d){var w=s-d;if((A>7e3||V>24576)&&w>423){c=di(e,a,0,N,k,O,$,V,U,d-U,c),V=A=$=0,U=d;for(var x=0;x<286;++x)k[x]=0;for(var x=0;x<30;++x)O[x]=0}var T=2,C=0,S=p,M=R-I&32767;if(w>2&&W==E(d-M))for(var L=Math.min(f,w)-1,H=Math.min(32767,d),B=Math.min(258,w);M<=H&&--S&&R!=I;){if(e[d+T]==e[d+T-M]){for(var z=0;z<B&&e[d+z]==e[d+z-M];++z);if(z>T){if(T=z,C=M,z>L)break;for(var P=Math.min(M,z-2),q=0,x=0;x<P;++x){var X=d-M+x+32768&32767,Q=b[X],pe=X-Q+32768&32767;pe>q&&(q=pe,I=X)}}}R=I,I=b[R],M+=R-I+32768&32767}if(C){N[V++]=268435456|cr[T]<<18|li[C];var Z=cr[T]&31,ce=li[C]&31;$+=Zt[Z]+Jt[ce],++k[257+Z],++O[ce],F=d+T,++A}else N[V++]=e[d],++k[e[d]]}}c=di(e,a,i,N,k,O,$,V,U,d-U,c),i||(c=Yt(a,c,yl))}return fr(l,0,r+pr(c)+o)},Sl=function(){var e=1,t=0;return{p:function(n){for(var r=e,o=t,i=n.length,s=0;s!=i;){for(var l=Math.min(s+5552,i);s<l;++s)r+=n[s],o+=r;r%=65521,o%=65521}e=r,t=o},d:function(){return(e>>>8<<16|(t&255)<<8|t>>>8)+((e&255)<<23)*2}}},Cl=function(e,t,n,r,o){return bl(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,n,r,!o)},Il=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},wl=function(e,t){var n=t.level,r=n==0?0:n<6?1:n==9?3:2;e[0]=120,e[1]=r<<6|(r?32-2*r:1)},El=function(e){if((e[0]&15)!=8||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(e[1]&32)throw"invalid zlib data: preset dictionaries not supported"}});var yi,bi=G(()=>{hr();yi=e=>{let t=Object.assign(Object.assign({},e),{v:"v1"});return Xt(mi(qt(JSON.stringify(t))),!0)}});var Si,Ci=G(()=>{hr();Si=e=>{if(typeof e!="string")return e;try{let t=JSON.parse(e);if(t.timestamp)return t}catch{}try{let t=JSON.parse(Xt(gi(qt(e,!0))));if(t.v==="v1")return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer ${"v1"}.`)}catch(t){throw console.error(t),new Error("Unknown data format.")}}});var Ue,xl,Ii,Tl,mr,wi=G(()=>{Ue=class{constructor(t){this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){let t=this.lineNumber||"",n=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${t}:${n})`:`${this.fileName}:${t}:${n}`}},xl=/(^|@)\S+:\d+/,Ii=/^\s*at .*(\S+:\d+|\(native\))/m,Tl=/^(eval@)?(\[native code])?$/,mr={parse:function(e){if(!e)return[];if(typeof e.stacktrace<"u"||typeof e["opera#sourceloc"]<"u")return this.parseOpera(e);if(e.stack&&e.stack.match(Ii))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(e.indexOf(":")===-1)return[e];let n=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!n)throw new Error(`Cannot parse given url: ${e}`);return[n[1],n[2]||void 0,n[3]||void 0]},parseV8OrIE:function(e){return e.stack.split(`
|
|
7
7
|
`).filter(function(n){return!!n.match(Ii)},this).map(function(n){n.indexOf("(eval ")>-1&&(n=n.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let r=n.replace(/^\s+/,"").replace(/\(eval code/g,"("),o=r.match(/ (\((.+):(\d+):(\d+)\)$)/);r=o?r.replace(o[0],""):r;let i=r.split(/\s+/).slice(1),s=this.extractLocation(o?o[1]:i.pop()),l=i.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(s[0])>-1?void 0:s[0];return new Ue({functionName:l,fileName:a,lineNumber:s[1],columnNumber:s[2]})},this)},parseFFOrSafari:function(e){return e.stack.split(`
|
|
8
8
|
`).filter(function(n){return!n.match(Tl)},this).map(function(n){if(n.indexOf(" > eval")>-1&&(n=n.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),n.indexOf("@")===-1&&n.indexOf(":")===-1)return new Ue({functionName:n});{let r=/((.*".+"[^@]*)?[^@]*)(?:@)/,o=n.match(r),i=o&&o[1]?o[1]:void 0,s=this.extractLocation(n.replace(r,""));return new Ue({functionName:i,fileName:s[0],lineNumber:s[1],columnNumber:s[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf(`
|
|
9
9
|
`)>-1&&e.message.split(`
|
|
@@ -12,8 +12,8 @@ or you can use record.mirror to access the mirror instance during recording.`,ct
|
|
|
12
12
|
`),r=[];for(let o=2,i=n.length;o<i;o+=2){let s=t.exec(n[o]);s&&r.push(new Ue({fileName:s[2],lineNumber:parseFloat(s[1])}))}return r},parseOpera10:function(e){let t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split(`
|
|
13
13
|
`),r=[];for(let o=0,i=n.length;o<i;o+=2){let s=t.exec(n[o]);s&&r.push(new Ue({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return r},parseOpera11:function(e){return e.stack.split(`
|
|
14
14
|
`).filter(function(n){return!!n.match(xl)&&!n.match(/^Error created at/)},this).map(function(n){let r=n.split("@"),o=this.extractLocation(r.pop()),s=(r.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ue({functionName:s,fileName:o[0],lineNumber:o[1],columnNumber:o[2]})},this)}}});function Al(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();let r=e.parentElement,o=[];if(r.children&&r.children.length>0)for(let i=0;i<r.children.length;i++){let s=r.children[i];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===n&&o.push(s)}o.length>1&&(n+=`:eq(${o.indexOf(e)})`),t=n+(t?">"+t:""),e=r}return t}function gr(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ei(e,t){if(t===0)return!0;let n=Object.keys(e);for(let r of n)if(gr(e[r])&&Ei(e[r],t-1))return!0;return!1}function Qt(e,t){let n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);let r=[],o=[];return JSON.stringify(e,function(l,a){if(r.length>0){let c=r.indexOf(this);~c?r.splice(c+1):r.push(this),~c?o.splice(c,1/0,l):o.push(l),~r.indexOf(a)&&(r[0]===a?a="[Circular ~]":a="[Circular ~."+o.slice(0,r.indexOf(a)).join(".")+"]")}else r.push(a);if(a===null)return a;if(a===void 0)return"undefined";if(i(a))return s(a);if(a instanceof Event){let c={};for(let d in a){let u=a[d];Array.isArray(u)?c[d]=Al(u.length?u[0]:null):c[d]=u}return c}else{if(a instanceof Node)return a instanceof HTMLElement?a?a.outerHTML:"":a.nodeName;if(a instanceof Error)return a.stack?a.stack+`
|
|
15
|
-
End of stack for Error object`:a.name+": "+a.message}return a});function i(l){return!!(gr(l)&&Object.keys(l).length>n.numOfKeysLimit||typeof l=="function"||gr(l)&&Ei(l,n.depthOfLimit))}function s(l){let a=l.toString();return n.stringLengthLimit&&a.length>n.stringLengthLimit&&(a=`${a.slice(0,n.stringLengthLimit)}...`),a}}var xi=G(()=>{});function kl(e,t,n){let r=n?Object.assign({},Ti,n):Ti,o=r.logger;if(!o)return()=>{};let i;typeof o=="string"?i=t[o]:i=o;let s=0,l=[];if(r.level.includes("error")&&window){let c=d=>{let u=d.message,h=d.error,f=mr.parse(h).map(
|
|
16
|
-
at `,r=n;return r+=t.trace.join(n),r}},ki=e=>{let t=e?.replayLogger||new yr(e).getConsoleLogger();return{handler(n,r,o){let i=null;if(n.type===_.IncrementalSnapshot&&n.data.source===D.Log?i=n.data:n.type===_.Plugin&&n.data.plugin===wt&&(i=n.data.payload),i)try{typeof t[i.level]=="function"&&t[i.level](i)}catch(s){o.replayer.config.showWarning&&console.warn(s)}}}}});var Sr={};kt(Sr,{default:()=>br});function br(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(o){o(n)}),(r=e.get("*"))&&r.slice().map(function(o){o(t,n)})}}}var Cr=G(()=>{});function Ri(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;let n=e.HTMLElement||e.Element,r=468,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||a,scrollIntoView:n.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function s(m){let v=["MSIE ","Trident/","Edge/"];return new RegExp(v.join("|")).test(m)}let l=s(e.navigator.userAgent)?1:0;function a(m,v){this.scrollLeft=m,this.scrollTop=v}function c(m){return .5*(1-Math.cos(Math.PI*m))}function d(m){if(m===null||typeof m!="object"||m.behavior===void 0||m.behavior==="auto"||m.behavior==="instant")return!0;if(typeof m=="object"&&m.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+m.behavior+" is not a valid value for enumeration ScrollBehavior.")}function u(m,v){if(v==="Y")return m.clientHeight+l<m.scrollHeight;if(v==="X")return m.clientWidth+l<m.scrollWidth}function h(m,v){let y=e.getComputedStyle(m,null)["overflow"+v];return y==="auto"||y==="scroll"}function f(m){let v=u(m,"Y")&&h(m,"Y"),y=u(m,"X")&&h(m,"X");return v||y}function p(m){for(;m!==t.body&&f(m)===!1;)m=m.parentNode||m.host;return m}function g(m){let v=i(),y,E,N,k=(v-m.startTime)/r;k=k>1?1:k,y=c(k),E=m.startX+(m.x-m.startX)*y,N=m.startY+(m.y-m.startY)*y,m.method.call(m.scrollable,E,N),(E!==m.x||N!==m.y)&&e.requestAnimationFrame(g.bind(e,m))}function b(m,v,y){let E,N,k,O,A=i();m===t.body?(E=e,N=e.scrollX||e.pageXOffset,k=e.scrollY||e.pageYOffset,O=o.scroll):(E=m,N=m.scrollLeft,k=m.scrollTop,O=a),g({scrollable:E,method:O,startTime:A,startX:N,startY:k,x:v,y})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(d(arguments[0])===!0){o.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}b.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(d(arguments[0])){o.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}b.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(arguments[0]===void 0)return;if(d(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}let m=arguments[0].left,v=arguments[0].top;b.call(this,this,typeof m>"u"?this.scrollLeft:~~m,typeof v>"u"?this.scrollTop:~~v)},n.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(d(arguments[0])===!0){o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},n.prototype.scrollIntoView=function(){if(d(arguments[0])===!0){o.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}let m=p(this),v=m.getBoundingClientRect(),y=this.getBoundingClientRect();m!==t.body?(b.call(this,m,m.scrollLeft+y.left-v.left,m.scrollTop+y.top-v.top),e.getComputedStyle(m).position!=="fixed"&&e.scrollBy({left:v.left,top:v.top,behavior:"smooth"})):e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})}}var Mi=G(()=>{});function Ir(e,t){if(e.type===_.IncrementalSnapshot&&e.data.source===D.MouseMove&&e.data.positions&&e.data.positions.length){let n=e.data.positions[0].timeOffset,r=e.timestamp+n;return e.delay=r-t,r-t}return e.delay=e.timestamp-t,e.delay}var tn,wr=G(()=>{ye();tn=class{constructor(t=[],n){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=n.speed,this.liveMode=n.liveMode}addAction(t){if(!this.actions.length||this.actions[this.actions.length-1].delay<=t.delay){this.actions.push(t);return}let n=this.findActionIndex(t);this.actions.splice(n,0,t)}start(){this.timeOffset=0;let t=performance.now(),n=()=>{let r=performance.now();for(this.timeOffset+=(r-t)*this.speed,t=r;this.actions.length;){let o=this.actions[0];if(this.timeOffset>=o.delay)this.actions.shift(),o.doAction();else break}(this.actions.length>0||this.liveMode)&&(this.raf=requestAnimationFrame(n))};this.raf=requestAnimationFrame(n)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}toggleLiveMode(t){this.liveMode=t}isActive(){return this.raf!==null}findActionIndex(t){let n=0,r=this.actions.length-1;for(;n<=r;){let o=Math.floor((n+r)/2);if(this.actions[o].delay<t.delay)n=o+1;else if(this.actions[o].delay>t.delay)r=o-1;else return o+1}return n}}});function Oi(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function Er(e){return e===void 0?[]:[].concat(e)}function Xe(e){return{type:"xstate.assign",assignment:e}}function Di(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function nn(e){return function(t){return e===t}}function Pi(e){return typeof e=="string"?{type:e}:e}function Li(e,t){return{value:e,context:t,actions:[],changed:!1,matches:nn(e)}}function _i(e,t,n){var r=t,o=!1;return[e.filter((function(i){if(i.type==="xstate.assign"){o=!0;var s=Object.assign({},r);return typeof i.assignment=="function"?s=i.assignment(r,n):Object.keys(i.assignment).forEach((function(l){s[l]=typeof i.assignment[l]=="function"?i.assignment[l](r,n):i.assignment[l]})),r=s,!1}return!0})),r,o]}function xr(e,t){t===void 0&&(t={});var n=Oi(_i(Er(e.states[e.initial].entry).map((function(s){return Di(s,t.actions)})),e.context,Bi),2),r=n[0],o=n[1],i={config:e,_options:t,initialState:{value:e.initial,actions:r,context:o,matches:nn(e.initial)},transition:function(s,l){var a,c,d=typeof s=="string"?{value:s,context:e.context}:s,u=d.value,h=d.context,f=Pi(l),p=e.states[u];if(p.on){var g=Er(p.on[f.type]);try{for(var b=(function(x){var T=typeof Symbol=="function"&&Symbol.iterator,C=T&&x[T],S=0;if(C)return C.call(x);if(x&&typeof x.length=="number")return{next:function(){return x&&S>=x.length&&(x=void 0),{value:x&&x[S++],done:!x}}};throw new TypeError(T?"Object is not iterable.":"Symbol.iterator is not defined.")})(g),m=b.next();!m.done;m=b.next()){var v=m.value;if(v===void 0)return Li(u,h);var y=typeof v=="string"?{target:v}:v,E=y.target,N=y.actions,k=N===void 0?[]:N,O=y.cond,A=O===void 0?function(){return!0}:O,$=E===void 0,V=E??u,F=e.states[V];if(A(h,f)){var U=Oi(_i(($?Er(k):[].concat(p.exit,k,F.entry).filter((function(x){return x}))).map((function(x){return Di(x,i._options.actions)})),h,f),3),W=U[0],R=U[1],I=U[2],w=E??u;return{value:w,context:R,actions:W,changed:E!==u||W.length>0||I,matches:nn(w)}}}}catch(x){a={error:x}}finally{try{m&&!m.done&&(c=b.return)&&c.call(b)}finally{if(a)throw a.error}}}return Li(u,h)}};return i}function Tr(e){var t=e.initialState,n=ot.NotStarted,r=new Set,o={_machine:e,send:function(i){n===ot.Running&&(t=e.transition(t,i),Fi(t,Pi(i)),r.forEach((function(s){return s(t)})))},subscribe:function(i){return r.add(i),i(t),{unsubscribe:function(){return r.delete(i)}}},start:function(i){if(i){var s=typeof i=="object"?i:{context:e.config.context,value:i};t={value:s.value,actions:[],context:s.context,matches:nn(s.value)}}return n=ot.Running,Fi(t,Bi),o},stop:function(){return n=ot.Stopped,r.clear(),o},get state(){return t},get status(){return n}};return o}var ot,Bi,Fi,Ui=G(()=>{(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(ot||(ot={}));Bi={type:"xstate.init"};Fi=function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))}});function Rl(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.type===_.Meta&&r.timestamp<=t)return e.slice(n)}return e}function Wi(e,{getCastFn:t,applyEventsSynchronously:n,emitter:r}){let o=xr({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:Xe({lastPlayedEvent:(i,s)=>s.type==="CAST_EVENT"?s.payload.event:i.lastPlayedEvent}),recordTimeOffset:Xe((i,s)=>{let l=i.timeOffset;return"payload"in s&&"timeOffset"in s.payload&&(l=s.payload.timeOffset),Object.assign(Object.assign({},i),{timeOffset:l,baselineTime:i.events[0].timestamp+l})}),play(i){var s;let{timer:l,events:a,baselineTime:c,lastPlayedEvent:d}=i;l.clear();for(let p of a)Ir(p,c);let u=Rl(a,c),h=d?.timestamp;d?.type===_.IncrementalSnapshot&&d.data.source===D.MouseMove&&(h=d.timestamp+((s=d.data.positions[0])===null||s===void 0?void 0:s.timeOffset)),c<(h||0)&&r.emit(Y.PlayBack);let f=new Array;for(let p of u)if(!(h&&h<c&&(p.timestamp<=h||p===d)))if(p.timestamp<c)f.push(p);else{let g=t(p,!1);l.addAction({doAction:()=>{g()},delay:p.delay})}n(f),r.emit(Y.Flush),l.start()},pause(i){i.timer.clear()},resetLastPlayedEvent:Xe(i=>Object.assign(Object.assign({},i),{lastPlayedEvent:null})),startLive:Xe({baselineTime:(i,s)=>(i.timer.toggleLiveMode(!0),i.timer.start(),s.type==="TO_LIVE"&&s.payload.baselineTime?s.payload.baselineTime:Date.now())}),addEvent:Xe((i,s)=>{let{baselineTime:l,timer:a,events:c}=i;if(s.type==="ADD_EVENT"){let{event:d}=s.payload;Ir(d,l);let u=c.length-1;if(!c[u]||c[u].timestamp<=d.timestamp)c.push(d);else{let p=-1,g=0;for(;g<=u;){let b=Math.floor((g+u)/2);c[b].timestamp<=d.timestamp?g=b+1:u=b-1}p===-1&&(p=g),c.splice(p,0,d)}let h=d.timestamp<l,f=t(d,h);h?f():a.isActive()&&a.addAction({doAction:()=>{f()},delay:d.delay})}return Object.assign(Object.assign({},i),{events:c})})}});return Tr(o)}function Vi(e){let t=xr({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(n,r)=>{"payload"in r&&n.timer.setSpeed(r.payload.speed)},recordSpeed:Xe({normalSpeed:n=>n.timer.speed}),restoreSpeed:n=>{n.timer.setSpeed(n.normalSpeed)}}});return Tr(t)}var Hi=G(()=>{Ui();ye();wr()});var Gi,$i=G(()=>{Gi=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }"]});function Ar(e,t){let n=zi.get(e);return n||(n=new Map,zi.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function Ee(e,t,n){return r=>be(this,void 0,void 0,function*(){if(r&&typeof r=="object"&&"rr_type"in r)if(n&&(n.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){let o=yield Ee(e,t,n)(r.args);return yield createImageBitmap.apply(null,o)}else if("index"in r){if(n||t===null)return r;let{rr_type:o,index:i}=r;return Ar(t,o)[i]}else if("args"in r){let{rr_type:o,args:i}=r,s=window[o];return new s(...yield Promise.all(i.map(Ee(e,t,n))))}else{if("base64"in r)return To(r.base64);if("src"in r){let o=e.get(r.src);if(o)return o;{let i=new Image;return i.src=r.src,e.set(r.src,i),i}}else if("data"in r&&r.rr_type==="Blob"){let o=yield Promise.all(r.data.map(Ee(e,t,n)));return new Blob(o,{type:r.type})}}else if(Array.isArray(r))return yield Promise.all(r.map(Ee(e,t,n)));return r})}var zi,rn=G(()=>{Ze();Hn();zi=new Map});function Ml(e,t){try{return t===ve.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}function Dl(e,t){if(!t?.constructor)return;let{name:n}=t.constructor;if(!Ol.includes(n))return;let r=Ar(e,n);r.includes(t)||r.push(t)}function Ki({mutation:e,target:t,type:n,imageMap:r,errorHandler:o}){return be(this,void 0,void 0,function*(){try{let i=Ml(t,n);if(!i)return;if(e.setter){i[e.property]=e.args[0];return}let s=i[e.property],l=yield Promise.all(e.args.map(Ee(r,i))),a=s.apply(i,l);Dl(i,a);let c=!1}catch(i){o(e,i)}})}var Ol,ji=G(()=>{Ze();ye();rn();Ol=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"]});function Yi({event:e,mutation:t,target:n,imageMap:r,errorHandler:o}){return be(this,void 0,void 0,function*(){try{let i=n.getContext("2d");if(t.setter){i[t.property]=t.args[0];return}let s=i[t.property];if(t.property==="drawImage"&&typeof t.args[0]=="string")r.get(e),s.apply(i,t.args);else{let l=yield Promise.all(t.args.map(Ee(r,i)));s.apply(i,l)}}catch(i){o(t,i)}})}var Zi=G(()=>{Ze();rn()});function kr({event:e,mutation:t,target:n,imageMap:r,canvasEventMap:o,errorHandler:i}){return be(this,void 0,void 0,function*(){try{let s=o.get(e)||t,l="commands"in s?s.commands:[s];if([ve.WebGL,ve.WebGL2].includes(t.type)){for(let a=0;a<l.length;a++){let c=l[a];yield Ki({mutation:c,type:t.type,target:n,imageMap:r,errorHandler:i})}return}for(let a=0;a<l.length;a++){let c=l[a];yield Yi({event:e,mutation:c,target:n,imageMap:r,errorHandler:i})}}catch(s){i(t,s)}})}var Ji=G(()=>{Ze();ye();ji();Zi()});function qi(e){return e.type==_.IncrementalSnapshot&&(e.data.source==D.TouchMove||e.data.source==D.MouseInteraction&&e.data.type==re.TouchStart)}var Ll,_l,Fl,Nr,Rr,on,Xi=G(()=>{Ze();ke();oi();Cr();Cr();Mi();wr();Hi();ye();ge();$i();Ji();rn();Ll=10*1e3,_l=5*1e3,Fl=br||Sr,Nr="[replayer]",Rr={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};on=class{constructor(t,n){if(this.usingVirtualDom=!1,this.virtualDom=new Je,this.mouseTail=null,this.tailPositions=[],this.emitter=Fl(),this.legacy_missingNodeRetryMap={},this.cache=Mn(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=Mt(),this.styleMirror=new Ke,this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.lastSelectionData=null,this.constructedStyleMutations=[],this.adoptedStyleSheets=[],this.handleResize=l=>{this.iframe.style.display="inherit";for(let a of[this.mouseTail,this.iframe])a&&(a.setAttribute("width",String(l.width)),a.setAttribute("height",String(l.height)))},this.applyEventsSynchronously=l=>{for(let a of l){switch(a.type){case _.DomContentLoaded:case _.Load:case _.Custom:continue;case _.FullSnapshot:case _.Meta:case _.Plugin:case _.IncrementalSnapshot:break}this.getCastFn(a,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null},this.getCastFn=(l,a=!1)=>{let c;switch(l.type){case _.DomContentLoaded:case _.Load:break;case _.Custom:c=()=>{this.emitter.emit(Y.CustomEvent,l)};break;case _.Meta:c=()=>this.emitter.emit(Y.Resize,{width:l.data.width,height:l.data.height});break;case _.FullSnapshot:c=()=>{var u;if(this.firstFullSnapshot){if(this.firstFullSnapshot===l){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(l,a),(u=this.iframe.contentWindow)===null||u===void 0||u.scrollTo(l.data.initialOffset),this.styleMirror.reset()};break;case _.IncrementalSnapshot:c=()=>{if(this.applyIncremental(l,a),!a&&(l===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(let u of this.service.state.context.events)if(!(u.timestamp<=l.timestamp)&&this.isUserInteraction(u)){u.delay-l.delay>Ll*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=u);break}if(this.nextUserInteractionEvent){let u=this.nextUserInteractionEvent.delay-l.delay,h={speed:Math.min(Math.round(u/_l),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:h}),this.emitter.emit(Y.SkipStart,h)}}};break}return()=>{c&&c();for(let h of this.config.plugins||[])h.handler&&h.handler(l,a,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:l}});let u=this.service.state.context.events.length-1;if(l===this.service.state.context.events[u]){let h=()=>{u<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(Y.Finish))};l.type===_.IncrementalSnapshot&&l.data.source===D.MouseMove&&l.data.positions.length?setTimeout(()=>{h()},Math.max(0,-l.data.positions[0].timeOffset+50)):h()}this.emitter.emit(Y.EventCast,l)}},!n?.liveMode&&t.length<2)throw new Error("Replayer need at least 2 events.");let r={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:Rr,useVirtualDom:!0};this.config=Object.assign({},r,n),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(Y.Resize,this.handleResize),this.setupDom();for(let l of this.config.plugins||[])l.getMirror&&l.getMirror({nodeMirror:this.mirror});this.emitter.on(Y.Flush,()=>{if(this.usingVirtualDom){let l={mirror:this.mirror,applyCanvas:(a,c,d)=>{kr({event:a,mutation:c,target:d,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(a,c)=>{a.source===D.StyleSheetRule?this.applyStyleSheetRule(a,c):a.source===D.StyleDeclaration&&this.applyStyleDeclaration(a,c)}};if(this.iframe.contentDocument&&Ie(this.iframe.contentDocument,this.virtualDom,l,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(let a in this.legacy_missingNodeRetryMap)try{let c=this.legacy_missingNodeRetryMap[a],d=jt(c.node,this.mirror,this.virtualDom.mirror);Ie(d,c.node,l,this.virtualDom.mirror),c.node=d}catch(c){this.config.showWarning&&console.warn(c)}this.constructedStyleMutations.forEach(a=>{this.applyStyleSheetMutation(a)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(a=>{this.applyAdoptedStyleSheet(a)}),this.adoptedStyleSheets=[]}this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(Y.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset()});let o=new tn([],{speed:this.config.speed,liveMode:this.config.liveMode});this.service=Wi({events:t.map(l=>n&&n.unpackFn?n.unpackFn(l):l).sort((l,a)=>l.timestamp-a.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(l=>{this.emitter.emit(Y.StateChange,{player:l})}),this.speedService=Vi({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(Y.StateChange,{speed:l})});let i=this.service.state.context.events.find(l=>l.type===_.Meta),s=this.service.state.context.events.find(l=>l.type===_.FullSnapshot);if(i){let{width:l,height:a}=i.data;setTimeout(()=>{this.emitter.emit(Y.Resize,{width:l,height:a})},0)}s&&setTimeout(()=>{var l;this.firstFullSnapshot||(this.firstFullSnapshot=s,this.rebuildFullSnapshot(s),(l=this.iframe.contentWindow)===null||l===void 0||l.scrollTo(s.data.initialOffset))},1),this.service.state.context.events.find(qi)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,n){return this.emitter.on(t,n),this}off(t,n){return this.emitter.off(t,n),this}setConfig(t){Object.keys(t).forEach(n=>{t[n],this.config[n]=t[n]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){let t=this.service.state.context.events[0],n=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:n.timestamp,totalTime:n.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){let{baselineTime:t,events:n}=this.service.state.context;return t-n[0].timestamp}getMirror(){return this.mirror}play(t=0){var n,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(r=(n=this.iframe.contentDocument)===null||n===void 0?void 0:n.getElementsByTagName("html")[0])===null||r===void 0||r.classList.remove("rrweb-paused"),this.emitter.emit(Y.Start)}pause(t){var n,r;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(r=(n=this.iframe.contentDocument)===null||n===void 0?void 0:n.getElementsByTagName("html")[0])===null||r===void 0||r.classList.add("rrweb-paused"),this.emitter.emit(Y.Pause)}resume(t=0){console.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(Y.Resume)}destroy(){this.pause(),this.config.root.removeChild(this.wrapper),this.emitter.emit(Y.Destroy)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){let n=this.config.unpackFn?this.config.unpackFn(t):t;qi(n)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:n}}))}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=Mn()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");let t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(Ri(this.iframe.contentWindow,this.iframe.contentDocument),ft(this.iframe.contentWindow))}rebuildFullSnapshot(t,n=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};let r=[],o=(l,a)=>{this.collectIframeAndAttachDocument(r,l);for(let c of this.config.plugins||[])c.onBuild&&c.onBuild(l,{id:a,replayer:this})};io(t.data.node,{doc:this.iframe.contentDocument,afterAppend:o,cache:this.cache,mirror:this.mirror}),o(this.iframe.contentDocument,t.data.node.id);for(let{mutationInQueue:l,builtNode:a}of r)this.attachDocumentToIframe(l,a),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==l);let{documentElement:i,head:s}=this.iframe.contentDocument;this.insertStyleRules(i,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(Y.FullsnapshotRebuilded,t),n||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,n){var r;let o=Gi(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&o.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){let i=this.virtualDom.createElement("style");this.virtualDom.mirror.add(i,or(i,this.virtualDom.unserializedId)),t.insertBefore(i,n),i.rules.push({source:D.StyleSheetRule,adds:o.map((s,l)=>({rule:s,index:l}))})}else{let i=document.createElement("style");t.insertBefore(i,n);for(let s=0;s<o.length;s++)(r=i.sheet)===null||r===void 0||r.insertRule(o[s],s)}}attachDocumentToIframe(t,n){let r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[],i=(s,l)=>{this.collectIframeAndAttachDocument(o,s);let a=r.getMeta(s);if(a?.type===K.Element&&a?.tagName.toUpperCase()==="HTML"){let{documentElement:c,head:d}=n.contentDocument;this.insertStyleRules(c,d)}for(let c of this.config.plugins||[])c.onBuild&&c.onBuild(s,{id:l,replayer:this})};tt(t.node,{doc:n.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:i,cache:this.cache}),i(n.contentDocument,t.node.id);for(let{mutationInQueue:s,builtNode:l}of o)this.attachDocumentToIframe(s,l),this.newDocumentQueue=this.newDocumentQueue.filter(a=>a!==s)}collectIframeAndAttachDocument(t,n){if(Ne(n,this.mirror)){let r=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(n));r&&t.push({mutationInQueue:r,builtNode:n})}}waitForStylesheetLoad(){var t;let n=(t=this.iframe.contentDocument)===null||t===void 0?void 0:t.head;if(n){let r=new Set,o,i=this.service.state,s=()=>{i=this.service.state};this.emitter.on(Y.Start,s),this.emitter.on(Y.Pause,s);let l=()=>{this.emitter.off(Y.Start,s),this.emitter.off(Y.Pause,s)};n.querySelectorAll('link[rel="stylesheet"]').forEach(a=>{a.sheet||(r.add(a),a.addEventListener("load",()=>{r.delete(a),r.size===0&&o!==-1&&(i.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(Y.LoadStylesheetEnd),o&&clearTimeout(o),l())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(Y.LoadStylesheetStart),o=setTimeout(()=>{i.matches("playing")&&this.play(this.getCurrentTime()),o=-1,l()},this.config.loadTimeout))}}preloadAllImages(){return be(this,void 0,void 0,function*(){this.service.state;let t=()=>{this.service.state};this.emitter.on(Y.Start,t),this.emitter.on(Y.Pause,t);let n=[];for(let r of this.service.state.context.events)r.type===_.IncrementalSnapshot&&r.data.source===D.CanvasMutation&&(n.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(i=>{this.preloadImages(i,r)}));return Promise.all(n)})}preloadImages(t,n){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(n)){let r=document.createElement("canvas"),o=r.getContext("2d"),i=o?.createImageData(r.width,r.height);i?.data,JSON.parse(t.args[0]),o?.putImageData(i,0,0)}}deserializeAndPreloadCanvasEvents(t,n){return be(this,void 0,void 0,function*(){if(!this.canvasEventMap.has(n)){let r={isUnchanged:!0};if("commands"in t){let o=yield Promise.all(t.commands.map(i=>be(this,void 0,void 0,function*(){let s=yield Promise.all(i.args.map(Ee(this.imageMap,null,r)));return Object.assign(Object.assign({},i),{args:s})})));r.isUnchanged===!1&&this.canvasEventMap.set(n,Object.assign(Object.assign({},t),{commands:o}))}else{let o=yield Promise.all(t.args.map(Ee(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(n,Object.assign(Object.assign({},t),{args:o}))}}})}applyIncremental(t,n){var r,o,i;let{data:s}=t;switch(s.source){case D.Mutation:{try{this.applyMutation(s,n)}catch(l){this.warn(`Exception in mutation ${l.message||l}`,s)}break}case D.Drag:case D.TouchMove:case D.MouseMove:if(n){let l=s.positions[s.positions.length-1];this.mousePos={x:l.x,y:l.y,id:l.id,debugData:s}}else s.positions.forEach(l=>{let a={doAction:()=>{this.moveAndHover(l.x,l.y,l.id,n,s)},delay:l.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(a)}),this.timer.addAction({doAction(){},delay:t.delay-((r=s.positions[0])===null||r===void 0?void 0:r.timeOffset)});break;case D.MouseInteraction:{if(s.id===-1||n)break;let l=new Event(re[s.type].toLowerCase()),a=this.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);this.emitter.emit(Y.MouseInteraction,{type:s.type,target:a});let{triggerFocus:c}=this.config;switch(s.type){case re.Blur:"blur"in a&&a.blur();break;case re.Focus:c&&a.focus&&a.focus({preventScroll:!0});break;case re.Click:case re.TouchStart:case re.TouchEnd:n?(s.type===re.TouchStart?this.touchActive=!0:s.type===re.TouchEnd&&(this.touchActive=!1),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===re.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,n,s),s.type===re.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===re.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===re.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case re.TouchCancel:n?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:a.dispatchEvent(l)}break}case D.Scroll:{if(s.id===-1)break;if(this.usingVirtualDom){let l=this.virtualDom.mirror.getNode(s.id);if(!l)return this.debugNodeNotFound(s,s.id);l.scrollData=s;break}this.applyScroll(s,n);break}case D.ViewportResize:this.emitter.emit(Y.Resize,{width:s.width,height:s.height});break;case D.Input:{if(s.id===-1)break;if(this.usingVirtualDom){let l=this.virtualDom.mirror.getNode(s.id);if(!l)return this.debugNodeNotFound(s,s.id);l.inputData=s;break}this.applyInput(s);break}case D.MediaInteraction:{let l=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!l)return this.debugNodeNotFound(s,s.id);let a=l;try{s.currentTime&&(a.currentTime=s.currentTime),s.volume&&(a.volume=s.volume),s.muted&&(a.muted=s.muted),s.type===1&&a.pause(),s.type===0&&a.play(),s.type===4&&(a.playbackRate=s.playbackRate)}catch(c){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${c.message||c}`)}break}case D.StyleSheetRule:case D.StyleDeclaration:{this.usingVirtualDom?s.styleId?this.constructedStyleMutations.push(s):s.id&&((o=this.virtualDom.mirror.getNode(s.id))===null||o===void 0||o.rules.push(s)):this.applyStyleSheetMutation(s);break}case D.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){let l=this.virtualDom.mirror.getNode(s.id);if(!l)return this.debugNodeNotFound(s,s.id);l.canvasMutations.push({event:t,mutation:s})}else{let l=this.mirror.getNode(s.id);if(!l)return this.debugNodeNotFound(s,s.id);kr({event:t,mutation:s,target:l,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case D.Font:{try{let l=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);(i=this.iframe.contentDocument)===null||i===void 0||i.fonts.add(l)}catch(l){this.config.showWarning&&console.warn(l)}break}case D.Selection:{if(n){this.lastSelectionData=s;break}this.applySelection(s);break}case D.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(s):this.applyAdoptedStyleSheet(s);break}}}applyMutation(t,n){if(this.config.useVirtualDom&&!this.usingVirtualDom&&n&&(this.usingVirtualDom=!0,ri(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(let c in this.legacy_missingNodeRetryMap)try{let d=this.legacy_missingNodeRetryMap[c],u=rr(d.node,this.virtualDom,this.mirror);u&&(d.node=u)}catch(d){this.config.showWarning&&console.warn(d)}let r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(c=>{var d;let u=r.getNode(c.id);if(!u)return t.removes.find(f=>f.id===c.parentId)?void 0:this.warnNodeNotFound(t,c.id);let h=r.getNode(c.parentId);if(!h)return this.warnNodeNotFound(t,c.parentId);if(c.isShadow&&xe(h)&&(h=h.shadowRoot),r.removeNodeFromMap(u),h)try{h.removeChild(u),this.usingVirtualDom&&u.nodeName==="#text"&&h.nodeName==="STYLE"&&((d=h.rules)===null||d===void 0?void 0:d.length)>0&&(h.rules=[])}catch(f){if(f instanceof DOMException)this.warn("parent could not remove child in mutation",h,u,t);else throw f}});let o=Object.assign({},this.legacy_missingNodeRetryMap),i=[],s=c=>{let d=null;return c.nextId&&(d=r.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!d},l=c=>{var d;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let u=r.getNode(c.parentId);if(!u)return c.node.type===K.Document?this.newDocumentQueue.push(c):i.push(c);c.node.isShadow&&(xe(u)||u.attachShadow({mode:"open"}),u=u.shadowRoot);let h=null,f=null;if(c.previousId&&(h=r.getNode(c.previousId)),c.nextId&&(f=r.getNode(c.nextId)),s(c))return i.push(c);if(c.node.rootId&&!r.getNode(c.node.rootId))return;let p=c.node.rootId?r.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ne(u,r)){this.attachDocumentToIframe(c,u);return}let g=(v,y)=>{for(let E of this.config.plugins||[])E.onBuild&&E.onBuild(v,{id:y,replayer:this})},b=tt(c.node,{doc:p,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:g});if(c.previousId===-1||c.nextId===-1){o[c.node.id]={node:b,mutation:c};return}let m=r.getMeta(u);if(m&&m.type===K.Element&&m.tagName==="textarea"&&c.node.type===K.Text){let v=Array.isArray(u.childNodes)?u.childNodes:Array.from(u.childNodes);for(let y of v)y.nodeType===u.TEXT_NODE&&u.removeChild(y)}if(h&&h.nextSibling&&h.nextSibling.parentNode)u.insertBefore(b,h.nextSibling);else if(f&&f.parentNode)u.contains(f)?u.insertBefore(b,f):u.insertBefore(b,null);else{if(u===p)for(;p.firstChild;)p.removeChild(p.firstChild);u.appendChild(b)}if(g(b,c.node.id),this.usingVirtualDom&&b.nodeName==="#text"&&u.nodeName==="STYLE"&&((d=u.rules)===null||d===void 0?void 0:d.length)>0&&(u.rules=[]),Ne(b,this.mirror)){let v=this.mirror.getId(b),y=this.newDocumentQueue.find(E=>E.parentId===v);y&&(this.attachDocumentToIframe(y,b),this.newDocumentQueue=this.newDocumentQueue.filter(E=>E!==y))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(o,u,b,c)};t.adds.forEach(c=>{l(c)});let a=Date.now();for(;i.length;){let c=Dn(i);if(i.length=0,Date.now()-a>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(let d of c)r.getNode(d.value.parentId)?Lt(d,h=>{l(h)}):this.debug("Drop resolve tree since there is no parent for the root node.",d)}Object.keys(o).length&&Object.assign(this.legacy_missingNodeRetryMap,o),Ln(t.texts).forEach(c=>{var d;let u=r.getNode(c.id);if(!u)return t.removes.find(h=>h.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);if(u.textContent=c.value,this.usingVirtualDom){let h=u.parentNode;((d=h?.rules)===null||d===void 0?void 0:d.length)>0&&(h.rules=[])}}),t.attributes.forEach(c=>{let d=r.getNode(c.id);if(!d)return t.removes.find(u=>u.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);for(let u in c.attributes)if(typeof u=="string"){let h=c.attributes[u];if(h===null)d.removeAttribute(u);else if(typeof h=="string")try{if(u==="_cssText"&&(d.nodeName==="LINK"||d.nodeName==="STYLE"))try{let f=r.getMeta(d);Object.assign(f.attributes,c.attributes);let p=tt(f,{doc:d.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache}),g=d.nextSibling,b=d.parentNode;if(p&&b){b.removeChild(d),b.insertBefore(p,g),r.replace(c.id,p);break}}catch{}d.setAttribute(u,h)}catch(f){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",f)}else if(u==="style"){let f=h,p=d;for(let g in f)if(f[g]===!1)p.style.removeProperty(g);else if(f[g]instanceof Array){let b=f[g];p.style.setProperty(g,b[0],b[1])}else{let b=f[g];p.style.setProperty(g,b)}}}})}applyScroll(t,n){var r,o;let i=this.mirror.getNode(t.id);if(!i)return this.debugNodeNotFound(t,t.id);let s=this.mirror.getMeta(i);if(i===this.iframe.contentDocument)(r=this.iframe.contentWindow)===null||r===void 0||r.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"});else if(s?.type===K.Document)(o=i.defaultView)===null||o===void 0||o.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"});else try{i.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"})}catch{}}applyInput(t){let n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);try{n.checked=t.isChecked,n.value=t.text}catch{}}applySelection(t){try{let n=new Set,r=t.ranges.map(({start:o,startOffset:i,end:s,endOffset:l})=>{let a=this.mirror.getNode(o),c=this.mirror.getNode(s);if(!a||!c)return;let d=new Range;d.setStart(a,i),d.setEnd(c,l);let u=a.ownerDocument,h=u?.getSelection();return h&&n.add(h),{range:d,selection:h}});n.forEach(o=>o.removeAllRanges()),r.forEach(o=>{var i;return o&&((i=o.selection)===null||i===void 0?void 0:i.addRange(o.range))})}catch{}}applyStyleSheetMutation(t){var n;let r=null;t.styleId?r=this.styleMirror.getStyle(t.styleId):t.id&&(r=((n=this.mirror.getNode(t.id))===null||n===void 0?void 0:n.sheet)||null),r&&(t.source===D.StyleSheetRule?this.applyStyleSheetRule(t,r):t.source===D.StyleDeclaration&&this.applyStyleDeclaration(t,r))}applyStyleSheetRule(t,n){var r,o,i,s;if((r=t.adds)===null||r===void 0||r.forEach(({rule:l,index:a})=>{try{if(Array.isArray(a)){let{positions:c,index:d}=Ft(a);Ye(n.cssRules,c).insertRule(l,d)}else{let c=a===void 0?void 0:Math.min(a,n.cssRules.length);n?.insertRule(l,c)}}catch{}}),(o=t.removes)===null||o===void 0||o.forEach(({index:l})=>{try{if(Array.isArray(l)){let{positions:a,index:c}=Ft(l);Ye(n.cssRules,a).deleteRule(c||0)}else n?.deleteRule(l)}catch{}}),t.replace)try{(i=n.replace)===null||i===void 0||i.call(n,t.replace)}catch{}if(t.replaceSync)try{(s=n.replaceSync)===null||s===void 0||s.call(n,t.replaceSync)}catch{}}applyStyleDeclaration(t,n){t.set&&Ye(n.rules,t.index).style.setProperty(t.set.property,t.set.value,t.set.priority),t.remove&&Ye(n.rules,t.index).style.removeProperty(t.remove.property)}applyAdoptedStyleSheet(t){var n;let r=this.mirror.getNode(t.id);if(!r)return;(n=t.styles)===null||n===void 0||n.forEach(l=>{var a;let c=null,d=null;if(xe(r)?d=((a=r.ownerDocument)===null||a===void 0?void 0:a.defaultView)||null:r.nodeName==="#document"&&(d=r.defaultView),!!d)try{c=new d.CSSStyleSheet,this.styleMirror.add(c,l.styleId),this.applyStyleSheetRule({source:D.StyleSheetRule,adds:l.rules},c)}catch{}});let o=10,i=0,s=(l,a)=>{let c=a.map(d=>this.styleMirror.getStyle(d)).filter(d=>d!==null);xe(l)?l.shadowRoot.adoptedStyleSheets=c:l.nodeName==="#document"&&(l.adoptedStyleSheets=c),c.length!==a.length&&i<o&&(setTimeout(()=>s(l,a),0+100*i),i++)};s(r,t.styleIds)}legacy_resolveMissingNode(t,n,r,o){let{previousId:i,nextId:s}=o,l=i&&t[i],a=s&&t[s];if(l){let{node:c,mutation:d}=l;n.insertBefore(c,r),delete t[d.node.id],delete this.legacy_missingNodeRetryMap[d.node.id],(d.previousId||d.nextId)&&this.legacy_resolveMissingNode(t,n,c,d)}if(a){let{node:c,mutation:d}=a;n.insertBefore(c,r.nextSibling),delete t[d.node.id],delete this.legacy_missingNodeRetryMap[d.node.id],(d.previousId||d.nextId)&&this.legacy_resolveMissingNode(t,n,c,d)}}moveAndHover(t,n,r,o,i){let s=this.mirror.getNode(r);if(!s)return this.debugNodeNotFound(i,r);let l=_t(s,this.iframe),a=t*l.absoluteScale+l.x,c=n*l.absoluteScale+l.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${c}px`,o||this.drawMouseTail({x:a,y:c}),this.hoverElements(s)}drawMouseTail(t){if(!this.mouseTail)return;let{lineCap:n,lineWidth:r,strokeStyle:o,duration:i}=this.config.mouseTail===!0?Rr:Object.assign({},Rr,this.config.mouseTail),s=()=>{if(!this.mouseTail)return;let l=this.mouseTail.getContext("2d");!l||!this.tailPositions.length||(l.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),l.beginPath(),l.lineWidth=r,l.lineCap=n,l.strokeStyle=o,l.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(a=>l.lineTo(a.x,a.y)),l.stroke())};this.tailPositions.push(t),s(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(l=>l!==t),s()},i/this.speedService.state.context.timer.speed)}hoverElements(t){var n;(n=this.iframe.contentDocument)===null||n===void 0||n.querySelectorAll(".\\:hover").forEach(o=>{o.classList.remove(":hover")});let r=t;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(t){return t.type!==_.IncrementalSnapshot?!1:t.data.source>D.Mutation&&t.data.source<=D.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(Y.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,n){this.warn(`Node with id '${n}' not found. `,t)}warnCanvasMutationFailed(t,n){this.warn("Has error on canvas update",n,"canvas mutation:",t)}debugNodeNotFound(t,n){this.debug(Nr,`Node with id '${n}' not found. `,t)}warn(...t){this.config.showWarning&&console.warn(Nr,...t)}debug(...t){this.config.showDebug&&console.log(Nr,...t)}}});var Qi={};kt(Qi,{EventType:()=>_,IncrementalSource:()=>D,MouseInteractions:()=>re,PLUGIN_NAME:()=>wt,Replayer:()=>on,ReplayerEvents:()=>Y,addCustomEvent:()=>ii,freezePage:()=>si,getRecordConsolePlugin:()=>Ai,getReplayConsolePlugin:()=>ki,mirror:()=>ct,pack:()=>yi,record:()=>Re,unpack:()=>Si,utils:()=>_n});var es=G(()=>{ai();bi();Ci();vr();Ni();Yn();ye();Xi();ge();ge()});var Pc={};kt(Pc,{BOWTIE_STAGES:()=>hn,holostaff:()=>Bc});var gn="holostaff_did",Nt="holostaff_did",yn="holostaff_huid";function Ks(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function We(){return typeof window<"u"&&typeof document<"u"}function js(e){if(!We())return null;let t=document.cookie?document.cookie.split("; "):[];for(let n of t){let r=n.indexOf("=");if(!(r<0)&&n.slice(0,r)===e)return decodeURIComponent(n.slice(r+1))}return null}function $r(e,t){if(!We())return;let n=window.location.protocol==="https:"?"; Secure":"";document.cookie=`${e}=${encodeURIComponent(t)}; Max-Age=31536000; Path=/; SameSite=Lax${n}`}function Ys(e){if(!We())return null;try{return window.localStorage.getItem(e)}catch{return null}}function vn(e,t){if(We())try{window.localStorage.setItem(e,t)}catch{}}function Zs(e){if(!We())return null;try{return window.sessionStorage.getItem(e)}catch{return null}}function Js(e,t){if(We())try{window.sessionStorage.setItem(e,t)}catch{}}function qs(e){if(We())try{window.sessionStorage.removeItem(e)}catch{}}function zr(){let e=js(gn),t=Ys(Nt);if(e&&t)return e!==t&&vn(Nt,e),e;if(e)return vn(Nt,e),e;if(t)return $r(gn,t),t;let n=Ks();return $r(gn,n),vn(Nt,n),n}function bn(){return Zs(yn)}function Kr(e){Js(yn,e)}function jr(){qs(yn)}var Xs="https://holostaff-vision-1008066443043.us-central1.run.app";function Yr(e){return{baseUrl:e.baseUrl??Xs,apiKey:e.apiKey,onError:e.onError}}function Zr(e){let t={"content-type":"application/json"};return e.apiKey&&(t.authorization=`Bearer ${e.apiKey}`),t}async function fe(e,t,n){try{let r=await fetch(`${e.baseUrl}${t}`,{method:"POST",headers:Zr(e),body:JSON.stringify(n),credentials:"omit",mode:"cors"});if(!r.ok){let o=await r.text().catch(()=>"");return e.onError?.(new Error(`HTTP ${r.status} ${r.statusText}${o?` \u2014 ${o}`:""}`),{method:"POST",path:t}),!1}return!0}catch(r){return e.onError?.(r instanceof Error?r:new Error(String(r)),{method:"POST",path:t}),!1}}async function Le(e,t,n){try{let r=await fetch(`${e.baseUrl}${t}`,{method:"POST",headers:Zr(e),body:JSON.stringify(n),credentials:"omit",mode:"cors"});if(!r.ok){let o=await r.text().catch(()=>"");return e.onError?.(new Error(`HTTP ${r.status} ${r.statusText}${o?` \u2014 ${o}`:""}`),{method:"POST",path:t}),null}return await r.json()}catch(r){return e.onError?.(r instanceof Error?r:new Error(String(r)),{method:"POST",path:t}),null}}function Ve(e,t,n){let r=`${e.baseUrl}${t}`,o=JSON.stringify(n);if(typeof navigator<"u"&&typeof navigator.sendBeacon=="function")try{let i=new Blob([o],{type:"text/plain"});return navigator.sendBeacon(r,i)}catch(i){return e.onError?.(i instanceof Error?i:new Error(String(i)),{method:"BEACON",path:t}),!1}try{return fetch(r,{method:"POST",headers:{"content-type":"text/plain"},body:o,keepalive:!0,credentials:"omit",mode:"cors"}),!0}catch(i){return e.onError?.(i instanceof Error?i:new Error(String(i)),{method:"BEACON",path:t}),!1}}function Sn(e,t,n,r){if(typeof EventSource>"u")return null;let o=new URLSearchParams({tenantId:n,sourceId:r}),i=`${e.baseUrl}/api/runtime/sessions/${encodeURIComponent(t)}/commands?${o}`;try{return new EventSource(i)}catch(s){return e.onError?.(s instanceof Error?s:new Error(String(s)),{method:"SSE",path:`/api/runtime/sessions/${t}/commands`}),null}}function Qs(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function Cn(){return`ses_${Date.now().toString(36)}_${Qs().slice(0,8)}`}function Jr(e,t){if(typeof window>"u")return{dispose:()=>{}};let n=!1,r=()=>{n||(n=!0,e())},o=()=>r(),i=()=>{document.visibilityState==="hidden"&&(t?.suppressOnHidden?.()||r())};return window.addEventListener("pagehide",o),document.addEventListener("visibilitychange",i),{dispose:()=>{window.removeEventListener("pagehide",o),document.removeEventListener("visibilitychange",i)}}}var ea=3e4,ta=80;function In(e){if(typeof window>"u")return{dispose:()=>{}};let t=null,n=new Date().toISOString(),r=null,o=null,i=!1,s=()=>{try{return window.location.pathname+window.location.search}catch{return"/"}},l=y=>{i||fe(e.cfg,`/api/runtime/sessions/${e.sessionId}/fastpath`,{...e.buildBody(),route:y,lastActivityAt:n})},a=()=>{r=null;let y=s();y!==t&&(t=y,l(y))},c=()=>{r||(r=setTimeout(a,ta))},d=()=>{n=new Date().toISOString()},u=()=>{c()},h=()=>{c()},f=window.history.pushState,p=window.history.replaceState,g=function(...y){let E=f.apply(window.history,y);return c(),E},b=function(...y){let E=p.apply(window.history,y);return c(),E};window.history.pushState=g,window.history.replaceState=b;let m={passive:!0};window.addEventListener("mousemove",d,m),window.addEventListener("scroll",d,m),window.addEventListener("keydown",d,m),window.addEventListener("touchstart",d,m),window.addEventListener("popstate",u),window.addEventListener("hashchange",h);let v=s();return t=v,l(v),o=setInterval(()=>{i||l(s())},ea),{dispose(){i||(i=!0,window.removeEventListener("mousemove",d),window.removeEventListener("scroll",d),window.removeEventListener("keydown",d),window.removeEventListener("touchstart",d),window.removeEventListener("popstate",u),window.removeEventListener("hashchange",h),window.history.pushState===g&&(window.history.pushState=f),window.history.replaceState===b&&(window.history.replaceState=p),o!=null&&(clearInterval(o),o=null),r!=null&&(clearTimeout(r),r=null))}}}var Bl=5e3,Pl=200,Ul=8e5,Wl=55e3,Vl=3e4,Hl=800,Gl=3e6,$l=15e3,zl=2;function Mr(e){if(typeof window>"u")return{dispose:()=>{}};if(e.observe?.enabled===!1)return{dispose:()=>{}};let t=!1,n=!1,r=null,o=[],i=0,s=[],l=0,a=null,c=null,d=`/api/runtime/sessions/${e.sessionId}/observations`,u=`/api/runtime/sessions/${e.sessionId}/heartbeat`,f=typeof navigator<"u"&&navigator.webdriver===!0?{automated:!0}:{},p=()=>{if(!o.length)return;let R=o;o=[],i=0,fe(e.cfg,d,{...e.buildBody(),...f,events:R})},g=()=>{if(!o.length)return;let R=o;for(o=[],i=0;R.length>1&&JSON.stringify(R).length>Wl;)R=R.slice(Math.ceil(R.length/2));Ve(e.cfg,d,{...e.buildBody(),...f,events:R})},b=R=>{try{return JSON.stringify(R).length}catch{return 1e3}},m=()=>{let R=-1;for(let I=s.length-1;I>=0;I--)if(s[I].type===zl){R=I;break}R>0&&(s=s.slice(R)),l=s.reduce((I,w)=>I+b(w),0)},v=R=>{if(!t){if(!n){s.push(R),l+=b(R),(s.length>Hl||l>Gl)&&m();return}o.push(R),i+=b(R),(o.length>=Pl||i>=Ul)&&p()}},y=()=>{a==null&&(a=setInterval(p,Bl))},E=()=>{a!=null&&(clearInterval(a),a=null)},N=()=>{c==null&&(c=setInterval(()=>{typeof document<"u"&&document.hidden||fe(e.cfg,u,{...e.buildBody(),...f})},$l))},k=()=>{c!=null&&(clearInterval(c),c=null)},O=["pointerdown","pointermove","keydown","wheel","scroll","touchstart"],A={passive:!0,capture:!0},$=()=>{n||t||(n=!0,U(),o=s,i=l,s=[],l=0,p(),y(),N())},V=R=>{R.isTrusted&&$()},F=()=>{for(let R of O)window.addEventListener(R,V,A)},U=()=>{for(let R of O)window.removeEventListener(R,V,A)},W=()=>{n&&(document.hidden?(p(),E(),k()):(y(),N()))};return typeof document<"u"&&document.addEventListener("visibilitychange",W),F(),e.evalMode&&$(),Promise.resolve().then(()=>(es(),Qi)).then(R=>{if(t)return;let I=R.record;if(typeof I!="function"){e.cfg.onError?.(new Error("rrweb.record unavailable"),{method:"OBSERVE",path:d});return}r=I({emit:w=>v(w),checkoutEveryNms:Vl,recordCanvas:!0,sampling:{canvas:2},inlineImages:!0,collectFonts:!0,maskInputOptions:{password:!0,email:!0,tel:!0},maskAllInputs:e.observe?.maskAllInputs??!1,maskTextClass:"holostaff-mask",blockClass:"holostaff-block",ignoreClass:"holostaff-ignore",...e.observe?.blockSelector?{blockSelector:e.observe.blockSelector}:{},...e.observe?.rrweb??{}})??null}).catch(R=>{e.cfg.onError?.(R instanceof Error?R:new Error(String(R)),{method:"OBSERVE",path:d})}),{dispose(){if(!t){t=!0,E(),k(),U(),typeof document<"u"&&document.removeEventListener("visibilitychange",W);try{r?.()}catch{}r=null,n&&g()}}}}function Kl(){return document.querySelector("script[nonce]")?.nonce??""}function ns(e){let t=document.createElement("style"),n=Kl();return n&&(t.nonce=n),t.textContent=e,t}function Et(e,t){try{let n=new CSSStyleSheet;n.replaceSync(t),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n];return}catch{}e.appendChild(ns(t))}var ts=new Map;function it(e,t){try{let r=ts.get(e);r||(r=new CSSStyleSheet,ts.set(e,r),document.adoptedStyleSheets=[...document.adoptedStyleSheets,r]),r.replaceSync(t);return}catch{}let n=document.getElementById(e);if(!n){n=ns(t),n.id=e,document.head.appendChild(n);return}n.textContent=t}var rs=56,os="holostaff-presence-root",sn=220,jl=12e4,Yl=45e3;function as(e){if(typeof window>"u"||typeof document>"u")return ql();let t=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,n=Zl(e),r=n.shadowRoot;Et(r,Xl(e));let o=document.createElement("div");o.className="wrap";let i=document.createElement("button");i.className="chip",i.setAttribute("data-holostaff","chip"),i.type="button",i.setAttribute("aria-label","Copilot"),i.style.display="none";let s=document.createElement("div");s.className="frame";let l=is("idle"),a=is("gesture"),c=document.createElement("img");c.className="poster",c.alt="",c.referrerPolicy="no-referrer";let d=document.createElement("div");d.className="mono",s.append(c,l,a,d),i.appendChild(s);let u=document.createElement("div");u.className="tag";let h=document.createElement("div");h.className="tag-name";let f=document.createElement("div");f.className="tag-scope",u.append(h,f),o.append(i,u),r.appendChild(o);let p=null,g=null,b=null,m=!1,v=!1,y=()=>e.dock.endsWith("right")?"glanceL":"glanceR",E=(F,U)=>{let W=F.portrait??{},R=W.poster??F.avatar??"",I=U?.light?.primary||U?.dark?.primary||"";I&&s.style.setProperty("--accent",I),d.textContent=(F.name.trim()[0]??"?").toUpperCase(),!t&&!!(W.idle||W.idleMp4)?(ss(l,W.idle,W.idleMp4),R&&(l.poster=R),l.style.display="block",c.style.display="none",d.style.display="none",l.play().catch(()=>{})):R?(c.src=R,c.style.display="block",l.style.display="none",d.style.display="none"):(d.style.display="flex",l.style.display="none",c.style.display="none")},N=F=>{if(m||t||document.hidden)return;let U=p?.portrait?.gestures?.[F];if(!U)return;ss(a,U,void 0),a.classList.add("show"),a.play().catch(()=>{}),b&&clearTimeout(b);let W=()=>{a.classList.remove("show")};a.onended=W,b=setTimeout(W,4e3)},k=()=>{g&&clearTimeout(g);let F=jl+Math.random()*Yl;g=setTimeout(()=>{!m&&!document.hidden&&!t&&p&&N(y()),k()},F)},O=()=>{v||o.classList.add("open"),N("meet")},A=()=>{o.classList.remove("open")};i.addEventListener("mouseenter",O),i.addEventListener("mouseleave",A),i.addEventListener("focus",O),i.addEventListener("blur",A),i.addEventListener("click",()=>{p&&e.onActivate?.(p)});let $=()=>{document.hidden?l.pause():p&&!t&&(p.portrait?.idle||p.portrait?.idleMp4)&&l.play().catch(()=>{})};return document.addEventListener("visibilitychange",$),{setCopilot:(F,U)=>{if(m)return;if(!F){p=null,i.classList.add("leaving"),setTimeout(()=>{p||(i.style.display="none")},t?0:sn),g&&(clearTimeout(g),g=null);return}let W=p?.copilotId!==F.copilotId;p=F,h.textContent=`${F.name} \xB7 ${F.roleLine}`,f.textContent=F.scopeLine,i.setAttribute("aria-label",`${F.name}, ${F.roleLine}. ${F.scopeLine}`),i.style.display="block",i.classList.remove("leaving"),W&&!t&&(i.classList.add("swap"),requestAnimationFrame(()=>requestAnimationFrame(()=>i.classList.remove("swap")))),E(F,U),k()},playGesture:N,getAnchorRect:()=>i.style.display==="none"?null:i.getBoundingClientRect(),innerGlance:y,getCopilot:()=>p,setTagSuppressed(F){v=F,F&&o.classList.remove("open")},destroy(){m=!0,g&&clearTimeout(g),b&&clearTimeout(b),document.removeEventListener("visibilitychange",$);try{n.remove()}catch{}}}}function is(e){let t=document.createElement("video");return t.className=e,t.muted=!0,t.loop=e==="idle",t.autoplay=e==="idle",t.playsInline=!0,t.setAttribute("playsinline",""),t.setAttribute("aria-hidden","true"),t.preload="auto",t}function ss(e,t,n){for(;e.firstChild;)e.removeChild(e.firstChild);if(t){let r=document.createElement("source");r.src=t,r.type=t.endsWith(".mp4")?"video/mp4":"video/webm",e.appendChild(r)}if(n&&n!==t){let r=document.createElement("source");r.src=n,r.type="video/mp4",e.appendChild(r)}e.load()}function Zl(e){let t=document.getElementById(os);if(t)return t;t=document.createElement("div"),t.id=os,t.setAttribute("data-holostaff","chip-host");let[n,r]=e.dock.split("-"),o=`${e.offset}px`;return t.style.cssText=["position:fixed",`${n}:${Jl(e,o)}`,`${r}:${o}`,"z-index:2147483646","pointer-events:none"].join(";"),t.attachShadow({mode:"open"}),document.body.appendChild(t),t}function Jl(e,t){let n=["#intercom-container",".intercom-lightweight-app","#launcher","#drift-widget",".drift-frame-controller","#crisp-chatbox","#hubspot-messages-iframe-container"];try{if(n.some(o=>document.querySelector(o)))return console.info("[holostaff] presence: chat widget detected in the dock corner; offsetting the copilot above it. Set init({ presence: { dock } }) to choose a corner."),`calc(${t} + 76px)`}catch{}return t}function ql(){return{setCopilot:()=>{},playGesture:()=>{},getAnchorRect:()=>null,innerGlance:()=>"glanceL",getCopilot:()=>null,setTagSuppressed:()=>{},destroy:()=>{}}}function Xl(e){let t=e.dock.endsWith("right");return`
|
|
15
|
+
End of stack for Error object`:a.name+": "+a.message}return a});function i(l){return!!(gr(l)&&Object.keys(l).length>n.numOfKeysLimit||typeof l=="function"||gr(l)&&Ei(l,n.depthOfLimit))}function s(l){let a=l.toString();return n.stringLengthLimit&&a.length>n.stringLengthLimit&&(a=`${a.slice(0,n.stringLengthLimit)}...`),a}}var xi=G(()=>{});function kl(e,t,n){let r=n?Object.assign({},Ti,n):Ti,o=r.logger;if(!o)return()=>{};let i;typeof o=="string"?i=t[o]:i=o;let s=0,l=[];if(r.level.includes("error")&&window){let c=d=>{let u=d.message,h=d.error,f=mr.parse(h).map(m=>m.toString()),p=[Qt(u,r.stringifyOptions)];e({level:"error",trace:f,payload:p})};window.addEventListener("error",c),l.push(()=>{window&&window.removeEventListener("error",c)})}for(let c of r.level)l.push(a(i,c));return()=>{l.forEach(c=>c())};function a(c,d){return c[d]?me(c,d,u=>(...h)=>{u.apply(this,h);try{let f=mr.parse(new Error).map(m=>m.toString()).splice(1),p=h.map(m=>Qt(m,r.stringifyOptions));s++,s<r.lengthThreshold?e({level:d,trace:f,payload:p}):s===r.lengthThreshold&&e({level:"warn",trace:[],payload:[Qt("The number of log records reached the threshold.")]})}catch(f){u("rrweb logger error:",f,...h)}}):()=>{}}}var Ti,wt,Ai,vr=G(()=>{ge();wi();xi();Ti={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};wt="rrweb/console@1",Ai=e=>({name:wt,observer:kl,options:e})});var en,Nl,yr,ki,Ni=G(()=>{vr();ye();en="__rrweb_original__",Nl={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0},yr=class{constructor(t){this.config=Object.assign(Nl,t)}getConsoleLogger(){let t={};for(let n of this.config.level)n==="trace"?t[n]=r=>{(console.log[en]?console.log[en]:console.log)(...r.payload.map(i=>JSON.parse(i)),this.formatMessage(r))}:t[n]=r=>{(console[n][en]?console[n][en]:console[n])(...r.payload.map(i=>JSON.parse(i)),this.formatMessage(r))};return t}formatMessage(t){if(t.trace.length===0)return"";let n=`
|
|
16
|
+
at `,r=n;return r+=t.trace.join(n),r}},ki=e=>{let t=e?.replayLogger||new yr(e).getConsoleLogger();return{handler(n,r,o){let i=null;if(n.type===_.IncrementalSnapshot&&n.data.source===D.Log?i=n.data:n.type===_.Plugin&&n.data.plugin===wt&&(i=n.data.payload),i)try{typeof t[i.level]=="function"&&t[i.level](i)}catch(s){o.replayer.config.showWarning&&console.warn(s)}}}}});var Sr={};kt(Sr,{default:()=>br});function br(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(o){o(n)}),(r=e.get("*"))&&r.slice().map(function(o){o(t,n)})}}}var Cr=G(()=>{});function Ri(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;let n=e.HTMLElement||e.Element,r=468,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||a,scrollIntoView:n.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function s(g){let v=["MSIE ","Trident/","Edge/"];return new RegExp(v.join("|")).test(g)}let l=s(e.navigator.userAgent)?1:0;function a(g,v){this.scrollLeft=g,this.scrollTop=v}function c(g){return .5*(1-Math.cos(Math.PI*g))}function d(g){if(g===null||typeof g!="object"||g.behavior===void 0||g.behavior==="auto"||g.behavior==="instant")return!0;if(typeof g=="object"&&g.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+g.behavior+" is not a valid value for enumeration ScrollBehavior.")}function u(g,v){if(v==="Y")return g.clientHeight+l<g.scrollHeight;if(v==="X")return g.clientWidth+l<g.scrollWidth}function h(g,v){let y=e.getComputedStyle(g,null)["overflow"+v];return y==="auto"||y==="scroll"}function f(g){let v=u(g,"Y")&&h(g,"Y"),y=u(g,"X")&&h(g,"X");return v||y}function p(g){for(;g!==t.body&&f(g)===!1;)g=g.parentNode||g.host;return g}function m(g){let v=i(),y,E,N,k=(v-g.startTime)/r;k=k>1?1:k,y=c(k),E=g.startX+(g.x-g.startX)*y,N=g.startY+(g.y-g.startY)*y,g.method.call(g.scrollable,E,N),(E!==g.x||N!==g.y)&&e.requestAnimationFrame(m.bind(e,g))}function b(g,v,y){let E,N,k,O,A=i();g===t.body?(E=e,N=e.scrollX||e.pageXOffset,k=e.scrollY||e.pageYOffset,O=o.scroll):(E=g,N=g.scrollLeft,k=g.scrollTop,O=a),m({scrollable:E,method:O,startTime:A,startX:N,startY:k,x:v,y})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(d(arguments[0])===!0){o.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}b.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(d(arguments[0])){o.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}b.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(arguments[0]===void 0)return;if(d(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}let g=arguments[0].left,v=arguments[0].top;b.call(this,this,typeof g>"u"?this.scrollLeft:~~g,typeof v>"u"?this.scrollTop:~~v)},n.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(d(arguments[0])===!0){o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},n.prototype.scrollIntoView=function(){if(d(arguments[0])===!0){o.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}let g=p(this),v=g.getBoundingClientRect(),y=this.getBoundingClientRect();g!==t.body?(b.call(this,g,g.scrollLeft+y.left-v.left,g.scrollTop+y.top-v.top),e.getComputedStyle(g).position!=="fixed"&&e.scrollBy({left:v.left,top:v.top,behavior:"smooth"})):e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})}}var Mi=G(()=>{});function Ir(e,t){if(e.type===_.IncrementalSnapshot&&e.data.source===D.MouseMove&&e.data.positions&&e.data.positions.length){let n=e.data.positions[0].timeOffset,r=e.timestamp+n;return e.delay=r-t,r-t}return e.delay=e.timestamp-t,e.delay}var tn,wr=G(()=>{ye();tn=class{constructor(t=[],n){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=n.speed,this.liveMode=n.liveMode}addAction(t){if(!this.actions.length||this.actions[this.actions.length-1].delay<=t.delay){this.actions.push(t);return}let n=this.findActionIndex(t);this.actions.splice(n,0,t)}start(){this.timeOffset=0;let t=performance.now(),n=()=>{let r=performance.now();for(this.timeOffset+=(r-t)*this.speed,t=r;this.actions.length;){let o=this.actions[0];if(this.timeOffset>=o.delay)this.actions.shift(),o.doAction();else break}(this.actions.length>0||this.liveMode)&&(this.raf=requestAnimationFrame(n))};this.raf=requestAnimationFrame(n)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}toggleLiveMode(t){this.liveMode=t}isActive(){return this.raf!==null}findActionIndex(t){let n=0,r=this.actions.length-1;for(;n<=r;){let o=Math.floor((n+r)/2);if(this.actions[o].delay<t.delay)n=o+1;else if(this.actions[o].delay>t.delay)r=o-1;else return o+1}return n}}});function Oi(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function Er(e){return e===void 0?[]:[].concat(e)}function Xe(e){return{type:"xstate.assign",assignment:e}}function Di(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function nn(e){return function(t){return e===t}}function Pi(e){return typeof e=="string"?{type:e}:e}function Li(e,t){return{value:e,context:t,actions:[],changed:!1,matches:nn(e)}}function _i(e,t,n){var r=t,o=!1;return[e.filter((function(i){if(i.type==="xstate.assign"){o=!0;var s=Object.assign({},r);return typeof i.assignment=="function"?s=i.assignment(r,n):Object.keys(i.assignment).forEach((function(l){s[l]=typeof i.assignment[l]=="function"?i.assignment[l](r,n):i.assignment[l]})),r=s,!1}return!0})),r,o]}function xr(e,t){t===void 0&&(t={});var n=Oi(_i(Er(e.states[e.initial].entry).map((function(s){return Di(s,t.actions)})),e.context,Bi),2),r=n[0],o=n[1],i={config:e,_options:t,initialState:{value:e.initial,actions:r,context:o,matches:nn(e.initial)},transition:function(s,l){var a,c,d=typeof s=="string"?{value:s,context:e.context}:s,u=d.value,h=d.context,f=Pi(l),p=e.states[u];if(p.on){var m=Er(p.on[f.type]);try{for(var b=(function(x){var T=typeof Symbol=="function"&&Symbol.iterator,C=T&&x[T],S=0;if(C)return C.call(x);if(x&&typeof x.length=="number")return{next:function(){return x&&S>=x.length&&(x=void 0),{value:x&&x[S++],done:!x}}};throw new TypeError(T?"Object is not iterable.":"Symbol.iterator is not defined.")})(m),g=b.next();!g.done;g=b.next()){var v=g.value;if(v===void 0)return Li(u,h);var y=typeof v=="string"?{target:v}:v,E=y.target,N=y.actions,k=N===void 0?[]:N,O=y.cond,A=O===void 0?function(){return!0}:O,$=E===void 0,V=E??u,F=e.states[V];if(A(h,f)){var U=Oi(_i(($?Er(k):[].concat(p.exit,k,F.entry).filter((function(x){return x}))).map((function(x){return Di(x,i._options.actions)})),h,f),3),W=U[0],R=U[1],I=U[2],w=E??u;return{value:w,context:R,actions:W,changed:E!==u||W.length>0||I,matches:nn(w)}}}}catch(x){a={error:x}}finally{try{g&&!g.done&&(c=b.return)&&c.call(b)}finally{if(a)throw a.error}}}return Li(u,h)}};return i}function Tr(e){var t=e.initialState,n=ot.NotStarted,r=new Set,o={_machine:e,send:function(i){n===ot.Running&&(t=e.transition(t,i),Fi(t,Pi(i)),r.forEach((function(s){return s(t)})))},subscribe:function(i){return r.add(i),i(t),{unsubscribe:function(){return r.delete(i)}}},start:function(i){if(i){var s=typeof i=="object"?i:{context:e.config.context,value:i};t={value:s.value,actions:[],context:s.context,matches:nn(s.value)}}return n=ot.Running,Fi(t,Bi),o},stop:function(){return n=ot.Stopped,r.clear(),o},get state(){return t},get status(){return n}};return o}var ot,Bi,Fi,Ui=G(()=>{(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(ot||(ot={}));Bi={type:"xstate.init"};Fi=function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))}});function Rl(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.type===_.Meta&&r.timestamp<=t)return e.slice(n)}return e}function Wi(e,{getCastFn:t,applyEventsSynchronously:n,emitter:r}){let o=xr({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:Xe({lastPlayedEvent:(i,s)=>s.type==="CAST_EVENT"?s.payload.event:i.lastPlayedEvent}),recordTimeOffset:Xe((i,s)=>{let l=i.timeOffset;return"payload"in s&&"timeOffset"in s.payload&&(l=s.payload.timeOffset),Object.assign(Object.assign({},i),{timeOffset:l,baselineTime:i.events[0].timestamp+l})}),play(i){var s;let{timer:l,events:a,baselineTime:c,lastPlayedEvent:d}=i;l.clear();for(let p of a)Ir(p,c);let u=Rl(a,c),h=d?.timestamp;d?.type===_.IncrementalSnapshot&&d.data.source===D.MouseMove&&(h=d.timestamp+((s=d.data.positions[0])===null||s===void 0?void 0:s.timeOffset)),c<(h||0)&&r.emit(Y.PlayBack);let f=new Array;for(let p of u)if(!(h&&h<c&&(p.timestamp<=h||p===d)))if(p.timestamp<c)f.push(p);else{let m=t(p,!1);l.addAction({doAction:()=>{m()},delay:p.delay})}n(f),r.emit(Y.Flush),l.start()},pause(i){i.timer.clear()},resetLastPlayedEvent:Xe(i=>Object.assign(Object.assign({},i),{lastPlayedEvent:null})),startLive:Xe({baselineTime:(i,s)=>(i.timer.toggleLiveMode(!0),i.timer.start(),s.type==="TO_LIVE"&&s.payload.baselineTime?s.payload.baselineTime:Date.now())}),addEvent:Xe((i,s)=>{let{baselineTime:l,timer:a,events:c}=i;if(s.type==="ADD_EVENT"){let{event:d}=s.payload;Ir(d,l);let u=c.length-1;if(!c[u]||c[u].timestamp<=d.timestamp)c.push(d);else{let p=-1,m=0;for(;m<=u;){let b=Math.floor((m+u)/2);c[b].timestamp<=d.timestamp?m=b+1:u=b-1}p===-1&&(p=m),c.splice(p,0,d)}let h=d.timestamp<l,f=t(d,h);h?f():a.isActive()&&a.addAction({doAction:()=>{f()},delay:d.delay})}return Object.assign(Object.assign({},i),{events:c})})}});return Tr(o)}function Vi(e){let t=xr({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(n,r)=>{"payload"in r&&n.timer.setSpeed(r.payload.speed)},recordSpeed:Xe({normalSpeed:n=>n.timer.speed}),restoreSpeed:n=>{n.timer.setSpeed(n.normalSpeed)}}});return Tr(t)}var Hi=G(()=>{Ui();ye();wr()});var Gi,$i=G(()=>{Gi=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }"]});function Ar(e,t){let n=zi.get(e);return n||(n=new Map,zi.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function Ee(e,t,n){return r=>be(this,void 0,void 0,function*(){if(r&&typeof r=="object"&&"rr_type"in r)if(n&&(n.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){let o=yield Ee(e,t,n)(r.args);return yield createImageBitmap.apply(null,o)}else if("index"in r){if(n||t===null)return r;let{rr_type:o,index:i}=r;return Ar(t,o)[i]}else if("args"in r){let{rr_type:o,args:i}=r,s=window[o];return new s(...yield Promise.all(i.map(Ee(e,t,n))))}else{if("base64"in r)return To(r.base64);if("src"in r){let o=e.get(r.src);if(o)return o;{let i=new Image;return i.src=r.src,e.set(r.src,i),i}}else if("data"in r&&r.rr_type==="Blob"){let o=yield Promise.all(r.data.map(Ee(e,t,n)));return new Blob(o,{type:r.type})}}else if(Array.isArray(r))return yield Promise.all(r.map(Ee(e,t,n)));return r})}var zi,rn=G(()=>{Ze();Hn();zi=new Map});function Ml(e,t){try{return t===ve.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}function Dl(e,t){if(!t?.constructor)return;let{name:n}=t.constructor;if(!Ol.includes(n))return;let r=Ar(e,n);r.includes(t)||r.push(t)}function Ki({mutation:e,target:t,type:n,imageMap:r,errorHandler:o}){return be(this,void 0,void 0,function*(){try{let i=Ml(t,n);if(!i)return;if(e.setter){i[e.property]=e.args[0];return}let s=i[e.property],l=yield Promise.all(e.args.map(Ee(r,i))),a=s.apply(i,l);Dl(i,a);let c=!1}catch(i){o(e,i)}})}var Ol,ji=G(()=>{Ze();ye();rn();Ol=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"]});function Yi({event:e,mutation:t,target:n,imageMap:r,errorHandler:o}){return be(this,void 0,void 0,function*(){try{let i=n.getContext("2d");if(t.setter){i[t.property]=t.args[0];return}let s=i[t.property];if(t.property==="drawImage"&&typeof t.args[0]=="string")r.get(e),s.apply(i,t.args);else{let l=yield Promise.all(t.args.map(Ee(r,i)));s.apply(i,l)}}catch(i){o(t,i)}})}var Zi=G(()=>{Ze();rn()});function kr({event:e,mutation:t,target:n,imageMap:r,canvasEventMap:o,errorHandler:i}){return be(this,void 0,void 0,function*(){try{let s=o.get(e)||t,l="commands"in s?s.commands:[s];if([ve.WebGL,ve.WebGL2].includes(t.type)){for(let a=0;a<l.length;a++){let c=l[a];yield Ki({mutation:c,type:t.type,target:n,imageMap:r,errorHandler:i})}return}for(let a=0;a<l.length;a++){let c=l[a];yield Yi({event:e,mutation:c,target:n,imageMap:r,errorHandler:i})}}catch(s){i(t,s)}})}var Ji=G(()=>{Ze();ye();ji();Zi()});function qi(e){return e.type==_.IncrementalSnapshot&&(e.data.source==D.TouchMove||e.data.source==D.MouseInteraction&&e.data.type==re.TouchStart)}var Ll,_l,Fl,Nr,Rr,on,Xi=G(()=>{Ze();ke();oi();Cr();Cr();Mi();wr();Hi();ye();ge();$i();Ji();rn();Ll=10*1e3,_l=5*1e3,Fl=br||Sr,Nr="[replayer]",Rr={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};on=class{constructor(t,n){if(this.usingVirtualDom=!1,this.virtualDom=new Je,this.mouseTail=null,this.tailPositions=[],this.emitter=Fl(),this.legacy_missingNodeRetryMap={},this.cache=Mn(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=Mt(),this.styleMirror=new Ke,this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.lastSelectionData=null,this.constructedStyleMutations=[],this.adoptedStyleSheets=[],this.handleResize=l=>{this.iframe.style.display="inherit";for(let a of[this.mouseTail,this.iframe])a&&(a.setAttribute("width",String(l.width)),a.setAttribute("height",String(l.height)))},this.applyEventsSynchronously=l=>{for(let a of l){switch(a.type){case _.DomContentLoaded:case _.Load:case _.Custom:continue;case _.FullSnapshot:case _.Meta:case _.Plugin:case _.IncrementalSnapshot:break}this.getCastFn(a,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null},this.getCastFn=(l,a=!1)=>{let c;switch(l.type){case _.DomContentLoaded:case _.Load:break;case _.Custom:c=()=>{this.emitter.emit(Y.CustomEvent,l)};break;case _.Meta:c=()=>this.emitter.emit(Y.Resize,{width:l.data.width,height:l.data.height});break;case _.FullSnapshot:c=()=>{var u;if(this.firstFullSnapshot){if(this.firstFullSnapshot===l){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(l,a),(u=this.iframe.contentWindow)===null||u===void 0||u.scrollTo(l.data.initialOffset),this.styleMirror.reset()};break;case _.IncrementalSnapshot:c=()=>{if(this.applyIncremental(l,a),!a&&(l===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(let u of this.service.state.context.events)if(!(u.timestamp<=l.timestamp)&&this.isUserInteraction(u)){u.delay-l.delay>Ll*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=u);break}if(this.nextUserInteractionEvent){let u=this.nextUserInteractionEvent.delay-l.delay,h={speed:Math.min(Math.round(u/_l),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:h}),this.emitter.emit(Y.SkipStart,h)}}};break}return()=>{c&&c();for(let h of this.config.plugins||[])h.handler&&h.handler(l,a,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:l}});let u=this.service.state.context.events.length-1;if(l===this.service.state.context.events[u]){let h=()=>{u<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(Y.Finish))};l.type===_.IncrementalSnapshot&&l.data.source===D.MouseMove&&l.data.positions.length?setTimeout(()=>{h()},Math.max(0,-l.data.positions[0].timeOffset+50)):h()}this.emitter.emit(Y.EventCast,l)}},!n?.liveMode&&t.length<2)throw new Error("Replayer need at least 2 events.");let r={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:Rr,useVirtualDom:!0};this.config=Object.assign({},r,n),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(Y.Resize,this.handleResize),this.setupDom();for(let l of this.config.plugins||[])l.getMirror&&l.getMirror({nodeMirror:this.mirror});this.emitter.on(Y.Flush,()=>{if(this.usingVirtualDom){let l={mirror:this.mirror,applyCanvas:(a,c,d)=>{kr({event:a,mutation:c,target:d,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(a,c)=>{a.source===D.StyleSheetRule?this.applyStyleSheetRule(a,c):a.source===D.StyleDeclaration&&this.applyStyleDeclaration(a,c)}};if(this.iframe.contentDocument&&Ie(this.iframe.contentDocument,this.virtualDom,l,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(let a in this.legacy_missingNodeRetryMap)try{let c=this.legacy_missingNodeRetryMap[a],d=jt(c.node,this.mirror,this.virtualDom.mirror);Ie(d,c.node,l,this.virtualDom.mirror),c.node=d}catch(c){this.config.showWarning&&console.warn(c)}this.constructedStyleMutations.forEach(a=>{this.applyStyleSheetMutation(a)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(a=>{this.applyAdoptedStyleSheet(a)}),this.adoptedStyleSheets=[]}this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(Y.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset()});let o=new tn([],{speed:this.config.speed,liveMode:this.config.liveMode});this.service=Wi({events:t.map(l=>n&&n.unpackFn?n.unpackFn(l):l).sort((l,a)=>l.timestamp-a.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(l=>{this.emitter.emit(Y.StateChange,{player:l})}),this.speedService=Vi({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(Y.StateChange,{speed:l})});let i=this.service.state.context.events.find(l=>l.type===_.Meta),s=this.service.state.context.events.find(l=>l.type===_.FullSnapshot);if(i){let{width:l,height:a}=i.data;setTimeout(()=>{this.emitter.emit(Y.Resize,{width:l,height:a})},0)}s&&setTimeout(()=>{var l;this.firstFullSnapshot||(this.firstFullSnapshot=s,this.rebuildFullSnapshot(s),(l=this.iframe.contentWindow)===null||l===void 0||l.scrollTo(s.data.initialOffset))},1),this.service.state.context.events.find(qi)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,n){return this.emitter.on(t,n),this}off(t,n){return this.emitter.off(t,n),this}setConfig(t){Object.keys(t).forEach(n=>{t[n],this.config[n]=t[n]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){let t=this.service.state.context.events[0],n=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:n.timestamp,totalTime:n.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){let{baselineTime:t,events:n}=this.service.state.context;return t-n[0].timestamp}getMirror(){return this.mirror}play(t=0){var n,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(r=(n=this.iframe.contentDocument)===null||n===void 0?void 0:n.getElementsByTagName("html")[0])===null||r===void 0||r.classList.remove("rrweb-paused"),this.emitter.emit(Y.Start)}pause(t){var n,r;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(r=(n=this.iframe.contentDocument)===null||n===void 0?void 0:n.getElementsByTagName("html")[0])===null||r===void 0||r.classList.add("rrweb-paused"),this.emitter.emit(Y.Pause)}resume(t=0){console.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(Y.Resume)}destroy(){this.pause(),this.config.root.removeChild(this.wrapper),this.emitter.emit(Y.Destroy)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){let n=this.config.unpackFn?this.config.unpackFn(t):t;qi(n)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:n}}))}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=Mn()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");let t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(Ri(this.iframe.contentWindow,this.iframe.contentDocument),ft(this.iframe.contentWindow))}rebuildFullSnapshot(t,n=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};let r=[],o=(l,a)=>{this.collectIframeAndAttachDocument(r,l);for(let c of this.config.plugins||[])c.onBuild&&c.onBuild(l,{id:a,replayer:this})};io(t.data.node,{doc:this.iframe.contentDocument,afterAppend:o,cache:this.cache,mirror:this.mirror}),o(this.iframe.contentDocument,t.data.node.id);for(let{mutationInQueue:l,builtNode:a}of r)this.attachDocumentToIframe(l,a),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==l);let{documentElement:i,head:s}=this.iframe.contentDocument;this.insertStyleRules(i,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(Y.FullsnapshotRebuilded,t),n||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,n){var r;let o=Gi(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&o.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){let i=this.virtualDom.createElement("style");this.virtualDom.mirror.add(i,or(i,this.virtualDom.unserializedId)),t.insertBefore(i,n),i.rules.push({source:D.StyleSheetRule,adds:o.map((s,l)=>({rule:s,index:l}))})}else{let i=document.createElement("style");t.insertBefore(i,n);for(let s=0;s<o.length;s++)(r=i.sheet)===null||r===void 0||r.insertRule(o[s],s)}}attachDocumentToIframe(t,n){let r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[],i=(s,l)=>{this.collectIframeAndAttachDocument(o,s);let a=r.getMeta(s);if(a?.type===K.Element&&a?.tagName.toUpperCase()==="HTML"){let{documentElement:c,head:d}=n.contentDocument;this.insertStyleRules(c,d)}for(let c of this.config.plugins||[])c.onBuild&&c.onBuild(s,{id:l,replayer:this})};tt(t.node,{doc:n.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:i,cache:this.cache}),i(n.contentDocument,t.node.id);for(let{mutationInQueue:s,builtNode:l}of o)this.attachDocumentToIframe(s,l),this.newDocumentQueue=this.newDocumentQueue.filter(a=>a!==s)}collectIframeAndAttachDocument(t,n){if(Ne(n,this.mirror)){let r=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(n));r&&t.push({mutationInQueue:r,builtNode:n})}}waitForStylesheetLoad(){var t;let n=(t=this.iframe.contentDocument)===null||t===void 0?void 0:t.head;if(n){let r=new Set,o,i=this.service.state,s=()=>{i=this.service.state};this.emitter.on(Y.Start,s),this.emitter.on(Y.Pause,s);let l=()=>{this.emitter.off(Y.Start,s),this.emitter.off(Y.Pause,s)};n.querySelectorAll('link[rel="stylesheet"]').forEach(a=>{a.sheet||(r.add(a),a.addEventListener("load",()=>{r.delete(a),r.size===0&&o!==-1&&(i.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(Y.LoadStylesheetEnd),o&&clearTimeout(o),l())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(Y.LoadStylesheetStart),o=setTimeout(()=>{i.matches("playing")&&this.play(this.getCurrentTime()),o=-1,l()},this.config.loadTimeout))}}preloadAllImages(){return be(this,void 0,void 0,function*(){this.service.state;let t=()=>{this.service.state};this.emitter.on(Y.Start,t),this.emitter.on(Y.Pause,t);let n=[];for(let r of this.service.state.context.events)r.type===_.IncrementalSnapshot&&r.data.source===D.CanvasMutation&&(n.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(i=>{this.preloadImages(i,r)}));return Promise.all(n)})}preloadImages(t,n){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(n)){let r=document.createElement("canvas"),o=r.getContext("2d"),i=o?.createImageData(r.width,r.height);i?.data,JSON.parse(t.args[0]),o?.putImageData(i,0,0)}}deserializeAndPreloadCanvasEvents(t,n){return be(this,void 0,void 0,function*(){if(!this.canvasEventMap.has(n)){let r={isUnchanged:!0};if("commands"in t){let o=yield Promise.all(t.commands.map(i=>be(this,void 0,void 0,function*(){let s=yield Promise.all(i.args.map(Ee(this.imageMap,null,r)));return Object.assign(Object.assign({},i),{args:s})})));r.isUnchanged===!1&&this.canvasEventMap.set(n,Object.assign(Object.assign({},t),{commands:o}))}else{let o=yield Promise.all(t.args.map(Ee(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(n,Object.assign(Object.assign({},t),{args:o}))}}})}applyIncremental(t,n){var r,o,i;let{data:s}=t;switch(s.source){case D.Mutation:{try{this.applyMutation(s,n)}catch(l){this.warn(`Exception in mutation ${l.message||l}`,s)}break}case D.Drag:case D.TouchMove:case D.MouseMove:if(n){let l=s.positions[s.positions.length-1];this.mousePos={x:l.x,y:l.y,id:l.id,debugData:s}}else s.positions.forEach(l=>{let a={doAction:()=>{this.moveAndHover(l.x,l.y,l.id,n,s)},delay:l.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(a)}),this.timer.addAction({doAction(){},delay:t.delay-((r=s.positions[0])===null||r===void 0?void 0:r.timeOffset)});break;case D.MouseInteraction:{if(s.id===-1||n)break;let l=new Event(re[s.type].toLowerCase()),a=this.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);this.emitter.emit(Y.MouseInteraction,{type:s.type,target:a});let{triggerFocus:c}=this.config;switch(s.type){case re.Blur:"blur"in a&&a.blur();break;case re.Focus:c&&a.focus&&a.focus({preventScroll:!0});break;case re.Click:case re.TouchStart:case re.TouchEnd:n?(s.type===re.TouchStart?this.touchActive=!0:s.type===re.TouchEnd&&(this.touchActive=!1),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===re.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,n,s),s.type===re.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===re.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===re.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case re.TouchCancel:n?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:a.dispatchEvent(l)}break}case D.Scroll:{if(s.id===-1)break;if(this.usingVirtualDom){let l=this.virtualDom.mirror.getNode(s.id);if(!l)return this.debugNodeNotFound(s,s.id);l.scrollData=s;break}this.applyScroll(s,n);break}case D.ViewportResize:this.emitter.emit(Y.Resize,{width:s.width,height:s.height});break;case D.Input:{if(s.id===-1)break;if(this.usingVirtualDom){let l=this.virtualDom.mirror.getNode(s.id);if(!l)return this.debugNodeNotFound(s,s.id);l.inputData=s;break}this.applyInput(s);break}case D.MediaInteraction:{let l=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!l)return this.debugNodeNotFound(s,s.id);let a=l;try{s.currentTime&&(a.currentTime=s.currentTime),s.volume&&(a.volume=s.volume),s.muted&&(a.muted=s.muted),s.type===1&&a.pause(),s.type===0&&a.play(),s.type===4&&(a.playbackRate=s.playbackRate)}catch(c){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${c.message||c}`)}break}case D.StyleSheetRule:case D.StyleDeclaration:{this.usingVirtualDom?s.styleId?this.constructedStyleMutations.push(s):s.id&&((o=this.virtualDom.mirror.getNode(s.id))===null||o===void 0||o.rules.push(s)):this.applyStyleSheetMutation(s);break}case D.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){let l=this.virtualDom.mirror.getNode(s.id);if(!l)return this.debugNodeNotFound(s,s.id);l.canvasMutations.push({event:t,mutation:s})}else{let l=this.mirror.getNode(s.id);if(!l)return this.debugNodeNotFound(s,s.id);kr({event:t,mutation:s,target:l,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case D.Font:{try{let l=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);(i=this.iframe.contentDocument)===null||i===void 0||i.fonts.add(l)}catch(l){this.config.showWarning&&console.warn(l)}break}case D.Selection:{if(n){this.lastSelectionData=s;break}this.applySelection(s);break}case D.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(s):this.applyAdoptedStyleSheet(s);break}}}applyMutation(t,n){if(this.config.useVirtualDom&&!this.usingVirtualDom&&n&&(this.usingVirtualDom=!0,ri(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(let c in this.legacy_missingNodeRetryMap)try{let d=this.legacy_missingNodeRetryMap[c],u=rr(d.node,this.virtualDom,this.mirror);u&&(d.node=u)}catch(d){this.config.showWarning&&console.warn(d)}let r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(c=>{var d;let u=r.getNode(c.id);if(!u)return t.removes.find(f=>f.id===c.parentId)?void 0:this.warnNodeNotFound(t,c.id);let h=r.getNode(c.parentId);if(!h)return this.warnNodeNotFound(t,c.parentId);if(c.isShadow&&xe(h)&&(h=h.shadowRoot),r.removeNodeFromMap(u),h)try{h.removeChild(u),this.usingVirtualDom&&u.nodeName==="#text"&&h.nodeName==="STYLE"&&((d=h.rules)===null||d===void 0?void 0:d.length)>0&&(h.rules=[])}catch(f){if(f instanceof DOMException)this.warn("parent could not remove child in mutation",h,u,t);else throw f}});let o=Object.assign({},this.legacy_missingNodeRetryMap),i=[],s=c=>{let d=null;return c.nextId&&(d=r.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!d},l=c=>{var d;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let u=r.getNode(c.parentId);if(!u)return c.node.type===K.Document?this.newDocumentQueue.push(c):i.push(c);c.node.isShadow&&(xe(u)||u.attachShadow({mode:"open"}),u=u.shadowRoot);let h=null,f=null;if(c.previousId&&(h=r.getNode(c.previousId)),c.nextId&&(f=r.getNode(c.nextId)),s(c))return i.push(c);if(c.node.rootId&&!r.getNode(c.node.rootId))return;let p=c.node.rootId?r.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ne(u,r)){this.attachDocumentToIframe(c,u);return}let m=(v,y)=>{for(let E of this.config.plugins||[])E.onBuild&&E.onBuild(v,{id:y,replayer:this})},b=tt(c.node,{doc:p,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:m});if(c.previousId===-1||c.nextId===-1){o[c.node.id]={node:b,mutation:c};return}let g=r.getMeta(u);if(g&&g.type===K.Element&&g.tagName==="textarea"&&c.node.type===K.Text){let v=Array.isArray(u.childNodes)?u.childNodes:Array.from(u.childNodes);for(let y of v)y.nodeType===u.TEXT_NODE&&u.removeChild(y)}if(h&&h.nextSibling&&h.nextSibling.parentNode)u.insertBefore(b,h.nextSibling);else if(f&&f.parentNode)u.contains(f)?u.insertBefore(b,f):u.insertBefore(b,null);else{if(u===p)for(;p.firstChild;)p.removeChild(p.firstChild);u.appendChild(b)}if(m(b,c.node.id),this.usingVirtualDom&&b.nodeName==="#text"&&u.nodeName==="STYLE"&&((d=u.rules)===null||d===void 0?void 0:d.length)>0&&(u.rules=[]),Ne(b,this.mirror)){let v=this.mirror.getId(b),y=this.newDocumentQueue.find(E=>E.parentId===v);y&&(this.attachDocumentToIframe(y,b),this.newDocumentQueue=this.newDocumentQueue.filter(E=>E!==y))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(o,u,b,c)};t.adds.forEach(c=>{l(c)});let a=Date.now();for(;i.length;){let c=Dn(i);if(i.length=0,Date.now()-a>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(let d of c)r.getNode(d.value.parentId)?Lt(d,h=>{l(h)}):this.debug("Drop resolve tree since there is no parent for the root node.",d)}Object.keys(o).length&&Object.assign(this.legacy_missingNodeRetryMap,o),Ln(t.texts).forEach(c=>{var d;let u=r.getNode(c.id);if(!u)return t.removes.find(h=>h.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);if(u.textContent=c.value,this.usingVirtualDom){let h=u.parentNode;((d=h?.rules)===null||d===void 0?void 0:d.length)>0&&(h.rules=[])}}),t.attributes.forEach(c=>{let d=r.getNode(c.id);if(!d)return t.removes.find(u=>u.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);for(let u in c.attributes)if(typeof u=="string"){let h=c.attributes[u];if(h===null)d.removeAttribute(u);else if(typeof h=="string")try{if(u==="_cssText"&&(d.nodeName==="LINK"||d.nodeName==="STYLE"))try{let f=r.getMeta(d);Object.assign(f.attributes,c.attributes);let p=tt(f,{doc:d.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache}),m=d.nextSibling,b=d.parentNode;if(p&&b){b.removeChild(d),b.insertBefore(p,m),r.replace(c.id,p);break}}catch{}d.setAttribute(u,h)}catch(f){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",f)}else if(u==="style"){let f=h,p=d;for(let m in f)if(f[m]===!1)p.style.removeProperty(m);else if(f[m]instanceof Array){let b=f[m];p.style.setProperty(m,b[0],b[1])}else{let b=f[m];p.style.setProperty(m,b)}}}})}applyScroll(t,n){var r,o;let i=this.mirror.getNode(t.id);if(!i)return this.debugNodeNotFound(t,t.id);let s=this.mirror.getMeta(i);if(i===this.iframe.contentDocument)(r=this.iframe.contentWindow)===null||r===void 0||r.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"});else if(s?.type===K.Document)(o=i.defaultView)===null||o===void 0||o.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"});else try{i.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"})}catch{}}applyInput(t){let n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);try{n.checked=t.isChecked,n.value=t.text}catch{}}applySelection(t){try{let n=new Set,r=t.ranges.map(({start:o,startOffset:i,end:s,endOffset:l})=>{let a=this.mirror.getNode(o),c=this.mirror.getNode(s);if(!a||!c)return;let d=new Range;d.setStart(a,i),d.setEnd(c,l);let u=a.ownerDocument,h=u?.getSelection();return h&&n.add(h),{range:d,selection:h}});n.forEach(o=>o.removeAllRanges()),r.forEach(o=>{var i;return o&&((i=o.selection)===null||i===void 0?void 0:i.addRange(o.range))})}catch{}}applyStyleSheetMutation(t){var n;let r=null;t.styleId?r=this.styleMirror.getStyle(t.styleId):t.id&&(r=((n=this.mirror.getNode(t.id))===null||n===void 0?void 0:n.sheet)||null),r&&(t.source===D.StyleSheetRule?this.applyStyleSheetRule(t,r):t.source===D.StyleDeclaration&&this.applyStyleDeclaration(t,r))}applyStyleSheetRule(t,n){var r,o,i,s;if((r=t.adds)===null||r===void 0||r.forEach(({rule:l,index:a})=>{try{if(Array.isArray(a)){let{positions:c,index:d}=Ft(a);Ye(n.cssRules,c).insertRule(l,d)}else{let c=a===void 0?void 0:Math.min(a,n.cssRules.length);n?.insertRule(l,c)}}catch{}}),(o=t.removes)===null||o===void 0||o.forEach(({index:l})=>{try{if(Array.isArray(l)){let{positions:a,index:c}=Ft(l);Ye(n.cssRules,a).deleteRule(c||0)}else n?.deleteRule(l)}catch{}}),t.replace)try{(i=n.replace)===null||i===void 0||i.call(n,t.replace)}catch{}if(t.replaceSync)try{(s=n.replaceSync)===null||s===void 0||s.call(n,t.replaceSync)}catch{}}applyStyleDeclaration(t,n){t.set&&Ye(n.rules,t.index).style.setProperty(t.set.property,t.set.value,t.set.priority),t.remove&&Ye(n.rules,t.index).style.removeProperty(t.remove.property)}applyAdoptedStyleSheet(t){var n;let r=this.mirror.getNode(t.id);if(!r)return;(n=t.styles)===null||n===void 0||n.forEach(l=>{var a;let c=null,d=null;if(xe(r)?d=((a=r.ownerDocument)===null||a===void 0?void 0:a.defaultView)||null:r.nodeName==="#document"&&(d=r.defaultView),!!d)try{c=new d.CSSStyleSheet,this.styleMirror.add(c,l.styleId),this.applyStyleSheetRule({source:D.StyleSheetRule,adds:l.rules},c)}catch{}});let o=10,i=0,s=(l,a)=>{let c=a.map(d=>this.styleMirror.getStyle(d)).filter(d=>d!==null);xe(l)?l.shadowRoot.adoptedStyleSheets=c:l.nodeName==="#document"&&(l.adoptedStyleSheets=c),c.length!==a.length&&i<o&&(setTimeout(()=>s(l,a),0+100*i),i++)};s(r,t.styleIds)}legacy_resolveMissingNode(t,n,r,o){let{previousId:i,nextId:s}=o,l=i&&t[i],a=s&&t[s];if(l){let{node:c,mutation:d}=l;n.insertBefore(c,r),delete t[d.node.id],delete this.legacy_missingNodeRetryMap[d.node.id],(d.previousId||d.nextId)&&this.legacy_resolveMissingNode(t,n,c,d)}if(a){let{node:c,mutation:d}=a;n.insertBefore(c,r.nextSibling),delete t[d.node.id],delete this.legacy_missingNodeRetryMap[d.node.id],(d.previousId||d.nextId)&&this.legacy_resolveMissingNode(t,n,c,d)}}moveAndHover(t,n,r,o,i){let s=this.mirror.getNode(r);if(!s)return this.debugNodeNotFound(i,r);let l=_t(s,this.iframe),a=t*l.absoluteScale+l.x,c=n*l.absoluteScale+l.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${c}px`,o||this.drawMouseTail({x:a,y:c}),this.hoverElements(s)}drawMouseTail(t){if(!this.mouseTail)return;let{lineCap:n,lineWidth:r,strokeStyle:o,duration:i}=this.config.mouseTail===!0?Rr:Object.assign({},Rr,this.config.mouseTail),s=()=>{if(!this.mouseTail)return;let l=this.mouseTail.getContext("2d");!l||!this.tailPositions.length||(l.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),l.beginPath(),l.lineWidth=r,l.lineCap=n,l.strokeStyle=o,l.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(a=>l.lineTo(a.x,a.y)),l.stroke())};this.tailPositions.push(t),s(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(l=>l!==t),s()},i/this.speedService.state.context.timer.speed)}hoverElements(t){var n;(n=this.iframe.contentDocument)===null||n===void 0||n.querySelectorAll(".\\:hover").forEach(o=>{o.classList.remove(":hover")});let r=t;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(t){return t.type!==_.IncrementalSnapshot?!1:t.data.source>D.Mutation&&t.data.source<=D.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(Y.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,n){this.warn(`Node with id '${n}' not found. `,t)}warnCanvasMutationFailed(t,n){this.warn("Has error on canvas update",n,"canvas mutation:",t)}debugNodeNotFound(t,n){this.debug(Nr,`Node with id '${n}' not found. `,t)}warn(...t){this.config.showWarning&&console.warn(Nr,...t)}debug(...t){this.config.showDebug&&console.log(Nr,...t)}}});var Qi={};kt(Qi,{EventType:()=>_,IncrementalSource:()=>D,MouseInteractions:()=>re,PLUGIN_NAME:()=>wt,Replayer:()=>on,ReplayerEvents:()=>Y,addCustomEvent:()=>ii,freezePage:()=>si,getRecordConsolePlugin:()=>Ai,getReplayConsolePlugin:()=>ki,mirror:()=>ct,pack:()=>yi,record:()=>Re,unpack:()=>Si,utils:()=>_n});var es=G(()=>{ai();bi();Ci();vr();Ni();Yn();ye();Xi();ge();ge()});var Pc={};kt(Pc,{BOWTIE_STAGES:()=>hn,holostaff:()=>Bc});var gn="holostaff_did",Nt="holostaff_did",yn="holostaff_huid";function Ks(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function We(){return typeof window<"u"&&typeof document<"u"}function js(e){if(!We())return null;let t=document.cookie?document.cookie.split("; "):[];for(let n of t){let r=n.indexOf("=");if(!(r<0)&&n.slice(0,r)===e)return decodeURIComponent(n.slice(r+1))}return null}function $r(e,t){if(!We())return;let n=window.location.protocol==="https:"?"; Secure":"";document.cookie=`${e}=${encodeURIComponent(t)}; Max-Age=31536000; Path=/; SameSite=Lax${n}`}function Ys(e){if(!We())return null;try{return window.localStorage.getItem(e)}catch{return null}}function vn(e,t){if(We())try{window.localStorage.setItem(e,t)}catch{}}function Zs(e){if(!We())return null;try{return window.sessionStorage.getItem(e)}catch{return null}}function Js(e,t){if(We())try{window.sessionStorage.setItem(e,t)}catch{}}function qs(e){if(We())try{window.sessionStorage.removeItem(e)}catch{}}function zr(){let e=js(gn),t=Ys(Nt);if(e&&t)return e!==t&&vn(Nt,e),e;if(e)return vn(Nt,e),e;if(t)return $r(gn,t),t;let n=Ks();return $r(gn,n),vn(Nt,n),n}function bn(){return Zs(yn)}function Kr(e){Js(yn,e)}function jr(){qs(yn)}var Xs="https://holostaff-vision-1008066443043.us-central1.run.app";function Yr(e){return{baseUrl:e.baseUrl??Xs,apiKey:e.apiKey,onError:e.onError}}function Zr(e){let t={"content-type":"application/json"};return e.apiKey&&(t.authorization=`Bearer ${e.apiKey}`),t}async function fe(e,t,n){try{let r=await fetch(`${e.baseUrl}${t}`,{method:"POST",headers:Zr(e),body:JSON.stringify(n),credentials:"omit",mode:"cors"});if(!r.ok){let o=await r.text().catch(()=>"");return e.onError?.(new Error(`HTTP ${r.status} ${r.statusText}${o?` \u2014 ${o}`:""}`),{method:"POST",path:t}),!1}return!0}catch(r){return e.onError?.(r instanceof Error?r:new Error(String(r)),{method:"POST",path:t}),!1}}async function Le(e,t,n){try{let r=await fetch(`${e.baseUrl}${t}`,{method:"POST",headers:Zr(e),body:JSON.stringify(n),credentials:"omit",mode:"cors"});if(!r.ok){let o=await r.text().catch(()=>"");return e.onError?.(new Error(`HTTP ${r.status} ${r.statusText}${o?` \u2014 ${o}`:""}`),{method:"POST",path:t}),null}return await r.json()}catch(r){return e.onError?.(r instanceof Error?r:new Error(String(r)),{method:"POST",path:t}),null}}function Ve(e,t,n){let r=`${e.baseUrl}${t}`,o=JSON.stringify(n);if(typeof navigator<"u"&&typeof navigator.sendBeacon=="function")try{let i=new Blob([o],{type:"text/plain"});return navigator.sendBeacon(r,i)}catch(i){return e.onError?.(i instanceof Error?i:new Error(String(i)),{method:"BEACON",path:t}),!1}try{return fetch(r,{method:"POST",headers:{"content-type":"text/plain"},body:o,keepalive:!0,credentials:"omit",mode:"cors"}),!0}catch(i){return e.onError?.(i instanceof Error?i:new Error(String(i)),{method:"BEACON",path:t}),!1}}function Sn(e,t,n,r){if(typeof EventSource>"u")return null;let o=new URLSearchParams({tenantId:n,sourceId:r}),i=`${e.baseUrl}/api/runtime/sessions/${encodeURIComponent(t)}/commands?${o}`;try{return new EventSource(i)}catch(s){return e.onError?.(s instanceof Error?s:new Error(String(s)),{method:"SSE",path:`/api/runtime/sessions/${t}/commands`}),null}}function Qs(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function Cn(){return`ses_${Date.now().toString(36)}_${Qs().slice(0,8)}`}function Jr(e,t){if(typeof window>"u")return{dispose:()=>{}};let n=!1,r=()=>{n||(n=!0,e())},o=()=>r(),i=()=>{document.visibilityState==="hidden"&&(t?.suppressOnHidden?.()||r())};return window.addEventListener("pagehide",o),document.addEventListener("visibilitychange",i),{dispose:()=>{window.removeEventListener("pagehide",o),document.removeEventListener("visibilitychange",i)}}}var ea=3e4,ta=80;function In(e){if(typeof window>"u")return{dispose:()=>{}};let t=null,n=new Date().toISOString(),r=null,o=null,i=!1,s=()=>{try{return window.location.pathname+window.location.search}catch{return"/"}},l=y=>{i||fe(e.cfg,`/api/runtime/sessions/${e.sessionId}/fastpath`,{...e.buildBody(),route:y,lastActivityAt:n})},a=()=>{r=null;let y=s();y!==t&&(t=y,l(y))},c=()=>{r||(r=setTimeout(a,ta))},d=()=>{n=new Date().toISOString()},u=()=>{c()},h=()=>{c()},f=window.history.pushState,p=window.history.replaceState,m=function(...y){let E=f.apply(window.history,y);return c(),E},b=function(...y){let E=p.apply(window.history,y);return c(),E};window.history.pushState=m,window.history.replaceState=b;let g={passive:!0};window.addEventListener("mousemove",d,g),window.addEventListener("scroll",d,g),window.addEventListener("keydown",d,g),window.addEventListener("touchstart",d,g),window.addEventListener("popstate",u),window.addEventListener("hashchange",h);let v=s();return t=v,l(v),o=setInterval(()=>{i||l(s())},ea),{dispose(){i||(i=!0,window.removeEventListener("mousemove",d),window.removeEventListener("scroll",d),window.removeEventListener("keydown",d),window.removeEventListener("touchstart",d),window.removeEventListener("popstate",u),window.removeEventListener("hashchange",h),window.history.pushState===m&&(window.history.pushState=f),window.history.replaceState===b&&(window.history.replaceState=p),o!=null&&(clearInterval(o),o=null),r!=null&&(clearTimeout(r),r=null))}}}var Bl=5e3,Pl=200,Ul=8e5,Wl=55e3,Vl=3e4,Hl=800,Gl=3e6,$l=15e3,zl=2;function Mr(e){if(typeof window>"u")return{dispose:()=>{}};if(e.observe?.enabled===!1)return{dispose:()=>{}};let t=!1,n=!1,r=null,o=[],i=0,s=[],l=0,a=null,c=null,d=`/api/runtime/sessions/${e.sessionId}/observations`,u=`/api/runtime/sessions/${e.sessionId}/heartbeat`,f=typeof navigator<"u"&&navigator.webdriver===!0?{automated:!0}:{},p=()=>{if(!o.length)return;let R=o;o=[],i=0,fe(e.cfg,d,{...e.buildBody(),...f,events:R})},m=()=>{if(!o.length)return;let R=o;for(o=[],i=0;R.length>1&&JSON.stringify(R).length>Wl;)R=R.slice(Math.ceil(R.length/2));Ve(e.cfg,d,{...e.buildBody(),...f,events:R})},b=R=>{try{return JSON.stringify(R).length}catch{return 1e3}},g=()=>{let R=-1;for(let I=s.length-1;I>=0;I--)if(s[I].type===zl){R=I;break}R>0&&(s=s.slice(R)),l=s.reduce((I,w)=>I+b(w),0)},v=R=>{if(!t){if(!n){s.push(R),l+=b(R),(s.length>Hl||l>Gl)&&g();return}o.push(R),i+=b(R),(o.length>=Pl||i>=Ul)&&p()}},y=()=>{a==null&&(a=setInterval(p,Bl))},E=()=>{a!=null&&(clearInterval(a),a=null)},N=()=>{c==null&&(c=setInterval(()=>{typeof document<"u"&&document.hidden||fe(e.cfg,u,{...e.buildBody(),...f})},$l))},k=()=>{c!=null&&(clearInterval(c),c=null)},O=["pointerdown","pointermove","keydown","wheel","scroll","touchstart"],A={passive:!0,capture:!0},$=()=>{n||t||(n=!0,U(),o=s,i=l,s=[],l=0,p(),y(),N())},V=R=>{R.isTrusted&&$()},F=()=>{for(let R of O)window.addEventListener(R,V,A)},U=()=>{for(let R of O)window.removeEventListener(R,V,A)},W=()=>{n&&(document.hidden?(p(),E(),k()):(y(),N()))};return typeof document<"u"&&document.addEventListener("visibilitychange",W),F(),e.evalMode&&$(),Promise.resolve().then(()=>(es(),Qi)).then(R=>{if(t)return;let I=R.record;if(typeof I!="function"){e.cfg.onError?.(new Error("rrweb.record unavailable"),{method:"OBSERVE",path:d});return}r=I({emit:w=>v(w),checkoutEveryNms:Vl,recordCanvas:!0,sampling:{canvas:2},inlineImages:!0,collectFonts:!0,maskInputOptions:{password:!0,email:!0,tel:!0},maskAllInputs:e.observe?.maskAllInputs??!1,maskTextClass:"holostaff-mask",blockClass:"holostaff-block",ignoreClass:"holostaff-ignore",...e.observe?.blockSelector?{blockSelector:e.observe.blockSelector}:{},...e.observe?.rrweb??{}})??null}).catch(R=>{e.cfg.onError?.(R instanceof Error?R:new Error(String(R)),{method:"OBSERVE",path:d})}),{dispose(){if(!t){t=!0,E(),k(),U(),typeof document<"u"&&document.removeEventListener("visibilitychange",W);try{r?.()}catch{}r=null,n&&m()}}}}function Kl(){return document.querySelector("script[nonce]")?.nonce??""}function ns(e){let t=document.createElement("style"),n=Kl();return n&&(t.nonce=n),t.textContent=e,t}function Et(e,t){try{let n=new CSSStyleSheet;n.replaceSync(t),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n];return}catch{}e.appendChild(ns(t))}var ts=new Map;function it(e,t){try{let r=ts.get(e);r||(r=new CSSStyleSheet,ts.set(e,r),document.adoptedStyleSheets=[...document.adoptedStyleSheets,r]),r.replaceSync(t);return}catch{}let n=document.getElementById(e);if(!n){n=ns(t),n.id=e,document.head.appendChild(n);return}n.textContent=t}var rs=56,os="holostaff-presence-root",sn=220,jl=12e4,Yl=45e3;function as(e){if(typeof window>"u"||typeof document>"u")return ql();let t=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,n=Zl(e),r=n.shadowRoot;Et(r,Xl(e));let o=document.createElement("div");o.className="wrap";let i=document.createElement("button");i.className="chip",i.setAttribute("data-holostaff","chip"),i.type="button",i.setAttribute("aria-label","Copilot"),i.style.display="none";let s=document.createElement("div");s.className="frame";let l=is("idle"),a=is("gesture"),c=document.createElement("img");c.className="poster",c.alt="",c.referrerPolicy="no-referrer";let d=document.createElement("div");d.className="mono",s.append(c,l,a,d),i.appendChild(s);let u=document.createElement("div");u.className="tag";let h=document.createElement("div");h.className="tag-name";let f=document.createElement("div");f.className="tag-scope",u.append(h,f),o.append(i,u),r.appendChild(o);let p=null,m=null,b=null,g=!1,v=!1,y=()=>e.dock.endsWith("right")?"glanceL":"glanceR",E=(F,U)=>{let W=F.portrait??{},R=W.poster??F.avatar??"",I=U?.light?.primary||U?.dark?.primary||"";I&&s.style.setProperty("--accent",I),d.textContent=(F.name.trim()[0]??"?").toUpperCase(),!t&&!!(W.idle||W.idleMp4)?(ss(l,W.idle,W.idleMp4),R&&(l.poster=R),l.style.display="block",c.style.display="none",d.style.display="none",l.play().catch(()=>{})):R?(c.src=R,c.style.display="block",l.style.display="none",d.style.display="none"):(d.style.display="flex",l.style.display="none",c.style.display="none")},N=F=>{if(g||t||document.hidden)return;let U=p?.portrait?.gestures?.[F];if(!U)return;ss(a,U,void 0),a.classList.add("show"),a.play().catch(()=>{}),b&&clearTimeout(b);let W=()=>{a.classList.remove("show")};a.onended=W,b=setTimeout(W,4e3)},k=()=>{m&&clearTimeout(m);let F=jl+Math.random()*Yl;m=setTimeout(()=>{!g&&!document.hidden&&!t&&p&&N(y()),k()},F)},O=()=>{v||o.classList.add("open"),N("meet")},A=()=>{o.classList.remove("open")};i.addEventListener("mouseenter",O),i.addEventListener("mouseleave",A),i.addEventListener("focus",O),i.addEventListener("blur",A),i.addEventListener("click",()=>{p&&e.onActivate?.(p)});let $=()=>{document.hidden?l.pause():p&&!t&&(p.portrait?.idle||p.portrait?.idleMp4)&&l.play().catch(()=>{})};return document.addEventListener("visibilitychange",$),{setCopilot:(F,U)=>{if(g)return;if(!F){p=null,i.classList.add("leaving"),setTimeout(()=>{p||(i.style.display="none")},t?0:sn),m&&(clearTimeout(m),m=null);return}let W=p?.copilotId!==F.copilotId;p=F,h.textContent=`${F.name} \xB7 ${F.roleLine}`,f.textContent=F.scopeLine,i.setAttribute("aria-label",`${F.name}, ${F.roleLine}. ${F.scopeLine}`),i.style.display="block",i.classList.remove("leaving"),W&&!t&&(i.classList.add("swap"),requestAnimationFrame(()=>requestAnimationFrame(()=>i.classList.remove("swap")))),E(F,U),k()},playGesture:N,getAnchorRect:()=>i.style.display==="none"?null:i.getBoundingClientRect(),innerGlance:y,getCopilot:()=>p,setTagSuppressed(F){v=F,F&&o.classList.remove("open")},destroy(){g=!0,m&&clearTimeout(m),b&&clearTimeout(b),document.removeEventListener("visibilitychange",$);try{n.remove()}catch{}}}}function is(e){let t=document.createElement("video");return t.className=e,t.muted=!0,t.loop=e==="idle",t.autoplay=e==="idle",t.playsInline=!0,t.setAttribute("playsinline",""),t.setAttribute("aria-hidden","true"),t.preload="auto",t}function ss(e,t,n){for(;e.firstChild;)e.removeChild(e.firstChild);if(t){let r=document.createElement("source");r.src=t,r.type=t.endsWith(".mp4")?"video/mp4":"video/webm",e.appendChild(r)}if(n&&n!==t){let r=document.createElement("source");r.src=n,r.type="video/mp4",e.appendChild(r)}e.load()}function Zl(e){let t=document.getElementById(os);if(t)return t;t=document.createElement("div"),t.id=os,t.setAttribute("data-holostaff","chip-host");let[n,r]=e.dock.split("-"),o=`${e.offset}px`;return t.style.cssText=["position:fixed",`${n}:${Jl(e,o)}`,`${r}:${o}`,"z-index:2147483646","pointer-events:none"].join(";"),t.attachShadow({mode:"open"}),document.body.appendChild(t),t}function Jl(e,t){let n=["#intercom-container",".intercom-lightweight-app","#launcher","#drift-widget",".drift-frame-controller","#crisp-chatbox","#hubspot-messages-iframe-container"];try{if(n.some(o=>document.querySelector(o)))return console.info("[holostaff] presence: chat widget detected in the dock corner; offsetting the copilot above it. Set init({ presence: { dock } }) to choose a corner."),`calc(${t} + 76px)`}catch{}return t}function ql(){return{setCopilot:()=>{},playGesture:()=>{},getAnchorRect:()=>null,innerGlance:()=>"glanceL",getCopilot:()=>null,setTagSuppressed:()=>{},destroy:()=>{}}}function Xl(e){let t=e.dock.endsWith("right");return`
|
|
17
17
|
:host { all: initial; }
|
|
18
18
|
.wrap {
|
|
19
19
|
position: relative;
|
|
@@ -70,7 +70,7 @@ End of stack for Error object`:a.name+": "+a.message}return a});function i(l){re
|
|
|
70
70
|
@media (prefers-reduced-motion: reduce) {
|
|
71
71
|
.chip, .frame, .gesture, .tag { transition: none; }
|
|
72
72
|
}
|
|
73
|
-
`}function Or(e){let t=e.options??{};if(t.enabled===!1||typeof window>"u"||!e.source)return Ql();let n=null,r=null,o=null,i=as({dock:t.dock??"bottom-right",offset:t.offset??16,onActivate:a=>o?.(a)}),s=a=>{let c=null;try{c=JSON.parse(a.data)}catch{return}c&&(n=c.copilot??null,r=c.designTokens??null,i.setCopilot(n,r))},l=a=>{let c=null;try{c=JSON.parse(a.data)}catch{return}!c||!c.copilot||(n=c.copilot,r=c.designTokens??r,i.setCopilot(n,r),i.playGesture(c.firstMeeting?"wave":"nod"))};return e.source.addEventListener("presence",s),e.source.addEventListener("copilot_changed",l),{chip:i,dispose(){e.source?.removeEventListener("presence",s),e.source?.removeEventListener("copilot_changed",l),i.destroy()},getCopilot:()=>n,getDesignTokens:()=>r,onActivate(a){o=a}}}function Ql(){return{chip:null,dispose:()=>{},getCopilot:()=>null,getDesignTokens:()=>null,onActivate:()=>{}}}var ec=45e3,tc=15e3,ls=260,Lr=200,nc=12e3,cs="holostaff-note-root";function _r(e){if(typeof window>"u"||!e.source)return{dispose:()=>{},onShow:()=>{},onTalk:()=>{}};let t=null,n=null,r=null,o=(l,a)=>{fe(e.cfg,`/api/runtime/sessions/${e.getSessionId()}/outcome`,{...e.buildBody(),interventionId:l,outcome:a})},i=l=>{let a=null;try{let c=JSON.parse(l.data);if(!c||typeof c.interventionId!="string")return;a=c}catch{return}if(a){if(a.modality!=="text"&&a.modality!=="voice_presentation"){e.cfg.onError?.(new Error(`Modality '${a.modality}' is not supported in this SDK build`),{method:"NOTE",path:"(fire_intervention)"});return}if(a.route){let c=a.route.split("?")[0];if(c&&c!==window.location.pathname){o(a.interventionId,"ignored");return}}t&&t.close("ignored"),t=rc(e,a,{showHandler:n,talkHandler:r},()=>{t&&t.event.interventionId===a.interventionId&&(t=null)})}},s=l=>{let a=null;try{a=JSON.parse(l.data)}catch{return}!a||!a.firstMeeting||!a.copilot?.intro||t||(t=oc(e,a,()=>{t=null}))};return e.source.addEventListener("fire_intervention",i),e.source.addEventListener("copilot_changed",s),{dispose(){e.source?.removeEventListener("fire_intervention",i),e.source?.removeEventListener("copilot_changed",s),t?.detach(),t=null},onShow(l){n=l},onTalk(l){r=l}}}function rc(e,t,n,r){let o=us();ps(o,e);let i=o.shadowRoot;i.innerHTML="";let s=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,l=t.copilot?.name?.trim()||"Copilot",a=t.copilot?.roleLine?.trim()||"",c=document.createElement("div");c.className=`note enter ${e.dock}`,c.setAttribute("role","status"),c.setAttribute("aria-live","polite"),c.setAttribute("data-holostaff","note"),c.setAttribute("data-holostaff-intervention",t.interventionId),c.setAttribute("data-holostaff-modality",t.modality);let d=document.createElement("div");d.className="head";let u=document.createElement("div");u.className="idblock";let h=document.createElement("div");if(h.className="name",h.textContent=l,u.appendChild(h),a){let x=document.createElement("div");x.className="role",x.textContent=a,u.appendChild(x)}d.appendChild(u);let f=document.createElement("button");f.className="x",f.type="button",f.setAttribute("aria-label","Dismiss"),f.textContent="\u2715",d.appendChild(f);let p=document.createElement("div");p.className="message",p.textContent=t.content||t.goal;let
|
|
73
|
+
`}function Or(e){let t=e.options??{};if(t.enabled===!1||typeof window>"u"||!e.source)return Ql();let n=null,r=null,o=null,i=as({dock:t.dock??"bottom-right",offset:t.offset??16,onActivate:a=>o?.(a)}),s=a=>{let c=null;try{c=JSON.parse(a.data)}catch{return}c&&(n=c.copilot??null,r=c.designTokens??null,i.setCopilot(n,r))},l=a=>{let c=null;try{c=JSON.parse(a.data)}catch{return}!c||!c.copilot||(n=c.copilot,r=c.designTokens??r,i.setCopilot(n,r),i.playGesture(c.firstMeeting?"wave":"nod"))};return e.source.addEventListener("presence",s),e.source.addEventListener("copilot_changed",l),{chip:i,dispose(){e.source?.removeEventListener("presence",s),e.source?.removeEventListener("copilot_changed",l),i.destroy()},getCopilot:()=>n,getDesignTokens:()=>r,onActivate(a){o=a}}}function Ql(){return{chip:null,dispose:()=>{},getCopilot:()=>null,getDesignTokens:()=>null,onActivate:()=>{}}}var ec=45e3,tc=15e3,ls=260,Lr=200,nc=12e3,cs="holostaff-note-root";function _r(e){if(typeof window>"u"||!e.source)return{dispose:()=>{},onShow:()=>{},onTalk:()=>{}};let t=null,n=null,r=null,o=(l,a)=>{fe(e.cfg,`/api/runtime/sessions/${e.getSessionId()}/outcome`,{...e.buildBody(),interventionId:l,outcome:a})},i=l=>{let a=null;try{let c=JSON.parse(l.data);if(!c||typeof c.interventionId!="string")return;a=c}catch{return}if(a){if(a.modality!=="text"&&a.modality!=="voice_presentation"){e.cfg.onError?.(new Error(`Modality '${a.modality}' is not supported in this SDK build`),{method:"NOTE",path:"(fire_intervention)"});return}if(a.route){let c=a.route.split("?")[0];if(c&&c!==window.location.pathname){o(a.interventionId,"ignored");return}}t&&t.close("ignored"),t=rc(e,a,{showHandler:n,talkHandler:r},()=>{t&&t.event.interventionId===a.interventionId&&(t=null)})}},s=l=>{let a=null;try{a=JSON.parse(l.data)}catch{return}!a||!a.firstMeeting||!a.copilot?.intro||t||(t=oc(e,a,()=>{t=null}))};return e.source.addEventListener("fire_intervention",i),e.source.addEventListener("copilot_changed",s),{dispose(){e.source?.removeEventListener("fire_intervention",i),e.source?.removeEventListener("copilot_changed",s),t?.detach(),t=null},onShow(l){n=l},onTalk(l){r=l}}}function rc(e,t,n,r){let o=us();ps(o,e);let i=o.shadowRoot;i.innerHTML="";let s=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,l=t.copilot?.name?.trim()||"Copilot",a=t.copilot?.roleLine?.trim()||"",c=document.createElement("div");c.className=`note enter ${e.dock}`,c.setAttribute("role","status"),c.setAttribute("aria-live","polite"),c.setAttribute("data-holostaff","note"),c.setAttribute("data-holostaff-intervention",t.interventionId),c.setAttribute("data-holostaff-modality",t.modality);let d=document.createElement("div");d.className="head";let u=document.createElement("div");u.className="idblock";let h=document.createElement("div");if(h.className="name",h.textContent=l,u.appendChild(h),a){let x=document.createElement("div");x.className="role",x.textContent=a,u.appendChild(x)}d.appendChild(u);let f=document.createElement("button");f.className="x",f.type="button",f.setAttribute("aria-label","Dismiss"),f.textContent="\u2715",d.appendChild(f);let p=document.createElement("div");p.className="message",p.textContent=t.content||t.goal;let m=t.modality==="voice_presentation",b=document.createElement("div");b.className="actions",n.talkHandler&&b.appendChild(Dr("secondary","Talk",()=>{n.talkHandler?.(ds(t)),w.close("engaged")})),m&&n.showHandler?b.appendChild(Dr("primary","Show me",()=>{n.showHandler?.(ds(t)),w.close("engaged")})):b.appendChild(Dr("primary","Got it",()=>w.close("engaged"))),c.append(d,p,b),Et(i,fs()),i.append(c),s?c.classList.remove("enter"):requestAnimationFrame(()=>requestAnimationFrame(()=>c.classList.remove("enter"))),e.presence.chip?.playGesture(e.presence.chip.innerGlance()),e.presence.chip?.setTagSuppressed(!0);let g=!1,v=!1,y=ec,E=null,N=0,k=!1,O=()=>{g||!v||k||(N=Date.now(),E=setTimeout(()=>w.close("ignored"),y))},A=()=>{k=!0,E!=null&&(clearTimeout(E),E=null,y=Math.max(1e3,y-(Date.now()-N)))},$=()=>{k&&(k=!1,O())},V=()=>{v||g||(v=!0,window.removeEventListener("pointerdown",V),window.removeEventListener("scroll",V),window.removeEventListener("keydown",V),F!=null&&(clearTimeout(F),F=null),document.hidden||O())};window.addEventListener("pointerdown",V,{passive:!0}),window.addEventListener("scroll",V,{passive:!0}),window.addEventListener("keydown",V);let F=setTimeout(V,tc);c.addEventListener("mouseenter",A),c.addEventListener("focusin",A),c.addEventListener("mouseleave",$),c.addEventListener("focusout",$);let U=()=>{document.hidden?A():v&&$()};document.addEventListener("visibilitychange",U);let W=x=>{fe(e.cfg,`/api/runtime/sessions/${e.getSessionId()}/outcome`,{...e.buildBody(),interventionId:t.interventionId,outcome:x})},R=()=>{E!=null&&clearTimeout(E),F!=null&&clearTimeout(F),window.removeEventListener("pointerdown",V),window.removeEventListener("scroll",V),window.removeEventListener("keydown",V),document.removeEventListener("visibilitychange",U),e.presence.chip?.setTagSuppressed(!1)},I=x=>{if(g)return;g=!0,R(),x&&W(x);let T=()=>{try{i.removeChild(c)}catch{}r()};if(s){T();return}c.classList.add("exit");let C=!1,S=()=>{C||(C=!0,T())};c.addEventListener("transitionend",S,{once:!0}),setTimeout(S,Lr+80)};f.addEventListener("click",()=>I("dismissed"));let w={event:t,close(x){I(x)},detach(){I(null)}};return w}function oc(e,t,n){let r=us();ps(r,e);let o=r.shadowRoot;o.innerHTML="";let i=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,s=t.copilot.name?.trim()||"Copilot",l=t.copilot.roleLine?.trim()||"",a=document.createElement("div");a.className=`note enter ${e.dock}`,a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.setAttribute("data-holostaff","intro");let c=document.createElement("div");c.className="head";let d=document.createElement("div");d.className="idblock";let u=document.createElement("div");if(u.className="name",u.textContent=s,d.appendChild(u),l){let v=document.createElement("div");v.className="role",v.textContent=l,d.appendChild(v)}c.appendChild(d);let h=document.createElement("button");h.className="x",h.type="button",h.setAttribute("aria-label","Dismiss"),h.textContent="\u2715",c.appendChild(h);let f=document.createElement("div");f.className="message",f.textContent=t.copilot.intro,a.append(c,f),Et(o,fs()),o.append(a),i?a.classList.remove("enter"):requestAnimationFrame(()=>requestAnimationFrame(()=>a.classList.remove("enter"))),e.presence.chip?.setTagSuppressed(!0);let p=!1,m=setTimeout(()=>g.close(null),nc),b=()=>{if(p)return;p=!0,e.presence.chip?.setTagSuppressed(!1),m!=null&&(clearTimeout(m),m=null);let v=()=>{try{o.removeChild(a)}catch{}n()};if(i){v();return}a.classList.add("exit");let y=!1,E=()=>{y||(y=!0,v())};a.addEventListener("transitionend",E,{once:!0}),setTimeout(E,Lr+80)};h.addEventListener("click",b);let g={event:{interventionId:`intro_${t.copilot.copilotId}`,modality:"text",content:t.copilot.intro,goal:"",stage:t.stage},close(){b()},detach(){b()}};return g}function ds(e){return{interventionId:e.interventionId,goal:e.goal,content:e.content,stage:e.stage}}function Dr(e,t,n){let r=document.createElement("button");return r.className=`btn ${e}`,r.type="button",r.textContent=t,r.addEventListener("click",n),r}function us(){let e=document.getElementById(cs);return e||(e=document.createElement("div"),e.id=cs,e.setAttribute("data-holostaff","note-host"),e.style.cssText="position:fixed;z-index:2147483646;pointer-events:none",e.attachShadow({mode:"open"}),document.body.appendChild(e),e)}function ps(e,t){let r=t.presence.chip?.getAnchorRect()??null;if(e.style.top=e.style.bottom=e.style.left=e.style.right="",r){t.dock.startsWith("bottom")?e.style.bottom=`${Math.max(8,window.innerHeight-r.top+12)}px`:e.style.top=`${Math.max(8,r.bottom+12)}px`,t.dock.endsWith("right")?e.style.right=`${Math.max(8,window.innerWidth-r.right)}px`:e.style.left=`${Math.max(8,r.left)}px`;return}let o=16;t.dock.startsWith("bottom")?e.style.bottom=`${o+64}px`:e.style.top=`${o+64}px`,t.dock.endsWith("right")?e.style.right=`${o}px`:e.style.left=`${o}px`}function fs(){return`
|
|
74
74
|
:host { all: initial; }
|
|
75
75
|
.note {
|
|
76
76
|
pointer-events: auto;
|
|
@@ -107,7 +107,7 @@ End of stack for Error object`:a.name+": "+a.message}return a});function i(l){re
|
|
|
107
107
|
.btn.secondary:hover { background: rgba(255,255,255,0.16); }
|
|
108
108
|
.btn:focus-visible, .x:focus-visible { outline: 2px solid #9ab8ff; outline-offset: 2px; }
|
|
109
109
|
@media (prefers-reduced-motion: reduce) { .note { transition: none; } }
|
|
110
|
-
`}var ic="holostaff-theater-root";function hs(e){if(typeof window>"u"||typeof document>"u")return lc();let t=sc(e.baseUrl),n=null,r=null,o=!1,i=!0,s=null,l=null,a=null,c=!1,d=null,u=y=>{if(t&&y.origin!==t)return;let E=y.data;if(!(!E||typeof E.type!="string"))switch(E.type){case"theater-ready":o=!0,s&&(clearTimeout(s),s=null),f(),l&&(p(l),l=null);break;case"theater-close":v();break;case"theater-error":e.onError?.(new Error(`Theater: ${E.error??"render error"}`));break}};window.addEventListener("message",u);let h=()=>{if(n)return;n=document.createElement("div"),n.id=ic,n.style.cssText=["position:fixed","inset:0","z-index:2147483647","background:rgba(8,9,12,0.62)","backdrop-filter:blur(2px)","opacity:0","transition:opacity 200ms ease-out"].join(";"),r=document.createElement("iframe"),r.title="Copilot presentation",r.setAttribute("sandbox","allow-scripts allow-same-origin"),r.style.cssText=["position:absolute","inset:0","width:100%","height:100%","border:0","background:transparent"].join(";"),r.addEventListener("error",()=>m());let y=document.createElement("button");y.type="button",y.setAttribute("aria-label","Close presentation"),y.textContent="\u2715",y.style.cssText=["position:absolute","top:18px","right:20px","z-index:2","width:40px","height:40px","border-radius:50%","border:0","background:rgba(255,255,255,0.14)","color:#fff","font-size:16px","cursor:pointer"].join(";"),y.addEventListener("click",()=>v()),n.addEventListener("click",E=>{E.target===n&&v()}),n.append(r,y,b()),document.body.appendChild(n),requestAnimationFrame(()=>{n&&(n.style.opacity="1")}),d&&(ac(d.wrap,d.fromRect),d=null),o=!1,r.src=`${e.baseUrl.replace(/\/$/,"")}/theater/app`,s=setTimeout(()=>{o||m()},6e3)},f=()=>{let y=e.presence.getDesignTokens();g({type:"theme",tokens:y})},p=y=>{let E=e.buildContext(),N=e.presence.getCopilot();g({type:"present",payload:{...E,copilotId:N?.copilotId,copilotName:N?.name,intent:y.intent,context:y.context}})},g=y=>{try{r?.contentWindow?.postMessage(y,t||"*")}catch{}},b=()=>{let y=document.createElement("div");y.style.cssText=["position:absolute","right:24px","bottom:24px","z-index:2","width:128px","height:128px","border-radius:50%","overflow:hidden","box-shadow:0 10px 30px rgba(0,0,0,0.45), 0 0 0 3px rgba(255,255,255,0.10)","background:#1a1a1a"].join(";");let E=a?.acquire()??null;if(E)return c=!0,E.video.style.cssText="width:100%;height:100%;object-fit:cover",y.appendChild(E.video),d={wrap:y,fromRect:E.fromRect},y;let N=e.presence.getCopilot(),k=N?.portrait;if(k?.idle||k?.idleMp4||k?.poster){let O=document.createElement("video");O.muted=!0,O.loop=!0,O.autoplay=!0,O.playsInline=!0,O.setAttribute("playsinline",""),O.style.cssText="width:100%;height:100%;object-fit:cover",k.poster&&(O.poster=k.poster);let A=k.idle||k.idleMp4;A&&(O.src=A,O.play().catch(()=>{})),y.appendChild(O)}else if(N?.avatar){let O=document.createElement("img");O.src=N.avatar,O.alt="",O.referrerPolicy="no-referrer",O.style.cssText="width:100%;height:100%;object-fit:cover",y.appendChild(O)}return y},m=()=>{i=!1,e.onError?.(new Error("Theater unavailable (likely host frame-src CSP). Falling back to telling.")),v()},v=()=>{if(s&&(clearTimeout(s),s=null),!n)return;if(c){try{a?.release()}catch{}c=!1}let y=n;n=null,r=null,o=!1,l=null,y.style.opacity="0",setTimeout(()=>{try{y.remove()}catch{}},200)};return{present(y){!i||!y?.intent||(h(),o?p(y):l=y)},highlight(y){g({type:"highlight",elementId:y})},close:v,setPresenter(y){a=y},isAvailable:()=>i,dispose(){window.removeEventListener("message",u),v()}}}function sc(e){try{return new URL(e).origin}catch{return""}}function ac(e,t){if(typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let r=e.getBoundingClientRect();if(!r.width||!r.height||!t.width||!t.height)return;let o=t.left-r.left,i=t.top-r.top,s=t.width/r.width,l=t.height/r.height;e.style.transformOrigin="top left",e.style.transition="none",e.style.transform=`translate(${o}px, ${i}px) scale(${s}, ${l})`,requestAnimationFrame(()=>{e.style.transition="transform 420ms cubic-bezier(0.16, 1, 0.3, 1)",e.style.transform="none"})}function lc(){return{present:()=>{},highlight:()=>{},close:()=>{},setPresenter:()=>{},isAvailable:()=>!1,dispose:()=>{}}}async function Fr(e,t){let n=new RTCPeerConnection;for(let p of e.micStream.getAudioTracks())n.addTrack(p,e.micStream);e.audioOut&&n.addEventListener("track",p=>{p.track.kind==="audio"&&p.streams[0]&&t.onRemoteAudio?.(p.streams[0])});let r=n.createDataChannel("oai-events"),o=ms(),i=!1,s=p=>{try{r.readyState==="open"&&r.send(JSON.stringify(p))}catch{}},l=/\/realtime\/calls(?:\?|$)/i.test(e.realtimeUrl),a=e.tools.map(p=>({type:"function",name:p.name,description:p.description,parameters:p.parameters}));r.addEventListener("open",()=>{let p=l?{type:"realtime",output_modalities:e.audioOut?["audio"]:["text"],...e.instructions?{instructions:e.instructions}:{},tools:a,tool_choice:"auto",audio:{input:{transcription:{model:"whisper-1"},turn_detection:{type:"semantic_vad"}},...e.audioOut&&e.voice?{output:{voice:e.voice}}:{}}}:{modalities:e.audioOut?["audio","text"]:["text"],...e.audioOut&&e.voice?{voice:e.voice}:{},...e.instructions?{instructions:e.instructions}:{},tools:a,tool_choice:"auto",input_audio_transcription:{model:"whisper-1"},turn_detection:{type:"server_vad",threshold:.5,silence_duration_ms:500}};s({type:"session.update",session:p}),e.seedMessage&&s({type:"conversation.item.create",item:{type:"message",role:"user",content:[{type:"input_text",text:e.seedMessage}]}}),s({type:"response.create"})}),r.addEventListener("message",p=>{let g;try{g=JSON.parse(p.data)}catch{return}c(g)});let c=p=>{switch(p.type){case"response.text.delta":case"response.output_text.delta":case"response.audio_transcript.delta":case"response.output_audio_transcript.delta":typeof p.delta=="string"&&t.onTextDelta(p.delta,o);break;case"response.created":i=!0;break;case"response.text.done":case"response.output_text.done":case"response.audio_transcript.done":case"response.output_audio_transcript.done":case"response.done":p.type==="response.done"&&(i=!1),t.onTurnDone(o),o=ms();break;case"input_audio_buffer.speech_started":t.onUserSpeechStarted();break;case"conversation.item.input_audio_transcription.completed":typeof p.transcript=="string"&&p.transcript.trim()&&t.onUserTranscript?.(p.transcript.trim());break;case"output_audio_buffer.started":t.onAudioPlaybackStarted?.();break;case"output_audio_buffer.stopped":case"output_audio_buffer.cleared":t.onAudioPlaybackStopped?.();break;case"response.function_call_arguments.done":{let g=typeof p.name=="string"?p.name:"",b=typeof p.call_id=="string"?p.call_id:"",m={};if(typeof p.arguments=="string")try{m=JSON.parse(p.arguments)}catch{}g&&b&&t.onToolCall({name:g,args:m,callId:b});break}case"error":t.onError(new Error(typeof p.error=="object"&&p.error?JSON.stringify(p.error):"realtime error"));break}},d=await n.createOffer();await n.setLocalDescription(d),await cc(n);let u=l?e.realtimeUrl:`${e.realtimeUrl}?model=${encodeURIComponent(e.realtimeModel)}`,h=await fetch(u,{method:"POST",headers:{Authorization:`Bearer ${e.ephemeralKey}`,"Content-Type":"application/sdp"},body:n.localDescription?.sdp??d.sdp??""});if(!h.ok)throw n.close(),new Error(`realtime SDP ${h.status}: ${(await h.text().catch(()=>"")).slice(0,200)}`);let f=await h.text();return await n.setRemoteDescription({type:"answer",sdp:f}),{sendToolResult(p,g){s({type:"conversation.item.create",item:{type:"function_call_output",call_id:p,output:typeof g=="string"?g:JSON.stringify(g)}}),s({type:"response.create"})},cancelResponse(){i&&s({type:"response.cancel"})},close(){try{r.close()}catch{}try{n.close()}catch{}}}}function ms(){return`turn_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,6)}`}function cc(e){return e.iceGatheringState==="complete"?Promise.resolve():new Promise(t=>{let n=()=>{e.removeEventListener("icegatheringstatechange",r),t()},r=()=>{e.iceGatheringState==="complete"&&n()};e.addEventListener("icegatheringstatechange",r),setTimeout(n,1500)})}async function gs(e){let n=await import(["@anam-ai","js-sdk"].join("/")),r=n.createClient??n.default?.createClient;if(typeof r!="function")throw new Error("@anam-ai/js-sdk: createClient not found (version mismatch)");let o=r(e.sessionToken,{disableInputAudio:!0}),i=uc(e.videoEl);typeof o.streamToVideoElement=="function"?await o.streamToVideoElement(i):typeof o.startSession=="function"&&await o.startSession();let s=[],l=!1,a=0,c=null,d=async()=>{let h=c;if(c=null,h?.endMessage)try{await h.endMessage()}catch{}},u=async()=>{if(!l){l=!0;try{for(;s.length;){let h=a,f=s.shift();if(!f)continue;if(await d(),h!==a)break;let p=null,g=`hs-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;try{typeof o.createTalkMessageStream=="function"&&(p=o.createTalkMessageStream(g))}catch{}if(!p){if(typeof o.talk=="function")try{await o.talk(f)}catch{}continue}c=p;let b=f+" ";try{p.streamMessageChunk&&await p.streamMessageChunk(b,!0)}catch(m){e.onError?.(m instanceof Error?m:new Error(String(m)))}if(await dc(Math.max(1200,Math.ceil(b.length*70)),()=>h!==a),h!==a)break;await d()}}finally{l=!1}}};return{enqueueSentence(h){let f=h.trim();f&&(s.push(f),u())},interrupt(){a++,s.length=0;try{o.interruptPersona?.()}catch{}d()},stop(){a++,s.length=0;try{o.interruptPersona?.()}catch{}d();try{typeof o.stopStreaming=="function"?o.stopStreaming():typeof o.disconnect=="function"&&o.disconnect()}catch{}}}}function dc(e,t){return new Promise(n=>{let r=Date.now(),o=()=>{if(t()||Date.now()-r>=e){n();return}setTimeout(o,100)};o()})}function uc(e){return e.id||(e.id=`holostaff-anam-${Math.random().toString(36).slice(2,9)}`),e.id}async function vs(e){let t=await hc(),{Room:n,RoomEvent:r,Track:o}=t,i=new n({adaptiveStream:!1,dynacast:!1});i.on(r.TrackSubscribed,b=>{b.kind===o.Kind.Video?(b.attach(e.videoEl),e.onVideo?.()):b.kind===o.Kind.Audio&&b.attach(e.audioEl)}),i.on(r.Disconnected,()=>e.onClosed?.()),await i.connect(e.livekitUrl,e.livekitToken);let s=new WebSocket(e.wsUrl),l=!1,a=[],c=b=>{let m=JSON.stringify(b);if(l&&s.readyState===WebSocket.OPEN)try{s.send(m)}catch{}else a.push(m)};s.addEventListener("open",()=>{l=!0;for(let b of a.splice(0))try{s.send(b)}catch{}}),s.addEventListener("message",b=>{let m={};try{m=JSON.parse(b.data)}catch{return}m.type==="agent.speak_started"?e.onSpeaking?.(!0):m.type==="agent.speak_ended"?e.onSpeaking?.(!1):m.type==="error"&&e.onError?.(new Error(`avatar ws: ${b.data.slice(0,200)}`))}),s.addEventListener("close",()=>{l=!1,e.onClosed?.()}),s.addEventListener("error",()=>e.onError?.(new Error("avatar control WS error")));let d=setInterval(()=>c({type:"session.keep_alive"}),6e4),u=!1,h="",f=null,p=null,g=()=>`hs-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`;return{async attachRealtimeAudio(b){f||(f=new an,f.onChunk=m=>{u&&c({type:"agent.speak",audio:m,event_id:h})},await f.start(b))},async attachMic(b){p||(p=new an,p.onChunk=m=>c({type:"listener.audio",audio:m}),await p.start(b))},beginTurn(){u=!0,h=g()},speakEnd(){u&&(u=!1,c({type:"agent.speak_end",event_id:h}))},interrupt(){u=!1,c({type:"agent.interrupt"})},stop(){u=!1,clearInterval(d);try{f?.stop()}catch{}try{p?.stop()}catch{}try{s.close(1e3,"stage closed")}catch{}try{i.disconnect()}catch{}try{e.videoEl.srcObject=null}catch{}try{e.audioEl.srcObject=null}catch{}}}}var pc=`
|
|
110
|
+
`}var ic="holostaff-theater-root";function hs(e){if(typeof window>"u"||typeof document>"u")return lc();let t=sc(e.baseUrl),n=null,r=null,o=!1,i=!0,s=null,l=null,a=null,c=!1,d=null,u=y=>{if(t&&y.origin!==t)return;let E=y.data;if(!(!E||typeof E.type!="string"))switch(E.type){case"theater-ready":o=!0,s&&(clearTimeout(s),s=null),f(),l&&(p(l),l=null);break;case"theater-close":v();break;case"theater-error":e.onError?.(new Error(`Theater: ${E.error??"render error"}`));break}};window.addEventListener("message",u);let h=()=>{if(n)return;n=document.createElement("div"),n.id=ic,n.style.cssText=["position:fixed","inset:0","z-index:2147483647","background:rgba(8,9,12,0.62)","backdrop-filter:blur(2px)","opacity:0","transition:opacity 200ms ease-out"].join(";"),r=document.createElement("iframe"),r.title="Copilot presentation",r.setAttribute("sandbox","allow-scripts allow-same-origin"),r.style.cssText=["position:absolute","inset:0","width:100%","height:100%","border:0","background:transparent"].join(";"),r.addEventListener("error",()=>g());let y=document.createElement("button");y.type="button",y.setAttribute("aria-label","Close presentation"),y.textContent="\u2715",y.style.cssText=["position:absolute","top:18px","right:20px","z-index:2","width:40px","height:40px","border-radius:50%","border:0","background:rgba(255,255,255,0.14)","color:#fff","font-size:16px","cursor:pointer"].join(";"),y.addEventListener("click",()=>v()),n.addEventListener("click",E=>{E.target===n&&v()}),n.append(r,y,b()),document.body.appendChild(n),requestAnimationFrame(()=>{n&&(n.style.opacity="1")}),d&&(ac(d.wrap,d.fromRect),d=null),o=!1,r.src=`${e.baseUrl.replace(/\/$/,"")}/theater/app`,s=setTimeout(()=>{o||g()},6e3)},f=()=>{let y=e.presence.getDesignTokens();m({type:"theme",tokens:y})},p=y=>{let E=e.buildContext(),N=e.presence.getCopilot();m({type:"present",payload:{...E,copilotId:N?.copilotId,copilotName:N?.name,intent:y.intent,context:y.context}})},m=y=>{try{r?.contentWindow?.postMessage(y,t||"*")}catch{}},b=()=>{let y=document.createElement("div");y.style.cssText=["position:absolute","right:24px","bottom:24px","z-index:2","width:128px","height:128px","border-radius:50%","overflow:hidden","box-shadow:0 10px 30px rgba(0,0,0,0.45), 0 0 0 3px rgba(255,255,255,0.10)","background:#1a1a1a"].join(";");let E=a?.acquire()??null;if(E)return c=!0,E.video.style.cssText="width:100%;height:100%;object-fit:cover",y.appendChild(E.video),d={wrap:y,fromRect:E.fromRect},y;let N=e.presence.getCopilot(),k=N?.portrait;if(k?.idle||k?.idleMp4||k?.poster){let O=document.createElement("video");O.muted=!0,O.loop=!0,O.autoplay=!0,O.playsInline=!0,O.setAttribute("playsinline",""),O.style.cssText="width:100%;height:100%;object-fit:cover",k.poster&&(O.poster=k.poster);let A=k.idle||k.idleMp4;A&&(O.src=A,O.play().catch(()=>{})),y.appendChild(O)}else if(N?.avatar){let O=document.createElement("img");O.src=N.avatar,O.alt="",O.referrerPolicy="no-referrer",O.style.cssText="width:100%;height:100%;object-fit:cover",y.appendChild(O)}return y},g=()=>{i=!1,e.onError?.(new Error("Theater unavailable (likely host frame-src CSP). Falling back to telling.")),v()},v=()=>{if(s&&(clearTimeout(s),s=null),!n)return;if(c){try{a?.release()}catch{}c=!1}let y=n;n=null,r=null,o=!1,l=null,y.style.opacity="0",setTimeout(()=>{try{y.remove()}catch{}},200)};return{present(y){!i||!y?.intent||(h(),o?p(y):l=y)},highlight(y){m({type:"highlight",elementId:y})},close:v,setPresenter(y){a=y},isAvailable:()=>i,dispose(){window.removeEventListener("message",u),v()}}}function sc(e){try{return new URL(e).origin}catch{return""}}function ac(e,t){if(typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let r=e.getBoundingClientRect();if(!r.width||!r.height||!t.width||!t.height)return;let o=t.left-r.left,i=t.top-r.top,s=t.width/r.width,l=t.height/r.height;e.style.transformOrigin="top left",e.style.transition="none",e.style.transform=`translate(${o}px, ${i}px) scale(${s}, ${l})`,requestAnimationFrame(()=>{e.style.transition="transform 420ms cubic-bezier(0.16, 1, 0.3, 1)",e.style.transform="none"})}function lc(){return{present:()=>{},highlight:()=>{},close:()=>{},setPresenter:()=>{},isAvailable:()=>!1,dispose:()=>{}}}async function Fr(e,t){let n=new RTCPeerConnection;for(let p of e.micStream.getAudioTracks())n.addTrack(p,e.micStream);e.audioOut&&n.addEventListener("track",p=>{p.track.kind==="audio"&&p.streams[0]&&t.onRemoteAudio?.(p.streams[0])});let r=n.createDataChannel("oai-events"),o=ms(),i=!1,s=p=>{try{r.readyState==="open"&&r.send(JSON.stringify(p))}catch{}},l=/\/realtime\/calls(?:\?|$)/i.test(e.realtimeUrl),a=e.tools.map(p=>({type:"function",name:p.name,description:p.description,parameters:p.parameters}));r.addEventListener("open",()=>{let p=l?{type:"realtime",output_modalities:e.audioOut?["audio"]:["text"],...e.instructions?{instructions:e.instructions}:{},tools:a,tool_choice:"auto",audio:{input:{transcription:{model:"whisper-1"},turn_detection:{type:"semantic_vad"}},...e.audioOut&&e.voice?{output:{voice:e.voice}}:{}}}:{modalities:e.audioOut?["audio","text"]:["text"],...e.audioOut&&e.voice?{voice:e.voice}:{},...e.instructions?{instructions:e.instructions}:{},tools:a,tool_choice:"auto",input_audio_transcription:{model:"whisper-1"},turn_detection:{type:"server_vad",threshold:.5,silence_duration_ms:500}};s({type:"session.update",session:p}),e.seedMessage&&s({type:"conversation.item.create",item:{type:"message",role:"user",content:[{type:"input_text",text:e.seedMessage}]}}),s({type:"response.create"})}),r.addEventListener("message",p=>{let m;try{m=JSON.parse(p.data)}catch{return}c(m)});let c=p=>{switch(p.type){case"response.text.delta":case"response.output_text.delta":case"response.audio_transcript.delta":case"response.output_audio_transcript.delta":typeof p.delta=="string"&&t.onTextDelta(p.delta,o);break;case"response.created":i=!0;break;case"response.text.done":case"response.output_text.done":case"response.audio_transcript.done":case"response.output_audio_transcript.done":case"response.done":p.type==="response.done"&&(i=!1),t.onTurnDone(o),o=ms();break;case"input_audio_buffer.speech_started":t.onUserSpeechStarted();break;case"conversation.item.input_audio_transcription.completed":typeof p.transcript=="string"&&p.transcript.trim()&&t.onUserTranscript?.(p.transcript.trim());break;case"output_audio_buffer.started":t.onAudioPlaybackStarted?.();break;case"output_audio_buffer.stopped":case"output_audio_buffer.cleared":t.onAudioPlaybackStopped?.();break;case"response.function_call_arguments.done":{let m=typeof p.name=="string"?p.name:"",b=typeof p.call_id=="string"?p.call_id:"",g={};if(typeof p.arguments=="string")try{g=JSON.parse(p.arguments)}catch{}m&&b&&t.onToolCall({name:m,args:g,callId:b});break}case"error":t.onError(new Error(typeof p.error=="object"&&p.error?JSON.stringify(p.error):"realtime error"));break}},d=await n.createOffer();await n.setLocalDescription(d),await cc(n);let u=l?e.realtimeUrl:`${e.realtimeUrl}?model=${encodeURIComponent(e.realtimeModel)}`,h=await fetch(u,{method:"POST",headers:{Authorization:`Bearer ${e.ephemeralKey}`,"Content-Type":"application/sdp"},body:n.localDescription?.sdp??d.sdp??""});if(!h.ok)throw n.close(),new Error(`realtime SDP ${h.status}: ${(await h.text().catch(()=>"")).slice(0,200)}`);let f=await h.text();return await n.setRemoteDescription({type:"answer",sdp:f}),{sendToolResult(p,m){s({type:"conversation.item.create",item:{type:"function_call_output",call_id:p,output:typeof m=="string"?m:JSON.stringify(m)}}),s({type:"response.create"})},cancelResponse(){i&&s({type:"response.cancel"})},close(){try{r.close()}catch{}try{n.close()}catch{}}}}function ms(){return`turn_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,6)}`}function cc(e){return e.iceGatheringState==="complete"?Promise.resolve():new Promise(t=>{let n=()=>{e.removeEventListener("icegatheringstatechange",r),t()},r=()=>{e.iceGatheringState==="complete"&&n()};e.addEventListener("icegatheringstatechange",r),setTimeout(n,1500)})}async function gs(e){let n=await import(["@anam-ai","js-sdk"].join("/")),r=n.createClient??n.default?.createClient;if(typeof r!="function")throw new Error("@anam-ai/js-sdk: createClient not found (version mismatch)");let o=r(e.sessionToken,{disableInputAudio:!0}),i=uc(e.videoEl);typeof o.streamToVideoElement=="function"?await o.streamToVideoElement(i):typeof o.startSession=="function"&&await o.startSession();let s=[],l=!1,a=0,c=null,d=async()=>{let h=c;if(c=null,h?.endMessage)try{await h.endMessage()}catch{}},u=async()=>{if(!l){l=!0;try{for(;s.length;){let h=a,f=s.shift();if(!f)continue;if(await d(),h!==a)break;let p=null,m=`hs-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;try{typeof o.createTalkMessageStream=="function"&&(p=o.createTalkMessageStream(m))}catch{}if(!p){if(typeof o.talk=="function")try{await o.talk(f)}catch{}continue}c=p;let b=f+" ";try{p.streamMessageChunk&&await p.streamMessageChunk(b,!0)}catch(g){e.onError?.(g instanceof Error?g:new Error(String(g)))}if(await dc(Math.max(1200,Math.ceil(b.length*70)),()=>h!==a),h!==a)break;await d()}}finally{l=!1}}};return{enqueueSentence(h){let f=h.trim();f&&(s.push(f),u())},interrupt(){a++,s.length=0;try{o.interruptPersona?.()}catch{}d()},stop(){a++,s.length=0;try{o.interruptPersona?.()}catch{}d();try{typeof o.stopStreaming=="function"?o.stopStreaming():typeof o.disconnect=="function"&&o.disconnect()}catch{}}}}function dc(e,t){return new Promise(n=>{let r=Date.now(),o=()=>{if(t()||Date.now()-r>=e){n();return}setTimeout(o,100)};o()})}function uc(e){return e.id||(e.id=`holostaff-anam-${Math.random().toString(36).slice(2,9)}`),e.id}async function vs(e){let t=await hc(),{Room:n,RoomEvent:r,Track:o}=t,i=new n({adaptiveStream:!1,dynacast:!1});i.on(r.TrackSubscribed,b=>{b.kind===o.Kind.Video?(b.attach(e.videoEl),e.onVideo?.()):b.kind===o.Kind.Audio&&b.attach(e.audioEl)}),i.on(r.Disconnected,()=>e.onClosed?.()),await i.connect(e.livekitUrl,e.livekitToken);let s=new WebSocket(e.wsUrl),l=!1,a=[],c=b=>{let g=JSON.stringify(b);if(l&&s.readyState===WebSocket.OPEN)try{s.send(g)}catch{}else a.push(g)};s.addEventListener("open",()=>{l=!0;for(let b of a.splice(0))try{s.send(b)}catch{}}),s.addEventListener("message",b=>{let g={};try{g=JSON.parse(b.data)}catch{return}g.type==="agent.speak_started"?e.onSpeaking?.(!0):g.type==="agent.speak_ended"?e.onSpeaking?.(!1):g.type==="error"&&e.onError?.(new Error(`avatar ws: ${b.data.slice(0,200)}`))}),s.addEventListener("close",()=>{l=!1,e.onClosed?.()}),s.addEventListener("error",()=>e.onError?.(new Error("avatar control WS error")));let d=setInterval(()=>c({type:"session.keep_alive"}),6e4),u=!1,h="",f=null,p=null,m=()=>`hs-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`;return{async attachRealtimeAudio(b){f||(f=new an,f.onChunk=g=>{u&&c({type:"agent.speak",audio:g,event_id:h})},await f.start(b))},async attachMic(b){p||(p=new an,p.onChunk=g=>c({type:"listener.audio",audio:g}),await p.start(b))},beginTurn(){u=!0,h=m()},speakEnd(){u&&(u=!1,c({type:"agent.speak_end",event_id:h}))},interrupt(){u=!1,c({type:"agent.interrupt"})},stop(){u=!1,clearInterval(d);try{f?.stop()}catch{}try{p?.stop()}catch{}try{s.close(1e3,"stage closed")}catch{}try{i.disconnect()}catch{}try{e.videoEl.srcObject=null}catch{}try{e.audioEl.srcObject=null}catch{}}}}var pc=`
|
|
111
111
|
class HsPcmProcessor extends AudioWorkletProcessor {
|
|
112
112
|
constructor() { super(); this._buf = new Float32Array(0); this._n = 2400 }
|
|
113
113
|
process(inputs) {
|
|
@@ -123,7 +123,7 @@ class HsPcmProcessor extends AudioWorkletProcessor {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
registerProcessor('hs-pcm-processor', HsPcmProcessor)
|
|
126
|
-
`,an=class{constructor(){this.onChunk=null;this.ctx=null;this.src=null;this.node=null;this.started=!1}async start(t){if(this.started)return;this.ctx=new AudioContext({sampleRate:24e3});let n=new Blob([pc],{type:"application/javascript"}),r=URL.createObjectURL(n);await this.ctx.audioWorklet.addModule(r),URL.revokeObjectURL(r),this.src=this.ctx.createMediaStreamSource(t),this.node=new AudioWorkletNode(this.ctx,"hs-pcm-processor"),this.node.port.onmessage=i=>{let s=i.data.samples;this.onChunk?.(fc(s))};let o=this.ctx.createGain();o.gain.value=0,this.src.connect(this.node),this.node.connect(o),o.connect(this.ctx.destination),this.started=!0}stop(){if(this.started){try{this.node?.disconnect()}catch{}try{this.src?.disconnect()}catch{}try{this.ctx?.close()}catch{}this.node=null,this.src=null,this.ctx=null,this.started=!1}}};function fc(e){let t=new Int16Array(e.length);for(let o=0;o<e.length;o++){let i=Math.max(-1,Math.min(1,e[o]??0));t[o]=i<0?i*32768:i*32767}let n=new Uint8Array(t.buffer),r="";for(let o=0;o<n.length;o++)r+=String.fromCharCode(n[o]??0);return btoa(r)}async function hc(){let e=globalThis.LivekitClient;if(e)return e;let t=await import("livekit-client");if(!t?.Room)throw new Error("livekit-client not found (install it or load its UMD build)");return t}var Br="holostaff-stage-root";function ys(e){let t=mc(),n=t;n.innerHTML="",vc(e.dock);let r=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,o=document.createElement("div");o.className=`sheet enter ${e.dock}`,o.setAttribute("role","dialog"),o.setAttribute("aria-label",`Conversation with ${e.copilotName}`);let i=document.createElement("div");i.className="avatar-area";let s=document.createElement("video");s.className="avatar-video",s.autoplay=!0,s.playsInline=!0,s.setAttribute("playsinline",""),i.appendChild(s);let l=document.createElement("div");l.className="state-ring",i.appendChild(l);let a=document.createElement("div");a.className="head";let c=document.createElement("div");c.className="idblock";let d=document.createElement("div");if(d.className="name",d.textContent=e.copilotName,c.appendChild(d),e.scopeLine){let v=document.createElement("div");v.className="scope",v.textContent=e.scopeLine,c.appendChild(v)}a.appendChild(c);let u=document.createElement("button");u.className="cc",u.type="button",u.setAttribute("aria-pressed","false"),u.title="Captions",u.textContent="CC",a.appendChild(u);let h=document.createElement("button");h.className="x",h.type="button",h.setAttribute("aria-label","End conversation"),h.textContent="\u2715",h.addEventListener("click",()=>e.onClose()),a.appendChild(h);let f=document.createElement("div");f.className="state-label",f.textContent="Connecting\u2026";let p=document.createElement("div");p.className="captions",p.setAttribute("aria-live","polite");let
|
|
126
|
+
`,an=class{constructor(){this.onChunk=null;this.ctx=null;this.src=null;this.node=null;this.started=!1}async start(t){if(this.started)return;this.ctx=new AudioContext({sampleRate:24e3});let n=new Blob([pc],{type:"application/javascript"}),r=URL.createObjectURL(n);await this.ctx.audioWorklet.addModule(r),URL.revokeObjectURL(r),this.src=this.ctx.createMediaStreamSource(t),this.node=new AudioWorkletNode(this.ctx,"hs-pcm-processor"),this.node.port.onmessage=i=>{let s=i.data.samples;this.onChunk?.(fc(s))};let o=this.ctx.createGain();o.gain.value=0,this.src.connect(this.node),this.node.connect(o),o.connect(this.ctx.destination),this.started=!0}stop(){if(this.started){try{this.node?.disconnect()}catch{}try{this.src?.disconnect()}catch{}try{this.ctx?.close()}catch{}this.node=null,this.src=null,this.ctx=null,this.started=!1}}};function fc(e){let t=new Int16Array(e.length);for(let o=0;o<e.length;o++){let i=Math.max(-1,Math.min(1,e[o]??0));t[o]=i<0?i*32768:i*32767}let n=new Uint8Array(t.buffer),r="";for(let o=0;o<n.length;o++)r+=String.fromCharCode(n[o]??0);return btoa(r)}async function hc(){let e=globalThis.LivekitClient;if(e)return e;let t=await import("livekit-client");if(!t?.Room)throw new Error("livekit-client not found (install it or load its UMD build)");return t}var Br="holostaff-stage-root";function ys(e){let t=mc(),n=t;n.innerHTML="",vc(e.dock);let r=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,o=document.createElement("div");o.className=`sheet enter ${e.dock}`,o.setAttribute("role","dialog"),o.setAttribute("aria-label",`Conversation with ${e.copilotName}`);let i=document.createElement("div");i.className="avatar-area";let s=document.createElement("video");s.className="avatar-video",s.autoplay=!0,s.playsInline=!0,s.setAttribute("playsinline",""),i.appendChild(s);let l=document.createElement("div");l.className="state-ring",i.appendChild(l);let a=document.createElement("div");a.className="head";let c=document.createElement("div");c.className="idblock";let d=document.createElement("div");if(d.className="name",d.textContent=e.copilotName,c.appendChild(d),e.scopeLine){let v=document.createElement("div");v.className="scope",v.textContent=e.scopeLine,c.appendChild(v)}a.appendChild(c);let u=document.createElement("button");u.className="cc",u.type="button",u.setAttribute("aria-pressed","false"),u.title="Captions",u.textContent="CC",a.appendChild(u);let h=document.createElement("button");h.className="x",h.type="button",h.setAttribute("aria-label","End conversation"),h.textContent="\u2715",h.addEventListener("click",()=>e.onClose()),a.appendChild(h);let f=document.createElement("div");f.className="state-label",f.textContent="Connecting\u2026";let p=document.createElement("div");p.className="captions",p.setAttribute("aria-live","polite");let m=!1;u.addEventListener("click",()=>{m=!m,u.setAttribute("aria-pressed",String(m)),u.classList.toggle("on",m),p.classList.toggle("show",m)});let b=document.createElement("div");return b.className="hint",b.textContent="Can't talk right now? Turn on captions, or use the suggestion buttons.",o.append(a,i,f,p,b),n.appendChild(o),r?o.classList.remove("enter"):requestAnimationFrame(()=>requestAnimationFrame(()=>o.classList.remove("enter"))),{video:s,setState:v=>{o.setAttribute("data-state",v),f.textContent={connecting:"Connecting\u2026",listening:"Listening\u2026",thinking:"Thinking\u2026",speaking:e.copilotName+" is speaking"}[v]},appendCaption(v){p.textContent=(p.textContent??"")+v,p.scrollTop=p.scrollHeight},setHidden(v){t.style.display=v?"none":""},detachVideo(){return s},reattachVideo(){s.parentNode!==i&&i.insertBefore(s,l)},destroy(){o.classList.add("exit"),setTimeout(()=>{try{t.remove()}catch{}},r?0:220)}}}function mc(){let e=document.getElementById(Br);return e||(e=document.createElement("div"),e.id=Br,e.style.cssText="position:fixed;inset:0;z-index:2147483646;pointer-events:none",document.body.appendChild(e),e)}var gc="holostaff-stage-style";function vc(e){let t=e.endsWith("right"),n=t?"right: 20px;":"left: 20px;",r=`${e.startsWith("bottom")?"bottom":"top"} ${t?"right":"left"}`,o=`#${Br}`,i=`
|
|
127
127
|
${o} .sheet { pointer-events: auto; box-sizing: border-box; position: fixed; ${n} bottom: 20px; width: 380px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 40px); background: #0e0f12; color: #fafafa; border-radius: 20px; overflow: hidden; box-shadow: 0 24px 64px rgba(0,0,0,0.45); display: flex; flex-direction: column; font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; transform-origin: ${r}; opacity: 1; transition: opacity 220ms ease-out, transform 220ms cubic-bezier(0.16,1,0.3,1); }
|
|
128
128
|
${o} .sheet * { box-sizing: border-box; }
|
|
129
129
|
${o} .sheet.enter { opacity: 0; transform: scale(0.9) translateY(12px); }
|
|
@@ -149,7 +149,7 @@ registerProcessor('hs-pcm-processor', HsPcmProcessor)
|
|
|
149
149
|
${o} .captions.show { display: block; }
|
|
150
150
|
${o} .hint { padding: 8px 16px 14px; font-size: 11px; color: #6b7280; }
|
|
151
151
|
@media (prefers-reduced-motion: reduce) { ${o} .sheet { transition: none; } }
|
|
152
|
-
`;it(gc,i)}var bs=800,ln=600,yc=15e3,bc=/^(cc-|one-time-code)/i,Sc=/\b(password|passcode|card number|cvv|cvc|security code|ssn|social security|secret)\b/i,Cc=/\b(pay|payment|place order|buy|purchase|order now|check ?out|confirm|complete|delete|remove|cancel|unsubscribe|send|sign|submit|transfer|upgrade|downgrade)\b/i;function fn(e={}){let t=0,n=null,r=null,o=()=>{r&&(clearTimeout(r),r=null);try{n?.remove()}catch{}n=null},i=async(l,a)=>{let c=Date.now();if(c-t<bs&&await Es(bs-(c-t)),n)return{ok:!1,error:"a previous action is still waiting for the visitor to Allow or Deny"};switch(l.action){case"navigate":{let d=(l.path??"").trim();if(!d)return{ok:!1,error:"navigate needs a path"};let u;try{u=new URL(d,window.location.origin)}catch{return{ok:!1,error:`not a valid path: ${d}`}}if(u.origin!==window.location.origin)return{ok:!1,error:"cross-origin navigation is not allowed"};t=Date.now();try{await e.beforeNavigate?.(u.pathname+u.search)}catch{}return window.location.assign(u.href),{ok:!0,did:`navigated to ${u.pathname}${u.search}`}}case"scroll_to":{let d=dn(l.target??"","any");return d.el?(d.el.scrollIntoView({block:"center",behavior:"smooth"}),await un(d.el,ln*2),t=Date.now(),{ok:!0,did:cn(`scrolled to and highlighted "${d.label}"`,d)}):{ok:!1,error:d.error,candidates:d.candidates}}case"hover":{let d=dn(l.target??"","hoverable");return d.el?(d.el.scrollIntoView({block:"center",behavior:"smooth"}),kc(d.el),await un(d.el,ln),t=Date.now(),{ok:!0,did:cn(`hovered "${d.label}" \u2014 controls revealed by hovering should now be on screen`,d)}):{ok:!1,error:d.error,candidates:d.candidates}}case"click":{let d=dn(l.target??"","clickable");if(!d.el)return{ok:!1,error:d.error,candidates:d.candidates};if(d.el.scrollIntoView({block:"center",behavior:"smooth"}),Cc.test(d.label)&&!await s(d.el,d.label,a))return{ok:!1,error:`the visitor did not allow clicking "${d.label}"`};await un(d.el,ln);let u=d.el.closest?d.el.closest("a[href]"):null;if(u&&!u.target&&u.origin===window.location.origin)try{await e.beforeNavigate?.(u.pathname+u.search)}catch{}return Ac(d.el),t=Date.now(),{ok:!0,did:cn(`clicked "${d.label}"`,d)}}case"fill":{if(l.value===void 0)return{ok:!1,error:'fill needs a value (use "" to clear a field)'};let d=l.value,u=dn(l.target??"","fillable");if(!u.el)return{ok:!1,error:u.error,candidates:u.candidates};let h=Tc(u.el,u.label);if(h)return{ok:!1,error:h};u.el.scrollIntoView({block:"center",behavior:"smooth"}),await un(u.el,ln);let f=Nc(u.el,d);return t=Date.now(),f==="reverted"?{ok:!1,error:`"${u.label}" did not keep the typed value \u2014 this widget probably wants a click or a choice from its own list, not free typing`}:f==="failed"?{ok:!1,error:`could not set a value on "${u.label}"`}:{ok:!0,did:cn(d?`filled "${u.label}"`:`cleared "${u.label}"`,u)}}default:return{ok:!1,error:`unknown action ${String(l.action)}`}}},s=(l,a,c)=>(Mc(),new Promise(d=>{let u=document.createElement("div");u.className="holostaff-act-pill";let h=document.createElement("span");h.textContent=`${c} wants to click "${a}"`;let f=document.createElement("button");f.type="button",f.textContent="Allow",f.className="allow";let p=document.createElement("button");p.type="button",p.textContent="Deny",p.className="deny",u.append(h,f,p);let g=l.getBoundingClientRect();u.style.top=`${Math.max(8,g.top-44)}px`,u.style.left=`${Math.max(8,g.left)}px`,document.body.appendChild(u),n=u;let b=m=>{o(),d(m)};f.addEventListener("click",()=>b(!0)),p.addEventListener("click",()=>b(!1)),r=setTimeout(()=>b(!1),yc)}));return{act:i,destroy(){o()}}}function cn(e,t){return t.note?`${e} (${t.note})`:e}var Ic='li, tr, fieldset, section, article, [role="group"], [role="listitem"], [role="row"], [class*="card"], [class*="block"], [class*="item"], [class*="panel"], [class*="row"], [class*="step"], [class*="field"]',wc='h1,h2,h3,h4,h5,h6,label,strong,b,[class*="title"],[class*="name"],[class*="label"],[class*="heading"],input,textarea';function pn(e,t){let n=e.parentElement;for(let r=0;n&&n!==document.body&&r<8;r++,n=n.parentElement){if(!n.matches(Ic))continue;if(n.getBoundingClientRect().height>window.innerHeight*.85)break;let i=0;for(let s of Array.from(n.querySelectorAll(wc))){if(i++>=6)break;if(s.contains(e)||e.contains(s))continue;let a=(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement?s.value||s.placeholder||"":s.textContent??"").replace(/\s+/g," ").trim();if(a&&a.length<=40&&a!==t)return a}}return""}var Pr='a[href], button, [role="button"], input[type="submit"], input[type="button"], summary, [role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"], [role="tab"], [role="switch"]',Ss='input:not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]), textarea, select, [contenteditable="true"]';function dn(e,t){let n=De(e.replace(/^\s*(button|link|input|dropdown|heading|copy|text|note):\s*/i,""));if(!n)return{el:null,label:"",error:"target (visible label) required"};let r=0,o=/^(.*?)\s*#(\d+)(?:\s*\/\s*\d+)?$/.exec(n);o&&o[1].trim()&&(n=o[1].trim(),r=parseInt(o[2],10));let i="",s=/^(.*?)\s*\[in\s+([^\]]+)\]$/.exec(n);s&&s[1].trim()&&(n=s[1].trim(),i=s[2].trim());let l=t==="clickable"?Pr:t==="fillable"?Ss:t==="hoverable"?`${Pr}, tr, li, [role="row"], [role="listitem"], [class*="card"], h1, h2, h3, [aria-label]`:`${Pr}, ${Ss}, h1, h2, h3, [aria-label]`,a=[];for(let f of Array.from(document.querySelectorAll(l))){if(!Is(f))continue;let p=Cs(f);if(!p)continue;let g=Ec(n,De(p));g>0&&a.push({el:f,label:p,score:g})}if(!a.length){let f=Array.from(document.querySelectorAll(l)).filter(Is).map(Cs).filter(Boolean).slice(0,8);return{el:null,label:"",error:`nothing on screen matches "${e}"`,candidates:f}}let c=Math.max(...a.map(f=>f.score)),d=a.filter(f=>f.score===c);if(i){let f=d.filter(p=>{let g=De(pn(p.el,p.label));return g&&(g.includes(i)||i.includes(g))});if(!f.length){let p=[...new Set(d.map(g=>pn(g.el,g.label)).filter(Boolean))];return{el:null,label:"",error:`no "${n}" inside a block matching "${i}"`,candidates:p.slice(0,6).map(g=>`[in: ${g}]`)}}d=f}if(d.find(f=>De(f.label)!==De(d[0].label)))return{el:null,label:"",error:`"${e}" is ambiguous`,candidates:[...new Set(d.slice(0,6).map(f=>f.label))]};if(r>0){let f=d[r-1];return f?{el:f.el,label:`${f.label} #${r}`}:{el:null,label:"",error:`only ${d.length} element${d.length===1?"":"s"} labeled "${d[0].label}" on screen \u2014 there is no #${r}`}}let h=d[0];return{el:h.el,label:h.label,...d.length>1?{note:`this is the 1st of ${d.length} identical "${h.label}" \u2014 target "${h.label} #2" and up for the others`}:{}}}function Cs(e){let t=e.getAttribute("aria-label");if(t?.trim())return t.trim();if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement){if(e.id){let l=document.querySelector(`label[for="${xc(e.id)}"]`);if(l?.textContent?.trim())return l.textContent.trim()}let i=e.closest("label");if(i?.textContent?.trim())return i.textContent.trim();let s=e.getAttribute("placeholder");return s?.trim()?s.trim():e instanceof HTMLInputElement&&(e.type==="submit"||e.type==="button")&&e.value.trim()?e.value.trim():e.name||""}let n=(e.textContent??"").trim().replace(/\s+/g," ");if(n)return n.length>80?"":n;let r=e.querySelector('[class*="i-"]'),o=r&&/i-[a-z0-9-]+:([a-z0-9-]+)/.exec(r.className||"");return o?`(icon: ${o[1].replace(/-\d+-(solid|outline)$/,"")})`:""}function Ec(e,t){if(!t)return 0;if(t===e)return 3;if(t.includes(e)||e.includes(t))return 2;let n=e.split(" ").filter(Boolean);return n.length&&n.filter(o=>t.includes(o)).length/n.length>=.6?1:0}function De(e){return e.toLowerCase().replace(/[():,]/g," ").replace(/\s+/g," ").trim()}function Is(e){if(e.disabled)return!1;let t=e.getBoundingClientRect();if(t.width<2||t.height<2)return!1;let n=window.getComputedStyle(e);return n.visibility!=="hidden"&&n.display!=="none"}function xc(e){return typeof CSS<"u"&&CSS.escape?CSS.escape(e):e.replace(/["\\]/g,"\\$&")}function Tc(e,t){let n=e,r=(n.type??"").toLowerCase(),o=n.autocomplete??"",i=`${t} ${n.name??""} ${n.id??""}`;return r==="password"||bc.test(o)||Sc.test(i)?`"${t}" looks like a sensitive field (password/payment/code). I can point the visitor to it, but they must type it themselves.`:null}function Ac(e){let t={bubbles:!0,cancelable:!0,composed:!0,view:window},n={...t,pointerId:1,pointerType:"mouse",isPrimary:!0};e.dispatchEvent(new PointerEvent("pointerover",n)),e.dispatchEvent(new PointerEvent("pointerdown",n)),e.dispatchEvent(new MouseEvent("mousedown",{...t,button:0})),e.dispatchEvent(new PointerEvent("pointerup",n)),e.dispatchEvent(new MouseEvent("mouseup",{...t,button:0})),e.click()}function kc(e){let t={bubbles:!0,cancelable:!0,composed:!0,view:window},n=e.getBoundingClientRect(),r={clientX:n.left+n.width/2,clientY:n.top+n.height/2},o={...t,...r,pointerId:1,pointerType:"mouse",isPrimary:!0};e.dispatchEvent(new PointerEvent("pointerover",o)),e.dispatchEvent(new PointerEvent("pointerenter",{...o,bubbles:!1})),e.dispatchEvent(new MouseEvent("mouseover",{...t,...r})),e.dispatchEvent(new MouseEvent("mouseenter",{...t,...r,bubbles:!1})),e.dispatchEvent(new PointerEvent("pointermove",o)),e.dispatchEvent(new MouseEvent("mousemove",{...t,...r}))}function ws(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}function Nc(e,t){if(e instanceof HTMLSelectElement){let n=Array.from(e.options).find(r=>De(r.textContent??"")===De(t)||r.value===t);return n?(e.value=n.value,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})),"ok"):"failed"}if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){let n=e instanceof HTMLInputElement?HTMLInputElement.prototype:HTMLTextAreaElement.prototype,r=Object.getOwnPropertyDescriptor(n,"value")?.set;e.focus(),r?r.call(e,t):e.value=t,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}));let o=ws(e.value),i=ws(t);return i?o.includes(i.slice(0,12))?"ok":"reverted":o===""?"ok":"reverted"}if(e.isContentEditable){e.focus();let n=!1;try{let r=window.getSelection();if(r){r.removeAllRanges();let o=document.createRange();o.selectNodeContents(e),r.addRange(o)}n=document.execCommand("insertText",!1,t)}catch{n=!1}return n||(e.textContent=t,e.dispatchEvent(new Event("input",{bubbles:!0}))),De(e.textContent??"").includes(De(t).slice(0,24))?"ok":"reverted"}return"failed"}async function un(e,t){let n=e.style.outline,r=e.style.outlineOffset;e.style.outline="3px solid #4f8bff",e.style.outlineOffset="2px",await Es(t),e.style.outline=n,e.style.outlineOffset=r}function Es(e){return new Promise(t=>setTimeout(t,e))}var Rc="holostaff-act-pill-style";function Mc(){it(Rc,`
|
|
152
|
+
`;it(gc,i)}var bs=800,ln=600,yc=15e3,bc=/^(cc-|one-time-code)/i,Sc=/\b(password|passcode|card number|cvv|cvc|security code|ssn|social security|secret)\b/i,Cc=/\b(pay|payment|place order|buy|purchase|order now|check ?out|confirm|complete|delete|remove|cancel|unsubscribe|send|sign|submit|transfer|upgrade|downgrade)\b/i;function fn(e={}){let t=0,n=null,r=null,o=()=>{r&&(clearTimeout(r),r=null);try{n?.remove()}catch{}n=null},i=async(l,a)=>{let c=Date.now();if(c-t<bs&&await Es(bs-(c-t)),n)return{ok:!1,error:"a previous action is still waiting for the visitor to Allow or Deny"};switch(l.action){case"navigate":{let d=(l.path??"").trim();if(!d)return{ok:!1,error:"navigate needs a path"};let u;try{u=new URL(d,window.location.origin)}catch{return{ok:!1,error:`not a valid path: ${d}`}}if(u.origin!==window.location.origin)return{ok:!1,error:"cross-origin navigation is not allowed"};t=Date.now();try{await e.beforeNavigate?.(u.pathname+u.search)}catch{}return window.location.assign(u.href),{ok:!0,did:`navigated to ${u.pathname}${u.search}`}}case"scroll_to":{let d=dn(l.target??"","any");return d.el?(d.el.scrollIntoView({block:"center",behavior:"smooth"}),await un(d.el,ln*2),t=Date.now(),{ok:!0,did:cn(`scrolled to and highlighted "${d.label}"`,d)}):{ok:!1,error:d.error,candidates:d.candidates}}case"hover":{let d=dn(l.target??"","hoverable");return d.el?(d.el.scrollIntoView({block:"center",behavior:"smooth"}),kc(d.el),await un(d.el,ln),t=Date.now(),{ok:!0,did:cn(`hovered "${d.label}" \u2014 controls revealed by hovering should now be on screen`,d)}):{ok:!1,error:d.error,candidates:d.candidates}}case"click":{let d=dn(l.target??"","clickable");if(!d.el)return{ok:!1,error:d.error,candidates:d.candidates};if(d.el.scrollIntoView({block:"center",behavior:"smooth"}),Cc.test(d.label)&&!await s(d.el,d.label,a))return{ok:!1,error:`the visitor did not allow clicking "${d.label}"`};await un(d.el,ln);let u=d.el.closest?d.el.closest("a[href]"):null;if(u&&!u.target&&u.origin===window.location.origin)try{await e.beforeNavigate?.(u.pathname+u.search)}catch{}return Ac(d.el),t=Date.now(),{ok:!0,did:cn(`clicked "${d.label}"`,d)}}case"fill":{if(l.value===void 0)return{ok:!1,error:'fill needs a value (use "" to clear a field)'};let d=l.value,u=dn(l.target??"","fillable");if(!u.el)return{ok:!1,error:u.error,candidates:u.candidates};let h=Tc(u.el,u.label);if(h)return{ok:!1,error:h};u.el.scrollIntoView({block:"center",behavior:"smooth"}),await un(u.el,ln);let f=Nc(u.el,d);return t=Date.now(),f==="reverted"?{ok:!1,error:`"${u.label}" did not keep the typed value \u2014 this widget probably wants a click or a choice from its own list, not free typing`}:f==="failed"?{ok:!1,error:`could not set a value on "${u.label}"`}:{ok:!0,did:cn(d?`filled "${u.label}"`:`cleared "${u.label}"`,u)}}default:return{ok:!1,error:`unknown action ${String(l.action)}`}}},s=(l,a,c)=>(Mc(),new Promise(d=>{let u=document.createElement("div");u.className="holostaff-act-pill";let h=document.createElement("span");h.textContent=`${c} wants to click "${a}"`;let f=document.createElement("button");f.type="button",f.textContent="Allow",f.className="allow";let p=document.createElement("button");p.type="button",p.textContent="Deny",p.className="deny",u.append(h,f,p);let m=l.getBoundingClientRect();u.style.top=`${Math.max(8,m.top-44)}px`,u.style.left=`${Math.max(8,m.left)}px`,document.body.appendChild(u),n=u;let b=g=>{o(),d(g)};f.addEventListener("click",()=>b(!0)),p.addEventListener("click",()=>b(!1)),r=setTimeout(()=>b(!1),yc)}));return{act:i,destroy(){o()}}}function cn(e,t){return t.note?`${e} (${t.note})`:e}var Ic='li, tr, fieldset, section, article, [role="group"], [role="listitem"], [role="row"], [class*="card"], [class*="block"], [class*="item"], [class*="panel"], [class*="row"], [class*="step"], [class*="field"]',wc='h1,h2,h3,h4,h5,h6,label,strong,b,[class*="title"],[class*="name"],[class*="label"],[class*="heading"],input,textarea';function pn(e,t){let n=e.parentElement;for(let r=0;n&&n!==document.body&&r<8;r++,n=n.parentElement){if(!n.matches(Ic))continue;if(n.getBoundingClientRect().height>window.innerHeight*.85)break;let i=0;for(let s of Array.from(n.querySelectorAll(wc))){if(i++>=6)break;if(s.contains(e)||e.contains(s))continue;let a=(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement?s.value||s.placeholder||"":s.textContent??"").replace(/\s+/g," ").trim();if(a&&a.length<=40&&a!==t)return a}}return""}var Pr='a[href], button, [role="button"], input[type="submit"], input[type="button"], summary, [role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"], [role="tab"], [role="switch"]',Ss='input:not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]), textarea, select, [contenteditable="true"]';function dn(e,t){let n=De(e.replace(/^\s*(button|link|input|dropdown|heading|copy|text|note):\s*/i,""));if(!n)return{el:null,label:"",error:"target (visible label) required"};let r=0,o=/^(.*?)\s*#(\d+)(?:\s*\/\s*\d+)?$/.exec(n);o&&o[1].trim()&&(n=o[1].trim(),r=parseInt(o[2],10));let i="",s=/^(.*?)\s*\[in\s+([^\]]+)\]$/.exec(n);s&&s[1].trim()&&(n=s[1].trim(),i=s[2].trim());let l=t==="clickable"?Pr:t==="fillable"?Ss:t==="hoverable"?`${Pr}, tr, li, [role="row"], [role="listitem"], [class*="card"], h1, h2, h3, [aria-label]`:`${Pr}, ${Ss}, h1, h2, h3, [aria-label]`,a=[];for(let f of Array.from(document.querySelectorAll(l))){if(!Is(f))continue;let p=Cs(f);if(!p)continue;let m=Ec(n,De(p));m>0&&a.push({el:f,label:p,score:m})}if(!a.length){let f=Array.from(document.querySelectorAll(l)).filter(Is).map(Cs).filter(Boolean).slice(0,8);return{el:null,label:"",error:`nothing on screen matches "${e}"`,candidates:f}}let c=Math.max(...a.map(f=>f.score)),d=a.filter(f=>f.score===c);if(i){let f=d.filter(p=>{let m=De(pn(p.el,p.label));return m&&(m.includes(i)||i.includes(m))});if(!f.length){let p=[...new Set(d.map(m=>pn(m.el,m.label)).filter(Boolean))];return{el:null,label:"",error:`no "${n}" inside a block matching "${i}"`,candidates:p.slice(0,6).map(m=>`[in: ${m}]`)}}d=f}if(d.find(f=>De(f.label)!==De(d[0].label)))return{el:null,label:"",error:`"${e}" is ambiguous`,candidates:[...new Set(d.slice(0,6).map(f=>f.label))]};if(r>0){let f=d[r-1];return f?{el:f.el,label:`${f.label} #${r}`}:{el:null,label:"",error:`only ${d.length} element${d.length===1?"":"s"} labeled "${d[0].label}" on screen \u2014 there is no #${r}`}}if(t==="fillable"&&d.length>1){let f=m=>m instanceof HTMLInputElement||m instanceof HTMLTextAreaElement?!m.value.trim():m.isContentEditable?!(m.textContent??"").trim():!1,p=d.findIndex(m=>f(m.el));if(p>=0){let m=d[p];return{el:m.el,label:m.label,note:`the first EMPTY of ${d.length} identical "${m.label}" (#${p+1}) \u2014 already-filled ones were skipped`}}}let h=d[0];return{el:h.el,label:h.label,...d.length>1?{note:`this is the 1st of ${d.length} identical "${h.label}" \u2014 target "${h.label} #2" and up for the others`}:{}}}function Cs(e){let t=e.getAttribute("aria-label");if(t?.trim())return t.trim();if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement){if(e.id){let l=document.querySelector(`label[for="${xc(e.id)}"]`);if(l?.textContent?.trim())return l.textContent.trim()}let i=e.closest("label");if(i?.textContent?.trim())return i.textContent.trim();let s=e.getAttribute("placeholder");return s?.trim()?s.trim():e instanceof HTMLInputElement&&(e.type==="submit"||e.type==="button")&&e.value.trim()?e.value.trim():e.name||""}let n=(e.textContent??"").trim().replace(/\s+/g," ");if(n)return n.length>80?"":n;let r=e.querySelector('[class*="i-"]'),o=r&&/i-[a-z0-9-]+:([a-z0-9-]+)/.exec(r.className||"");return o?`(icon: ${o[1].replace(/-\d+-(solid|outline)$/,"")})`:""}function Ec(e,t){if(!t)return 0;if(t===e)return 3;if(t.includes(e)||e.includes(t))return 2;let n=e.split(" ").filter(Boolean);return n.length&&n.filter(o=>t.includes(o)).length/n.length>=.6?1:0}function De(e){return e.toLowerCase().replace(/[():,]/g," ").replace(/\s+/g," ").trim()}function Is(e){if(e.disabled)return!1;let t=e.getBoundingClientRect();if(t.width<2||t.height<2)return!1;let n=window.getComputedStyle(e);return n.visibility!=="hidden"&&n.display!=="none"}function xc(e){return typeof CSS<"u"&&CSS.escape?CSS.escape(e):e.replace(/["\\]/g,"\\$&")}function Tc(e,t){let n=e,r=(n.type??"").toLowerCase(),o=n.autocomplete??"",i=`${t} ${n.name??""} ${n.id??""}`;return r==="password"||bc.test(o)||Sc.test(i)?`"${t}" looks like a sensitive field (password/payment/code). I can point the visitor to it, but they must type it themselves.`:null}function Ac(e){let t={bubbles:!0,cancelable:!0,composed:!0,view:window},n={...t,pointerId:1,pointerType:"mouse",isPrimary:!0};e.dispatchEvent(new PointerEvent("pointerover",n)),e.dispatchEvent(new PointerEvent("pointerdown",n)),e.dispatchEvent(new MouseEvent("mousedown",{...t,button:0})),e.dispatchEvent(new PointerEvent("pointerup",n)),e.dispatchEvent(new MouseEvent("mouseup",{...t,button:0})),e.click()}function kc(e){let t={bubbles:!0,cancelable:!0,composed:!0,view:window},n=e.getBoundingClientRect(),r={clientX:n.left+n.width/2,clientY:n.top+n.height/2},o={...t,...r,pointerId:1,pointerType:"mouse",isPrimary:!0};e.dispatchEvent(new PointerEvent("pointerover",o)),e.dispatchEvent(new PointerEvent("pointerenter",{...o,bubbles:!1})),e.dispatchEvent(new MouseEvent("mouseover",{...t,...r})),e.dispatchEvent(new MouseEvent("mouseenter",{...t,...r,bubbles:!1})),e.dispatchEvent(new PointerEvent("pointermove",o)),e.dispatchEvent(new MouseEvent("mousemove",{...t,...r}))}function ws(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}function Nc(e,t){if(e instanceof HTMLSelectElement){let n=Array.from(e.options).find(r=>De(r.textContent??"")===De(t)||r.value===t);return n?(e.value=n.value,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})),"ok"):"failed"}if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){let n=e instanceof HTMLInputElement?HTMLInputElement.prototype:HTMLTextAreaElement.prototype,r=Object.getOwnPropertyDescriptor(n,"value")?.set;e.focus(),r?r.call(e,t):e.value=t,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}));let o=ws(e.value),i=ws(t);return i?o.includes(i.slice(0,12))?"ok":"reverted":o===""?"ok":"reverted"}if(e.isContentEditable){e.focus();let n=!1;try{let r=window.getSelection();if(r){r.removeAllRanges();let o=document.createRange();o.selectNodeContents(e),r.addRange(o)}n=document.execCommand("insertText",!1,t)}catch{n=!1}return n||(e.textContent=t,e.dispatchEvent(new Event("input",{bubbles:!0}))),De(e.textContent??"").includes(De(t).slice(0,24))?"ok":"reverted"}return"failed"}async function un(e,t){let n=e.style.outline,r=e.style.outlineOffset;e.style.outline="3px solid #4f8bff",e.style.outlineOffset="2px",await Es(t),e.style.outline=n,e.style.outlineOffset=r}function Es(e){return new Promise(t=>setTimeout(t,e))}var Rc="holostaff-act-pill-style";function Mc(){it(Rc,`
|
|
153
153
|
.holostaff-act-pill { position: fixed; z-index: 2147483647; display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #0e0f12; color: #fafafa; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,0.35); font: 12px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }
|
|
154
154
|
.holostaff-act-pill button { appearance: none; border: 0; border-radius: 999px; padding: 5px 12px; font-weight: 600; font-size: 12px; cursor: pointer; }
|
|
155
155
|
.holostaff-act-pill .allow { background: #4f8bff; color: #fff; }
|
|
@@ -157,10 +157,10 @@ registerProcessor('hs-pcm-processor', HsPcmProcessor)
|
|
|
157
157
|
`)}var Ur="holostaff:stage-resume";function Wr(e){try{sessionStorage.setItem(Ur,JSON.stringify(e))}catch{}}function xs(){try{let e=sessionStorage.getItem(Ur);if(!e)return null;sessionStorage.removeItem(Ur);let t=JSON.parse(e);return!t||typeof t.at!="number"||Date.now()-t.at>6e4?null:t}catch{return null}}function Ts(e){let n=e.transcript.slice(-14).map(r=>`${r.role==="user"?"Visitor":"You"}: ${r.text}`).join(`
|
|
158
158
|
`).slice(-2500);return`[SESSION RESUMED AFTER PAGE NAVIGATION] You navigated the visitor to ${e.destPath} and the conversation reconnected there. Conversation so far:
|
|
159
159
|
`+(n||"(no transcript captured)")+`
|
|
160
|
-
Continue exactly where you left off \u2014 briefly confirm the new page is up and go on. Do NOT re-greet, do NOT re-introduce yourself.`}var As={name:"get_screen",description:"Look at what the visitor is doing RIGHT NOW: current page URL/title and a fresh summary of their recent on-screen activity. Call this whenever the answer depends on where they are, or whenever they may have moved since the conversation started. Cheap \u2014 prefer calling it over guessing.",parameters:{type:"object",properties:{},required:[]}},ks={name:"act",description:"Perform ONE small visible action on the visitor's screen, on their behalf, with their knowledge. Always say aloud what you are about to do first. Targets are VISIBLE labels (button/link text, field label or placeholder). The result tells you what actually happened \u2014 never claim more than it says. Consequential clicks (pay, order, delete, send\u2026) show the visitor an Allow/Deny pill; tell them to expect it. Sensitive fields (passwords, card numbers, codes) are refused \u2014 point with scroll_to and let the visitor type. After navigate, call get_screen before acting again.",parameters:{type:"object",properties:{action:{type:"string",enum:["click","fill","scroll_to","navigate"]},target:{type:"string",description:"Visible label of the element (for click/fill/scroll_to)."},value:{type:"string",description:"Text to type (fill only)."},path:{type:"string",description:'Same-origin path, e.g. "/checkout" (navigate only).'}},required:["action"]}},Ns={name:"present",description:"Show a visual frame in the Theater when a picture beats words. Call again to show the next thing.",parameters:{type:"object",properties:{intent:{type:"string",description:'What to show, e.g. "how attention works".'},context:{type:"string",description:"Optional extra detail for the frame."}},required:["intent"]}};function Rs(e){if(typeof window>"u")return{open:()=>{},close:()=>{},isOpen:()=>!1,acquirePresenter:()=>null,releasePresenter:()=>{},dispose:()=>{}};let t=!1,n=null,r=null,o=null,i=null,s=null,l=null,a=null,c=null,d=null,u="",h=[],f="",p=null,g=!1,b=!1,m=(w,x)=>{let T=x.trim();T&&(h.push({role:w,text:T}),h.length>16&&h.shift())},v=async w=>{if(!t||!i||!p)return;g=!0;let x=(C,S)=>Promise.race([C,new Promise(M=>setTimeout(()=>M(null),S))]),T=await x(Le(e.cfg,`/api/runtime/sessions/${e.getSessionId()}/voice-rekey`,e.buildBody()),2e3).catch(()=>null);await x(Le(e.cfg,`/api/runtime/sessions/${e.getSessionId()}/voice-preserve`,{...e.buildBody(),avatarSessionId:i}),800).catch(()=>null),Wr({at:Date.now(),destPath:w,avatar:p,rekey:T&&T.ephemeralKey?T:null,transcript:h})},y=()=>{!t||g||!i||!p||(g=!0,Ve(e.cfg,`/api/runtime/sessions/${e.getSessionId()}/voice-preserve`,{...e.buildBody(),avatarSessionId:i}),Wr({at:Date.now(),destPath:"(a page the visitor opened)",avatar:p,rekey:null,transcript:h}))},E="",N=null,k=w=>{e.cfg.onError?.(w,{method:"STAGE",path:"(voice)"})},O=()=>{t=!1,e.reportConversationActive(!1),l&&(clearTimeout(l),l=null);try{a?.close()}catch{}try{r?.stop()}catch{}try{o?.stop()}catch{}try{d?.destroy()}catch{}if(b){try{window.removeEventListener("pagehide",y)}catch{}b=!1}i&&!g&&Le(e.cfg,`/api/runtime/sessions/${e.getSessionId()}/voice-stop`,{...e.buildBody(),avatarSessionId:i});try{c?.getTracks().forEach(w=>w.stop())}catch{}try{s?.remove()}catch{}try{n?.destroy()}catch{}a=null,r=null,o=null,i=null,s=null,c=null,n=null,d=null,u="",p=null,f=""},A=w=>{let x=/[^.!?]+[.!?]+(\s|$)/g,T,C=0;for(;(T=x.exec(u))!==null;)r?.enqueueSentence(T[0]),C=x.lastIndex;u=u.slice(C),w&&u.trim()&&(r?.enqueueSentence(u),u="")},$=async w=>{try{c=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{k(new Error("Microphone unavailable \u2014 voice needs mic access on the host origin.")),e.theater&&w?.intent&&e.theater.present({intent:w.intent}),O();return}let x=null,T;if(w?.resume){T=Ts(w.resume);let B=w.resume;if(B.avatar){let z=B.rekey??await Le(e.cfg,`/api/runtime/sessions/${e.getSessionId()}/voice-rekey`,e.buildBody()).catch(()=>null);z?.ephemeralKey&&(Le(e.cfg,`/api/runtime/sessions/${e.getSessionId()}/voice-resume`,{...e.buildBody(),avatarSessionId:B.avatar.sessionId}),x={provider:"holostaff",ephemeralKey:z.ephemeralKey,anamSessionToken:null,avatar:B.avatar,realtimeUrl:z.realtimeUrl,realtimeModel:z.realtimeModel,instructions:z.instructions,copilotName:z.copilotName,voiceId:z.voiceId})}}if(x||(x=await Le(e.cfg,`/api/runtime/sessions/${e.getSessionId()}/voice`,e.buildBody())),!x||!x.ephemeralKey){k(new Error("voice mint failed or returned incomplete session")),O();return}let C=x.provider??"anam";if(!(C==="holostaff"?!!x.avatar:!!x.anamSessionToken)){k(new Error("voice mint returned no face session")),O();return}let M=e.presence.getCopilot();d=fn({beforeNavigate:v}),b||(window.addEventListener("pagehide",y),b=!0),n=ys({dock:e.dock,copilotName:x.copilotName||M?.name||"Copilot",scopeLine:M?.scopeLine,onClose:()=>U()}),n.setState("connecting");let L=({name:B,args:z,callId:P})=>{if(B==="present"&&e.theater){let q=typeof z.intent=="string"?z.intent:"",X=typeof z.context=="string"?z.context:void 0;q&&e.theater.present({intent:q,context:X}),a?.sendToolResult(P,{ok:!0})}else if(B==="act"){let q=d;if(!q){a?.sendToolResult(P,{ok:!1,error:"stage not ready"});return}q.act(z,x.copilotName||M?.name||"The copilot").then(X=>a?.sendToolResult(P,X)).catch(X=>a?.sendToolResult(P,{ok:!1,error:X.message}))}else if(B==="get_screen"){let q=window.location.href,X=document.title;Le(e.cfg,`/api/runtime/sessions/${e.getSessionId()}/voice-context`,e.buildBody()).then(Q=>{a?.sendToolResult(P,{url:q,pageTitle:X,stage:Q?.stage??null,recentActivity:Q?.visionSummary??"no activity summary available yet"})}).catch(()=>{a?.sendToolResult(P,{url:q,pageTitle:X})})}else a?.sendToolResult(P,{error:`unknown tool ${B}`})},H=T??(w?.intent?`The visitor tapped "Talk" on your suggestion: "${w.intent}". Open the conversation on that.`:void 0);try{C==="holostaff"?await F(x,H,L):await V(x,H,L),n?.setState("listening")}catch(B){k(B instanceof Error?B:new Error("voice connect failed")),O()}},V=async(w,x,T)=>{if(!n||!c)throw new Error("stage not ready");r=await gs({sessionToken:w.anamSessionToken,videoEl:n.video,onError:k}),a=await Fr({ephemeralKey:w.ephemeralKey,realtimeUrl:w.realtimeUrl,realtimeModel:w.realtimeModel,instructions:w.instructions,tools:[Ns,As,ks],micStream:c,seedMessage:x},{onTextDelta:(C,S)=>{E=S,S!==N&&(n?.setState("speaking"),u+=C,n?.appendCaption(C),A(!1))},onTurnDone:C=>{if(C===N){N=null;return}A(!0),n?.setState("listening")},onUserSpeechStarted:()=>{N=E,u="",a?.cancelResponse(),r?.interrupt(),n?.setState("listening")},onToolCall:T,onError:k})},F=async(w,x,T)=>{if(!n||!c)throw new Error("stage not ready");let C=w.avatar;i=C.sessionId,p=C,s=document.createElement("audio"),s.autoplay=!0,s.setAttribute("playsinline",""),s.style.display="none",document.body.appendChild(s);let S=!1,M=null,L=!1,H=()=>{if(!S){k(new Error("avatar media blocked \u2014 continuing voice-only"));try{o?.stop()}catch{}if(o=null,M&&s)try{s.srcObject=M}catch{}}};o=await vs({livekitUrl:C.livekitUrl,livekitToken:C.livekitToken,wsUrl:C.wsUrl,videoEl:n.video,audioEl:s,onVideo:()=>{S=!0,l&&(clearTimeout(l),l=null)},onSpeaking:B=>n?.setState(B?"speaking":"listening"),onError:k}),l=setTimeout(H,6e3),a=await Fr({ephemeralKey:w.ephemeralKey,realtimeUrl:w.realtimeUrl,realtimeModel:w.realtimeModel,instructions:w.instructions,tools:[Ns,As,ks],micStream:c,seedMessage:x,audioOut:!0,voice:w.voiceId??void 0},{onAudioPlaybackStarted:()=>{L=!0,o?.beginTurn(),n?.setState("speaking")},onAudioPlaybackStopped:()=>{o?.speakEnd(),n?.setState("listening")},onTextDelta:(B,z)=>{!L&&z!==E&&o?.beginTurn(),E=z,z!==N&&(n?.setState("speaking"),n?.appendCaption(B),f+=B)},onTurnDone:B=>{if(B===N){N=null,f="";return}m("assistant",f),f="",L||(o?.speakEnd(),n?.setState("listening"))},onUserTranscript:B=>m("user",B),onUserSpeechStarted:()=>{N=E,a?.cancelResponse(),o?.interrupt(),n?.setState("listening")},onRemoteAudio:B=>{if(M=B,o)o.attachRealtimeAudio(B);else if(s)try{s.srcObject=B}catch{}},onToolCall:T,onError:k}),o&&o.attachMic(c)},U=()=>{t&&O()},W=!1,R=w=>{t||(t=!0,e.reportConversationActive(!0),$(w))},I=xs();return I&&setTimeout(()=>R({resume:I}),250),{open:R,close:U,isOpen:()=>t,acquirePresenter(){if(!t||!n||!r&&!o)return null;let w=n.detachVideo(),x=w.getBoundingClientRect();return W=!0,n.setHidden(!0),{video:w,fromRect:x}},releasePresenter(){W&&(W=!1,n&&(n.reattachVideo(),n.setHidden(!1)))},dispose(){t&&O()}}}var Ms=new Set(["button","link","input","dropdown"]),Oc=8;function Os(){let e=[],t=new Set,n=(c,d,u)=>{let h=(d||"").replace(/\s+/g," ").trim().slice(0,140);if(h){if(!Ms.has(c)){if(t.has(c+h))return;t.add(c+h)}e.push([c,h,u??null])}},r=[],o=()=>{let c=new Map;for(let[f,p]of e)c.set(f+"\0"+p,(c.get(f+"\0"+p)??0)+1);let d=e.map(([f,p,g])=>{let m=Ms.has(f)&&g&&((c.get(f+"\0"+p)??0)>1||p.startsWith("(icon:"))?pn(g,p):"";return[f,m?p+" [in: "+m.slice(0,40)+"]":p]}),u=new Map;for(let[f,p]of d)u.set(f+"\0"+p,(u.get(f+"\0"+p)??0)+1);let h=new Map;for(let[f,p]of d){let g=f+"\0"+p,b=u.get(g);if(b>1){let m=(h.get(g)??0)+1;if(h.set(g,m),m>Oc)continue;r.push(f+": "+p+" #"+m+"/"+b)}else r.push(f+": "+p)}return r},i=c=>{let d=c.getBoundingClientRect();return d.width>2&&d.height>2&&d.bottom>0&&d.top<innerHeight*2.2},s=document,l=[...document.querySelectorAll('[role="dialog"], dialog, [class*="modal"] [class*="content"], [id*="modal"]')].filter(c=>{if(!i(c))return!1;let d=c.getBoundingClientRect();return d.width*d.height>innerWidth*innerHeight*.08&&d.width<innerWidth*.95}).filter(c=>!c.closest("[data-holostaff-autopilot]"));l.length&&(s=l[l.length-1],r.push("note: A DIALOG IS OPEN on top of the page \u2014 the page behind it is dimmed and NOT clickable. Only what is listed below (the dialog) is interactive right now."));let a=c=>!!c.closest("[data-holostaff-autopilot], .holostaff-act-pill");return s.querySelectorAll('h1,h2,h3,[class*="title"]').forEach(c=>{i(c)&&!a(c)&&n("heading",c.textContent)}),s.querySelectorAll('button,[role="button"],a[href]').forEach(c=>{if(!i(c)||a(c))return;let d=(c.textContent||"").trim()||c.getAttribute("aria-label")||c.getAttribute("title")||"";if(!d){let u=c.querySelector('[class*="i-"]'),h=u&&/i-[a-z0-9-]+:([a-z0-9-]+)/.exec(u.className||"");h&&(d="(icon: "+h[1].replace(/-\d+-(solid|outline)$/,"")+")")}n(c.tagName==="A"?"link":"button",d,c)}),s.querySelectorAll("input,textarea,select").forEach(c=>{if(!i(c)||a(c))return;let d=c,u=d.labels&&d.labels[0]?(d.labels[0].textContent||"").trim():"";if(c.tagName==="SELECT"){let h=c,f=Array.from(h.options||[]).map(g=>(g.textContent||"").trim()).filter(Boolean).slice(0,12),p=h.selectedOptions&&h.selectedOptions[0]?(h.selectedOptions[0].textContent||"").trim():"";n("dropdown",'label="'+u+'" current="'+p+'" options=['+f.join(" | ")+"]",c);return}n("input",(d.type||c.tagName.toLowerCase())+' placeholder="'+(d.placeholder||"")+'" label="'+u+'"',c)}),s.querySelectorAll('code,pre,[class*="alert"],[class*="empty"],[class*="toast"]').forEach(c=>{i(c)&&!a(c)&&n("text",c.textContent)}),s.querySelectorAll('p,li,span[class*="caption"],[class*="subtitle"]').forEach(c=>{i(c)&&!a(c)&&(c.textContent||"").trim().length>25&&n("copy",c.textContent)}),o(),`URL: ${window.location.href}
|
|
160
|
+
Continue exactly where you left off \u2014 briefly confirm the new page is up and go on. Do NOT re-greet, do NOT re-introduce yourself.`}var As={name:"get_screen",description:"Look at what the visitor is doing RIGHT NOW: current page URL/title and a fresh summary of their recent on-screen activity. Call this whenever the answer depends on where they are, or whenever they may have moved since the conversation started. Cheap \u2014 prefer calling it over guessing.",parameters:{type:"object",properties:{},required:[]}},ks={name:"act",description:"Perform ONE small visible action on the visitor's screen, on their behalf, with their knowledge. Always say aloud what you are about to do first. Targets are VISIBLE labels (button/link text, field label or placeholder). The result tells you what actually happened \u2014 never claim more than it says. Consequential clicks (pay, order, delete, send\u2026) show the visitor an Allow/Deny pill; tell them to expect it. Sensitive fields (passwords, card numbers, codes) are refused \u2014 point with scroll_to and let the visitor type. After navigate, call get_screen before acting again.",parameters:{type:"object",properties:{action:{type:"string",enum:["click","fill","scroll_to","navigate"]},target:{type:"string",description:"Visible label of the element (for click/fill/scroll_to)."},value:{type:"string",description:"Text to type (fill only)."},path:{type:"string",description:'Same-origin path, e.g. "/checkout" (navigate only).'}},required:["action"]}},Ns={name:"present",description:"Show a visual frame in the Theater when a picture beats words. Call again to show the next thing.",parameters:{type:"object",properties:{intent:{type:"string",description:'What to show, e.g. "how attention works".'},context:{type:"string",description:"Optional extra detail for the frame."}},required:["intent"]}};function Rs(e){if(typeof window>"u")return{open:()=>{},close:()=>{},isOpen:()=>!1,acquirePresenter:()=>null,releasePresenter:()=>{},dispose:()=>{}};let t=!1,n=null,r=null,o=null,i=null,s=null,l=null,a=null,c=null,d=null,u="",h=[],f="",p=null,m=!1,b=!1,g=(w,x)=>{let T=x.trim();T&&(h.push({role:w,text:T}),h.length>16&&h.shift())},v=async w=>{if(!t||!i||!p)return;m=!0;let x=(C,S)=>Promise.race([C,new Promise(M=>setTimeout(()=>M(null),S))]),T=await x(Le(e.cfg,`/api/runtime/sessions/${e.getSessionId()}/voice-rekey`,e.buildBody()),2e3).catch(()=>null);await x(Le(e.cfg,`/api/runtime/sessions/${e.getSessionId()}/voice-preserve`,{...e.buildBody(),avatarSessionId:i}),800).catch(()=>null),Wr({at:Date.now(),destPath:w,avatar:p,rekey:T&&T.ephemeralKey?T:null,transcript:h})},y=()=>{!t||m||!i||!p||(m=!0,Ve(e.cfg,`/api/runtime/sessions/${e.getSessionId()}/voice-preserve`,{...e.buildBody(),avatarSessionId:i}),Wr({at:Date.now(),destPath:"(a page the visitor opened)",avatar:p,rekey:null,transcript:h}))},E="",N=null,k=w=>{e.cfg.onError?.(w,{method:"STAGE",path:"(voice)"})},O=()=>{t=!1,e.reportConversationActive(!1),l&&(clearTimeout(l),l=null);try{a?.close()}catch{}try{r?.stop()}catch{}try{o?.stop()}catch{}try{d?.destroy()}catch{}if(b){try{window.removeEventListener("pagehide",y)}catch{}b=!1}i&&!m&&Le(e.cfg,`/api/runtime/sessions/${e.getSessionId()}/voice-stop`,{...e.buildBody(),avatarSessionId:i});try{c?.getTracks().forEach(w=>w.stop())}catch{}try{s?.remove()}catch{}try{n?.destroy()}catch{}a=null,r=null,o=null,i=null,s=null,c=null,n=null,d=null,u="",p=null,f=""},A=w=>{let x=/[^.!?]+[.!?]+(\s|$)/g,T,C=0;for(;(T=x.exec(u))!==null;)r?.enqueueSentence(T[0]),C=x.lastIndex;u=u.slice(C),w&&u.trim()&&(r?.enqueueSentence(u),u="")},$=async w=>{try{c=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{k(new Error("Microphone unavailable \u2014 voice needs mic access on the host origin.")),e.theater&&w?.intent&&e.theater.present({intent:w.intent}),O();return}let x=null,T;if(w?.resume){T=Ts(w.resume);let B=w.resume;if(B.avatar){let z=B.rekey??await Le(e.cfg,`/api/runtime/sessions/${e.getSessionId()}/voice-rekey`,e.buildBody()).catch(()=>null);z?.ephemeralKey&&(Le(e.cfg,`/api/runtime/sessions/${e.getSessionId()}/voice-resume`,{...e.buildBody(),avatarSessionId:B.avatar.sessionId}),x={provider:"holostaff",ephemeralKey:z.ephemeralKey,anamSessionToken:null,avatar:B.avatar,realtimeUrl:z.realtimeUrl,realtimeModel:z.realtimeModel,instructions:z.instructions,copilotName:z.copilotName,voiceId:z.voiceId})}}if(x||(x=await Le(e.cfg,`/api/runtime/sessions/${e.getSessionId()}/voice`,e.buildBody())),!x||!x.ephemeralKey){k(new Error("voice mint failed or returned incomplete session")),O();return}let C=x.provider??"anam";if(!(C==="holostaff"?!!x.avatar:!!x.anamSessionToken)){k(new Error("voice mint returned no face session")),O();return}let M=e.presence.getCopilot();d=fn({beforeNavigate:v}),b||(window.addEventListener("pagehide",y),b=!0),n=ys({dock:e.dock,copilotName:x.copilotName||M?.name||"Copilot",scopeLine:M?.scopeLine,onClose:()=>U()}),n.setState("connecting");let L=({name:B,args:z,callId:P})=>{if(B==="present"&&e.theater){let q=typeof z.intent=="string"?z.intent:"",X=typeof z.context=="string"?z.context:void 0;q&&e.theater.present({intent:q,context:X}),a?.sendToolResult(P,{ok:!0})}else if(B==="act"){let q=d;if(!q){a?.sendToolResult(P,{ok:!1,error:"stage not ready"});return}q.act(z,x.copilotName||M?.name||"The copilot").then(X=>a?.sendToolResult(P,X)).catch(X=>a?.sendToolResult(P,{ok:!1,error:X.message}))}else if(B==="get_screen"){let q=window.location.href,X=document.title;Le(e.cfg,`/api/runtime/sessions/${e.getSessionId()}/voice-context`,e.buildBody()).then(Q=>{a?.sendToolResult(P,{url:q,pageTitle:X,stage:Q?.stage??null,recentActivity:Q?.visionSummary??"no activity summary available yet"})}).catch(()=>{a?.sendToolResult(P,{url:q,pageTitle:X})})}else a?.sendToolResult(P,{error:`unknown tool ${B}`})},H=T??(w?.intent?`The visitor tapped "Talk" on your suggestion: "${w.intent}". Open the conversation on that.`:void 0);try{C==="holostaff"?await F(x,H,L):await V(x,H,L),n?.setState("listening")}catch(B){k(B instanceof Error?B:new Error("voice connect failed")),O()}},V=async(w,x,T)=>{if(!n||!c)throw new Error("stage not ready");r=await gs({sessionToken:w.anamSessionToken,videoEl:n.video,onError:k}),a=await Fr({ephemeralKey:w.ephemeralKey,realtimeUrl:w.realtimeUrl,realtimeModel:w.realtimeModel,instructions:w.instructions,tools:[Ns,As,ks],micStream:c,seedMessage:x},{onTextDelta:(C,S)=>{E=S,S!==N&&(n?.setState("speaking"),u+=C,n?.appendCaption(C),A(!1))},onTurnDone:C=>{if(C===N){N=null;return}A(!0),n?.setState("listening")},onUserSpeechStarted:()=>{N=E,u="",a?.cancelResponse(),r?.interrupt(),n?.setState("listening")},onToolCall:T,onError:k})},F=async(w,x,T)=>{if(!n||!c)throw new Error("stage not ready");let C=w.avatar;i=C.sessionId,p=C,s=document.createElement("audio"),s.autoplay=!0,s.setAttribute("playsinline",""),s.style.display="none",document.body.appendChild(s);let S=!1,M=null,L=!1,H=()=>{if(!S){k(new Error("avatar media blocked \u2014 continuing voice-only"));try{o?.stop()}catch{}if(o=null,M&&s)try{s.srcObject=M}catch{}}};o=await vs({livekitUrl:C.livekitUrl,livekitToken:C.livekitToken,wsUrl:C.wsUrl,videoEl:n.video,audioEl:s,onVideo:()=>{S=!0,l&&(clearTimeout(l),l=null)},onSpeaking:B=>n?.setState(B?"speaking":"listening"),onError:k}),l=setTimeout(H,6e3),a=await Fr({ephemeralKey:w.ephemeralKey,realtimeUrl:w.realtimeUrl,realtimeModel:w.realtimeModel,instructions:w.instructions,tools:[Ns,As,ks],micStream:c,seedMessage:x,audioOut:!0,voice:w.voiceId??void 0},{onAudioPlaybackStarted:()=>{L=!0,o?.beginTurn(),n?.setState("speaking")},onAudioPlaybackStopped:()=>{o?.speakEnd(),n?.setState("listening")},onTextDelta:(B,z)=>{!L&&z!==E&&o?.beginTurn(),E=z,z!==N&&(n?.setState("speaking"),n?.appendCaption(B),f+=B)},onTurnDone:B=>{if(B===N){N=null,f="";return}g("assistant",f),f="",L||(o?.speakEnd(),n?.setState("listening"))},onUserTranscript:B=>g("user",B),onUserSpeechStarted:()=>{N=E,a?.cancelResponse(),o?.interrupt(),n?.setState("listening")},onRemoteAudio:B=>{if(M=B,o)o.attachRealtimeAudio(B);else if(s)try{s.srcObject=B}catch{}},onToolCall:T,onError:k}),o&&o.attachMic(c)},U=()=>{t&&O()},W=!1,R=w=>{t||(t=!0,e.reportConversationActive(!0),$(w))},I=xs();return I&&setTimeout(()=>R({resume:I}),250),{open:R,close:U,isOpen:()=>t,acquirePresenter(){if(!t||!n||!r&&!o)return null;let w=n.detachVideo(),x=w.getBoundingClientRect();return W=!0,n.setHidden(!0),{video:w,fromRect:x}},releasePresenter(){W&&(W=!1,n&&(n.reattachVideo(),n.setHidden(!1)))},dispose(){t&&O()}}}var Ms=new Set(["button","link","input","dropdown"]),Oc=8;function Os(){let e=[],t=new Set,n=(c,d,u)=>{let h=(d||"").replace(/\s+/g," ").trim().slice(0,140);if(h){if(!Ms.has(c)){if(t.has(c+h))return;t.add(c+h)}e.push([c,h,u??null])}},r=[],o=()=>{let c=new Map;for(let[f,p]of e)c.set(f+"\0"+p,(c.get(f+"\0"+p)??0)+1);let d=e.map(([f,p,m])=>{let g=Ms.has(f)&&m&&((c.get(f+"\0"+p)??0)>1||p.startsWith("(icon:"))?pn(m,p):"";return[f,g?p+" [in: "+g.slice(0,40)+"]":p]}),u=new Map;for(let[f,p]of d)u.set(f+"\0"+p,(u.get(f+"\0"+p)??0)+1);let h=new Map;for(let[f,p]of d){let m=f+"\0"+p,b=u.get(m);if(b>1){let g=(h.get(m)??0)+1;if(h.set(m,g),g>Oc)continue;r.push(f+": "+p+" #"+g+"/"+b)}else r.push(f+": "+p)}return r},i=c=>{let d=c.getBoundingClientRect();return d.width>2&&d.height>2&&d.bottom>0&&d.top<innerHeight*2.2},s=document,l=[...document.querySelectorAll('[role="dialog"], dialog, [class*="modal"] [class*="content"], [id*="modal"]')].filter(c=>{if(!i(c))return!1;let d=c.getBoundingClientRect();return d.width*d.height>innerWidth*innerHeight*.08&&d.width<innerWidth*.95}).filter(c=>!c.closest("[data-holostaff-autopilot]"));l.length&&(s=l[l.length-1],r.push("note: A DIALOG IS OPEN on top of the page \u2014 the page behind it is dimmed and NOT clickable. Only what is listed below (the dialog) is interactive right now."));let a=c=>!!c.closest("[data-holostaff-autopilot], .holostaff-act-pill");return s.querySelectorAll('h1,h2,h3,[class*="title"]').forEach(c=>{i(c)&&!a(c)&&n("heading",c.textContent)}),s.querySelectorAll('button,[role="button"],a[href]').forEach(c=>{if(!i(c)||a(c))return;let d=(c.textContent||"").trim()||c.getAttribute("aria-label")||c.getAttribute("title")||"";if(!d){let u=c.querySelector('[class*="i-"]'),h=u&&/i-[a-z0-9-]+:([a-z0-9-]+)/.exec(u.className||"");h&&(d="(icon: "+h[1].replace(/-\d+-(solid|outline)$/,"")+")")}n(c.tagName==="A"?"link":"button",d,c)}),s.querySelectorAll("input,textarea,select").forEach(c=>{if(!i(c)||a(c))return;let d=c,u=d.labels&&d.labels[0]?(d.labels[0].textContent||"").trim():"";if(c.tagName==="SELECT"){let f=c,p=Array.from(f.options||[]).map(b=>(b.textContent||"").trim()).filter(Boolean).slice(0,12),m=f.selectedOptions&&f.selectedOptions[0]?(f.selectedOptions[0].textContent||"").trim():"";n("dropdown",'label="'+u+'" current="'+m+'" options=['+p.join(" | ")+"]",c);return}let h=d.type==="password"?d.value?"\u2022\u2022\u2022":"":d.value||"";n("input",(d.type||c.tagName.toLowerCase())+' placeholder="'+(d.placeholder||"")+'" label="'+u+'" value="'+h.slice(0,30)+'"',c)}),s.querySelectorAll('code,pre,[class*="alert"],[class*="empty"],[class*="toast"]').forEach(c=>{i(c)&&!a(c)&&n("text",c.textContent)}),s.querySelectorAll('p,li,span[class*="caption"],[class*="subtitle"]').forEach(c=>{i(c)&&!a(c)&&(c.textContent||"").trim().length>25&&n("copy",c.textContent)}),o(),`URL: ${window.location.href}
|
|
161
161
|
TITLE: ${document.title}
|
|
162
162
|
`+r.slice(0,90).join(`
|
|
163
|
-
`)}var Dc="holostaff-autopilot-style",Vr="holostaff_autopilot_active",Ds=e=>`holostaff_autopilot_dismissed:${e}`,Lc=350;function _s(e){_c();let t=!1,n=[],r=null,o=null,i=null,s=null,l=!1,a=!1,c=!1,d="",u=I=>e.onError?.(I instanceof Error?I:new Error(String(I))),h=async(I,w)=>{let x=await fetch(`${e.baseUrl}/api/runtime/autopilot${I}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({tenantId:e.tenantId,...w})}),T=await x.json().catch(()=>({}));if(!x.ok)throw new Error(String(T.error??`autopilot HTTP ${x.status}`));return T},f=I=>{try{I?.remove()}catch{}};function p(I){let w=document.createElement("div");return w.className=`holostaff-ap ${I}`,w.setAttribute("data-holostaff-autopilot",""),document.body.appendChild(w),w}function
|
|
163
|
+
`)}var Dc="holostaff-autopilot-style",Vr="holostaff_autopilot_active",Ds=e=>`holostaff_autopilot_dismissed:${e}`,Lc=350;function _s(e){_c();let t=!1,n=[],r=null,o=null,i=null,s=null,l=!1,a=!1,c=!1,d="",u=I=>e.onError?.(I instanceof Error?I:new Error(String(I))),h=async(I,w)=>{let x=await fetch(`${e.baseUrl}/api/runtime/autopilot${I}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({tenantId:e.tenantId,...w})}),T=await x.json().catch(()=>({}));if(!x.ok)throw new Error(String(T.error??`autopilot HTTP ${x.status}`));return T},f=I=>{try{I?.remove()}catch{}};function p(I){let w=document.createElement("div");return w.className=`holostaff-ap ${I}`,w.setAttribute("data-holostaff-autopilot",""),document.body.appendChild(w),w}function m(I){if(r||l||sessionStorage.getItem(Ds(I.workflowName)))return;r=p("holostaff-ap-offer");let w=document.createElement("div");w.className="ap-title",w.textContent=I.workflowName;let x=document.createElement("div");x.className="ap-line",x.textContent="I can do this for you while you watch. You stay in control.";let T=document.createElement("div");T.className="ap-row";let C=g("Do this for me","ap-primary",()=>{f(r),r=null,b(I)}),S=g("No thanks","ap-ghost",()=>{sessionStorage.setItem(Ds(I.workflowName),"1"),f(r),r=null});T.append(C,S),r.append(w,x,T)}function b(I){i=p("holostaff-ap-overlay");let w=document.createElement("div");w.className="ap-box";let x=document.createElement("div");x.className="ap-title",x.textContent=I.workflowName;let T=document.createElement("div");T.className="ap-line",T.textContent="Anything I should know first? Optional.";let C=document.createElement("textarea");C.className="ap-textarea",C.rows=3,C.placeholder="Names, details, what you want at the end.";let S=document.createElement("div");S.className="ap-row";let M=g("Start","ap-primary",()=>{let H=C.value.trim();f(i),i=null,k(I,H)}),L=g("Cancel","ap-ghost",()=>{f(i),i=null});S.append(M,L),w.append(x,T,C,S),i.appendChild(w),C.focus()}function g(I,w,x){let T=document.createElement("button");return T.type="button",T.className=`ap-btn ${w}`,T.textContent=I,T.addEventListener("click",x),T}function v(I,w,x){f(o),o=p("holostaff-ap-panel");let T=document.createElement("div");T.className="ap-title",T.textContent=`Autopilot \xB7 ${I}`;let C=document.createElement("div");C.className="ap-line ap-status",C.textContent="Starting\u2026";let S=document.createElement("div");S.className="ap-meta";let M=document.createElement("div");M.className="ap-row";let L=g("Resume","ap-primary",x);L.style.display="none";let H=g("Stop","ap-ghost",w);return M.append(L,H),o.append(T,C,S,M),{el:o,status:(B,z)=>{C.textContent=B,S.textContent=`step ${z}`},note:B=>{C.textContent=B,L.style.display=a?"":"none"}}}function y(I){return new Promise(w=>{i=p("holostaff-ap-overlay");let x=document.createElement("div");x.className="ap-box";let T=document.createElement("div");T.className="ap-line",T.textContent=I.label,x.appendChild(T);let C=S=>{f(i),i=null,w(S)};if(I.type==="choice"&&I.options?.length){let S=document.createElement("div");S.className="ap-row ap-wrap";for(let M of I.options.slice(0,6))S.appendChild(g(M,"ap-primary",()=>C(M)));x.appendChild(S)}else if(I.type==="user-input-fields"){let S=document.createElement("div");S.className="ap-meta",S.textContent="Type those in yourself, then continue. The autopilot never enters them for you.";let M=document.createElement("div");M.className="ap-row",M.appendChild(g("Done, continue","ap-primary",()=>C(""))),x.append(S,M)}else{let S=document.createElement("textarea");S.className="ap-textarea",S.rows=2,S.placeholder="Type your answer",S.setAttribute("aria-label","Your answer to the autopilot");let M=document.createElement("div");M.className="ap-row",M.appendChild(g("Send","ap-primary",()=>C(S.value.trim()))),x.append(S,M),S.focus()}i.appendChild(x)})}function E(I,w){f(o),o=null;let x=p("holostaff-ap-panel"),T=document.createElement("div");T.className="ap-title",T.textContent=I==="done"?"Done":I==="stopped"?"Stopped":"Handing back";let C=document.createElement("div");C.className="ap-line",C.textContent=w;let S=document.createElement("div");S.className="ap-row",S.appendChild(g("Close","ap-ghost",()=>f(x))),x.append(T,C,S),setTimeout(()=>f(x),3e4)}function N(I){try{I?sessionStorage.setItem(Vr,JSON.stringify(I)):sessionStorage.removeItem(Vr)}catch{}}async function k(I,w){try{let{handoverId:x}=await h("/start",{sourceId:e.sourceId,workflowName:I.workflowName,intent:w,path:window.location.pathname});await O({handoverId:x,workflowName:I.workflowName,step:0})}catch(x){u(x),E("give_up","The autopilot could not start. Nothing was changed.")}}async function O(I){l=!0,a=!1,c=!1,s=fn();let w=v(I.workflowName,()=>{c=!0,a=!1,h(`/${I.handoverId}/end`,{reason:"user_stop"}).catch(()=>{}),N(null),E("stopped","You have the controls. Nothing else will happen.")},()=>{a=!1,I.lastResult="the user paused you and may have changed things themselves \u2014 re-read the screen before acting",w.status("Resuming\u2026",I.step)});N(I);try{for(;!t&&!c;){if(a){await Ls(400);continue}let x=Os(),T;try{T=await h(`/${I.handoverId}/tick`,{digest:x,...I.lastResult?{lastResult:I.lastResult}:{},...I.answer?{answer:I.answer}:{}})}catch(M){u(M),E("give_up","The autopilot lost its connection. You have the controls.");break}if(I.answer=void 0,I.step+=1,N(I),T.kind==="done"||T.kind==="give_up"){N(null),E(T.kind,T.summary??(T.kind==="done"?"Finished.":"I could not finish. You have the controls."));break}if(a){I.lastResult="the user took the controls before this action ran \u2014 nothing was done; re-read the screen once resumed",N(I);continue}if(T.status&&w.status(T.status,I.step),T.kind==="ask"&&T.ask){let M=await y(T.ask);if(c)break;T.ask.type==="user-input-fields"?I.lastResult="The user says they entered those fields themselves. Continue.":(I.answer=M||"(no answer)",I.lastResult="the user answered your question");continue}let C=T.kind==="choose"?{action:"fill",target:T.target,value:T.value}:{action:T.kind,target:T.target,value:T.value,path:T.path};T.kind==="navigate"&&N(I);let S=await s.act(C,"The autopilot");I.lastResult=S.ok?S.did??"ok":`${S.error??"action failed"}${S.candidates?.length?` \u2014 on screen: ${S.candidates.slice(0,6).join(", ")}`:""}`,N(I),await Ls(Lc)}}finally{l=!1,s?.destroy(),s=null,c||(f(o),o=null)}}let A=I=>{if(!l||a||c||i)return;let w=I.target;if(w&&(w.closest?.("[data-holostaff-autopilot]")||w.closest?.(".holostaff-act-pill"))||!I.isTrusted)return;a=!0;let x=o?.querySelector(".ap-status");x&&(x.textContent="Paused \u2014 you took the wheel.");let T=o?.querySelectorAll(".ap-btn")[0];T&&(T.style.display="")};window.addEventListener("pointerdown",A,!0),window.addEventListener("keydown",A,!0);function $(I,w){if(!I)return!1;if(I==="/")return w==="/";let x=I.replace(/:[^/]+/g,"[^/]+").replace(/\/+$/,"");return new RegExp(`^${x}/?$`).test(w.replace(/\/+$/,"")||"/")}function V(){try{return!!(sessionStorage.getItem("holostaff_autopilot_preview")||localStorage.getItem("holostaff_autopilot_preview"))}catch{return!1}}function F(){if(t||l)return;let I=window.location.pathname;if(I===d)return;d=I,f(r),r=null;let w=n.find(x=>x.entryRoutes.some(T=>$(T,I)))??(V()?n[0]:void 0);w&&m(w)}let U=history.pushState.bind(history),W=history.replaceState.bind(history);history.pushState=(...I)=>{U(...I),setTimeout(F,50)},history.replaceState=(...I)=>{W(...I),setTimeout(F,50)};let R=()=>{setTimeout(F,50)};return window.addEventListener("popstate",R),(async()=>{try{let I="";try{(sessionStorage.getItem("holostaff_autopilot_preview")||localStorage.getItem("holostaff_autopilot_preview"))&&(I="&preview=1")}catch{}let w=await fetch(`${e.baseUrl}/api/runtime/autopilot/catalog?tenantId=${encodeURIComponent(e.tenantId)}&sourceId=${encodeURIComponent(e.sourceId)}${I}`);w.ok&&(n=(await w.json()).autopilots??[])}catch(I){u(I)}try{let I=sessionStorage.getItem(Vr);if(I){let w=JSON.parse(I);w.lastResult=w.lastResult??"the page reloaded \u2014 re-read the screen",O(w);return}}catch{}F()})(),{dispose(){t=!0,c=!0,window.removeEventListener("popstate",R),window.removeEventListener("pointerdown",A,!0),window.removeEventListener("keydown",A,!0),history.pushState=U,history.replaceState=W,s?.destroy(),f(r),f(o),f(i)}}}function Ls(e){return new Promise(t=>setTimeout(t,e))}function _c(){it(Dc,`
|
|
164
164
|
.holostaff-ap { position: fixed; z-index: 2147483600; font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; color: #16181d; }
|
|
165
165
|
.holostaff-ap-offer, .holostaff-ap-panel { right: 20px; bottom: 20px; width: 300px; background: #fff; border: 1px solid rgba(0,0,0,0.12); border-radius: 14px; box-shadow: 0 12px 36px rgba(0,0,0,0.16); padding: 14px 16px; }
|
|
166
166
|
.holostaff-ap-overlay { inset: 0; background: rgba(10,12,16,0.35); display: flex; align-items: center; justify-content: center; }
|