posthog-js 1.174.2 → 1.174.3

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,16 +1,2 @@
1
- !function(){"use strict";var e,t="2.0.0-alpha.13";function n(e){const t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function r(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function o(e){try{const n=e.rules||e.cssRules;return n?((t=Array.from(n).map(i).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}var t}function i(e){let t;if(function(e){return"styleSheet"in e}(e))try{t=o(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}else if(function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(e.cssText);return t||e.cssText}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(e||(e={}));class s{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function a(e){let{element:t,maskInputOptions:n,tagName:r,type:o,value:i,maskInputFn:s}=e,a=i||"";const c=o&&l(o);return(n[r.toLowerCase()]||c&&n[c])&&(a=s?s(a,t):"*".repeat(a.length)),a}function l(e){return e.toLowerCase()}const c="__rrweb_original__";function u(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?l(t):null}function d(e,t){var n;let r;try{r=new URL(e,null!=t?t:window.location.href)}catch(e){return null}const o=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==o?void 0:o[1])&&void 0!==n?n:null}let p=1;const h=new RegExp("[^a-z0-9-_:]"),f=-2;function g(){return p++}let m,y;const v=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,C=/^(?:[a-z+]+:)?\/\//i,b=/^www\..*/i,_=/^(data:)([^,]*),(.*)/i;function I(e,t){return(e||"").replace(v,((e,n,r,o,i,s)=>{const a=r||i||s,l=n||o||"";if(!a)return e;if(C.test(a)||b.test(a))return`url(${l}${a}${l})`;if(_.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const c=t.split("/"),u=a.split("/");c.pop();for(const e of u)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`}))}const S=/^[^ \t\n\r\u000c]+/,w=/^[, \t\n\r\u000c]+/;function k(e,t){if(!t||""===t.trim())return t;const n=e.createElement("a");return n.href=t,n.href}function A(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function T(){const e=document.createElement("a");return e.href="",e.href}function x(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?k(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}const o=[];for(;r(w),!(n>=t.length);){let i=r(S);if(","===i.slice(-1))i=k(e,i.substring(0,i.length-1)),o.push(i);else{let r="";i=k(e,i);let s=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((i+r).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){n+=1,o.push((i+r).trim());break}"("===e&&(s=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?I(r,T()):"object"===t&&"data"===n?k(e,r):r:k(e,r):r}function M(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t||"video"===e&&"src"===t&&n&&n.startsWith("blob:http")}function E(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&E(e.parentNode,t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&E(e.parentNode,t,n)}function N(e,t,n,r){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===o)return!1;if("string"==typeof t){if(r){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(E(o,t,r))return!0;if(n)if(r){if(o.closest(n))return!0}else if(o.matches(n))return!0}catch(e){}return!1}function O(t,n){const{doc:r,mirror:i,blockClass:s,blockSelector:d,needsMask:p,inlineStylesheet:f,maskInputOptions:g={},maskTextFn:v,maskInputFn:C,dataURLOptions:b={},inlineImages:_,recordCanvas:S,keepIframeSrcFn:w,newlyAddedElement:k=!1}=n,E=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode}:{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:E};case t.ELEMENT_NODE:return function(t,n){const{doc:r,blockClass:i,blockSelector:s,inlineStylesheet:d,maskInputOptions:p={},maskInputFn:f,dataURLOptions:g={},inlineImages:v,recordCanvas:C,keepIframeSrcFn:b,newlyAddedElement:_=!1,rootId:S}=n,w=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(e){}return!1}(t,i,s),k=function(e){if(e instanceof HTMLFormElement)return"form";const t=l(e.tagName);return h.test(t)?"div":t}(t);let E={};const N=t.attributes.length;for(let e=0;e<N;e++){const n=t.attributes[e];M(k,n.name,n.value)||(E[n.name]=x(r,k,l(n.name),n.value))}if("link"===k&&d){const e=t.href;let n=Array.from(r.styleSheets).find((t=>t.href===e));if(!n&&e.includes(".css")){const t=window.location.origin+"/"+e.replace(window.location.href,"");n=Array.from(r.styleSheets).find((e=>e.href===t))}let i=null;n&&(i=o(n)),i&&(delete E.rel,delete E.href,E._cssText=I(i,n.href))}if("style"===k&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const e=o(t.sheet);e&&(E._cssText=I(e,T()))}if("input"===k||"textarea"===k||"select"===k){const e=t.value,n=t.checked;"radio"!==E.type&&"checkbox"!==E.type&&"submit"!==E.type&&"button"!==E.type&&e?E.value=a({element:t,type:u(t),tagName:k,value:e,maskInputOptions:p,maskInputFn:f}):n&&(E.checked=n)}"option"===k&&(t.selected&&!p.select?E.selected=!0:delete E.selected);if("canvas"===k&&C)if("2d"===t.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const o=t.getImageData,i=c in o?o[c]:o;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((e=>0!==e)))return!1}return!0})(t)||(E.rr_dataURL=t.toDataURL(g.type,g.quality));else if(!("__context"in t)){const e=t.toDataURL(g.type,g.quality),n=document.createElement("canvas");n.width=t.width,n.height=t.height;e!==n.toDataURL(g.type,g.quality)&&(E.rr_dataURL=e)}if("img"===k&&v){m||(m=r.createElement("canvas"),y=m.getContext("2d"));const e=t,n=e.crossOrigin;e.crossOrigin="anonymous";const o=()=>{e.removeEventListener("load",o);try{m.width=e.naturalWidth,m.height=e.naturalHeight,y.drawImage(e,0,0),E.rr_dataURL=m.toDataURL(g.type,g.quality)}catch(t){console.warn(`Cannot inline img src=${e.currentSrc}! Error: ${t}`)}n?E.crossOrigin=n:e.removeAttribute("crossorigin")};e.complete&&0!==e.naturalWidth?o():e.addEventListener("load",o)}if("audio"===k||"video"===k){const e=E;e.rr_mediaState=t.paused?"paused":"played",e.rr_mediaCurrentTime=t.currentTime,e.rr_mediaPlaybackRate=t.playbackRate,e.rr_mediaMuted=t.muted,e.rr_mediaLoop=t.loop,e.rr_mediaVolume=t.volume}_||(t.scrollLeft&&(E.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(E.rr_scrollTop=t.scrollTop));if(w){const{width:e,height:n}=t.getBoundingClientRect();E={class:E.class,rr_width:`${e}px`,rr_height:`${n}px`}}"iframe"!==k||b(E.src)||(t.contentDocument||(E.rr_src=E.src),delete E.src);let O;try{customElements.get(k)&&(O=!0)}catch(e){}return{type:e.Element,tagName:k,attributes:E,childNodes:[],isSVG:A(t)||void 0,needBlock:w,rootId:S,isCustom:O}}(t,{doc:r,blockClass:s,blockSelector:d,inlineStylesheet:f,maskInputOptions:g,maskInputFn:C,dataURLOptions:b,inlineImages:_,recordCanvas:S,keepIframeSrcFn:w,newlyAddedElement:k,rootId:E});case t.TEXT_NODE:return function(t,n){var r;const{needsMask:i,maskTextFn:s,rootId:a}=n,l=t.parentNode&&t.parentNode.tagName;let c=t.textContent;const u="STYLE"===l||void 0,d="SCRIPT"===l||void 0;if(u&&c){try{t.nextSibling||t.previousSibling||(null===(r=t.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(c=o(t.parentNode.sheet))}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}c=I(c,T())}d&&(c="SCRIPT_PLACEHOLDER");!u&&!d&&c&&i&&(c=s?s(c,t.parentElement):c.replace(/[\S]/g,"*"));return{type:e.Text,textContent:c||"",isStyle:u,rootId:a}}(t,{needsMask:p,maskTextFn:v,rootId:E});case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:E};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:E};default:return!1}}function L(e){return null==e?"":e.toLowerCase()}function R(t,o){const{doc:i,mirror:s,blockClass:a,blockSelector:l,maskTextClass:c,maskTextSelector:u,skipChild:p=!1,inlineStylesheet:h=!0,maskInputOptions:m={},maskTextFn:y,maskInputFn:v,slimDOMOptions:C,dataURLOptions:b={},inlineImages:_=!1,recordCanvas:I=!1,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:k=5e3,onStylesheetLoad:A,stylesheetLoadTimeout:T=5e3,keepIframeSrcFn:x=(()=>!1),newlyAddedElement:M=!1}=o;let{needsMask:E}=o,{preserveWhiteSpace:D=!0}=o;if(!E&&t.childNodes){E=N(t,c,u,void 0===E)}const F=O(t,{doc:i,mirror:s,blockClass:a,blockSelector:l,needsMask:E,inlineStylesheet:h,maskInputOptions:m,maskTextFn:y,maskInputFn:v,dataURLOptions:b,inlineImages:_,recordCanvas:I,keepIframeSrcFn:x,newlyAddedElement:M});if(!F)return console.warn(t,"not serialized"),null;let q;q=s.hasNode(t)?s.getId(t):!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===d(t.attributes.href)))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(L(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===L(t.attributes.name)||"icon"===L(t.attributes.rel)||"apple-touch-icon"===L(t.attributes.rel)||"shortcut icon"===L(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&L(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(L(t.attributes.property).match(/^(og|twitter|fb):/)||L(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===L(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===L(t.attributes.name)||"googlebot"===L(t.attributes.name)||"bingbot"===L(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===L(t.attributes.name)||"generator"===L(t.attributes.name)||"framework"===L(t.attributes.name)||"publisher"===L(t.attributes.name)||"progid"===L(t.attributes.name)||L(t.attributes.property).match(/^article:/)||L(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===L(t.attributes.name)||"yandex-verification"===L(t.attributes.name)||"csrf-token"===L(t.attributes.name)||"p:domain_verify"===L(t.attributes.name)||"verify-v1"===L(t.attributes.name)||"verification"===L(t.attributes.name)||"shopify-checkout-api-token"===L(t.attributes.name)))return!0}}return!1}(F,C)&&(D||F.type!==e.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?g():f;const H=Object.assign(F,{id:q});if(s.add(t,H),q===f)return null;S&&S(t);let B=!p;if(H.type===e.Element){B=B&&!H.needBlock,delete H.needBlock;const e=t.shadowRoot;e&&r(e)&&(H.isShadowHost=!0)}if((H.type===e.Document||H.type===e.Element)&&B){C.headWhitespace&&H.type===e.Element&&"head"===H.tagName&&(D=!1);const n={doc:i,mirror:s,blockClass:a,blockSelector:l,needsMask:E,maskTextClass:c,maskTextSelector:u,skipChild:p,inlineStylesheet:h,maskInputOptions:m,maskTextFn:y,maskInputFn:v,slimDOMOptions:C,dataURLOptions:b,inlineImages:_,recordCanvas:I,preserveWhiteSpace:D,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:k,onStylesheetLoad:A,stylesheetLoadTimeout:T,keepIframeSrcFn:x};if(H.type===e.Element&&"textarea"===H.tagName&&void 0!==H.attributes.value);else for(const e of Array.from(t.childNodes)){const t=R(e,n);t&&H.childNodes.push(t)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(t)&&t.shadowRoot)for(const e of Array.from(t.shadowRoot.childNodes)){const o=R(e,n);o&&(r(t.shadowRoot)&&(o.isShadow=!0),H.childNodes.push(o))}}return t.parentNode&&n(t.parentNode)&&r(t.parentNode)&&(H.isShadow=!0),H.type===e.Element&&"iframe"===H.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let o,i=!1;try{o=r.document.readyState}catch(e){return}if("complete"!==o){const r=setTimeout((()=>{i||(t(),i=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(r),i=!0,t()}))}const s="about:blank";if(r.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(t,(()=>{const e=t.contentDocument;if(e&&w){const n=R(e,{doc:e,mirror:s,blockClass:a,blockSelector:l,needsMask:E,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:h,maskInputOptions:m,maskTextFn:y,maskInputFn:v,slimDOMOptions:C,dataURLOptions:b,inlineImages:_,recordCanvas:I,preserveWhiteSpace:D,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:k,onStylesheetLoad:A,stylesheetLoadTimeout:T,keepIframeSrcFn:x});n&&w(t,n)}}),k),H.type===e.Element&&"link"===H.tagName&&"string"==typeof H.attributes.rel&&("stylesheet"===H.attributes.rel||"preload"===H.attributes.rel&&"string"==typeof H.attributes.href&&"css"===d(H.attributes.href))&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(e){return}if(r)return;const i=setTimeout((()=>{o||(t(),o=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(i),o=!0,t()}))}(t,(()=>{if(A){const e=R(t,{doc:i,mirror:s,blockClass:a,blockSelector:l,needsMask:E,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:h,maskInputOptions:m,maskTextFn:y,maskInputFn:v,slimDOMOptions:C,dataURLOptions:b,inlineImages:_,recordCanvas:I,preserveWhiteSpace:D,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:k,onStylesheetLoad:A,stylesheetLoadTimeout:T,keepIframeSrcFn:x});e&&A(t,e)}}),T),H}function D(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const F="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let q={map:{},getId:()=>(console.error(F),-1),getNode:()=>(console.error(F),null),removeNodeFromMap(){console.error(F)},has:()=>(console.error(F),!1),reset(){console.error(F)}};function H(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,o=0;return function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];const l=Date.now();o||!1!==n.leading||(o=l);const c=t-(l-o),u=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),o=l,e.apply(u,s)):r||!1===n.trailing||(r=setTimeout((()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(u,s)}),c))}}function B(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),i&&i.set&&i.set.call(this,e)}}),()=>B(e,t,i||{},!0)}function P(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(q=new Proxy(q,{get:(e,t,n)=>("map"===t&&console.error(F),Reflect.get(e,t,n))}));let W=Date.now;function Z(e){var t,n,r,o,i,s;const a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==a?void 0:a.documentElement.scrollLeft)||(null===(n=null===(t=null==a?void 0:a.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null==a?void 0:a.body)||void 0===r?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null===(i=null===(o=null==a?void 0:a.body)||void 0===o?void 0:o.parentElement)||void 0===i?void 0:i.scrollTop)||(null===(s=null==a?void 0:a.body)||void 0===s?void 0:s.scrollTop)||0}}function V(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function U(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function G(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}function j(e,t,n,r){if(!e)return!1;const o=G(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(E(o,t,r))return!0}catch(e){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function $(e,t){return t.getId(e)===f}function K(e,t){if(n(e))return!1;const r=t.getId(e);return!t.has(r)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||K(e.parentNode,t))}function Q(e){return Boolean(e.changedTouches)}function z(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Y(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function J(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(W=()=>(new Date).getTime());class X{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function ee(e){var t,n;let r=null;return(null===(n=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function te(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=ee(n);)n=t;return n}(e);return t.contains(n)}function ne(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||te(e))}var re=(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))(re||{}),oe=(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[e.CustomElement=16]="CustomElement",e))(oe||{}),ie=(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))(ie||{}),se=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(se||{}),ae=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ae||{});function le(e){return"__ln"in e}class ce{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&le(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&le(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const ue=(e,t)=>`${e}@${t}`;class de{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new ce,o=e=>{let t=e,n=f;for(;n===f;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},i=i=>{if(!i.parentNode||!ne(i)||"TEXTAREA"===i.parentNode.tagName)return;const s=n(i.parentNode)?this.mirror.getId(ee(i)):this.mirror.getId(i.parentNode),a=o(i);if(-1===s||-1===a)return r.addNode(i);const l=R(i,{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:e=>{z(e,this.mirror)&&this.iframeManager.addIframe(e),Y(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),J(i)&&this.shadowDomManager.addShadowRoot(i.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});l&&(e.push({parentId:s,nextId:a,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)he(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||i(e);for(const e of this.addedSet)ge(this.droppedSet,e)||he(this.removes,e,this.mirror)?ge(this.movedSet,e)?i(e):this.droppedSet.add(e):i(e);let s=null;for(;r.length;){let e=null;if(s){const t=this.mirror.getId(s.value.parentNode),n=o(s.value);-1!==t&&-1!==n&&(e=s)}if(!e){let t=r.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(n.value.parentNode);if(-1===o(n.value))continue;if(-1!==t){e=n;break}{const t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=t.parentNode.host;if(-1!==this.mirror.getId(r)){e=n;break}}}}}}if(!e){for(;r.head;)r.removeNode(r.head.value);break}s=e.previous,r.removeNode(e.value),i(e.value)}const a={texts:this.texts.map((e=>{const t=e.node;return t.parentNode&&"TEXTAREA"===t.parentNode.tagName&&this.genTextAreaValueMutation(t.parentNode),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.genTextAreaValueMutation=e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(e.childNodes,(e=>e.textContent||"")).join("")},this.processMutation=e=>{if(!$(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;j(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:N(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,G(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,r=e.target.getAttribute(n);if("value"===n){const e=u(t);r=a({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:r,maskInputFn:this.maskInputFn})}if(j(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let o=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(r)){if(t.contentDocument)return;n="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!M(t.tagName,n,r)&&(o.attributes[n]=x(this.doc,l(t.tagName),l(n),r),"style"===n)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),i=t.style.getPropertyPriority(e);r!==n.style.getPropertyValue(e)||i!==n.style.getPropertyPriority(e)?o.styleDiff[e]=""===i?r:[r,i]:o._unchangedStyles[e]=[r,i]}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}break}case"childList":if(j(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const o=this.mirror.getId(t),i=n(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);j(e.target,this.blockClass,this.blockSelector,!1)||$(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(pe(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===o||K(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ue(o,i)]?pe(this.movedSet,t):this.removes.push({parentId:i,id:o,isShadow:!(!n(e.target)||!r(e.target))||void 0})),this.mapRemoves.push(t))}))}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if($(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[ue(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);j(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach((e=>this.genAdds(e))),J(e)&&e.shadowRoot.childNodes.forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}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 pe(e,t){e.delete(t),t.childNodes.forEach((t=>pe(e,t)))}function he(e,t,n){return 0!==e.length&&fe(e,t,n)}function fe(e,t,n){const{parentNode:r}=t;if(!r)return!1;const o=n.getId(r);return!!e.some((e=>e.id===o))||fe(e,r,n)}function ge(e,t){return 0!==e.size&&me(e,t)}function me(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||me(e,n))}let ye;function ve(e){ye=e}function Ce(){ye=void 0}const be=e=>{if(!ye)return e;return function(){try{return e(...arguments)}catch(e){if(ye&&!0===ye(e))return;throw e}}},_e=[];function Ie(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Se(e,t){var n,r;const o=new de;_e.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const s=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");s&&window[s]&&(i=window[s]);const a=new i(be(o.processMutations.bind(o)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function we(e){let{mouseInteractionCb:t,doc:n,mirror:r,blockClass:o,blockSelector:i,sampling:s}=e;if(!1===s.mouseInteraction)return()=>{};const a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,c=[];let u=null;return Object.keys(ie).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((e=>{let s=l(e);const a=(e=>n=>{const s=Ie(n);if(j(s,o,i,!0))return;let a=null,l=e;if("pointerType"in n){switch(n.pointerType){case"mouse":a=se.Mouse;break;case"touch":a=se.Touch;break;case"pen":a=se.Pen}a===se.Touch?ie[e]===ie.MouseDown?l="TouchStart":ie[e]===ie.MouseUp&&(l="TouchEnd"):se.Pen}else Q(n)&&(a=se.Touch);null!==a?(u=a,(l.startsWith("Touch")&&a===se.Touch||l.startsWith("Mouse")&&a===se.Mouse)&&(a=null)):ie[e]===ie.Click&&(a=u,u=null);const c=Q(n)?n.changedTouches[0]:n;if(!c)return;const d=r.getId(s),{clientX:p,clientY:h}=c;be(t)(Object.assign({type:ie[l],id:d,x:p,y:h},null!==a&&{pointerType:a}))})(e);if(window.PointerEvent)switch(ie[e]){case ie.MouseDown:case ie.MouseUp:s=s.replace("mouse","pointer");break;case ie.TouchStart:case ie.TouchEnd:return}c.push(D(s,a,n))})),be((()=>{c.forEach((e=>e()))}))}function ke(e){let{scrollCb:t,doc:n,mirror:r,blockClass:o,blockSelector:i,sampling:s}=e;return D("scroll",be(H(be((e=>{const s=Ie(e);if(!s||j(s,o,i,!0))return;const a=r.getId(s);if(s===n&&n.defaultView){const e=Z(n.defaultView);t({id:a,x:e.left,y:e.top})}else t({id:a,x:s.scrollLeft,y:s.scrollTop})})),s.scroll||100)),n)}const Ae=["INPUT","TEXTAREA","SELECT"],Te=new WeakMap;function xe(e){return function(e,t){if(Oe("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Oe("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Oe("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Oe("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Me(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function Ee(e,t){let{mirror:n,stylesheetManager:r}=e;var o,i,s;let a=null;a="#document"===t.nodeName?n.getId(t):n.getId(t.host);const l="#document"===t.nodeName?null===(o=t.defaultView)||void 0===o?void 0:o.Document:null===(s=null===(i=t.ownerDocument)||void 0===i?void 0:i.defaultView)||void 0===s?void 0:s.ShadowRoot,c=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&l&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set(e){var t;const n=null===(t=c.set)||void 0===t?void 0:t.call(this,e);if(null!==a&&-1!==a)try{r.adoptStyleSheets(e,a)}catch(e){}return n}}),be((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function Ne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.doc.defaultView;if(!n)return()=>{};let r;!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:p,selectionCb:h,customElementCb:f}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),n(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),r(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),o(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),i(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),s(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),a(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),l(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),c(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),u(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),p(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),h(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),f(...arguments)}}(e,t),e.recordDOM&&(r=Se(e,e.doc));const o=function(e){let{mousemoveCb:t,sampling:n,doc:r,mirror:o}=e;if(!1===n.mousemove)return()=>{};const i="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500;let a,l=[];const c=H(be((e=>{const n=Date.now()-a;t(l.map((e=>(e.timeOffset-=n,e))),e),l=[],a=null})),s),u=be(H(be((e=>{const t=Ie(e),{clientX:n,clientY:r}=Q(e)?e.changedTouches[0]:e;a||(a=W()),l.push({x:n,y:r,id:o.getId(t),timeOffset:W()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?oe.Drag:e instanceof MouseEvent?oe.MouseMove:oe.TouchMove)})),i,{trailing:!1})),d=[D("mousemove",u,r),D("touchmove",u,r),D("drag",u,r)];return be((()=>{d.forEach((e=>e()))}))}(e),i=we(e),s=ke(e),l=function(e,t){let{viewportResizeCb:n}=e,{win:r}=t,o=-1,i=-1;return D("resize",be(H(be((()=>{const e=V(),t=U();o===e&&i===t||(n({width:Number(t),height:Number(e)}),o=e,i=t)})),200)),r)}(e,{win:n}),c=function(e){let{inputCb:t,doc:n,mirror:r,blockClass:o,blockSelector:i,ignoreClass:s,ignoreSelector:l,maskInputOptions:c,maskInputFn:d,sampling:p,userTriggeredOnInput:h}=e;function f(e){let t=Ie(e);const r=e.isTrusted,p=t&&t.tagName;if(t&&"OPTION"===p&&(t=t.parentElement),!t||!p||Ae.indexOf(p)<0||j(t,o,i,!0))return;if(t.classList.contains(s)||l&&t.matches(l))return;let f=t.value,m=!1;const y=u(t)||"";"radio"===y||"checkbox"===y?m=t.checked:(c[p.toLowerCase()]||c[y])&&(f=a({element:t,maskInputOptions:c,tagName:p,type:y,value:f,maskInputFn:d})),g(t,h?{text:f,isChecked:m,userTriggered:r}:{text:f,isChecked:m});const v=t.name;"radio"===y&&v&&m&&n.querySelectorAll(`input[type="radio"][name="${v}"]`).forEach((e=>{if(e!==t){const t=e.value;g(e,h?{text:t,isChecked:!m,userTriggered:!1}:{text:t,isChecked:!m})}}))}function g(e,n){const o=Te.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){Te.set(e,n);const o=r.getId(e);be(t)(Object.assign(Object.assign({},n),{id:o}))}}const m=("last"===p.input?["change"]:["input","change"]).map((e=>D(e,be(f),n))),y=n.defaultView;if(!y)return()=>{m.forEach((e=>e()))};const v=y.Object.getOwnPropertyDescriptor(y.HTMLInputElement.prototype,"value"),C=[[y.HTMLInputElement.prototype,"value"],[y.HTMLInputElement.prototype,"checked"],[y.HTMLSelectElement.prototype,"value"],[y.HTMLTextAreaElement.prototype,"value"],[y.HTMLSelectElement.prototype,"selectedIndex"],[y.HTMLOptionElement.prototype,"selected"]];return v&&v.set&&m.push(...C.map((e=>B(e[0],e[1],{set(){be(f)({target:this,isTrusted:!1})}},!1,y)))),be((()=>{m.forEach((e=>e()))}))}(e),d=function(e){let{mediaInteractionCb:t,blockClass:n,blockSelector:r,mirror:o,sampling:i,doc:s}=e;const a=be((e=>H(be((i=>{const s=Ie(i);if(!s||j(s,n,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u,loop:d}=s;t({type:e,id:o.getId(s),currentTime:a,volume:l,muted:c,playbackRate:u,loop:d})})),i.media||500))),l=[D("play",a(0),s),D("pause",a(1),s),D("seeked",a(2),s),D("volumechange",a(3),s),D("ratechange",a(4),s)];return be((()=>{l.forEach((e=>e()))}))}(e);let p=()=>{},h=()=>{},f=()=>{},g=()=>{};e.recordDOM&&(p=function(e,t){let{styleSheetRuleCb:n,mirror:r,stylesheetManager:o}=e,{win:i}=t;if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return()=>{};const s=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:be(((e,t,i)=>{const[s,a]=i,{id:l,styleId:c}=Me(t,r,o.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:s,index:a}]}),e.apply(t,i)}))});const a=i.CSSStyleSheet.prototype.deleteRule;let l,c;i.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:be(((e,t,i)=>{const[s]=i,{id:a,styleId:l}=Me(t,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:s}]}),e.apply(t,i)}))}),i.CSSStyleSheet.prototype.replace&&(l=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:be(((e,t,i)=>{const[s]=i,{id:a,styleId:l}=Me(t,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replace:s}),e.apply(t,i)}))})),i.CSSStyleSheet.prototype.replaceSync&&(c=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:be(((e,t,i)=>{const[s]=i,{id:a,styleId:l}=Me(t,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replaceSync:s}),e.apply(t,i)}))}));const u={};Le("CSSGroupingRule")?u.CSSGroupingRule=i.CSSGroupingRule:(Le("CSSMediaRule")&&(u.CSSMediaRule=i.CSSMediaRule),Le("CSSConditionRule")&&(u.CSSConditionRule=i.CSSConditionRule),Le("CSSSupportsRule")&&(u.CSSSupportsRule=i.CSSSupportsRule));const d={};return Object.entries(u).forEach((e=>{let[t,i]=e;d[t]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(d[t].insertRule,{apply:be(((e,t,i)=>{const[s,a]=i,{id:l,styleId:c}=Me(t.parentStyleSheet,r,o.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:s,index:[...xe(t),a||0]}]}),e.apply(t,i)}))}),i.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:be(((e,t,i)=>{const[s]=i,{id:a,styleId:l}=Me(t.parentStyleSheet,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:[...xe(t),s]}]}),e.apply(t,i)}))})})),be((()=>{i.CSSStyleSheet.prototype.insertRule=s,i.CSSStyleSheet.prototype.deleteRule=a,l&&(i.CSSStyleSheet.prototype.replace=l),c&&(i.CSSStyleSheet.prototype.replaceSync=c),Object.entries(u).forEach((e=>{let[t,n]=e;n.prototype.insertRule=d[t].insertRule,n.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:n}),h=Ee(e,e.doc),f=function(e,t){let{styleDeclarationCb:n,mirror:r,ignoreCSSAttributes:o,stylesheetManager:i}=e,{win:s}=t;const a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:be(((e,t,s)=>{var l;const[c,u,d]=s;if(o.has(c))return a.apply(t,[c,u,d]);const{id:p,styleId:h}=Me(null===(l=t.parentRule)||void 0===l?void 0:l.parentStyleSheet,r,i.styleMirror);return(p&&-1!==p||h&&-1!==h)&&n({id:p,styleId:h,set:{property:c,value:u,priority:d},index:xe(t.parentRule)}),e.apply(t,s)}))});const l=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:be(((e,t,s)=>{var a;const[c]=s;if(o.has(c))return l.apply(t,[c]);const{id:u,styleId:d}=Me(null===(a=t.parentRule)||void 0===a?void 0:a.parentStyleSheet,r,i.styleMirror);return(u&&-1!==u||d&&-1!==d)&&n({id:u,styleId:d,remove:{property:c},index:xe(t.parentRule)}),e.apply(t,s)}))}),be((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n}),e.collectFonts&&(g=function(e){let{fontCb:t,doc:n}=e;const r=n.defaultView;if(!r)return()=>{};const o=[],i=new WeakMap,s=r.FontFace;r.FontFace=function(e,t,n){const r=new s(e,t,n);return i.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const a=P(n.fonts,"add",(function(e){return function(n){return setTimeout(be((()=>{const e=i.get(n);e&&(t(e),i.delete(n))})),0),e.apply(this,[n])}}));return o.push((()=>{r.FontFace=s})),o.push(a),be((()=>{o.forEach((e=>e()))}))}(e)));const m=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:i}=e;let s=!0;const a=be((()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const i=e.getRangeAt(t),{startContainer:s,startOffset:l,endContainer:c,endOffset:u}=i;j(s,r,o,!0)||j(c,r,o,!0)||a.push({start:n.getId(s),startOffset:l,end:n.getId(c),endOffset:u})}i({ranges:a})}));return a(),D("selectionchange",a)}(e),y=function(e){let{doc:t,customElementCb:n}=e;const r=t.defaultView;return r&&r.customElements?P(r.customElements,"define",(function(e){return function(t,r,o){try{n({define:{name:t}})}catch(e){console.warn(`Custom element callback failed for ${t}`)}return e.apply(this,[t,r,o])}})):()=>{}}(e),v=[];for(const t of e.plugins)v.push(t.observer(t.callback,n,t.options));return be((()=>{_e.forEach((e=>e.reset())),null==r||r.disconnect(),o(),i(),s(),l(),c(),d(),p(),h(),f(),g(),m(),y(),v.forEach((e=>e()))}))}function Oe(e){return void 0!==window[e]}function Le(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Re{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),i=r||this.getRemoteIdToIdMap(e);let s=o.get(t);return s||(s=this.generateIdFn(),o.set(t,s),i.set(s,t)),s}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,r)))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=r.get(t);return o||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class De{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Re(g),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Re(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case re.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:re.IncrementalSnapshot,data:{source:oe.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case re.Meta:case re.Load:case re.DomContentLoaded:return!1;case re.Plugin:return t;case re.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case re.IncrementalSnapshot:switch(t.data.source){case oe.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case oe.Drag:case oe.TouchMove:case oe.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case oe.ViewportResize:return!1;case oe.MediaInteraction:case oe.MouseInteraction:case oe.Scroll:case oe.CanvasMutation:case oe.Input:return this.replaceIds(t.data,e,["id"]),t;case oe.StyleSheetRule:case oe.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case oe.Font:return t;case oe.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case oe.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,n,r){for(const o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(t,n){t.type===e.Document||t.rootId||(t.rootId=n),"childNodes"in t&&t.childNodes.forEach((e=>{this.patchRootIdOnNode(e,n)}))}}class Fe{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!r(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=Se(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(ke(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(Ee({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(P(e.prototype,"attachShadow",(function(e){return function(r){const o=e.call(this,r);return this.shadowRoot&&ne(this)&&n.addShadowRoot(this.shadowRoot,t),o}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}
2
- /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
- PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function qe(e,t,n,r){return new(n||(n=Promise))((function(t,o){function i(e){try{a(r.next(e))}catch(e){o(e)}}function s(e){try{a(r.throw(e))}catch(e){o(e)}}function a(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n((function(e){e(r)}))).then(i,s)}a((r=r.apply(e,[])).next())}))}for(var He="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Be="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Pe=0;Pe<64;Pe++)Be[He.charCodeAt(Pe)]=Pe;const We=new Map;const Ze=(e,t,n)=>{if(!e||!Ge(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=We.get(e);return n||(n=new Map,We.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function Ve(e,t,n){if(e instanceof Array)return e.map((e=>Ve(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=He[n[t]>>2],o+=He[(3&n[t])<<4|n[t+1]>>4],o+=He[(15&n[t+1])<<2|n[t+2]>>6],o+=He[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Ve(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Ve(e.data,t,n),e.width,e.height]}}if(Ge(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Ze(e,t,n)}}return e}const Ue=(e,t,n)=>e.map((e=>Ve(e,t,n))),Ge=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function je(e,t,n,r){const o=[];try{const i=P(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o){for(var i=arguments.length,s=new Array(i>1?i-1:0),a=1;a<i;a++)s[a-1]=arguments[a];if(!j(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(o);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(s[0]&&"object"==typeof s[0]){const e=s[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[o,...s])}}));o.push(i)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach((e=>e()))}}function $e(e,t,n,r,o,i,s){const a=[],l=Object.getOwnPropertyNames(e);for(const i of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(i))try{if("function"!=typeof e[i])continue;const l=P(e,i,(function(e){return function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];const u=e.apply(this,l);if(Ze(u,s,this),"tagName"in this.canvas&&!j(this.canvas,r,o,!0)){const e=Ue(l,s,this),r={type:t,property:i,args:e};n(this.canvas,r)}return u}}));a.push(l)}catch(r){const o=B(e,i,{set(e){n(this.canvas,{type:t,property:i,args:[e],setter:!0})}});a.push(o)}return a}function Ke(e,t,n){var r=void 0===t?null:t,o=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o<i;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),i=o.indexOf("\n",10)+1,s=o.substring(i)+(r?"//# sourceMappingURL="+r:""),a=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(a)}var Qe,ze,Ye,Je,Xe=(Qe="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",ze=null,Ye=!1,function(e){return Je=Je||Ke(Qe,ze,Ye),new Worker(Je,e)});class et{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:r,blockSelector:o,recordCanvas:i,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(n,r,o),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,o,{dataURLOptions:s})}initCanvasFPSObserver(e,t,n,r,o){const i=je(t,n,r,!0),s=new Map,a=new Xe;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:i}=e.data;this.mutationCb({id:t,type:ae["2D"],commands:[{property:"clearRect",args:[0,0,o,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const l=1e3/e;let c,u=0;const d=e=>{u&&e-u<l||(u=e,(()=>{const e=[],o=t=>{t.querySelectorAll("canvas").forEach((t=>{j(t,n,r,!0)||e.push(t)})),t.querySelectorAll("*").forEach((e=>{e.shadowRoot&&o(e.shadowRoot)}))};return o(t.document),e})().forEach((e=>qe(this,0,void 0,(function*(){var t;const n=this.mirror.getId(e);if(s.get(n))return;if(0===e.width||0===e.height)return;if(s.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const r=e.clientWidth||e.width,i=e.clientHeight||e.height,l=yield createImageBitmap(e,{resizeWidth:r,resizeHeight:i});a.postMessage({id:n,bitmap:l,width:r,height:i,dataURLOptions:o.dataURLOptions},[l])}))))),c=requestAnimationFrame(d)};c=requestAnimationFrame(d),this.resetObservers=()=>{i(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=je(e,t,n,!1),o=function(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const i=P(t.CanvasRenderingContext2D.prototype,s,(function(o){return function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];return j(this.canvas,n,r,!0)||setTimeout((()=>{const n=Ue(a,t,this);e(this.canvas,{type:ae["2D"],property:s,args:n})}),0),o.apply(this,a)}}));o.push(i)}catch(n){const r=B(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:ae["2D"],property:s,args:[t],setter:!0})}});o.push(r)}return()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),i=function(e,t,n,r,o){const i=[];return i.push(...$e(t.WebGLRenderingContext.prototype,ae.WebGL,e,n,r,0,t)),void 0!==t.WebGL2RenderingContext&&i.push(...$e(t.WebGL2RenderingContext.prototype,ae.WebGL2,e,n,r,0,t)),()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{r(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map((e=>{const t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["type"]);return t})),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}class tt{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new X,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,t)=>({rule:i(e),index:t})))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class nt{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame((()=>{this.clear(),this.loop&&this.periodicallyClear()}))}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some((e=>e!==t))}add(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function rt(e){return Object.assign(Object.assign({},e),{timestamp:W()})}let ot,it,st,at=!1;const lt=new s;function ct(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:c="rr-mask",maskTextSelector:u=null,inlineStylesheet:d=!0,maskAllInputs:p,maskInputOptions:h,slimDOMOptions:f,maskInputFn:g,maskTextFn:m,hooks:y,packFn:v,sampling:C={},dataURLOptions:b={},mousemoveWait:_,recordDOM:I=!0,recordCanvas:S=!1,recordCrossOriginIframes:w=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:A=!1,collectFonts:T=!1,inlineImages:x=!1,plugins:M,keepIframeSrcFn:E=(()=>!1),ignoreCSSAttributes:N=new Set([]),errorHandler:O}=e;ve(O);const L=!w||window.parent===window;let F=!1;if(!L)try{window.parent.document&&(F=!1)}catch(e){F=!0}if(L&&!t)throw new Error("emit function is required");void 0!==_&&void 0===C.mousemove&&(C.mousemove=_),lt.reset();const q=!0===p?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==h?h:{password:!0},H=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f}:f||{};let B;!function(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];let o=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})}();let P=0;const W=e=>{for(const t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!F&&(e=v(e)),e};ot=(e,o)=>{var i;if(!(null===(i=_e[0])||void 0===i?void 0:i.isFrozen())||e.type===re.FullSnapshot||e.type===re.IncrementalSnapshot&&e.data.source===oe.Mutation||_e.forEach((e=>e.unfreeze())),L)null==t||t(W(e),o);else if(F){const t={type:"rrweb",event:W(e),origin:window.location.origin,isCheckout:o};window.parent.postMessage(t,"*")}if(e.type===re.FullSnapshot)B=e,P=0;else if(e.type===re.IncrementalSnapshot){if(e.data.source===oe.Mutation&&e.data.isAttachIframe)return;P++;const t=r&&P>=r,o=n&&e.timestamp-B.timestamp>n;(t||o)&&it(!0)}};const G=e=>{ot(rt({type:re.IncrementalSnapshot,data:Object.assign({source:oe.Mutation},e)}))},j=e=>ot(rt({type:re.IncrementalSnapshot,data:Object.assign({source:oe.Scroll},e)})),$=e=>ot(rt({type:re.IncrementalSnapshot,data:Object.assign({source:oe.CanvasMutation},e)})),K=new tt({mutationCb:G,adoptedStyleSheetCb:e=>ot(rt({type:re.IncrementalSnapshot,data:Object.assign({source:oe.AdoptedStyleSheet},e)}))}),Q=new De({mirror:lt,mutationCb:G,stylesheetManager:K,recordCrossOriginIframes:w,wrappedEmit:ot});for(const e of M||[])e.getMirror&&e.getMirror({nodeMirror:lt,crossOriginIframeMirror:Q.crossOriginIframeMirror,crossOriginIframeStyleMirror:Q.crossOriginIframeStyleMirror});const X=new nt;st=new et({recordCanvas:S,mutationCb:$,win:window,blockClass:o,blockSelector:i,mirror:lt,sampling:C.canvas,dataURLOptions:b});const ee=new Fe({mutationCb:G,scrollCb:j,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:u,inlineStylesheet:d,maskInputOptions:q,dataURLOptions:b,maskTextFn:m,maskInputFn:g,recordCanvas:S,inlineImages:x,sampling:C,slimDOMOptions:H,iframeManager:Q,stylesheetManager:K,canvasManager:st,keepIframeSrcFn:E,processedNodeManager:X},mirror:lt});it=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!I)return;ot(rt({type:re.Meta,data:{href:window.location.href,width:U(),height:V()}}),e),K.reset(),ee.init(),_e.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new s,blockClass:r="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:a=null,inlineStylesheet:l=!0,inlineImages:c=!1,recordCanvas:u=!1,maskAllInputs:d=!1,maskTextFn:p,maskInputFn:h,slimDOM:f=!1,dataURLOptions:g,preserveWhiteSpace:m,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:C,onStylesheetLoad:b,stylesheetLoadTimeout:_,keepIframeSrcFn:I=(()=>!1)}=t||{};return R(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===d?{password:!0}:d,maskTextFn:p,maskInputFn:h,slimDOMOptions:!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===f,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===f?{}:f,dataURLOptions:g,inlineImages:c,recordCanvas:u,preserveWhiteSpace:m,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:C,onStylesheetLoad:b,stylesheetLoadTimeout:_,keepIframeSrcFn:I,newlyAddedElement:!1})}(document,{mirror:lt,blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:u,inlineStylesheet:d,maskAllInputs:q,maskTextFn:m,slimDOM:H,dataURLOptions:b,recordCanvas:S,inlineImages:x,onSerialize:e=>{z(e,lt)&&Q.addIframe(e),Y(e,lt)&&K.trackLinkElement(e),J(e)&&ee.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{Q.attachIframe(e,t),ee.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{K.attachLinkElement(e,t)},keepIframeSrcFn:E});if(!t)return console.warn("Failed to snapshot the document");ot(rt({type:re.FullSnapshot,data:{node:t,initialOffset:Z(window)}}),e),_e.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&K.adoptStyleSheets(document.adoptedStyleSheets,lt.getId(document))};try{const e=[],t=e=>{var t;return be(Ne)({mutationCb:G,mousemoveCb:(e,t)=>ot(rt({type:re.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>ot(rt({type:re.IncrementalSnapshot,data:Object.assign({source:oe.MouseInteraction},e)})),scrollCb:j,viewportResizeCb:e=>ot(rt({type:re.IncrementalSnapshot,data:Object.assign({source:oe.ViewportResize},e)})),inputCb:e=>ot(rt({type:re.IncrementalSnapshot,data:Object.assign({source:oe.Input},e)})),mediaInteractionCb:e=>ot(rt({type:re.IncrementalSnapshot,data:Object.assign({source:oe.MediaInteraction},e)})),styleSheetRuleCb:e=>ot(rt({type:re.IncrementalSnapshot,data:Object.assign({source:oe.StyleSheetRule},e)})),styleDeclarationCb:e=>ot(rt({type:re.IncrementalSnapshot,data:Object.assign({source:oe.StyleDeclaration},e)})),canvasMutationCb:$,fontCb:e=>ot(rt({type:re.IncrementalSnapshot,data:Object.assign({source:oe.Font},e)})),selectionCb:e=>{ot(rt({type:re.IncrementalSnapshot,data:Object.assign({source:oe.Selection},e)}))},customElementCb:e=>{ot(rt({type:re.IncrementalSnapshot,data:Object.assign({source:oe.CustomElement},e)}))},blockClass:o,ignoreClass:a,ignoreSelector:l,maskTextClass:c,maskTextSelector:u,maskInputOptions:q,inlineStylesheet:d,sampling:C,recordDOM:I,recordCanvas:S,inlineImages:x,userTriggeredOnInput:A,collectFonts:T,doc:e,maskInputFn:g,maskTextFn:m,keepIframeSrcFn:E,blockSelector:i,slimDOMOptions:H,dataURLOptions:b,mirror:lt,iframeManager:Q,stylesheetManager:K,shadowDomManager:ee,processedNodeManager:X,canvasManager:st,ignoreCSSAttributes:N,plugins:(null===(t=null==M?void 0:M.filter((e=>e.observer)))||void 0===t?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>ot(rt({type:re.Plugin,data:{plugin:e.name,payload:t}}))}))))||[]},y)};Q.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}}));const n=()=>{it(),e.push(t(document)),at=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(D("DOMContentLoaded",(()=>{ot(rt({type:re.DomContentLoaded,data:{}})),"DOMContentLoaded"===k&&n()}))),e.push(D("load",(()=>{ot(rt({type:re.Load,data:{}})),"load"===k&&n()}),window))),()=>{e.forEach((e=>e())),X.destroy(),at=!1,Ce()}}catch(e){console.warn(e)}}ct.addCustomEvent=(e,t)=>{if(!at)throw new Error("please add custom event after start recording");ot(rt({type:re.Custom,data:{tag:e,payload:t}}))},ct.freezePage=()=>{_e.forEach((e=>e.freeze()))},ct.takeFullSnapshot=e=>{if(!at)throw new Error("please take full snapshot after start recording");it(e)},ct.mirror=lt;class ut{constructor(e){this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}}const dt=/(^|@)\S+:\d+/,pt=/^\s*at .*(\S+:\d+|\(native\))/m,ht=/^(eval@)?(\[native code])?$/,ft={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(pt)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(pt)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],""):t;const r=t.split(/\s+/).slice(1),o=this.extractLocation(n?n[1]:r.pop()),i=r.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new ut({functionName:i,fileName:s,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(ht)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new ut({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new ut({functionName:r,fileName:o[0],lineNumber:o[1],columnNumber:o[2]})}}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[];for(let e=2,o=n.length;e<o;e+=2){const o=t.exec(n[e]);o&&r.push(new ut({fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[];for(let e=0,o=n.length;e<o;e+=2){const o=t.exec(n[e]);o&&r.push(new ut({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(dt)&&!e.match(/^Error created at/)}),this).map((function(e){const t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new ut({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function gt(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();const r=e.parentElement,o=[];if(r.children&&r.children.length>0)for(let e=0;e<r.children.length;e++){const t=r.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===n&&o.push(t)}o.length>1&&(n+=`:eq(${o.indexOf(e)})`),t=n+(t?">"+t:""),e=r}return t}function mt(e){return"[object Object]"===Object.prototype.toString.call(e)}function yt(e,t){if(0===t)return!0;const n=Object.keys(e);for(const r of n)if(mt(e[r])&&yt(e[r],t-1))return!0;return!1}function vt(e,t){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);const r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){const n=r.indexOf(this);~n?r.splice(n+1):r.push(this),~n?o.splice(n,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(mt(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(mt(e)&&yt(e,n.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=`${t.slice(0,n.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const n in t){const r=t[n];Array.isArray(r)?e[n]=gt(r.length?r[0]:null):e[n]=r}return e}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}const Ct={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function bt(e,t,n){const r=n?Object.assign({},Ct,n):Ct,o=r.logger;if(!o)return()=>{};let i;i="string"==typeof o?t[o]:o;let s=0,a=!1;const l=[];if(r.level.includes("error")){const n=t=>{const n=t.message,o=t.error,i=ft.parse(o).map((e=>e.toString())),s=[vt(n,r.stringifyOptions)];e({level:"error",trace:i,payload:s})};t.addEventListener("error",n),l.push((()=>{t.removeEventListener("error",n)}));const o=t=>{let n,o;t.reason instanceof Error?(n=t.reason,o=[vt(`Uncaught (in promise) ${n.name}: ${n.message}`,r.stringifyOptions)]):(n=new Error,o=[vt("Uncaught (in promise)",r.stringifyOptions),vt(t.reason,r.stringifyOptions)]);const i=ft.parse(n).map((e=>e.toString()));e({level:"error",trace:i,payload:o})};t.addEventListener("unhandledrejection",o),l.push((()=>{t.removeEventListener("unhandledrejection",o)}))}for(const e of r.level)l.push(c(i,e));return()=>{l.forEach((e=>e()))};function c(t,n){var o=this;return t[n]?P(t,n,(t=>function(){for(var i=arguments.length,l=new Array(i),c=0;c<i;c++)l[c]=arguments[c];if(t.apply(o,l),!a){a=!0;try{const t=ft.parse(new Error).map((e=>e.toString())).splice(1),o=l.map((e=>vt(e,r.stringifyOptions)));s++,s<r.lengthThreshold?e({level:n,trace:t,payload:o}):s===r.lengthThreshold&&e({level:"warn",trace:[],payload:[vt("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}const _t=e=>({name:"rrweb/console@1",observer:bt,options:e}),It=Array.isArray,St=Object.prototype,wt=St.hasOwnProperty,kt=St.toString,At=It||function(e){return"[object Array]"===kt.call(e)},Tt=function(e){return"function"==typeof e},xt=function(e){return e===Object(e)&&!At(e)},Mt=function(e){return void 0===e},Et=function(e){return"[object String]"==kt.call(e)},Nt=function(e){return Et(e)&&0===e.trim().length},Ot=function(e){return null===e},Lt=function(e){return Mt(e)||Ot(e)},Rt=function(e){return"[object Number]"==kt.call(e)},Dt=function(e){return"[object Boolean]"===kt.call(e)},Ft=e=>e instanceof Document,qt=e=>e instanceof FormData,Ht="undefined"!=typeof window?window:void 0,Bt="undefined"!=typeof globalThis?globalThis:Ht,Pt=Array.prototype.forEach,Wt=null==Bt?void 0:Bt.navigator,Zt=null==Bt?void 0:Bt.document;null==Bt||Bt.location,null==Bt||Bt.fetch,null!=Bt&&Bt.XMLHttpRequest&&"withCredentials"in new Bt.XMLHttpRequest&&Bt.XMLHttpRequest,null==Bt||Bt.AbortController,null==Wt||Wt.userAgent;const Vt=null!=Ht?Ht:{},Ut="[PostHog.js]",Gt={_log:function(e){if(Ht&&Vt.POSTHOG_DEBUG&&!Mt(Ht.console)&&Ht.console){const o="__rrweb_original__"in Ht.console[e]?Ht.console[e].__rrweb_original__:Ht.console[e];for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o(Ut,...n)}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Gt._log("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Gt._log("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Gt._log("error",...t)},critical:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.error(Ut,...t)},uninitializedWarning:e=>{Gt.error(`You must initialize PostHog before calling ${e}`)}},jt={};function $t(e,t,n){if(!Lt(e)){if(At(e))return function(e,t,n){if(At(e))if(Pt&&e.forEach===Pt)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(let r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r)===jt)return}(e,t,n);if(qt(e)){for(const r of e.entries())if(t.call(n,r[1],r[0])===jt)return}else for(const r in e)if(wt.call(e,r)&&t.call(n,e[r],r)===jt)return}}const Kt=function(e){let t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&";const o=[];return $t(e,(function(e,r){Mt(e)||Mt(r)||"undefined"===r||(t=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),n=encodeURIComponent(r),o[o.length]=n+"="+t)})),o.join(r)},Qt={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]};function zt(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return Tt(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function Yt(e,t){var n;const r=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch{return null}}(e),o={hostname:r,isHostDenied:!1};if(null===(n=t.payloadHostDenyList)||void 0===n||!n.length||null==r||!r.trim().length)return o;for(const e of t.payloadHostDenyList)if(r.endsWith(e))return{hostname:r,isHostDenied:!0};return o}const Jt=e=>"navigation"===e.entryType,Xt=e=>"resource"===e.entryType;function en(e,t,n){if(n.recordInitialRequests){const r=t.performance.getEntries().filter((e=>Jt(e)||Xt(e)&&n.initiatorTypes.includes(e.initiatorType)));e({requests:r.flatMap((e=>an({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}const r=new t.PerformanceObserver((t=>{const r=t.getEntries().filter((e=>Jt(e)||Xt(e)&&n.initiatorTypes.includes(e.initiatorType)&&(e=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:r.flatMap((e=>an({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((e=>n.performanceEntryTypeToObserve.includes(e)));return r.observe({entryTypes:o}),()=>{r.disconnect()}}function tn(e,t){return!!t&&(Dt(t)||t[e])}function nn(e){let{type:t,recordBody:n,headers:r}=e;function o(e){const t=Object.keys(r).find((e=>"content-type"===e.toLowerCase())),n=t&&r[t];return e.some((e=>null==n?void 0:n.includes(e)))}if(!n)return!1;if(Dt(n))return!0;if(At(n))return o(n);const i=n[t];return Dt(i)?i:o(i)}async function rn(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(i>10)return Gt.warn("Failed to get performance entry for request",{url:n,initiatorType:t}),null;const s=function(e,t){for(let n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}(e.performance.getEntriesByName(n),(e=>Xt(e)&&e.initiatorType===t&&(Mt(r)||e.startTime>=r)&&(Mt(o)||e.startTime<=o)));return s||(await new Promise((e=>setTimeout(e,50*i))),rn(e,t,n,r,o,i+1))}function on(e){let{body:t,options:n,url:r}=e;if(Lt(t))return null;const{hostname:o,isHostDenied:i}=Yt(r,n);if(i)return o+" is in deny list";if(Et(t))return t;if(Ft(t))return t.textContent;if(qt(t))return Kt(t);if(xt(t))try{return JSON.stringify(t)}catch{return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}const sn=e=>!Ot(e)&&("navigation"===e.entryType||"resource"===e.entryType);function an(e){let{entry:t,method:n,status:r,networkRequest:o,isInitial:i,start:s,end:a,url:l,initiatorType:c}=e;s=t?t.startTime:s,a=t?t.responseEnd:a;const u=Math.floor(Date.now()-performance.now()),d=Math.floor(u+(s||0)),p=[{...t?t.toJSON():{name:l},startTime:Mt(s)?void 0:Math.round(s),endTime:Mt(a)?void 0:Math.round(a),timeOrigin:u,timestamp:d,method:n,initiatorType:t?t.initiatorType:c,status:r,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:i}];if(sn(t))for(const e of t.serverTiming||[])p.push({timeOrigin:u,timestamp:d,startTime:Math.round(t.startTime),name:e.name,duration:e.duration,entryType:"serverTiming"});return p}const ln=["video/","audio/"];function cn(e){return new Promise(((t,n)=>{const r=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>n(e))).finally((()=>clearTimeout(r)))}catch{clearTimeout(r),t("[SessionReplay] Failed to read body")}}))}async function un(e){let{r:t,options:n,url:r}=e;const o=function(e){var t;let{r:n,options:r,url:o}=e;if("chunked"===n.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const i=null===(t=n.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),s=ln.some((e=>null==i?void 0:i.startsWith(e)));if(i&&s)return`Content-Type ${i} is not supported`;const{hostname:a,isHostDenied:l}=Yt(o,r);return l?a+" is in deny list":null}({r:t,options:n,url:r});return Ot(o)?cn(t):Promise.resolve(o)}function dn(e,t,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const r=tn("request",n.recordHeaders),o=tn("response",n.recordHeaders),i=zt(t,"fetch",(i=>async function(s,a){const l=new Request(s,a);let c;const u={};let d,p;try{const e={};l.headers.forEach(((t,n)=>{e[n]=t})),r&&(u.requestHeaders=e),nn({type:"request",headers:e,url:s,recordBody:n.recordBody})&&(u.requestBody=await async function(e){let{r:t,options:n,url:r}=e;const{hostname:o,isHostDenied:i}=Yt(r,n);return i?Promise.resolve(o+" is in deny list"):cn(t)}({r:l,options:n,url:s})),d=t.performance.now(),c=await i(l),p=t.performance.now();const a={};return c.headers.forEach(((e,t)=>{a[t]=e})),o&&(u.responseHeaders=a),nn({type:"response",headers:a,url:s,recordBody:n.recordBody})&&(u.responseBody=await un({r:c,options:n,url:s})),c}finally{rn(t,"fetch",l.url,d,p).then((t=>{var n;const r=an({entry:t,method:l.method,status:null===(n=c)||void 0===n?void 0:n.status,networkRequest:u,start:d,end:p,url:l.url,initiatorType:"fetch"});e({requests:r})})).catch((()=>{}))}}));return()=>{i()}}let pn=null;function hn(e,t,n){if(!("performance"in t))return()=>{};if(pn)return Gt.warn("Network observer already initialised, doing nothing"),()=>{};const r=n?Object.assign({},Qt,n):Qt,o=t=>{const n=[];t.requests.forEach((e=>{const t=r.maskRequestFn(e);t&&n.push(t)})),n.length>0&&e({...t,requests:n})},i=en(o,t,r);let s=()=>{},a=()=>{};return(r.recordHeaders||r.recordBody)&&(s=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const r=tn("request",n.recordHeaders),o=tn("response",n.recordHeaders),i=zt(t.XMLHttpRequest.prototype,"open",(i=>function(s,a){let l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=arguments.length>3?arguments[3]:void 0,u=arguments.length>4?arguments[4]:void 0;const d=this,p=new Request(a),h={};let f,g;const m={},y=d.setRequestHeader.bind(d);d.setRequestHeader=(e,t)=>(m[e]=t,y(e,t)),r&&(h.requestHeaders=m);const v=d.send.bind(d);d.send=e=>(nn({type:"request",headers:m,url:a,recordBody:n.recordBody})&&(h.requestBody=on({body:e,options:n,url:a})),f=t.performance.now(),v(e)),d.addEventListener("readystatechange",(()=>{if(d.readyState!==d.DONE)return;g=t.performance.now();const r={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{const t=e.split(": "),n=t.shift(),o=t.join(": ");n&&(r[n]=o)})),o&&(h.responseHeaders=r),nn({type:"response",headers:r,url:a,recordBody:n.recordBody})&&(h.responseBody=on({body:d.response,options:n,url:a})),rn(t,"xmlhttprequest",p.url,f,g).then((t=>{const n=an({entry:t,method:p.method,status:null==d?void 0:d.status,networkRequest:h,start:f,end:g,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:n})})).catch((()=>{}))})),i.call(d,s,a,l,c,u)}));return()=>{i()}}(o,t,r),a=dn(o,t,r)),pn=()=>{i(),s(),a()},pn}const fn=e=>({name:"rrweb/network@1",observer:hn,options:e});let gn,mn,yn;Vt.__PosthogExtensions__=Vt.__PosthogExtensions__||{},Vt.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:_t,getRecordNetworkPlugin:fn},Vt.__PosthogExtensions__.rrweb={record:ct,version:"v2",rrwebVersion:t},Vt.rrweb={record:ct,version:"v2",rrwebVersion:t},Vt.rrwebConsoleRecord={getRecordConsolePlugin:_t},Vt.getRecordNetworkPlugin=fn,function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(gn||(gn={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(mn||(mn={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(yn||(yn={}));var vn,Cn,bn,_n,In,Sn,wn,kn,An={},Tn=[],xn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Mn=Array.isArray;function En(e,t){for(var n in t)e[n]=t[n];return e}function Nn(e){var t=e.parentNode;t&&t.removeChild(e)}function On(e,t,n){var r,o,i,s={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?vn.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===s[i]&&(s[i]=e.defaultProps[i]);return Ln(e,s,r,o,null)}function Ln(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==o?++bn:o,__i:-1,__u:0};return null==o&&null!=Cn.vnode&&Cn.vnode(i),i}function Rn(e){return e.children}function Dn(e,t){this.props=e,this.context=t}function Fn(e,t){if(null==t)return e.__?Fn(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Fn(e):null}function qn(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return qn(e)}}function Hn(e){(!e.__d&&(e.__d=!0)&&_n.push(e)&&!Bn.__r++||In!==Cn.debounceRendering)&&((In=Cn.debounceRendering)||Sn)(Bn)}function Bn(){var e,t,n,r,o,i,s,a,l;for(_n.sort(wn);e=_n.shift();)e.__d&&(t=_n.length,r=void 0,i=(o=(n=e).__v).__e,a=[],l=[],(s=n.__P)&&((r=En({},o)).__v=o.__v+1,Cn.vnode&&Cn.vnode(r),$n(s,r,o,n.__n,void 0!==s.ownerSVGElement,32&o.__u?[i]:null,a,null==i?Fn(o):i,!!(32&o.__u),l),r.__.__k[r.__i]=r,Kn(a,r,l),r.__e!=i&&qn(r)),_n.length>t&&_n.sort(wn));Bn.__r=0}function Pn(e,t,n,r,o,i,s,a,l,c,u){var d,p,h,f,g,m=r&&r.__k||Tn,y=t.length;for(n.__d=l,function(e,t,n){var r,o,i,s,a,l=t.length,c=n.length,u=c,d=0;for(e.__k=[],r=0;r<l;r++)null!=(o=e.__k[r]=null==(o=t[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?Ln(null,o,null,null,o):Mn(o)?Ln(Rn,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?Ln(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,a=Zn(o,n,s=r+d,u),o.__i=a,i=null,-1!==a&&(u--,(i=n[a])&&(i.__u|=131072)),null==i||null===i.__v?(-1==a&&d--,"function"!=typeof o.type&&(o.__u|=65536)):a!==s&&(a===s+1?d++:a>s?u>l-s?d+=a-s:d--:d=a<s&&a==s-1?a-s:0,a!==r+d&&(o.__u|=65536))):(i=n[r])&&null==i.key&&i.__e&&(i.__e==e.__d&&(e.__d=Fn(i)),zn(i,i,!1),n[r]=null,u--);if(u)for(r=0;r<c;r++)null!=(i=n[r])&&0==(131072&i.__u)&&(i.__e==e.__d&&(e.__d=Fn(i)),zn(i,i))}(n,t,m),l=n.__d,d=0;d<y;d++)null!=(h=n.__k[d])&&"boolean"!=typeof h&&"function"!=typeof h&&(p=-1===h.__i?An:m[h.__i]||An,h.__i=d,$n(e,h,p,o,i,s,a,l,c,u),f=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&Qn(p.ref,null,h),u.push(h.ref,h.__c||f,h)),null==g&&null!=f&&(g=f),65536&h.__u||p.__k===h.__k?l=Wn(h,l,e):"function"==typeof h.type&&void 0!==h.__d?l=h.__d:f&&(l=f.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=l,n.__e=g}function Wn(e,t,n){var r,o;if("function"==typeof e.type){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=Wn(r[o],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function Zn(e,t,n,r){var o=e.key,i=e.type,s=n-1,a=n+1,l=t[n];if(null===l||l&&o==l.key&&i===l.type)return n;if(r>(null!=l&&0==(131072&l.__u)?1:0))for(;s>=0||a<t.length;){if(s>=0){if((l=t[s])&&0==(131072&l.__u)&&o==l.key&&i===l.type)return s;s--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&o==l.key&&i===l.type)return a;a++}}return-1}function Vn(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||xn.test(t)?n:n+"px"}function Un(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Vn(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Vn(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,i?jn:Gn,i)):e.removeEventListener(t,i?jn:Gn,i);else{if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function Gn(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Cn.event?Cn.event(e):e)}function jn(e){return this.l[e.type+!0](Cn.event?Cn.event(e):e)}function $n(e,t,n,r,o,i,s,a,l,c){var u,d,p,h,f,g,m,y,v,C,b,_,I,S,w,k=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),i=[a=t.__e=n.__e]),(u=Cn.__b)&&u(t);e:if("function"==typeof k)try{if(y=t.props,v=(u=k.contextType)&&r[u.__c],C=u?v?v.props.value:u.__:r,n.__c?m=(d=t.__c=n.__c).__=d.__E:("prototype"in k&&k.prototype.render?t.__c=d=new k(y,C):(t.__c=d=new Dn(y,C),d.constructor=k,d.render=Yn),v&&v.sub(d),d.props=y,d.state||(d.state={}),d.context=C,d.__n=r,p=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=En({},d.__s)),En(d.__s,k.getDerivedStateFromProps(y,d.__s))),h=d.props,f=d.state,d.__v=t,p)null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==k.getDerivedStateFromProps&&y!==h&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,C),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,C)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,C),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(h,f,g)}))}if(d.context=C,d.props=y,d.__P=e,d.__e=!1,_=Cn.__r,I=0,"prototype"in k&&k.prototype.render){for(d.state=d.__s,d.__d=!1,_&&_(t),u=d.render(d.props,d.state,d.context),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[]}else do{d.__d=!1,_&&_(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++I<25);d.state=d.__s,null!=d.getChildContext&&(r=En(En({},r),d.getChildContext())),p||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(h,f)),Pn(e,Mn(w=null!=u&&u.type===Rn&&null==u.key?u.props.children:u)?w:[w],t,n,r,o,i,s,a,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),m&&(d.__E=d.__=null)}catch(e){t.__v=null,l||null!=i?(t.__e=a,t.__u|=l?160:32,i[i.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),Cn.__e(e,t,n)}else null==i&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,o,i,s,a,l){var c,u,d,p,h,f,g,m=n.props,y=t.props,v=t.type;if("svg"===v&&(o=!0),null!=i)for(c=0;c<i.length;c++)if((h=i[c])&&"setAttribute"in h==!!v&&(v?h.localName===v:3===h.nodeType)){e=h,i[c]=null;break}if(null==e){if(null===v)return document.createTextNode(y);e=o?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,y.is&&y),i=null,a=!1}if(null===v)m===y||a&&e.data===y||(e.data=y);else{if(i=i&&vn.call(e.childNodes),m=n.props||An,!a&&null!=i)for(m={},c=0;c<e.attributes.length;c++)m[(h=e.attributes[c]).name]=h.value;for(c in m)h=m[c],"children"==c||("dangerouslySetInnerHTML"==c?d=h:"key"===c||c in y||Un(e,c,null,h,o));for(c in y)h=y[c],"children"==c?p=h:"dangerouslySetInnerHTML"==c?u=h:"value"==c?f=h:"checked"==c?g=h:"key"===c||a&&"function"!=typeof h||m[c]===h||Un(e,c,h,m[c],o);if(u)a||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),Pn(e,Mn(p)?p:[p],t,n,r,o&&"foreignObject"!==v,i,s,i?i[0]:n.__k&&Fn(n,0),a,l),null!=i)for(c=i.length;c--;)null!=i[c]&&Nn(i[c]);a||(c="value",void 0!==f&&(f!==e[c]||"progress"===v&&!f||"option"===v&&f!==m[c])&&Un(e,c,f,m[c],!1),c="checked",void 0!==g&&g!==e[c]&&Un(e,c,g,m[c],!1))}return e}(n.__e,t,n,r,o,i,s,l,c);(u=Cn.diffed)&&u(t)}function Kn(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)Qn(n[r],n[++r],n[++r]);Cn.__c&&Cn.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Cn.__e(e,t.__v)}}))}function Qn(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Cn.__e(e,n)}}function zn(e,t,n){var r,o;if(Cn.unmount&&Cn.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Qn(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Cn.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&zn(r[o],t,n||"function"!=typeof e.type);n||null==e.__e||Nn(e.__e),e.__=e.__e=e.__d=void 0}function Yn(e,t,n){return this.constructor(e,n)}function Jn(e,t,n){var r,o,i,s;Cn.__&&Cn.__(e,t),o=(r="function"==typeof n)?null:t.__k,i=[],s=[],$n(t,e=(!r&&n||t).__k=On(Rn,null,[e]),o||An,An,void 0!==t.ownerSVGElement,!r&&n?[n]:o?null:t.firstChild?vn.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,s),Kn(i,e,s)}function Xn(e,t,n){var r,o,i,s,a=En({},e.props);for(i in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==i?r=t[i]:"ref"==i?o=t[i]:a[i]=void 0===t[i]&&void 0!==s?s[i]:t[i];return arguments.length>2&&(a.children=arguments.length>3?vn.call(arguments,2):n),Ln(e.type,a,r||e.key,o||e.ref,null)}vn=Tn.slice,Cn={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},bn=0,Dn.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=En({},this.state),"function"==typeof e&&(e=e(En({},n),this.props)),e&&En(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Hn(this))},Dn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Hn(this))},Dn.prototype.render=Rn,_n=[],Sn="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,wn=function(e,t){return e.__v.__b-t.__v.__b},Bn.__r=0,kn=0;const er=Ht,tr=Zt,nr=e=>{const t={left:"left: 30px;",right:"right: 30px;",center:"\n left: 50%;\n transform: translateX(-50%);\n "};return`\n .survey-form, .thank-you-message {\n position: fixed;\n margin: 0px;\n bottom: 0px;\n color: black;\n font-weight: normal;\n font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n text-align: left;\n max-width: ${parseInt((null==e?void 0:e.maxWidth)||"300")}px;\n width: 100%;\n z-index: ${parseInt((null==e?void 0:e.zIndex)||"99999")};\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n border-bottom: 0px;\n ${t[(null==e?void 0:e.position)||"right"]||"right: 30px;"}\n flex-direction: column;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n box-shadow: -6px 0 16px -8px rgb(0 0 0 / 8%), -9px 0 28px 0 rgb(0 0 0 / 5%), -12px 0 48px 16px rgb(0 0 0 / 3%);\n }\n \n .survey-box, .thank-you-message-container {\n padding: 20px 25px 10px;\n display: flex;\n flex-direction: column;\n border-radius: 10px;\n }\n\n .thank-you-message {\n text-align: center;\n }\n\n .form-submit[disabled] {\n opacity: 0.6;\n filter: grayscale(50%);\n cursor: not-allowed;\n }\n .survey-form textarea {\n color: #2d2d2d;\n font-size: 14px;\n font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n background: white;\n color: black;\n outline: none;\n padding-left: 10px;\n padding-right: 10px;\n padding-top: 10px;\n border-radius: 6px;\n border-color: ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n margin-top: 14px;\n width: 100%;\n box-sizing: border-box;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea {\n margin-top: 0;\n }\n .form-submit {\n box-sizing: border-box;\n margin: 0;\n font-family: inherit;\n overflow: visible;\n text-transform: none;\n position: relative;\n display: inline-block;\n font-weight: 700;\n white-space: nowrap;\n text-align: center;\n border: 1.5px solid transparent;\n cursor: pointer;\n user-select: none;\n touch-action: manipulation;\n padding: 12px;\n font-size: 14px;\n border-radius: 6px;\n outline: 0;\n background: ${(null==e?void 0:e.submitButtonColor)||"black"} !important;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);\n box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);\n width: 100%;\n }\n .form-cancel {\n display: flex;\n float: right;\n border: none;\n background: none;\n cursor: pointer;\n }\n .cancel-btn-wrapper {\n position: absolute;\n width: 35px;\n height: 35px;\n border-radius: 100%;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n background: white;\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .bolded { font-weight: 600; }\n .buttons {\n display: flex;\n justify-content: center;\n }\n .footer-branding {\n font-size: 11px;\n margin-top: 10px;\n text-align: center;\n display: flex;\n justify-content: center;\n gap: 4px;\n align-items: center;\n font-weight: 500;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n text-decoration: none;\n backgroundColor: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n color: ${or((null==e?void 0:e.backgroundColor)||"#eeeded")};\n }\n .survey-question {\n font-weight: 500;\n font-size: 14px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .question-textarea-wrapper {\n display: flex;\n flex-direction: column;\n }\n .survey-question-description {\n font-size: 13px;\n padding-top: 5px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .ratings-number {\n font-size: 16px;\n font-weight: 600;\n padding: 8px 0px;\n border: none;\n }\n .ratings-number:hover {\n cursor: pointer;\n }\n .rating-options {\n margin-top: 14px;\n }\n .rating-options-number {\n display: grid;\n border-radius: 6px;\n overflow: hidden;\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n }\n .rating-options-number > .ratings-number {\n border-right: 1px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n }\n .rating-options-number > .ratings-number:last-of-type {\n border-right: 0px;\n }\n .rating-options-number .rating-active {\n background: ${(null==e?void 0:e.ratingButtonActiveColor)||"black"};\n }\n .rating-options-emoji {\n display: flex;\n justify-content: space-between;\n }\n .ratings-emoji {\n font-size: 16px;\n background-color: transparent;\n border: none;\n padding: 0px;\n }\n .ratings-emoji:hover {\n cursor: pointer;\n }\n .ratings-emoji.rating-active svg {\n fill: ${(null==e?void 0:e.ratingButtonActiveColor)||"black"};\n }\n .emoji-svg {\n fill: '#939393';\n }\n .rating-text {\n display: flex;\n flex-direction: row;\n font-size: 11px;\n justify-content: space-between;\n margin-top: 6px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n opacity: .60;\n }\n .multiple-choice-options {\n margin-top: 13px;\n font-size: 14px;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options {\n margin-top: 0;\n }\n .multiple-choice-options .choice-option {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 13px;\n cursor: pointer;\n margin-bottom: 5px;\n position: relative;\n }\n .multiple-choice-options > .choice-option:last-of-type {\n margin-bottom: 0px;\n }\n .multiple-choice-options input {\n cursor: pointer;\n position: absolute;\n opacity: 0;\n }\n .choice-check {\n position: absolute;\n right: 10px;\n background: white;\n }\n .choice-check svg {\n display: none;\n }\n .multiple-choice-options .choice-option:hover .choice-check svg {\n display: inline-block;\n opacity: .25;\n }\n .multiple-choice-options input:checked + label + .choice-check svg {\n display: inline-block;\n opacity: 100% !important;\n }\n .multiple-choice-options input:checked + label {\n font-weight: bold;\n border: 1.5px solid rgba(0,0,0);\n }\n .multiple-choice-options input:checked + label input {\n font-weight: bold;\n }\n .multiple-choice-options label {\n width: 100%;\n cursor: pointer;\n padding: 10px;\n border: 1.5px solid rgba(0,0,0,.25);\n border-radius: 4px;\n background: white;\n }\n .multiple-choice-options .choice-option-open label {\n padding-right: 30px;\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n max-width: 100%;\n }\n .multiple-choice-options .choice-option-open label span {\n width: 100%;\n }\n .multiple-choice-options .choice-option-open input:disabled + label {\n opacity: 0.6;\n }\n .multiple-choice-options .choice-option-open label input {\n position: relative;\n opacity: 1;\n flex-grow: 1;\n border: 0;\n outline: 0;\n }\n .thank-you-message-body {\n margin-top: 6px;\n font-size: 14px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .thank-you-message-header {\n margin: 10px 0px 0px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .thank-you-message-container .form-submit {\n margin-top: 20px;\n margin-bottom: 10px;\n }\n .thank-you-message-countdown {\n margin-left: 6px;\n }\n .bottom-section {\n margin-top: 14px;\n }\n `};function rr(e){if("#"===e[0]){const t=e.replace(/^#/,"");return"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")"}return"rgb(255, 255, 255)"}function or(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:sr;"#"===t[0]&&(e=rr(t)),t.startsWith("rgb")&&(e=t);const n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(n&&(e=rr(n)),!e)return"black";const r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){const e=parseInt(r[1]),t=parseInt(r[2]),n=parseInt(r[3]);return Math.sqrt(e*e*.299+t*t*.587+n*n*.114)>127.5?"black":"white"}return"black"}const ir={backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:"right"},sr="#eeeded",ar=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;r&&(localStorage.setItem(hr(n),"true"),r.capture("survey sent",{$survey_name:n.name,$survey_id:n.id,$survey_iteration:n.current_iteration,$survey_iteration_start_date:n.current_iteration_start_date,$survey_questions:n.questions.map((e=>e.question)),sessionRecordingUrl:null===(e=r.get_session_replay_url)||void 0===e?void 0:e.call(r),...t,$set:{[fr(n,"responded")]:!0}}),er.dispatchEvent(new Event("PHSurveySent")))},lr=(e,t,n)=>{var r;!n&&t&&(t.capture("survey dismissed",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(r=t.get_session_replay_url)||void 0===r?void 0:r.call(t),$set:{[fr(e,"dismissed")]:!0}}),localStorage.setItem(hr(e),"true"),er.dispatchEvent(new Event("PHSurveyClosed")))},cr=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),ur=(e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n]))?t.reverse():t,dr=e=>(e.questions.forEach(((e,t)=>{e.originalQuestionIndex=t})),e.appearance&&e.appearance.shuffleQuestions?ur(e.questions,cr(e.questions)):e.questions),pr=e=>{var t,n;return!(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||!n.repeatedActivation||!(e=>{var t,n,r,o,i,s;return null!=(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(r=n.values)||void 0===r?void 0:r.length)&&(null===(o=e.conditions)||void 0===o||null===(i=o.events)||void 0===i||null===(s=i.values)||void 0===s?void 0:s.length)>0})(e))},hr=e=>{let t=`seenSurvey_${e.id}`;return e.current_iteration&&e.current_iteration>0&&(t=`seenSurvey_${e.id}_${e.current_iteration}`),t},fr=(e,t)=>{let n=`$survey_${t}/${e.id}`;return e.current_iteration&&e.current_iteration>0&&(n=`$survey_${t}/${e.id}/${e.current_iteration}`),n},gr=function(e,t){var n={__c:t="__cC"+kn++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,Hn(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0}),mr=e=>{let{component:t,children:n,renderAsHtml:r,style:o}=e;return Xn(t,r?{dangerouslySetInnerHTML:{__html:n},style:o}:{children:n,style:o})},yr=Zt;var vr,Cr,br,_r,Ir=0,Sr=[],wr=[],kr=Cn.__b,Ar=Cn.__r,Tr=Cn.diffed,xr=Cn.__c,Mr=Cn.unmount;function Er(e,t){Cn.__h&&Cn.__h(Cr,e,Ir||t),Ir=0;var n=Cr.__H||(Cr.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:wr}),n.__[e]}function Nr(e){return Ir=1,function(e,t,n){var r=Er(vr++,2);if(r.t=e,!r.__c&&(r.__=[Zr(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Cr,!Cr.u)){var o=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(e){return e.__c}));if(o.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var s=!1;return o.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&r.__c.props===e)&&(!i||i.call(this,e,t,n))};Cr.u=!0;var i=Cr.shouldComponentUpdate,s=Cr.componentWillUpdate;Cr.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,o(e,t,n),i=r}s&&s.call(this,e,t,n)},Cr.shouldComponentUpdate=o}return r.__N||r.__}(Zr,e)}function Or(e,t){var n=Er(vr++,3);!Cn.__s&&Wr(n.__H,t)&&(n.__=e,n.i=t,Cr.__H.__h.push(n))}function Lr(e){return Ir=5,Rr((function(){return{current:e}}),[])}function Rr(e,t){var n=Er(vr++,7);return Wr(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Dr(e){var t=Cr.context[e.__c],n=Er(vr++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Cr)),t.props.value):e.__}function Fr(){for(var e;e=Sr.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Br),e.__H.__h.forEach(Pr),e.__H.__h=[]}catch(t){e.__H.__h=[],Cn.__e(t,e.__v)}}Cn.__b=function(e){Cr=null,kr&&kr(e)},Cn.__r=function(e){Ar&&Ar(e),vr=0;var t=(Cr=e.__c).__H;t&&(br===Cr?(t.__h=[],Cr.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=wr,e.__N=e.i=void 0}))):(t.__h.forEach(Br),t.__h.forEach(Pr),t.__h=[],vr=0)),br=Cr},Cn.diffed=function(e){Tr&&Tr(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Sr.push(t)&&_r===Cn.requestAnimationFrame||((_r=Cn.requestAnimationFrame)||Hr)(Fr)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==wr&&(e.__=e.__V),e.i=void 0,e.__V=wr}))),br=Cr=null},Cn.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Br),e.__h=e.__h.filter((function(e){return!e.__||Pr(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Cn.__e(n,e.__v)}})),xr&&xr(e,t)},Cn.unmount=function(e){Mr&&Mr(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Br(e)}catch(e){t=e}})),n.__H=void 0,t&&Cn.__e(t,n.__v))};var qr="function"==typeof requestAnimationFrame;function Hr(e){var t,n=function(){clearTimeout(r),qr&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);qr&&(t=requestAnimationFrame(n))}function Br(e){var t=Cr,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Cr=t}function Pr(e){var t=Cr;e.__c=e.__(),Cr=t}function Wr(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Zr(e,t){return"function"==typeof t?t(e):t}var Vr=0;function Ur(e,t,n,r,o,i){var s,a,l={};for(a in t)"ref"==a?s=t[a]:l[a]=t[a];var c={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Vr,__i:-1,__u:0,__source:o,__self:i};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return Cn.vnode&&Cn.vnode(c),c}const Gr=Ur("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ur("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),jr=Ur("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ur("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),$r=Ur("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ur("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Kr=Ur("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ur("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),Qr=Ur("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ur("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),zr=Ur("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ur("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:"black"})}),Yr=Ur("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Ur("g",{"clip-path":"url(#clip0_2415_6911)",children:[Ur("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Ur("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Ur("g",{mask:"url(#mask0_2415_6911)",children:[Ur("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),Ur("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),Ur("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),Ur("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),Ur("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),Ur("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),Ur("defs",{children:Ur("clipPath",{id:"clip0_2415_6911",children:Ur("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),Jr=Ur("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ur("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});function Xr(){return Ur("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Yr]})}function eo(e){let{text:t,submitDisabled:n,appearance:r,onSubmit:o,link:i}=e;const{isPreviewMode:s,isPopup:a}=Dr(gr),l=r.submitButtonTextColor||or(r.submitButtonColor||ir.submitButtonColor);return Ur("div",{className:"bottom-section",children:[Ur("div",{className:"buttons",children:Ur("button",{className:"form-submit",disabled:n&&!s,type:"button",style:a?{color:l}:{},onClick:()=>{s||(i&&(null==Ht||Ht.open(i)),o())},children:t})}),!r.whiteLabel&&Ur(Xr,{})]})}function to(e){let{question:t,description:n,descriptionContentType:r,backgroundColor:o,forceDisableHtml:i}=e;const{isPopup:s}=Dr(gr);return Ur("div",{style:s?{backgroundColor:o||ir.backgroundColor}:{},children:[Ur("div",{className:"survey-question",children:t}),n&&mr({component:On("div",{className:"survey-question-description"}),children:n,renderAsHtml:!i&&"text"!==r})]})}function no(e){let{onClick:t}=e;const{isPreviewMode:n}=Dr(gr);return Ur("div",{className:"cancel-btn-wrapper",onClick:t,disabled:n,children:Ur("button",{className:"form-cancel",onClick:t,disabled:n,children:zr})})}function ro(e){let{header:t,description:n,contentType:r,forceDisableHtml:o,appearance:i,onClose:s,styleOverrides:a}=e;const l=or(i.backgroundColor||ir.backgroundColor),{isPopup:c}=Dr(gr);return Ur(Rn,{children:Ur("div",{className:"thank-you-message",style:{...a},children:Ur("div",{className:"thank-you-message-container",children:[c&&Ur(no,{onClick:()=>s()}),Ur("h3",{className:"thank-you-message-header",style:{color:l},children:t}),n&&mr({component:On("div",{className:"thank-you-message-body"}),children:n,renderAsHtml:!o&&"text"!==r,style:{color:l}}),c&&Ur(eo,{text:i.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:i,onSubmit:()=>s()})]})})})}function oo(e){var t;const n=Lr(null),[r,o]=Nr(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black");return Or((()=>{if(n.current){const e=function(e){const t=er.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"===t)return"black";const n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(!n)return"black";const r=parseInt(n[1]),o=parseInt(n[2]),i=parseInt(n[3]);return Math.sqrt(r*r*.299+o*o*.587+i*i*.114)>127.5?"black":"white"}(n.current);o(e)}}),[e.appearance,e.forceUpdate]),{ref:n,textColor:r}}function io(e){let{question:t,forceDisableHtml:n,appearance:r,onSubmit:o}=e;const i=Lr(null),[s,a]=Nr("");return Ur("div",{ref:i,children:[Ur(to,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:r.backgroundColor,forceDisableHtml:n}),Ur("textarea",{rows:4,placeholder:null==r?void 0:r.placeholder,onInput:e=>a(e.currentTarget.value)}),Ur(eo,{text:t.buttonText||"Submit",submitDisabled:!s&&!t.optional,appearance:r,onSubmit:()=>o(s)})]})}function so(e){let{question:t,forceDisableHtml:n,appearance:r,onSubmit:o}=e;return Ur(Rn,{children:[Ur(to,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),Ur(eo,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:r,onSubmit:()=>o("link clicked")})]})}function ao(e){let{question:t,forceDisableHtml:n,displayQuestionIndex:r,appearance:o,onSubmit:i}=e;const s=t.scale,a=10===t.scale?0:1,[l,c]=Nr(null);return Ur(Rn,{children:[Ur(to,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:o.backgroundColor}),Ur("div",{className:"rating-section",children:[Ur("div",{className:"rating-options",children:["emoji"===t.display&&Ur("div",{className:"rating-options-emoji",children:(3===t.scale?uo:po).map(((e,t)=>{const n=t+1===l;return Ur("button",{className:`ratings-emoji question-${r}-rating-${t} ${n?"rating-active":null}`,value:t+1,type:"button",onClick:()=>{c(t+1)},style:{fill:n?o.ratingButtonActiveColor:o.ratingButtonColor,borderColor:o.borderColor},children:e},t)}))}),"number"===t.display&&Ur("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${s-a+1}, minmax(0, 1fr))`},children:mo(t.scale).map(((e,t)=>Ur(lo,{displayQuestionIndex:r,active:l===e,appearance:o,num:e,setActiveNumber:e=>{c(e)}},t)))})]}),Ur("div",{className:"rating-text",children:[Ur("div",{children:t.lowerBoundLabel}),Ur("div",{children:t.upperBoundLabel})]})]}),Ur(eo,{text:t.buttonText||(null==o?void 0:o.submitButtonText)||"Submit",submitDisabled:Ot(l)&&!t.optional,appearance:o,onSubmit:()=>i(l)})]})}function lo(e){let{num:t,active:n,displayQuestionIndex:r,appearance:o,setActiveNumber:i}=e;const{textColor:s,ref:a}=oo({appearance:o,defaultTextColor:"black",forceUpdate:n});return Ur("button",{ref:a,className:`ratings-number question-${r}-rating-${t} ${n?"rating-active":null}`,type:"button",onClick:()=>{i(t)},style:{color:s,backgroundColor:n?o.ratingButtonActiveColor:o.ratingButtonColor,borderColor:o.borderColor},children:t})}function co(e){let{question:t,forceDisableHtml:n,displayQuestionIndex:r,appearance:o,onSubmit:i}=e;const s=Lr(null),a=Rr((()=>(e=>{if(!e.shuffleOptions)return e.choices;const t=e.choices;let n="";e.hasOpenChoice&&(n=t.pop());const r=ur(t,cr(t));return e.hasOpenChoice&&(e.choices.push(n),r.push(n)),r})(t)),[t]),[l,c]=Nr(t.type===mn.MultipleChoice?[]:null),[u,d]=Nr(!1),[p,h]=Nr(""),f=t.type===mn.SingleChoice?"radio":"checkbox";return Ur("div",{ref:s,children:[Ur(to,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:o.backgroundColor}),Ur("div",{className:"multiple-choice-options",children:a.map(((e,n)=>{let o="choice-option";const i=e,s=e;return t.hasOpenChoice&&n===t.choices.length-1&&(o+=" choice-option-open"),Ur("div",{className:o,children:[Ur("input",{type:f,id:`surveyQuestion${r}Choice${n}`,name:`question${r}`,value:i,disabled:!i,onInput:()=>t.hasOpenChoice&&n===t.choices.length-1?d(!u):t.type===mn.SingleChoice?c(i):t.type===mn.MultipleChoice&&At(l)?l.includes(i)?c(l.filter((e=>e!==i))):c([...l,i]):void 0}),Ur("label",{htmlFor:`surveyQuestion${r}Choice${n}`,style:{color:"black"},children:t.hasOpenChoice&&n===t.choices.length-1?Ur(Rn,{children:[Ur("span",{children:[s,":"]}),Ur("input",{type:"text",id:`surveyQuestion${r}Choice${n}Open`,name:`question${r}`,onInput:e=>{const n=e.currentTarget.value;return t.type===mn.SingleChoice?c(n):t.type===mn.MultipleChoice&&At(l)?h(n):void 0}})]}):s}),Ur("span",{className:"choice-check",style:{color:"black"},children:Jr})]})}))}),Ur(eo,{text:t.buttonText||"Submit",submitDisabled:(Ot(l)||At(l)&&!u&&0===l.length||At(l)&&u&&!p&&0===l.length&&!t.optional)&&!t.optional,appearance:o,onSubmit:()=>{u&&t.type===mn.MultipleChoice?At(l)&&i([...l,p]):i(l)}})]})}const uo=[$r,jr,Gr],po=[Kr,$r,jr,Gr,Qr],ho=[1,2,3,4,5],fo=[1,2,3,4,5,6,7],go=[0,1,2,3,4,5,6,7,8,9,10];function mo(e){switch(e){case 5:default:return ho;case 7:return fo;case 10:return go}}const yo=Ht,vo=Zt;class Co{constructor(e){this.posthog=e,this.surveyInFocus=null}canShowNextEventBasedSurvey=()=>{const e=vo.querySelectorAll("div[class^=PostHogSurvey]");var t;return!(e.length>0)||1===(null===(t=e[e.length-1].shadowRoot)||void 0===t?void 0:t.childElementCount)};handlePopoverSurvey=e=>{var t;const n=null===(t=e.conditions)||void 0===t?void 0:t.seenSurveyWaitPeriodInDays,r=localStorage.getItem("lastSeenSurveyDate");if(n&&r){const e=new Date,t=Math.abs(e.getTime()-new Date(r).getTime());if(Math.ceil(t/864e5)<n)return}const o=(e=>!!localStorage.getItem(hr(e))&&!pr(e))(e);if(!o){this.addSurveyToFocus(e.id);const t=((e,t,n)=>{const r=tr.createElement("div");r.className=`PostHogSurvey${t}`;const o=r.attachShadow({mode:"open"});if(e){const t=Object.assign(tr.createElement("style"),{innerText:e});o.appendChild(t)}return tr.body.appendChild(r),o})(nr(null==e?void 0:e.appearance),e.id);Jn(Ur(Io,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!0},"popover-survey"),t)}};handleWidget=e=>{const t=function(e){var t;const n=yr.createElement("div");n.className=`PostHogWidget${e.id}`;const r=n.attachShadow({mode:"open"}),o=`\n .ph-survey-widget-tab {\n position: fixed;\n top: 50%;\n right: 0;\n background: ${(null===(t=e.appearance)||void 0===t?void 0:t.widgetColor)||"#e0a045"};\n color: white;\n transform: rotate(-90deg) translate(0, -100%);\n transform-origin: right top;\n min-width: 40px;\n padding: 8px 12px;\n font-weight: 500;\n border-radius: 3px 3px 0 0;\n text-align: center;\n cursor: pointer;\n z-index: 9999999;\n }\n .ph-survey-widget-tab:hover {\n padding-bottom: 13px;\n }\n .ph-survey-widget-button {\n position: fixed;\n }\n `;return r.append(Object.assign(yr.createElement("style"),{innerText:o})),yr.body.appendChild(n),r}(e),n=nr(e.appearance);t.appendChild(Object.assign(vo.createElement("style"),{innerText:n})),Jn(Ur(wo,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus},"feedback-survey"),t)};handleWidgetSelector=e=>{var t;const n=(null===(t=e.appearance)||void 0===t?void 0:t.widgetSelector)&&vo.querySelector(e.appearance.widgetSelector);if(n)if(0===vo.querySelectorAll(`.PostHogWidget${e.id}`).length)this.handleWidget(e);else if(1===vo.querySelectorAll(`.PostHogWidget${e.id}`).length&&!n.getAttribute("PHWidgetSurveyClickListener")){var r,o;const t=null===(r=vo.querySelector(`.PostHogWidget${e.id}`))||void 0===r||null===(o=r.shadowRoot)||void 0===o?void 0:o.querySelector(".survey-form");n.addEventListener("click",(()=>{t&&(t.style.display="none"===t.style.display?"block":"none",t.addEventListener("PHSurveyClosed",(()=>{this.removeSurveyFromFocus(e.id),t.style.display="none"})))})),n.setAttribute("PHWidgetSurveyClickListener","true")}};sortSurveysByAppearanceDelay(e){return e.sort(((e,t)=>{var n,r;return((null===(n=e.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)-((null===(r=t.appearance)||void 0===r?void 0:r.surveyPopupDelaySeconds)||0)}))}canRenderSurvey=e=>{const t={visible:!1};if(e.end_date)return t.disabledReason=`survey was completed on ${e.end_date}`,t;if(e.type!=gn.Popover)return t.disabledReason="Only Popover survey types can be rendered",t;if(!(!e.linked_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.linked_flag_key)))return t.disabledReason=`linked feature flag ${e.linked_flag_key} is false`,t;if(!(!e.targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.targeting_flag_key)))return t.disabledReason=`targeting feature flag ${e.targeting_flag_key} is false`,t;return!e.internal_targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key)?(t.visible=!0,t):(t.disabledReason=`internal targeting feature flag ${e.internal_targeting_flag_key} is false`,t)};renderSurvey=(e,t)=>{Jn(Ur(Io,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!1},"popover-survey"),t)};callSurveysAndEvaluateDisplayLogic=(()=>{var e=this;return function(){var t;let n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(t=e.posthog)||void 0===t||t.getActiveMatchingSurveys((t=>{const n=t.filter((e=>"api"!==e.type));e.sortSurveysByAppearanceDelay(n).forEach((t=>{if(Ot(e.surveyInFocus)){var n,r,o;if(t.type===gn.Widget)"tab"===(null===(n=t.appearance)||void 0===n?void 0:n.widgetType)&&0===vo.querySelectorAll(`.PostHogWidget${t.id}`).length&&e.handleWidget(t),"selector"===(null===(r=t.appearance)||void 0===r?void 0:r.widgetType)&&null!==(o=t.appearance)&&void 0!==o&&o.widgetSelector&&e.handleWidgetSelector(t);t.type===gn.Popover&&e.canShowNextEventBasedSurvey()&&e.handlePopoverSurvey(t)}}))}),n)}})();addSurveyToFocus=e=>{Ot(this.surveyInFocus)||Gt.error(`Survey ${[...this.surveyInFocus]} already in focus. Cannot add survey ${e}.`),this.surveyInFocus=e};removeSurveyFromFocus=e=>{this.surveyInFocus!==e&&Gt.error(`Survey ${e} is not in focus. Cannot remove survey ${e}.`),this.surveyInFocus=null};getTestAPI(){return{addSurveyToFocus:this.addSurveyToFocus,removeSurveyFromFocus:this.removeSurveyFromFocus,surveyInFocus:this.surveyInFocus,canShowNextEventBasedSurvey:this.canShowNextEventBasedSurvey,handleWidget:this.handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,handleWidgetSelector:this.handleWidgetSelector,sortSurveysByAppearanceDelay:this.sortSurveysByAppearanceDelay}}}function bo(e){if(!vo||!yo)return;const t=new Co(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((()=>{t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}function _o(e,t,n,r,o){const[i,s]=Nr(r||0===n),[a,l]=Nr(!1);return Or((()=>{if(r||!t)return;const i=()=>{o(e.id),s(!1)},a=()=>{var t,n;null!==(t=e.appearance)&&void 0!==t&&t.displayThankYouMessage?(l(!0),o(e.id),null!==(n=e.appearance)&&void 0!==n&&n.autoDisappear&&setTimeout((()=>{s(!1)}),5e3)):(o(e.id),s(!1))},c=()=>{var n;s(!0),yo.dispatchEvent(new Event("PHSurveyShown")),t.capture("survey shown",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(n=t.get_session_replay_url)||void 0===n?void 0:n.call(t)}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())};return yo.addEventListener("PHSurveyClosed",i),yo.addEventListener("PHSurveySent",a),n>0?(()=>{const e=setTimeout((()=>{c()}),n);return()=>{clearTimeout(e),yo.removeEventListener("PHSurveyClosed",i),yo.removeEventListener("PHSurveySent",a)}})():(c(),()=>{yo.removeEventListener("PHSurveyClosed",i),yo.removeEventListener("PHSurveySent",a)})}),[]),{isPopupVisible:i,isSurveySent:a,setIsPopupVisible:s}}function Io(e){var t,n,r,o,i,s;let{survey:a,forceDisableHtml:l,posthog:c,style:u,previewPageIndex:d,removeSurveyFromFocus:p,isPopup:h}=e;const f=Number.isInteger(d),g=null!==(t=a.appearance)&&void 0!==t&&t.surveyPopupDelaySeconds?1e3*a.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:m,isSurveySent:y,setIsPopupVisible:v}=_o(a,c,g,f,p),C=y||d===a.questions.length,b=null!==(n=u)&&void 0!==n&&n.left&&Rt(null===(r=u)||void 0===r?void 0:r.left)?{left:u.left-40}:{};return f&&(u=u||{},u.left="unset",u.right="unset",u.transform="unset"),m?Ur(gr.Provider,{value:{isPreviewMode:f,previewPageIndex:d,handleCloseSurveyPopup:()=>lr(a,c,f),isPopup:h||!1},children:C?Ur(ro,{header:(null===(o=a.appearance)||void 0===o?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null===(i=a.appearance)||void 0===i?void 0:i.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null===(s=a.appearance)||void 0===s?void 0:s.thankYouMessageDescriptionContentType,appearance:a.appearance||ir,styleOverrides:{...u,...b},onClose:()=>v(!1)}):Ur(So,{survey:a,forceDisableHtml:!!l,posthog:c,styleOverrides:u})}):Ur(Rn,{})}function So(e){var t,n;let{survey:r,forceDisableHtml:o,posthog:i,styleOverrides:s}=e;const a=or((null===(t=r.appearance)||void 0===t?void 0:t.backgroundColor)||ir.backgroundColor),[l,c]=Nr({}),{isPreviewMode:u,previewPageIndex:d,handleCloseSurveyPopup:p,isPopup:h}=Dr(gr),[f,g]=Nr(d||0),m=Rr((()=>dr(r)),[r]);Or((()=>{g(null!=d?d:0)}),[d]);return Ur("form",{className:"survey-form",style:h?{color:a,borderColor:null===(n=r.appearance)||void 0===n?void 0:n.borderColor,...s}:{},children:m.map(((e,t)=>{var n;const{originalQuestionIndex:s}=e;return(u?f===s:f===t)&&Ur("div",{className:"survey-box",style:h?{backgroundColor:(null===(n=r.appearance)||void 0===n?void 0:n.backgroundColor)||ir.backgroundColor}:{},children:[h&&Ur(no,{onClick:()=>p()}),ko({question:e,forceDisableHtml:o,displayQuestionIndex:t,appearance:r.appearance||ir,onSubmit:e=>(e=>{let{res:t,originalQuestionIndex:n,displayQuestionIndex:o}=e;if(!i)return;const s=0===n?"$survey_response":`$survey_response_${n}`;if(c({...l,[s]:t}),!i.getNextSurveyStep)return void(o===r.questions.length-1?ar({...l,[s]:t},r,i):g(o+1));const a=i.getNextSurveyStep(r,o,t);a===yn.End?ar({...l,[s]:t},r,i):g(a)})({res:e,originalQuestionIndex:s,displayQuestionIndex:t})})]})}))})}function wo(e){var t,n;let{survey:r,forceDisableHtml:o,posthog:i,readOnly:s,removeSurveyFromFocus:a}=e;const[l,c]=Nr(!1),[u,d]=Nr({}),p=Lr(null);return Or((()=>{var e,t;if(!s&&i){if("tab"===(null===(e=r.appearance)||void 0===e?void 0:e.widgetType)&&p.current){var n;const e=p.current.getBoundingClientRect(),t={top:"50%",left:parseInt(""+(e.right-360)),bottom:"auto",borderRadius:10,borderBottom:`1.5px solid ${(null===(n=r.appearance)||void 0===n?void 0:n.borderColor)||"#c9c6c6"}`};d(t)}if("selector"===(null===(t=r.appearance)||void 0===t?void 0:t.widgetType)){const e=vo.querySelector(r.appearance.widgetSelector||"");null==e||e.addEventListener("click",(()=>{c(!l)})),null==e||e.setAttribute("PHWidgetSurveyClickListener","true")}}}),[]),Ur(Rn,{children:["tab"===(null===(t=r.appearance)||void 0===t?void 0:t.widgetType)&&Ur("div",{className:"ph-survey-widget-tab",ref:p,onClick:()=>!s&&c(!l),style:{color:or(r.appearance.widgetColor)},children:[Ur("div",{className:"ph-survey-widget-tab-icon"}),(null===(n=r.appearance)||void 0===n?void 0:n.widgetLabel)||""]}),l&&Ur(Io,{posthog:i,survey:r,forceDisableHtml:o,style:u,removeSurveyFromFocus:a,isPopup:!0},"feedback-widget-survey")]})}const ko=e=>{let{question:t,forceDisableHtml:n,displayQuestionIndex:r,appearance:o,onSubmit:i}=e;const s={[mn.Open]:io,[mn.Link]:so,[mn.Rating]:ao,[mn.SingleChoice]:co,[mn.MultipleChoice]:co},a={question:t,forceDisableHtml:n,appearance:o,onSubmit:i},l={[mn.Open]:{},[mn.Link]:{},[mn.Rating]:{displayQuestionIndex:r},[mn.SingleChoice]:{displayQuestionIndex:r},[mn.MultipleChoice]:{displayQuestionIndex:r}};return Ur(s[t.type],{...{...a,...l[t.type]}})};function Ao(e){return!Mt(Event)&&To(e,Event)}function To(e,t){try{return e instanceof t}catch{return!1}}function xo(e){return Ot(e)||!xt(e)&&!Tt(e)}function Mo(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function Eo(e){return Mo(e,"DOMError")}Vt.__PosthogExtensions__=Vt.__PosthogExtensions__||{},Vt.__PosthogExtensions__.canActivateRepeatedly=pr,Vt.__PosthogExtensions__.generateSurveys=bo,Vt.extendPostHogWithSurveys=bo;const No=/\(error: (.*)\)/,Oo=50,Lo="?";function Ro(e,t,n,r){const o={filename:e,function:"<anonymous>"===t?Lo:t,in_app:!0};return Mt(n)||(o.lineno=n),Mt(r)||(o.colno=r),o}const Do=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Fo=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,qo=/\((\S*)(?::(\d+))(?::(\d+))\)/,Ho=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Bo=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Po=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=[],o=e.split("\n");for(let e=t;e<o.length;e++){const t=o[e];if(t.length>1024)continue;const i=No.test(t)?t.replace(No,"$1"):t;if(!i.match(/\S*Error: /)){for(const e of r){const t=e(i);if(t){n.push(t);break}}if(n.length>=Oo)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return t.reverse(),t.slice(0,Oo).map((e=>({...e,filename:e.filename||Wo(t).filename,function:e.function||Lo})))}(n)}}(...[[30,e=>{const t=Do.exec(e);if(t){const[,e,n,r]=t;return Ro(e,Lo,+n,+r)}const n=Fo.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){const e=qo.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}const[e,t]=Zo(n[1]||Lo,n[2]);return Ro(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,e=>{const t=Ho.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=Bo.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||Lo;return[n,e]=Zo(n,e),Ro(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function Wo(e){return e[e.length-1]||{}}const Zo=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:Lo,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};let Vo;!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(Vo||(Vo={}));const Uo=["fatal","error","warning","log","info","debug"],Go=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function jo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=e.stacktrace||e.stack||"",r=function(e){if(e&&$o.test(e.message))return 1;return 0}(e);try{const e=Po(n,r);return e.slice(0,e.length-t)}catch{}return[]}const $o=/Minified React error #\d+;/i;function Ko(e,t){var n,r;const o=jo(e),i=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null!==(r=null==t?void 0:t.synthetic)&&void 0!==r&&r;return{$exception_list:[{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:function(e){const t=e.message;if(t.error&&"string"==typeof t.error.message)return t.error.message;return t}(e),stacktrace:{frames:o},mechanism:{handled:i,synthetic:s}}],$exception_level:"error"}}function Qo(e,t){var n,r,o;const i=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(o=null==t?void 0:t.defaultExceptionType)&&void 0!==o?o:"Error",value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:i,synthetic:s}};if(null!=t&&t.syntheticException){const e=jo(t.syntheticException,1);e.length&&(a.stacktrace={frames:e})}return{$exception_list:[a],$exception_level:"error"}}function zo(e){return Et(e)&&!Nt(e)&&Uo.indexOf(e)>=0}function Yo(e,t){var n,r;const o=null===(n=null==t?void 0:t.handled)||void 0===n||n,i=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,s=null!=t&&t.overrideExceptionType?t.overrideExceptionType:Ao(e)?e.constructor.name:"Error",a=null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:`Non-Error exception captured with keys: ${function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40;const n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(let e=n.length;e>0;e--){const r=n.slice(0,e).join(", ");if(!(r.length>t))return e===n.length||r.length<=t?r:`${r.slice(0,t)}...`}return""}(e)}`,l={type:s,value:a,mechanism:{handled:o,synthetic:i}};if(null!=t&&t.syntheticException){const e=jo(null==t?void 0:t.syntheticException,1);e.length&&(l.stacktrace={frames:e})}return{$exception_list:[l],$exception_level:zo(e.level)?e.level:"error"}}function Jo(e,t){let[n,r,o,i,s]=e,a={$exception_list:[]};const l=s||n;if(Eo(l)||function(e){return Mo(e,"DOMException")}(l)){const e=l;if(function(e){return"stack"in e}(l))a=Ko(l,t);else{const n=e.name||(Eo(e)?"DOMError":"DOMException"),r=e.message?`${n}: ${e.message}`:n,o=Eo(e)?"DOMError":"DOMException";a=Qo(r,{...t,overrideExceptionType:o,defaultExceptionMessage:r})}return"code"in e&&(a.$exception_DOMException_code=`${e.code}`),a}if(function(e){return Mo(e,"ErrorEvent")}(l)&&l.error)return Ko(l.error,t);if(function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return To(e,Error)}}(l))return Ko(l,t);if(function(e){return Mo(e,"Object")}(l)||Ao(l)){return Yo(l,t)}if(Mt(s)&&Et(n)){let e="Error",r=n;const o=n.match(Go);return o&&(e=o[1],r=o[2]),Qo(r,{...t,overrideExceptionType:e,defaultExceptionMessage:r})}return Qo(l,t)}function Xo(e){let[t]=e;const n=function(e){if(xo(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}(t);return xo(n)?Qo(`Non-Error promise rejection captured with value: ${String(n)}`,{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):Jo([n],{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(n)})}const ei={wrapOnError:e=>{const t=Ht;t||Gt.info("window not available, cannot wrap onerror");const n=t.onerror;return t.onerror=function(){for(var t,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];const s=Jo(o);return e(s),null!==(t=null==n?void 0:n(...o))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onerror)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=n}},wrapUnhandledRejection:e=>{const t=Ht;t||Gt.info("window not available, cannot wrap onUnhandledRejection");const n=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];const a=Xo(i);return e(a),null!==(r=null==n?void 0:n.apply(t,i))&&void 0!==r&&r},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onunhandledrejection)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=n}}};Vt.__PosthogExtensions__=Vt.__PosthogExtensions__||{},Vt.__PosthogExtensions__.errorWrappingFunctions=ei,Vt.__PosthogExtensions__.parseErrorAsProperties=Jo,Vt.posthogErrorWrappingFunctions=ei,Vt.parseErrorAsProperties=Jo;const ti=(e,t)=>{const{sessionId:n,windowId:r}=e.checkAndGetSessionAndWindowId(!0);t.headers.set("X-POSTHOG-SESSION-ID",n),t.headers.set("X-POSTHOG-WINDOW-ID",r)};Vt.__PosthogExtensions__=Vt.__PosthogExtensions__||{};const ni={_patchFetch:e=>zt(Ht,"fetch",(t=>async function(n,r){const o=new Request(n,r);return ti(e,o),t(o)})),_patchXHR:e=>zt(Ht.XMLHttpRequest.prototype,"open",(t=>function(n,r){let o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;const a=new Request(r);return ti(e,a),t.call(this,n,a.url,o,i,s)}))};Vt.__PosthogExtensions__.tracingHeadersPatchFns=ni,Vt.postHogTracingHeadersPatchFns=ni;var ri,oi,ii,si=-1,ai=function(e){addEventListener("pageshow",(function(t){t.persisted&&(si=t.timeStamp,e(t))}),!0)},li=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ci=function(){var e=li();return e&&e.activationStart||0},ui=function(e,t){var n=li(),r="navigate";return si>=0?r="back-forward-cache":n&&(document.prerendering||ci()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},di=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},pi=function(e,t,n,r){var o,i;return function(s){t.value>=0&&(s||r)&&((i=t.value-(o||0))||void 0===o)&&(o=t.value,t.delta=i,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},hi=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},fi=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},gi=function(e){var t=!1;return function(){t||(e(),t=!0)}},mi=-1,yi=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},vi=function(e){"hidden"===document.visibilityState&&mi>-1&&(mi="visibilitychange"===e.type?e.timeStamp:0,bi())},Ci=function(){addEventListener("visibilitychange",vi,!0),addEventListener("prerenderingchange",vi,!0)},bi=function(){removeEventListener("visibilitychange",vi,!0),removeEventListener("prerenderingchange",vi,!0)},_i=function(){return mi<0&&(mi=yi(),Ci(),ai((function(){setTimeout((function(){mi=yi(),Ci()}),0)}))),{get firstHiddenTime(){return mi}}},Ii=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Si=[1800,3e3],wi=function(e,t){t=t||{},Ii((function(){var n,r=_i(),o=ui("FCP"),i=di("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(i.disconnect(),e.startTime<r.firstHiddenTime&&(o.value=Math.max(e.startTime-ci(),0),o.entries.push(e),n(!0)))}))}));i&&(n=pi(e,o,Si,t.reportAllChanges),ai((function(r){o=ui("FCP"),n=pi(e,o,Si,t.reportAllChanges),hi((function(){o.value=performance.now()-r.timeStamp,n(!0)}))})))}))},ki=[.1,.25],Ai=[2500,4e3],Ti={},xi=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Mi=function(e){if("loading"===document.readyState)return"loading";var t=xi();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},Ei=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Ni=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,o=r.id?"#"+r.id:Ei(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+o.length>(t||100)-1)return n||o;if(n=n?o+">"+n:o,r.id)break;e=r.parentNode}}catch(e){}return n},Oi=-1,Li=function(e,t){var n=xi(),r="navigate";return Oi>=0?r="back-forward-cache":n&&(document.prerendering||function(){var e=xi();return e&&e.activationStart||0}()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:-1,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},Ri=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},Di=function(e,t,n,r){var o,i;return function(s){t.value>=0&&(s||r)&&((i=t.value-(o||0))||void 0===o)&&(o=t.value,t.delta=i,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Fi=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},qi=0,Hi=1/0,Bi=0,Pi=function(e){e.forEach((function(e){e.interactionId&&(Hi=Math.min(Hi,e.interactionId),Bi=Math.max(Bi,e.interactionId),qi=Bi?(Bi-Hi)/7+1:0)}))},Wi=function(){"interactionCount"in performance||ri||(ri=Ri("event",Pi,{type:"event",buffered:!0,durationThreshold:0}))},Zi=[],Vi=new Map,Ui=0,Gi=function(){return(ri?qi:performance.interactionCount||0)-Ui},ji=[],$i=function(e){if(ji.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Zi[Zi.length-1],n=Vi.get(e.interactionId);if(n||Zi.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};Vi.set(r.id,r),Zi.push(r)}Zi.sort((function(e,t){return t.latency-e.latency})),Zi.length>10&&Zi.splice(10).forEach((function(e){return Vi.delete(e.id)}))}}},Ki=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=function(e){var t=!1;return function(){t||(e(),t=!0)}}(e),"hidden"===document.visibilityState?e():(n=t(e),Fi(e)),n},Qi=[200,500],zi=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()}((function(){var n;Wi();var r,o=Li("INP"),i=function(e){Ki((function(){e.forEach($i);var t,n=(t=Math.min(Zi.length-1,Math.floor(Gi()/50)),Zi[t]);n&&n.latency!==o.value&&(o.value=n.latency,o.entries=n.entries,r())}))},s=Ri("event",i,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=Di(e,o,Qi,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Fi((function(){i(s.takeRecords()),r(!0)})),function(e){addEventListener("pageshow",(function(t){t.persisted&&(Oi=t.timeStamp,e(t))}),!0)}((function(){Ui=0,Zi.length=0,Vi.clear(),o=Li("INP"),r=Di(e,o,Qi,t.reportAllChanges)})))})))},Yi=[],Ji=[],Xi=new WeakMap,es=new Map,ts=-1,ns=function(e){Yi=Yi.concat(e),rs()},rs=function(){ts<0&&(ts=Ki(os))},os=function(){es.size>10&&es.forEach((function(e,t){Vi.has(t)||es.delete(t)}));var e=Zi.map((function(e){return Xi.get(e.entries[0])})),t=Ji.length-50;Ji=Ji.filter((function(n,r){return r>=t||e.includes(n)}));for(var n=new Set,r=0;r<Ji.length;r++){var o=Ji[r];is(o.startTime,o.processingEnd).forEach((function(e){n.add(e)}))}for(var i=0;i<50;i++){var s=Yi[Yi.length-1-i];if(!s||s.startTime<ii)break;n.add(s)}Yi=Array.from(n),ts=-1};ji.push((function(e){e.interactionId&&e.target&&!es.has(e.interactionId)&&es.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;ii=Math.max(ii,e.processingEnd);for(var r=Ji.length-1;r>=0;r--){var o=Ji[r];if(Math.abs(n-o.renderTime)<=8){(t=o).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:[e]},Ji.push(t)),(e.interactionId||"first-input"===e.entryType)&&Xi.set(e,t),rs()}));var is=function(e,t){for(var n,r=[],o=0;n=Yi[o];o++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;r.push(n)}return r};const ss={onLCP:function(e,t){t=t||{},Ii((function(){var n,r=_i(),o=ui("LCP"),i=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(o.value=Math.max(e.startTime-ci(),0),o.entries=[e],n())}))},s=di("largest-contentful-paint",i);if(s){n=pi(e,o,Ai,t.reportAllChanges);var a=gi((function(){Ti[o.id]||(i(s.takeRecords()),s.disconnect(),Ti[o.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=gi(e),"hidden"===document.visibilityState?e():(n=t(e),fi(e)),n}(a)}),!0)})),fi(a),ai((function(r){o=ui("LCP"),n=pi(e,o,Ai,t.reportAllChanges),hi((function(){o.value=performance.now()-r.timeStamp,Ti[o.id]=!0,n(!0)}))}))}}))},onCLS:function(e,t){t=t||{},wi(gi((function(){var n,r=ui("CLS",0),o=0,i=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=i[0],n=i[i.length-1];o&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(o+=e.value,i.push(e)):(o=e.value,i=[e])}})),o>r.value&&(r.value=o,r.entries=i,n())},a=di("layout-shift",s);a&&(n=pi(e,r,ki,t.reportAllChanges),fi((function(){s(a.takeRecords()),n(!0)})),ai((function(){o=0,r=ui("CLS",0),n=pi(e,r,ki,t.reportAllChanges),hi((function(){return n()}))})),setTimeout(n,0))})))},onFCP:wi,onINP:function(e,t){oi||(oi=Ri("long-animation-frame",ns)),zi((function(t){var n=function(e){var t=e.entries[0],n=Xi.get(t),r=t.processingStart,o=n.processingEnd,i=n.entries.sort((function(e,t){return e.processingStart-t.processingStart})),s=is(t.startTime,o),a=e.entries.find((function(e){return e.target})),l=a&&a.target||es.get(t.interactionId),c=[t.startTime+t.duration,o].concat(s.map((function(e){return e.startTime+e.duration}))),u=Math.max.apply(Math,c),d={interactionTarget:Ni(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:u,processedEventEntries:i,longAnimationFrameEntries:s,inputDelay:r-t.startTime,processingDuration:o-r,presentationDelay:Math.max(u-o,0),loadState:Mi(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(n)}),t)}};Vt.__PosthogExtensions__=Vt.__PosthogExtensions__||{},Vt.__PosthogExtensions__.postHogWebVitalsCallbacks=ss,Vt.postHogWebVitalsCallbacks=ss}();
1
+ !function(){"use strict";var e,t=Object.defineProperty,n=(e,n,r)=>((e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r)(e,"symbol"!=typeof n?n+"":n,r),r=Object.defineProperty,o=(e,t,n)=>((e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),i=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(i||{});function s(e){return e.nodeType===e.ELEMENT_NODE}function a(e){const t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function l(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function c(e){try{const n=e.rules||e.cssRules;return n?((t=Array.from(n,u).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}var t}function u(e){let t;if(function(e){return"styleSheet"in e}(e))try{t=c(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}else if(function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(e.cssText);return t||e.cssText}function d(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let p=class{constructor(){o(this,"idNodeMap",new Map),o(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function h(e){let{element:t,maskInputOptions:n,tagName:r,type:o,value:i,maskInputFn:s}=e,a=i||"";const l=o&&f(o);return(n[r.toLowerCase()]||l&&n[l])&&(a=s?s(a,t):"*".repeat(a.length)),a}function f(e){return e.toLowerCase()}const m="__rrweb_original__";function g(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?f(t):null}function y(e,t){var n;let r;try{r=new URL(e,null!=t?t:window.location.href)}catch(e){return null}const o=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==o?void 0:o[1])&&void 0!==n?n:null}let v=1;const b=new RegExp("[^a-z0-9-_:]"),C=-2;function _(){return v++}let I,S;const w=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,k=/^(?:[a-z+]+:)?\/\//i,T=/^www\..*/i,M=/^(data:)([^,]*),(.*)/i;function x(e,t){return(e||"").replace(w,((e,n,r,o,i,s)=>{const a=r||i||s,l=n||o||"";if(!a)return e;if(k.test(a)||T.test(a))return`url(${l}${a}${l})`;if(M.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const c=t.split("/"),u=a.split("/");c.pop();for(const e of u)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`}))}const A=/^[^ \t\n\r\u000c]+/,E=/^[, \t\n\r\u000c]+/;const N=new WeakMap;function L(e,t){return t&&""!==t.trim()?R(e,t):t}function O(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function R(e,t){let n=N.get(e);if(n||(n=e.createElement("a"),N.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function D(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?L(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}const o=[];for(;r(E),!(n>=t.length);){let i=r(A);if(","===i.slice(-1))i=L(e,i.substring(0,i.length-1)),o.push(i);else{let r="";i=L(e,i);let s=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((i+r).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){n+=1,o.push((i+r).trim());break}"("===e&&(s=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?x(r,R(e)):"object"===t&&"data"===n?L(e,r):r:L(e,r):r}function F(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function H(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&H(e.parentNode,t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&H(e.parentNode,t,n)}function Z(e,t,n,r){let o;if(s(e)){if(o=e,!o.childNodes.length)return!1}else{if(null===e.parentElement)return!1;o=e.parentElement}try{if("string"==typeof t){if(r){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(H(o,t,r))return!0;if(n)if(r){if(o.closest(n))return!0}else if(o.matches(n))return!0}catch(e){}return!1}function P(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:s,needsMask:a,inlineStylesheet:l,maskInputOptions:u={},maskTextFn:p,maskInputFn:y,dataURLOptions:v={},inlineImages:C,recordCanvas:_,keepIframeSrcFn:w,newlyAddedElement:k=!1}=t,T=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:i.Document,childNodes:[],compatMode:e.compatMode}:{type:i.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:i.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:T};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:p,recordCanvas:y,keepIframeSrcFn:v,newlyAddedElement:C=!1,rootId:_}=t,w=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,r,o),k=function(e){if(e instanceof HTMLFormElement)return"form";const t=f(e.tagName);return b.test(t)?"div":t}(e);let T={};const M=e.attributes.length;for(let t=0;t<M;t++){const r=e.attributes[t];F(k,r.name,r.value)||(T[r.name]=D(n,k,f(r.name),r.value))}if("link"===k&&s){const t=e.href;let r=d(n,t);if(!r&&t.includes(".css")){r=d(n,window.location.origin+"/"+t.replace(window.location.href,""))}let o=null;r&&(o=c(r)),o&&(delete T.rel,delete T.href,T._cssText=x(o,r.href))}if("style"===k&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const t=c(e.sheet);t&&(T._cssText=x(t,R(n)))}if("input"===k||"textarea"===k||"select"===k){const t=e.value,n=e.checked;"radio"!==T.type&&"checkbox"!==T.type&&"submit"!==T.type&&"button"!==T.type&&t?T.value=h({element:e,type:g(e),tagName:k,value:t,maskInputOptions:a,maskInputFn:l}):n&&(T.checked=n)}"option"===k&&(e.selected&&!a.select?T.selected=!0:delete T.selected);if("canvas"===k&&y)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const o=t.getImageData,i=m in o?o[m]:o;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(T.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){const t=e.toDataURL(u.type,u.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height;t!==r.toDataURL(u.type,u.quality)&&(T.rr_dataURL=t)}if("img"===k&&p){I||(I=n.createElement("canvas"),S=I.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",o=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{I.width=t.naturalWidth,I.height=t.naturalHeight,S.drawImage(t,0,0),T.rr_dataURL=I.toDataURL(u.type,u.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i));console.warn(`Cannot inline img src=${r}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(o?T.crossOrigin=o:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i)}if("audio"===k||"video"===k){const t=T;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}C||(e.scrollLeft&&(T.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(T.rr_scrollTop=e.scrollTop));if(w){const{width:t,height:n}=e.getBoundingClientRect();T={class:T.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==k||v(T.src)||(e.contentDocument||(T.rr_src=T.src),delete T.src);let A;try{customElements.get(k)&&(A=!0)}catch(e){}return{type:i.Element,tagName:k,attributes:T,childNodes:[],isSVG:O(e)||void 0,needBlock:w,rootId:_,isCustom:A}}(e,{doc:n,blockClass:o,blockSelector:s,inlineStylesheet:l,maskInputOptions:u,maskInputFn:y,dataURLOptions:v,inlineImages:C,recordCanvas:_,keepIframeSrcFn:w,newlyAddedElement:k,rootId:T});case e.TEXT_NODE:return function(e,t){var n;const{needsMask:r,maskTextFn:o,rootId:s}=t,a=e.parentNode&&e.parentNode.tagName;let l=e.textContent;const u="STYLE"===a||void 0,d="SCRIPT"===a||void 0;if(u&&l){try{e.nextSibling||e.previousSibling||(null==(n=e.parentNode.sheet)?void 0:n.cssRules)&&(l=c(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}l=x(l,R(t.doc))}d&&(l="SCRIPT_PLACEHOLDER");!u&&!d&&l&&r&&(l=o?o(l,e.parentElement):l.replace(/[\S]/g,"*"));return{type:i.Text,textContent:l||"",isStyle:u,rootId:s}}(e,{doc:n,needsMask:a,maskTextFn:p,rootId:T});case e.CDATA_SECTION_NODE:return{type:i.CDATA,textContent:"",rootId:T};case e.COMMENT_NODE:return{type:i.Comment,textContent:e.textContent||"",rootId:T};default:return!1}}function B(e){return null==e?"":e.toLowerCase()}function W(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:c,maskTextClass:u,maskTextSelector:d,skipChild:p=!1,inlineStylesheet:h=!0,maskInputOptions:f={},maskTextFn:m,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b={},inlineImages:I=!1,recordCanvas:S=!1,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:T=5e3,onStylesheetLoad:M,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:A=(()=>!1),newlyAddedElement:E=!1}=t;let{needsMask:N}=t,{preserveWhiteSpace:L=!0}=t;if(!N){N=Z(e,u,d,void 0===N)}const O=P(e,{doc:n,mirror:r,blockClass:o,blockSelector:c,needsMask:N,inlineStylesheet:h,maskInputOptions:f,maskTextFn:m,maskInputFn:g,dataURLOptions:b,inlineImages:I,recordCanvas:S,keepIframeSrcFn:A,newlyAddedElement:E});if(!O)return console.warn(e,"not serialized"),null;let R;R=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===i.Comment)return!0;if(e.type===i.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===y(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(B(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===B(e.attributes.name)||"icon"===B(e.attributes.rel)||"apple-touch-icon"===B(e.attributes.rel)||"shortcut icon"===B(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&B(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(B(e.attributes.property).match(/^(og|twitter|fb):/)||B(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===B(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===B(e.attributes.name)||"googlebot"===B(e.attributes.name)||"bingbot"===B(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===B(e.attributes.name)||"generator"===B(e.attributes.name)||"framework"===B(e.attributes.name)||"publisher"===B(e.attributes.name)||"progid"===B(e.attributes.name)||B(e.attributes.property).match(/^article:/)||B(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===B(e.attributes.name)||"yandex-verification"===B(e.attributes.name)||"csrf-token"===B(e.attributes.name)||"p:domain_verify"===B(e.attributes.name)||"verify-v1"===B(e.attributes.name)||"verification"===B(e.attributes.name)||"shopify-checkout-api-token"===B(e.attributes.name)))return!0}}return!1}(O,v)&&(L||O.type!==i.Text||O.isStyle||O.textContent.replace(/^\s+|\s+$/gm,"").length)?_():C;const D=Object.assign(O,{id:R});if(r.add(e,D),R===C)return null;w&&w(e);let F=!p;if(D.type===i.Element){F=F&&!D.needBlock,delete D.needBlock;const t=e.shadowRoot;t&&l(t)&&(D.isShadowHost=!0)}if((D.type===i.Document||D.type===i.Element)&&F){v.headWhitespace&&D.type===i.Element&&"head"===D.tagName&&(L=!1);const t={doc:n,mirror:r,blockClass:o,blockSelector:c,needsMask:N,maskTextClass:u,maskTextSelector:d,skipChild:p,inlineStylesheet:h,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b,inlineImages:I,recordCanvas:S,preserveWhiteSpace:L,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:T,onStylesheetLoad:M,stylesheetLoadTimeout:x,keepIframeSrcFn:A};if(D.type===i.Element&&"textarea"===D.tagName&&void 0!==D.attributes.value);else for(const n of Array.from(e.childNodes)){const e=W(n,t);e&&D.childNodes.push(e)}if(s(e)&&e.shadowRoot)for(const n of Array.from(e.shadowRoot.childNodes)){const r=W(n,t);r&&(l(e.shadowRoot)&&(r.isShadow=!0),D.childNodes.push(r))}}return e.parentNode&&a(e.parentNode)&&l(e.parentNode)&&(D.isShadow=!0),D.type===i.Element&&"iframe"===D.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let o,i=!1;try{o=r.document.readyState}catch(e){return}if("complete"!==o){const r=setTimeout((()=>{i||(t(),i=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(r),i=!0,t()}))}const s="about:blank";if(r.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,(()=>{const t=e.contentDocument;if(t&&k){const n=W(t,{doc:t,mirror:r,blockClass:o,blockSelector:c,needsMask:N,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b,inlineImages:I,recordCanvas:S,preserveWhiteSpace:L,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:T,onStylesheetLoad:M,stylesheetLoadTimeout:x,keepIframeSrcFn:A});n&&k(e,n)}}),T),D.type===i.Element&&"link"===D.tagName&&"string"==typeof D.attributes.rel&&("stylesheet"===D.attributes.rel||"preload"===D.attributes.rel&&"string"==typeof D.attributes.href&&"css"===y(D.attributes.href))&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(e){return}if(r)return;const i=setTimeout((()=>{o||(t(),o=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(i),o=!0,t()}))}(e,(()=>{if(M){const t=W(e,{doc:n,mirror:r,blockClass:o,blockSelector:c,needsMask:N,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b,inlineImages:I,recordCanvas:S,preserveWhiteSpace:L,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:T,onStylesheetLoad:M,stylesheetLoadTimeout:x,keepIframeSrcFn:A});t&&M(e,t)}}),x),D}function G(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const q="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let V={map:{},getId:()=>(console.error(q),-1),getNode:()=>(console.error(q),null),removeNodeFromMap(){console.error(q)},has:()=>(console.error(q),!1),reset(){console.error(q)}};function Y(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,o=0;return function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];const l=Date.now();o||!1!==n.leading||(o=l);const c=t-(l-o),u=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),o=l,e.apply(u,s)):r||!1===n.trailing||(r=setTimeout((()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(u,s)}),c))}}function j(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),i&&i.set&&i.set.call(this,e)}}),()=>j(e,t,i||{},!0)}function U(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(V=new Proxy(V,{get:(e,t,n)=>("map"===t&&console.error(q),Reflect.get(e,t,n))}));let z=Date.now;function X(e){var t,n,r,o,i,s;const a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==a?void 0:a.documentElement.scrollLeft)||(null==(n=null==(t=null==a?void 0:a.body)?void 0:t.parentElement)?void 0:n.scrollLeft)||(null==(r=null==a?void 0:a.body)?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null==(i=null==(o=null==a?void 0:a.body)?void 0:o.parentElement)?void 0:i.scrollTop)||(null==(s=null==a?void 0:a.body)?void 0:s.scrollTop)||0}}function $(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function J(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function K(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}function Q(e,t,n,r){if(!e)return!1;const o=K(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(H(o,t,r))return!0}catch(e){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function ee(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||t.getId(e)===C}function te(e,t){if(a(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||te(e.parentNode,t))}function ne(e){return Boolean(e.changedTouches)}function re(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function oe(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function ie(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(z=()=>(new Date).getTime());let se=class{constructor(){n(this,"id",1),n(this,"styleIDMap",new WeakMap),n(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function ae(e){var t,n;let r=null;return(null==(n=null==(t=e.getRootNode)?void 0:t.call(e))?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function le(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=ae(n);)n=t;return n}(e);return t.contains(n)}function ce(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||le(e))}var ue=(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))(ue||{}),de=(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[e.CustomElement=16]="CustomElement",e))(de||{}),pe=(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))(pe||{}),he=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(he||{}),fe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(fe||{}),me=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(me||{});function ge(e){return"__ln"in e}class ye{constructor(){n(this,"length",0),n(this,"head",null),n(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&ge(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&ge(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const ve=(e,t)=>`${e}@${t}`;class be{constructor(){n(this,"frozen",!1),n(this,"locked",!1),n(this,"texts",[]),n(this,"attributes",[]),n(this,"attributeMap",new WeakMap),n(this,"removes",[]),n(this,"mapRemoves",[]),n(this,"movedMap",{}),n(this,"addedSet",new Set),n(this,"movedSet",new Set),n(this,"droppedSet",new Set),n(this,"mutationCb"),n(this,"blockClass"),n(this,"blockSelector"),n(this,"maskTextClass"),n(this,"maskTextSelector"),n(this,"inlineStylesheet"),n(this,"maskInputOptions"),n(this,"maskTextFn"),n(this,"maskInputFn"),n(this,"keepIframeSrcFn"),n(this,"recordCanvas"),n(this,"inlineImages"),n(this,"slimDOMOptions"),n(this,"dataURLOptions"),n(this,"doc"),n(this,"mirror"),n(this,"iframeManager"),n(this,"stylesheetManager"),n(this,"shadowDomManager"),n(this,"canvasManager"),n(this,"processedNodeManager"),n(this,"unattachedDoc"),n(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),n(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new ye,r=e=>{let t=e,n=C;for(;n===C;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{if(!o.parentNode||!ce(o)||"TEXTAREA"===o.parentNode.tagName)return;const i=a(o.parentNode)?this.mirror.getId(ae(o)):this.mirror.getId(o.parentNode),s=r(o);if(-1===i||-1===s)return n.addNode(o);const l=W(o,{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:e=>{re(e,this.mirror)&&this.iframeManager.addIframe(e),oe(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),ie(o)&&this.shadowDomManager.addShadowRoot(o.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});l&&(e.push({parentId:i,nextId:s,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)_e(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||o(e);for(const e of this.addedSet)Ie(this.droppedSet,e)||_e(this.removes,e,this.mirror)?Ie(this.movedSet,e)?o(e):this.droppedSet.add(e):o(e);let i=null;for(;n.length;){let e=null;if(i){const t=this.mirror.getId(i.value.parentNode),n=r(i.value);-1!==t&&-1!==n&&(e=i)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(n.value.parentNode);if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=t.parentNode.host;if(-1!==this.mirror.getId(r)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}i=e.previous,n.removeNode(e.value),o(e.value)}const s={texts:this.texts.map((e=>{const t=e.node;return t.parentNode&&"TEXTAREA"===t.parentNode.tagName&&this.genTextAreaValueMutation(t.parentNode),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(s.texts.length||s.attributes.length||s.removes.length||s.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(s))})),n(this,"genTextAreaValueMutation",(e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(e.childNodes,(e=>e.textContent||"")).join("")})),n(this,"processMutation",(e=>{if(!ee(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=e.target.textContent;Q(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Z(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,K(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,r=e.target.getAttribute(n);if("value"===n){const e=g(t);r=h({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:r,maskInputFn:this.maskInputFn})}if(Q(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let o=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(r)){if(t.contentDocument)return;n="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!F(t.tagName,n)&&(o.attributes[n]=D(this.doc,f(t.tagName),f(n),r),"style"===n)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),i=t.style.getPropertyPriority(e);r!==n.style.getPropertyValue(e)||i!==n.style.getPropertyPriority(e)?o.styleDiff[e]=""===i?r:[r,i]:o._unchangedStyles[e]=[r,i]}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}break}case"childList":if(Q(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const n=this.mirror.getId(t),r=a(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Q(e.target,this.blockClass,this.blockSelector,!1)||ee(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Ce(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||te(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ve(n,r)]?Ce(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!a(e.target)||!l(e.target))||void 0})),this.mapRemoves.push(t))}))}})),n(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(ee(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[ve(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Q(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach((e=>this.genAdds(e))),ie(e)&&e.shadowRoot.childNodes.forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}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 Ce(e,t){e.delete(t),t.childNodes.forEach((t=>Ce(e,t)))}function _e(e,t,n){return 0!==e.length&&function(e,t,n){let r=t.parentNode;for(;r;){const t=n.getId(r);if(e.some((e=>e.id===t)))return!0;r=r.parentNode}return!1}(e,t,n)}function Ie(e,t){return 0!==e.size&&Se(e,t)}function Se(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||Se(e,n))}let we;const ke=e=>{if(!we)return e;return function(){try{return e(...arguments)}catch(e){if(we&&!0===we(e))return;throw e}}},Te=[];function Me(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function xe(e,t){var n,r;const o=new be;Te.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const s=null==(r=null==(n=null==window?void 0:window.Zone)?void 0:n.__symbol__)?void 0:r.call(n,"MutationObserver");s&&window[s]&&(i=window[s]);const a=new i(ke(o.processMutations.bind(o)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Ae(e){let{mouseInteractionCb:t,doc:n,mirror:r,blockClass:o,blockSelector:i,sampling:s}=e;if(!1===s.mouseInteraction)return()=>{};const a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,l=[];let c=null;return Object.keys(pe).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((e=>{let s=f(e);const a=(e=>n=>{const s=Me(n);if(Q(s,o,i,!0))return;let a=null,l=e;if("pointerType"in n){switch(n.pointerType){case"mouse":a=he.Mouse;break;case"touch":a=he.Touch;break;case"pen":a=he.Pen}a===he.Touch?pe[e]===pe.MouseDown?l="TouchStart":pe[e]===pe.MouseUp&&(l="TouchEnd"):he.Pen}else ne(n)&&(a=he.Touch);null!==a?(c=a,(l.startsWith("Touch")&&a===he.Touch||l.startsWith("Mouse")&&a===he.Mouse)&&(a=null)):pe[e]===pe.Click&&(a=c,c=null);const u=ne(n)?n.changedTouches[0]:n;if(!u)return;const d=r.getId(s),{clientX:p,clientY:h}=u;ke(t)({type:pe[l],id:d,x:p,y:h,...null!==a&&{pointerType:a}})})(e);if(window.PointerEvent)switch(pe[e]){case pe.MouseDown:case pe.MouseUp:s=s.replace("mouse","pointer");break;case pe.TouchStart:case pe.TouchEnd:return}l.push(G(s,a,n))})),ke((()=>{l.forEach((e=>e()))}))}function Ee(e){let{scrollCb:t,doc:n,mirror:r,blockClass:o,blockSelector:i,sampling:s}=e;return G("scroll",ke(Y(ke((e=>{const s=Me(e);if(!s||Q(s,o,i,!0))return;const a=r.getId(s);if(s===n&&n.defaultView){const e=X(n.defaultView);t({id:a,x:e.left,y:e.top})}else t({id:a,x:s.scrollLeft,y:s.scrollTop})})),s.scroll||100)),n)}const Ne=["INPUT","TEXTAREA","SELECT"],Le=new WeakMap;function Oe(e){return function(e,t){if(He("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||He("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||He("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||He("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Re(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function De(e,t){let{mirror:n,stylesheetManager:r}=e;var o,i,s;let a=null;a="#document"===t.nodeName?n.getId(t):n.getId(t.host);const l="#document"===t.nodeName?null==(o=t.defaultView)?void 0:o.Document:null==(s=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:s.ShadowRoot,c=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&l&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null==(e=c.get)?void 0:e.call(this)},set(e){var t;const n=null==(t=c.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{r.adoptStyleSheets(e,a)}catch(e){}return n}}),ke((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function Fe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.doc.defaultView;if(!n)return()=>{};let r;!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:p,selectionCb:h,customElementCb:f}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),n(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),r(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),o(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),i(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),s(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),a(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),l(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),c(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),u(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),p(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),h(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),f(...arguments)}}(e,t),e.recordDOM&&(r=xe(e,e.doc));const o=function(e){let{mousemoveCb:t,sampling:n,doc:r,mirror:o}=e;if(!1===n.mousemove)return()=>{};const i="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500;let a,l=[];const c=Y(ke((e=>{const n=Date.now()-a;t(l.map((e=>(e.timeOffset-=n,e))),e),l=[],a=null})),s),u=ke(Y(ke((e=>{const t=Me(e),{clientX:n,clientY:r}=ne(e)?e.changedTouches[0]:e;a||(a=z()),l.push({x:n,y:r,id:o.getId(t),timeOffset:z()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?de.Drag:e instanceof MouseEvent?de.MouseMove:de.TouchMove)})),i,{trailing:!1})),d=[G("mousemove",u,r),G("touchmove",u,r),G("drag",u,r)];return ke((()=>{d.forEach((e=>e()))}))}(e),i=Ae(e),s=Ee(e),a=function(e,t){let{viewportResizeCb:n}=e,{win:r}=t,o=-1,i=-1;return G("resize",ke(Y(ke((()=>{const e=$(),t=J();o===e&&i===t||(n({width:Number(t),height:Number(e)}),o=e,i=t)})),200)),r)}(e,{win:n}),l=function(e){let{inputCb:t,doc:n,mirror:r,blockClass:o,blockSelector:i,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:c,sampling:u,userTriggeredOnInput:d}=e;function p(e){let t=Me(e);const r=e.isTrusted,u=t&&t.tagName;if(t&&"OPTION"===u&&(t=t.parentElement),!t||!u||Ne.indexOf(u)<0||Q(t,o,i,!0))return;if(t.classList.contains(s)||a&&t.matches(a))return;let p=t.value,m=!1;const y=g(t)||"";"radio"===y||"checkbox"===y?m=t.checked:(l[u.toLowerCase()]||l[y])&&(p=h({element:t,maskInputOptions:l,tagName:u,type:y,value:p,maskInputFn:c})),f(t,d?{text:p,isChecked:m,userTriggered:r}:{text:p,isChecked:m});const v=t.name;"radio"===y&&v&&m&&n.querySelectorAll(`input[type="radio"][name="${v}"]`).forEach((e=>{if(e!==t){const t=e.value;f(e,d?{text:t,isChecked:!m,userTriggered:!1}:{text:t,isChecked:!m})}}))}function f(e,n){const o=Le.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){Le.set(e,n);const o=r.getId(e);ke(t)({...n,id:o})}}const m=("last"===u.input?["change"]:["input","change"]).map((e=>G(e,ke(p),n))),y=n.defaultView;if(!y)return()=>{m.forEach((e=>e()))};const v=y.Object.getOwnPropertyDescriptor(y.HTMLInputElement.prototype,"value"),b=[[y.HTMLInputElement.prototype,"value"],[y.HTMLInputElement.prototype,"checked"],[y.HTMLSelectElement.prototype,"value"],[y.HTMLTextAreaElement.prototype,"value"],[y.HTMLSelectElement.prototype,"selectedIndex"],[y.HTMLOptionElement.prototype,"selected"]];return v&&v.set&&m.push(...b.map((e=>j(e[0],e[1],{set(){ke(p)({target:this,isTrusted:!1})}},!1,y)))),ke((()=>{m.forEach((e=>e()))}))}(e),c=function(e){let{mediaInteractionCb:t,blockClass:n,blockSelector:r,mirror:o,sampling:i,doc:s}=e;const a=ke((e=>Y(ke((i=>{const s=Me(i);if(!s||Q(s,n,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u,loop:d}=s;t({type:e,id:o.getId(s),currentTime:a,volume:l,muted:c,playbackRate:u,loop:d})})),i.media||500))),l=[G("play",a(me.Play),s),G("pause",a(me.Pause),s),G("seeked",a(me.Seeked),s),G("volumechange",a(me.VolumeChange),s),G("ratechange",a(me.RateChange),s)];return ke((()=>{l.forEach((e=>e()))}))}(e);let u=()=>{},d=()=>{},p=()=>{},f=()=>{};e.recordDOM&&(u=function(e,t){let{styleSheetRuleCb:n,mirror:r,stylesheetManager:o}=e,{win:i}=t;if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return()=>{};const s=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:ke(((e,t,i)=>{const[s,a]=i,{id:l,styleId:c}=Re(t,r,o.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:s,index:a}]}),e.apply(t,i)}))});const a=i.CSSStyleSheet.prototype.deleteRule;let l,c;i.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:ke(((e,t,i)=>{const[s]=i,{id:a,styleId:l}=Re(t,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:s}]}),e.apply(t,i)}))}),i.CSSStyleSheet.prototype.replace&&(l=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:ke(((e,t,i)=>{const[s]=i,{id:a,styleId:l}=Re(t,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replace:s}),e.apply(t,i)}))})),i.CSSStyleSheet.prototype.replaceSync&&(c=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:ke(((e,t,i)=>{const[s]=i,{id:a,styleId:l}=Re(t,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replaceSync:s}),e.apply(t,i)}))}));const u={};Ze("CSSGroupingRule")?u.CSSGroupingRule=i.CSSGroupingRule:(Ze("CSSMediaRule")&&(u.CSSMediaRule=i.CSSMediaRule),Ze("CSSConditionRule")&&(u.CSSConditionRule=i.CSSConditionRule),Ze("CSSSupportsRule")&&(u.CSSSupportsRule=i.CSSSupportsRule));const d={};return Object.entries(u).forEach((e=>{let[t,i]=e;d[t]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(d[t].insertRule,{apply:ke(((e,t,i)=>{const[s,a]=i,{id:l,styleId:c}=Re(t.parentStyleSheet,r,o.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:s,index:[...Oe(t),a||0]}]}),e.apply(t,i)}))}),i.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:ke(((e,t,i)=>{const[s]=i,{id:a,styleId:l}=Re(t.parentStyleSheet,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:[...Oe(t),s]}]}),e.apply(t,i)}))})})),ke((()=>{i.CSSStyleSheet.prototype.insertRule=s,i.CSSStyleSheet.prototype.deleteRule=a,l&&(i.CSSStyleSheet.prototype.replace=l),c&&(i.CSSStyleSheet.prototype.replaceSync=c),Object.entries(u).forEach((e=>{let[t,n]=e;n.prototype.insertRule=d[t].insertRule,n.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:n}),d=De(e,e.doc),p=function(e,t){let{styleDeclarationCb:n,mirror:r,ignoreCSSAttributes:o,stylesheetManager:i}=e,{win:s}=t;const a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:ke(((e,t,s)=>{var l;const[c,u,d]=s;if(o.has(c))return a.apply(t,[c,u,d]);const{id:p,styleId:h}=Re(null==(l=t.parentRule)?void 0:l.parentStyleSheet,r,i.styleMirror);return(p&&-1!==p||h&&-1!==h)&&n({id:p,styleId:h,set:{property:c,value:u,priority:d},index:Oe(t.parentRule)}),e.apply(t,s)}))});const l=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:ke(((e,t,s)=>{var a;const[c]=s;if(o.has(c))return l.apply(t,[c]);const{id:u,styleId:d}=Re(null==(a=t.parentRule)?void 0:a.parentStyleSheet,r,i.styleMirror);return(u&&-1!==u||d&&-1!==d)&&n({id:u,styleId:d,remove:{property:c},index:Oe(t.parentRule)}),e.apply(t,s)}))}),ke((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n}),e.collectFonts&&(f=function(e){let{fontCb:t,doc:n}=e;const r=n.defaultView;if(!r)return()=>{};const o=[],i=new WeakMap,s=r.FontFace;r.FontFace=function(e,t,n){const r=new s(e,t,n);return i.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const a=U(n.fonts,"add",(function(e){return function(n){return setTimeout(ke((()=>{const e=i.get(n);e&&(t(e),i.delete(n))})),0),e.apply(this,[n])}}));return o.push((()=>{r.FontFace=s})),o.push(a),ke((()=>{o.forEach((e=>e()))}))}(e)));const m=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:i}=e;let s=!0;const a=ke((()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const i=e.getRangeAt(t),{startContainer:s,startOffset:l,endContainer:c,endOffset:u}=i;Q(s,r,o,!0)||Q(c,r,o,!0)||a.push({start:n.getId(s),startOffset:l,end:n.getId(c),endOffset:u})}i({ranges:a})}));return a(),G("selectionchange",a)}(e),y=function(e){let{doc:t,customElementCb:n}=e;const r=t.defaultView;return r&&r.customElements?U(r.customElements,"define",(function(e){return function(t,r,o){try{n({define:{name:t}})}catch(e){console.warn(`Custom element callback failed for ${t}`)}return e.apply(this,[t,r,o])}})):()=>{}}(e),v=[];for(const t of e.plugins)v.push(t.observer(t.callback,n,t.options));return ke((()=>{Te.forEach((e=>e.reset())),null==r||r.disconnect(),o(),i(),s(),a(),l(),c(),u(),d(),p(),f(),m(),y(),v.forEach((e=>e()))}))}function He(e){return void 0!==window[e]}function Ze(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Pe{constructor(e){n(this,"iframeIdToRemoteIdMap",new WeakMap),n(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),i=r||this.getRemoteIdToIdMap(e);let s=o.get(t);return s||(s=this.generateIdFn(),o.set(t,s),i.set(s,t)),s}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,r)))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=r.get(t);return o||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Be{constructor(e){n(this,"iframes",new WeakMap),n(this,"crossOriginIframeMap",new WeakMap),n(this,"crossOriginIframeMirror",new Pe(_)),n(this,"crossOriginIframeStyleMirror"),n(this,"crossOriginIframeRootIdMap",new WeakMap),n(this,"mirror"),n(this,"mutationCb"),n(this,"wrappedEmit"),n(this,"loadListener"),n(this,"stylesheetManager"),n(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Pe(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case ue.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:ue.IncrementalSnapshot,data:{source:de.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ue.Meta:case ue.Load:case ue.DomContentLoaded:return!1;case ue.Plugin:return t;case ue.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ue.IncrementalSnapshot:switch(t.data.source){case de.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case de.Drag:case de.TouchMove:case de.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case de.ViewportResize:return!1;case de.MediaInteraction:case de.MouseInteraction:case de.Scroll:case de.CanvasMutation:case de.Input:return this.replaceIds(t.data,e,["id"]),t;case de.StyleSheetRule:case de.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case de.Font:return t;case de.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case de.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,n,r){for(const o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===i.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class We{constructor(e){n(this,"shadowDoms",new WeakSet),n(this,"mutationCb"),n(this,"scrollCb"),n(this,"bypassOptions"),n(this,"mirror"),n(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!l(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=xe({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(Ee({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(De({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(U(e.prototype,"attachShadow",(function(e){return function(r){const o=e.call(this,r);return this.shadowRoot&&ce(this)&&n.addShadowRoot(this.shadowRoot,t),o}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Ge="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ve=0;Ve<64;Ve++)qe[Ge.charCodeAt(Ve)]=Ve;const Ye=new Map;const je=(e,t,n)=>{if(!e||!Xe(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=Ye.get(e);return n||(n=new Map,Ye.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function Ue(e,t,n){if(e instanceof Array)return e.map((e=>Ue(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){return{rr_type:e.constructor.name,base64:function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=Ge[n[t]>>2],o+=Ge[(3&n[t])<<4|n[t+1]>>4],o+=Ge[(15&n[t+1])<<2|n[t+2]>>6],o+=Ge[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Ue(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Ue(e.data,t,n),e.width,e.height]}}if(Xe(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:je(e,t,n)}}return e}const ze=(e,t,n)=>e.map((e=>Ue(e,t,n))),Xe=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function $e(e,t,n,r){const o=[];try{const i=U(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o){for(var i=arguments.length,s=new Array(i>1?i-1:0),a=1;a<i;a++)s[a-1]=arguments[a];if(!Q(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(o);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(s[0]&&"object"==typeof s[0]){const e=s[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[o,...s])}}));o.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach((e=>e()))}}function Je(e,t,n,r,o,i){const s=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=U(e,l,(function(e){return function(){for(var s=arguments.length,a=new Array(s),c=0;c<s;c++)a[c]=arguments[c];const u=e.apply(this,a);if(je(u,i,this),"tagName"in this.canvas&&!Q(this.canvas,r,o,!0)){const e=ze(a,i,this),r={type:t,property:l,args:e};n(this.canvas,r)}return u}}));s.push(a)}catch{const r=j(e,l,{set(e){n(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(r)}return s}const Ke="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Qe="undefined"!=typeof window&&window.Blob&&new Blob([(et=Ke,Uint8Array.from(atob(et),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});var et;function tt(e){let t;try{if(t=Qe&&(window.URL||window.webkitURL).createObjectURL(Qe),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),n}catch(t){return new Worker("data:text/javascript;base64,"+Ke,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class nt{constructor(e){n(this,"pendingCanvasMutations",new Map),n(this,"rafStamps",{latestId:0,invokeId:null}),n(this,"mirror"),n(this,"mutationCb"),n(this,"resetObservers"),n(this,"frozen",!1),n(this,"locked",!1),n(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));const{sampling:t="all",win:r,blockClass:o,blockSelector:i,recordCanvas:s,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(r,o,i),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,o,i,{dataURLOptions:a})}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(e,t,n,r,o){const i=$e(t,n,r,!0),s=new Map,a=new tt;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:i}=e.data;this.mutationCb({id:t,type:fe["2D"],commands:[{property:"clearRect",args:[0,0,o,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const l=1e3/e;let c,u=0;const d=e=>{u&&e-u<l||(u=e,(()=>{const e=[],o=t=>{t.querySelectorAll("canvas").forEach((t=>{Q(t,n,r,!0)||e.push(t)})),t.querySelectorAll("*").forEach((e=>{e.shadowRoot&&o(e.shadowRoot)}))};return o(t.document),e})().forEach((async e=>{var t;const n=this.mirror.getId(e);if(s.get(n))return;if(0===e.width||0===e.height)return;if(s.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const r=e.clientWidth||e.width,i=e.clientHeight||e.height,l=await createImageBitmap(e,{resizeWidth:r,resizeHeight:i});a.postMessage({id:n,bitmap:l,width:r,height:i,dataURLOptions:o.dataURLOptions},[l])}))),c=requestAnimationFrame(d)};c=requestAnimationFrame(d),this.resetObservers=()=>{i(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=$e(e,t,n,!1),o=function(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const i=U(t.CanvasRenderingContext2D.prototype,s,(function(o){return function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];return Q(this.canvas,n,r,!0)||setTimeout((()=>{const n=ze(a,t,this);e(this.canvas,{type:fe["2D"],property:s,args:n})}),0),o.apply(this,a)}}));o.push(i)}catch{const n=j(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:fe["2D"],property:s,args:[t],setter:!0})}});o.push(n)}return()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),i=function(e,t,n,r){const o=[];return o.push(...Je(t.WebGLRenderingContext.prototype,fe.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&o.push(...Je(t.WebGL2RenderingContext.prototype,fe.WebGL2,e,n,r,t)),()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map((e=>{const{type:t,...n}=e;return n})),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}class rt{constructor(e){n(this,"trackedLinkElements",new WeakSet),n(this,"mutationCb"),n(this,"adoptedStyleSheetCb"),n(this,"styleMirror",new se),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,t)=>({rule:u(e),index:t})))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class ot{constructor(){n(this,"nodeMap",new WeakMap),n(this,"active",!1)}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let it,st,at,lt=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null==(e=t.contentWindow)?void 0:e.Array.from)||Array.from,document.body.removeChild(t)}}catch(e){console.debug("Unable to override Array.from",e)}const ct=new p;function ut(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:h,slimDOMOptions:f,maskInputFn:m,maskTextFn:g,hooks:y,packFn:v,sampling:b={},dataURLOptions:C={},mousemoveWait:_,recordDOM:I=!0,recordCanvas:S=!1,recordCrossOriginIframes:w=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:T=!1,collectFonts:M=!1,inlineImages:x=!1,plugins:A,keepIframeSrcFn:E=(()=>!1),ignoreCSSAttributes:N=new Set([]),errorHandler:L}=e;we=L;const O=!w||window.parent===window;let R=!1;if(!O)try{window.parent.document&&(R=!1)}catch(e){R=!0}if(O&&!t)throw new Error("emit function is required");if(!O&&!R)return()=>{};void 0!==_&&void 0===b.mousemove&&(b.mousemove=_),ct.reset();const D=!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==h?h:{password:!0},F=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};let H;!function(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];let o=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})}();let Z=0;const P=e=>{for(const t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!R&&(e=v(e)),e};it=(e,o)=>{var i;const s=e;if(s.timestamp=z(),!(null==(i=Te[0])?void 0:i.isFrozen())||s.type===ue.FullSnapshot||s.type===ue.IncrementalSnapshot&&s.data.source===de.Mutation||Te.forEach((e=>e.unfreeze())),O)null==t||t(P(s),o);else if(R){const e={type:"rrweb",event:P(s),origin:window.location.origin,isCheckout:o};window.parent.postMessage(e,"*")}if(s.type===ue.FullSnapshot)H=s,Z=0;else if(s.type===ue.IncrementalSnapshot){if(s.data.source===de.Mutation&&s.data.isAttachIframe)return;Z++;const e=r&&Z>=r,t=n&&s.timestamp-H.timestamp>n;(e||t)&&st(!0)}};const B=e=>{it({type:ue.IncrementalSnapshot,data:{source:de.Mutation,...e}})},q=e=>it({type:ue.IncrementalSnapshot,data:{source:de.Scroll,...e}}),V=e=>it({type:ue.IncrementalSnapshot,data:{source:de.CanvasMutation,...e}}),Y=new rt({mutationCb:B,adoptedStyleSheetCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.AdoptedStyleSheet,...e}})}),j=new Be({mirror:ct,mutationCb:B,stylesheetManager:Y,recordCrossOriginIframes:w,wrappedEmit:it});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:ct,crossOriginIframeMirror:j.crossOriginIframeMirror,crossOriginIframeStyleMirror:j.crossOriginIframeStyleMirror});const U=new ot;at=new nt({recordCanvas:S,mutationCb:V,win:window,blockClass:o,blockSelector:i,mirror:ct,sampling:b.canvas,dataURLOptions:C});const K=new We({mutationCb:B,scrollCb:q,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:D,dataURLOptions:C,maskTextFn:g,maskInputFn:m,recordCanvas:S,inlineImages:x,sampling:b,slimDOMOptions:F,iframeManager:j,stylesheetManager:Y,canvasManager:at,keepIframeSrcFn:E,processedNodeManager:U},mirror:ct});st=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!I)return;it({type:ue.Meta,data:{href:window.location.href,width:J(),height:$()}},e),Y.reset(),K.init(),Te.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new p,blockClass:r="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:h,slimDOM:f=!1,dataURLOptions:m,preserveWhiteSpace:g,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:_,keepIframeSrcFn:I=(()=>!1)}=t||{};return W(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===u?{password:!0}:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===f,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===f?{}:f,dataURLOptions:m,inlineImages:l,recordCanvas:c,preserveWhiteSpace:g,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:_,keepIframeSrcFn:I,newlyAddedElement:!1})}(document,{mirror:ct,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:D,maskTextFn:g,maskInputFn:m,slimDOM:F,dataURLOptions:C,recordCanvas:S,inlineImages:x,onSerialize:e=>{re(e,ct)&&j.addIframe(e),oe(e,ct)&&Y.trackLinkElement(e),ie(e)&&K.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{j.attachIframe(e,t),K.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Y.attachLinkElement(e,t)},keepIframeSrcFn:E});if(!t)return console.warn("Failed to snapshot the document");it({type:ue.FullSnapshot,data:{node:t,initialOffset:X(window)}},e),Te.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,ct.getId(document))};try{const e=[],t=e=>{var t;return ke(Fe)({mutationCb:B,mousemoveCb:(e,t)=>it({type:ue.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.MouseInteraction,...e}}),scrollCb:q,viewportResizeCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.ViewportResize,...e}}),inputCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.Input,...e}}),mediaInteractionCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.MediaInteraction,...e}}),styleSheetRuleCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.StyleSheetRule,...e}}),styleDeclarationCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.StyleDeclaration,...e}}),canvasMutationCb:V,fontCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.Font,...e}}),selectionCb:e=>{it({type:ue.IncrementalSnapshot,data:{source:de.Selection,...e}})},customElementCb:e=>{it({type:ue.IncrementalSnapshot,data:{source:de.CustomElement,...e}})},blockClass:o,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:u,sampling:b,recordDOM:I,recordCanvas:S,inlineImages:x,userTriggeredOnInput:T,collectFonts:M,doc:e,maskInputFn:m,maskTextFn:g,keepIframeSrcFn:E,blockSelector:i,slimDOMOptions:F,dataURLOptions:C,mirror:ct,iframeManager:j,stylesheetManager:Y,shadowDomManager:K,processedNodeManager:U,canvasManager:at,ignoreCSSAttributes:N,plugins:(null==(t=null==A?void 0:A.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>it({type:ue.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},y)};j.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}}));const n=()=>{st(),e.push(t(document)),lt=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(G("DOMContentLoaded",(()=>{it({type:ue.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&n()}))),e.push(G("load",(()=>{it({type:ue.Load,data:{}}),"load"===k&&n()}),window))),()=>{e.forEach((e=>e())),U.destroy(),lt=!1,we=void 0}}catch(e){console.warn(e)}}var dt,pt;ut.addCustomEvent=(e,t)=>{if(!lt)throw new Error("please add custom event after start recording");it({type:ue.Custom,data:{tag:e,payload:t}})},ut.freezePage=()=>{Te.forEach((e=>e.freeze()))},ut.takeFullSnapshot=e=>{if(!lt)throw new Error("please take full snapshot after start recording");st(e)},ut.mirror=ct,(pt=dt||(dt={}))[pt.NotStarted=0]="NotStarted",pt[pt.Running=1]="Running",pt[pt.Stopped=2]="Stopped";const ht="2.0.0-alpha.16";var ft,mt=Object.defineProperty,gt=(e,t,n)=>(((e,t,n)=>{t in e?mt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),yt=Object.defineProperty,vt=(e,t,n)=>(((e,t,n)=>{t in e?yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),bt=Object.defineProperty,Ct=(e,t,n)=>(((e,t,n)=>{t in e?bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);class _t{constructor(){Ct(this,"idNodeMap",new Map),Ct(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function It(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&It(e.parentNode,t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&It(e.parentNode,t,n)}const St="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let wt={map:{},getId:()=>(console.error(St),-1),getNode:()=>(console.error(St),null),removeNodeFromMap(){console.error(St)},has:()=>(console.error(St),!1),reset(){console.error(St)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(wt=new Proxy(wt,{get:(e,t,n)=>("map"===t&&console.error(St),Reflect.get(e,t,n))}));let kt=Date.now;function Tt(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}/[1-9][0-9]{12}/.test(Date.now().toString())||(kt=()=>(new Date).getTime());function Mt(e){var t,n;let r=null;return(null==(n=null==(t=e.getRootNode)?void 0:t.call(e))?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function xt(e){let t,n=e;for(;t=Mt(n);)n=t;return n}function At(e){const t=e.ownerDocument;if(!t)return!1;const n=xt(e);return t.contains(n)}const Et=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){vt(this,"id",1),vt(this,"styleIDMap",new WeakMap),vt(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return wt},closestElementOfNode:Tt,getBaseDimension:function e(t,n){var r,o;const i=null==(o=null==(r=t.ownerDocument)?void 0:r.defaultView)?void 0:o.frameElement;if(!i||i===n)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=i.getBoundingClientRect(),a=e(i,n),l=s.height/i.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,n){const r=t[n[0]];return 1===n.length?r:e(r.cssRules[n[1]].cssRules,n.slice(2))},getPositionsAndIndex:function(e){const t=[...e],n=t.pop();return{positions:t,index:n}},getRootShadowHost:xt,getShadowHost:Mt,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,n,r,o,i,s;const a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==a?void 0:a.documentElement.scrollLeft)||(null==(n=null==(t=null==a?void 0:a.body)?void 0:t.parentElement)?void 0:n.scrollLeft)||(null==(r=null==a?void 0:a.body)?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null==(i=null==(o=null==a?void 0:a.body)?void 0:o.parentElement)?void 0:i.scrollTop)||(null==(s=null==a?void 0:a.body)?void 0:s.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return Boolean(null==e?void 0:e.shadowRoot)},hookSetter:function e(t,n,r,o){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const s=i.Object.getOwnPropertyDescriptor(t,n);return i.Object.defineProperty(t,n,o?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>e(t,n,s||{},!0)},inDom:function(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||At(e))},isAncestorRemoved:function e(t,n){if(function(e){const t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}(t))return!1;const r=n.getId(t);return!n.has(r)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode,n))},isBlocked:function(e,t,n,r){if(!e)return!1;const o=Tt(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(It(o,t,r))return!0}catch(e){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1},isIgnored:function(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,n){n(t.value);for(let r=t.children.length-1;r>=0;r--)e(t.children[r],n)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return kt},on:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)},patch:function(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}},polyfill:function(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];let o=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})},queueToResolveTrees:function(e){const t={},n=(e,n)=>{const r={value:e,parent:n,children:[]};return t[e.node.id]=r,r},r=[];for(const o of e){const{nextId:e,parentId:i}=o;if(e&&e in t){const i=t[e];if(i.parent){const e=i.parent.children.indexOf(i);i.parent.children.splice(e,0,n(o,i.parent))}else{const e=r.indexOf(i);r.splice(e,0,n(o,null))}}else if(i in t){const e=t[i];e.children.push(n(o,e))}else r.push(n(o,null))}return r},shadowHostInDom:At,throttle:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,o=0;return function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];const l=Date.now();o||!1!==n.leading||(o=l);const c=t-(l-o),u=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),o=l,e.apply(u,s)):r||!1===n.trailing||(r=setTimeout((()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(u,s)}),c))}},uniqueTextMutations:function(e){const t=new Set,n=[];for(let r=e.length;r--;){const o=e[r];t.has(o.id)||(n.push(o),t.add(o.id))}return n}},Symbol.toStringTag,{value:"Module"}));for(var Nt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Lt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ot=0;Ot<64;Ot++)Lt[Nt.charCodeAt(Ot)]=Ot;"undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpCiAgICAgICAgcmV0dXJuIHRyYW5zcGFyZW50QmxvYk1hcC5nZXQoaWQpOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIHRyYW5zcGFyZW50QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICAgIHJldHVybiBiYXNlNjQ7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gIiI7CiAgICB9CiAgfQogIGNvbnN0IHdvcmtlciA9IHNlbGY7CiAgd29ya2VyLm9ubWVzc2FnZSA9IGFzeW5jIGZ1bmN0aW9uKGUpIHsKICAgIGlmICgiT2Zmc2NyZWVuQ2FudmFzIiBpbiBnbG9iYWxUaGlzKSB7CiAgICAgIGNvbnN0IHsgaWQsIGJpdG1hcCwgd2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMgfSA9IGUuZGF0YTsKICAgICAgY29uc3QgdHJhbnNwYXJlbnRCYXNlNjQgPSBnZXRUcmFuc3BhcmVudEJsb2JGb3IoCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0LAogICAgICAgIGRhdGFVUkxPcHRpb25zCiAgICAgICk7CiAgICAgIGNvbnN0IG9mZnNjcmVlbiA9IG5ldyBPZmZzY3JlZW5DYW52YXMod2lkdGgsIGhlaWdodCk7CiAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCIyZCIpOwogICAgICBjdHguZHJhd0ltYWdlKGJpdG1hcCwgMCwgMCk7CiAgICAgIGJpdG1hcC5jbG9zZSgpOwogICAgICBjb25zdCBibG9iID0gYXdhaXQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOwogICAgICBjb25zdCB0eXBlID0gYmxvYi50eXBlOwogICAgICBjb25zdCBhcnJheUJ1ZmZlciA9IGF3YWl0IGJsb2IuYXJyYXlCdWZmZXIoKTsKICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsKICAgICAgaWYgKCFsYXN0QmxvYk1hcC5oYXMoaWQpICYmIGF3YWl0IHRyYW5zcGFyZW50QmFzZTY0ID09PSBiYXNlNjQpIHsKICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOwogICAgICB9CiAgICAgIGlmIChsYXN0QmxvYk1hcC5nZXQoaWQpID09PSBiYXNlNjQpCiAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOwogICAgICB3b3JrZXIucG9zdE1lc3NhZ2UoewogICAgICAgIGlkLAogICAgICAgIHR5cGUsCiAgICAgICAgYmFzZTY0LAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodAogICAgICB9KTsKICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkOiBlLmRhdGEuaWQgfSk7CiAgICB9CiAgfTsKfSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9aW1hZ2UtYml0bWFwLWRhdGEtdXJsLXdvcmtlci1CWjFyN1JKRC5qcy5tYXAK")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(ft=e.contentWindow)?void 0:ft.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var Rt;new _t,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Rt||(Rt={}));class Dt{constructor(e){gt(this,"fileName"),gt(this,"functionName"),gt(this,"lineNumber"),gt(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}}const Ft=/(^|@)\S+:\d+/,Ht=/^\s*at .*(\S+:\d+|\(native\))/m,Zt=/^(eval@)?(\[native code])?$/,Pt={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Ht)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Ht)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],""):t;const r=t.split(/\s+/).slice(1),o=this.extractLocation(n?n[1]:r.pop()),i=r.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new Dt({functionName:i,fileName:s,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Zt)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Dt({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new Dt({functionName:r,fileName:o[0],lineNumber:o[1],columnNumber:o[2]})}}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[];for(let e=2,o=n.length;e<o;e+=2){const o=t.exec(n[e]);o&&r.push(new Dt({fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[];for(let e=0,o=n.length;e<o;e+=2){const o=t.exec(n[e]);o&&r.push(new Dt({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Ft)&&!e.match(/^Error created at/)}),this).map((function(e){const t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Dt({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Bt(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();const r=e.parentElement,o=[];if(r.children&&r.children.length>0)for(let e=0;e<r.children.length;e++){const t=r.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===n&&o.push(t)}o.length>1&&(n+=`:eq(${o.indexOf(e)})`),t=n+(t?">"+t:""),e=r}return t}function Wt(e){return"[object Object]"===Object.prototype.toString.call(e)}function Gt(e,t){if(0===t)return!0;const n=Object.keys(e);for(const r of n)if(Wt(e[r])&&Gt(e[r],t-1))return!0;return!1}function qt(e,t){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);const r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){const n=r.indexOf(this);~n?r.splice(n+1):r.push(this),~n?o.splice(n,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Wt(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Wt(e)&&Gt(e,n.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=`${t.slice(0,n.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const n in t){const r=t[n];Array.isArray(r)?e[n]=Bt(r.length?r[0]:null):e[n]=r}return e}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}const Vt={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Yt(e,t,n){const r=n?Object.assign({},Vt,n):Vt,o=r.logger;if(!o)return()=>{};let i;i="string"==typeof o?t[o]:o;let s=0,a=!1;const l=[];if(r.level.includes("error")){const n=t=>{const n=t.message,o=t.error,i=Pt.parse(o).map((e=>e.toString())),s=[qt(n,r.stringifyOptions)];e({level:"error",trace:i,payload:s})};t.addEventListener("error",n),l.push((()=>{t.removeEventListener("error",n)}));const o=t=>{let n,o;t.reason instanceof Error?(n=t.reason,o=[qt(`Uncaught (in promise) ${n.name}: ${n.message}`,r.stringifyOptions)]):(n=new Error,o=[qt("Uncaught (in promise)",r.stringifyOptions),qt(t.reason,r.stringifyOptions)]);const i=Pt.parse(n).map((e=>e.toString()));e({level:"error",trace:i,payload:o})};t.addEventListener("unhandledrejection",o),l.push((()=>{t.removeEventListener("unhandledrejection",o)}))}for(const e of r.level)l.push(c(i,e));return()=>{l.forEach((e=>e()))};function c(t,n){var o=this;return t[n]?Et.patch(t,n,(t=>function(){for(var i=arguments.length,l=new Array(i),c=0;c<i;c++)l[c]=arguments[c];if(t.apply(o,l),!a){a=!0;try{const t=Pt.parse(new Error).map((e=>e.toString())).splice(1),o=l.map((e=>qt(e,r.stringifyOptions)));s++,s<r.lengthThreshold?e({level:n,trace:t,payload:o}):s===r.lengthThreshold&&e({level:"warn",trace:[],payload:[qt("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}const jt=e=>({name:"rrweb/console@1",observer:Yt,options:e}),Ut=Array.isArray,zt=Object.prototype,Xt=zt.hasOwnProperty,$t=zt.toString,Jt=Ut||function(e){return"[object Array]"===$t.call(e)},Kt=function(e){return"function"==typeof e},Qt=function(e){return e===Object(e)&&!Jt(e)},en=function(e){return void 0===e},tn=function(e){return"[object String]"==$t.call(e)},nn=function(e){return tn(e)&&0===e.trim().length},rn=function(e){return null===e},on=function(e){return en(e)||rn(e)},sn=function(e){return"[object Number]"==$t.call(e)},an=function(e){return"[object Boolean]"===$t.call(e)},ln=e=>e instanceof Document,cn=e=>e instanceof FormData,un="undefined"!=typeof window?window:void 0,dn="undefined"!=typeof globalThis?globalThis:un,pn=Array.prototype.forEach,hn=null==dn?void 0:dn.navigator,fn=null==dn?void 0:dn.document;null==dn||dn.location,null==dn||dn.fetch,null!=dn&&dn.XMLHttpRequest&&"withCredentials"in new dn.XMLHttpRequest&&dn.XMLHttpRequest,null==dn||dn.AbortController,null==hn||hn.userAgent;const mn=null!=un?un:{},gn="[PostHog.js]",yn={_log:function(e){if(un&&mn.POSTHOG_DEBUG&&!en(un.console)&&un.console){const o="__rrweb_original__"in un.console[e]?un.console[e].__rrweb_original__:un.console[e];for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o(gn,...n)}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];yn._log("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];yn._log("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];yn._log("error",...t)},critical:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.error(gn,...t)},uninitializedWarning:e=>{yn.error(`You must initialize PostHog before calling ${e}`)}},vn={};function bn(e,t,n){if(!on(e)){if(Jt(e))return function(e,t,n){if(Jt(e))if(pn&&e.forEach===pn)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(let r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r)===vn)return}(e,t,n);if(cn(e)){for(const r of e.entries())if(t.call(n,r[1],r[0])===vn)return}else for(const r in e)if(Xt.call(e,r)&&t.call(n,e[r],r)===vn)return}}const Cn=function(e){let t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&";const o=[];return bn(e,(function(e,r){en(e)||en(r)||"undefined"===r||(t=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),n=encodeURIComponent(r),o[o.length]=n+"="+t)})),o.join(r)},_n={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]};function In(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return Kt(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function Sn(e,t){var n;const r=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch{return null}}(e),o={hostname:r,isHostDenied:!1};if(null===(n=t.payloadHostDenyList)||void 0===n||!n.length||null==r||!r.trim().length)return o;for(const e of t.payloadHostDenyList)if(r.endsWith(e))return{hostname:r,isHostDenied:!0};return o}const wn=e=>"navigation"===e.entryType,kn=e=>"resource"===e.entryType;function Tn(e,t,n){if(n.recordInitialRequests){const r=t.performance.getEntries().filter((e=>wn(e)||kn(e)&&n.initiatorTypes.includes(e.initiatorType)));e({requests:r.flatMap((e=>Ln({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}const r=new t.PerformanceObserver((t=>{const r=t.getEntries().filter((e=>wn(e)||kn(e)&&n.initiatorTypes.includes(e.initiatorType)&&(e=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:r.flatMap((e=>Ln({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((e=>n.performanceEntryTypeToObserve.includes(e)));return r.observe({entryTypes:o}),()=>{r.disconnect()}}function Mn(e,t){return!!t&&(an(t)||t[e])}function xn(e){let{type:t,recordBody:n,headers:r}=e;function o(e){const t=Object.keys(r).find((e=>"content-type"===e.toLowerCase())),n=t&&r[t];return e.some((e=>null==n?void 0:n.includes(e)))}if(!n)return!1;if(an(n))return!0;if(Jt(n))return o(n);const i=n[t];return an(i)?i:o(i)}async function An(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(i>10)return yn.warn("Failed to get performance entry for request",{url:n,initiatorType:t}),null;const s=function(e,t){for(let n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}(e.performance.getEntriesByName(n),(e=>kn(e)&&e.initiatorType===t&&(en(r)||e.startTime>=r)&&(en(o)||e.startTime<=o)));return s||(await new Promise((e=>setTimeout(e,50*i))),An(e,t,n,r,o,i+1))}function En(e){let{body:t,options:n,url:r}=e;if(on(t))return null;const{hostname:o,isHostDenied:i}=Sn(r,n);if(i)return o+" is in deny list";if(tn(t))return t;if(ln(t))return t.textContent;if(cn(t))return Cn(t);if(Qt(t))try{return JSON.stringify(t)}catch{return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}const Nn=e=>!rn(e)&&("navigation"===e.entryType||"resource"===e.entryType);function Ln(e){let{entry:t,method:n,status:r,networkRequest:o,isInitial:i,start:s,end:a,url:l,initiatorType:c}=e;s=t?t.startTime:s,a=t?t.responseEnd:a;const u=Math.floor(Date.now()-performance.now()),d=Math.floor(u+(s||0)),p=[{...t?t.toJSON():{name:l},startTime:en(s)?void 0:Math.round(s),endTime:en(a)?void 0:Math.round(a),timeOrigin:u,timestamp:d,method:n,initiatorType:t?t.initiatorType:c,status:r,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:i}];if(Nn(t))for(const e of t.serverTiming||[])p.push({timeOrigin:u,timestamp:d,startTime:Math.round(t.startTime),name:e.name,duration:e.duration,entryType:"serverTiming"});return p}const On=["video/","audio/"];function Rn(e){return new Promise(((t,n)=>{const r=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>n(e))).finally((()=>clearTimeout(r)))}catch{clearTimeout(r),t("[SessionReplay] Failed to read body")}}))}async function Dn(e){let{r:t,options:n,url:r}=e;const o=function(e){var t;let{r:n,options:r,url:o}=e;if("chunked"===n.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const i=null===(t=n.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),s=On.some((e=>null==i?void 0:i.startsWith(e)));if(i&&s)return`Content-Type ${i} is not supported`;const{hostname:a,isHostDenied:l}=Sn(o,r);return l?a+" is in deny list":null}({r:t,options:n,url:r});return rn(o)?Rn(t):Promise.resolve(o)}function Fn(e,t,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const r=Mn("request",n.recordHeaders),o=Mn("response",n.recordHeaders),i=In(t,"fetch",(i=>async function(s,a){const l=new Request(s,a);let c;const u={};let d,p;try{const e={};l.headers.forEach(((t,n)=>{e[n]=t})),r&&(u.requestHeaders=e),xn({type:"request",headers:e,url:s,recordBody:n.recordBody})&&(u.requestBody=await async function(e){let{r:t,options:n,url:r}=e;const{hostname:o,isHostDenied:i}=Sn(r,n);return i?Promise.resolve(o+" is in deny list"):Rn(t)}({r:l,options:n,url:s})),d=t.performance.now(),c=await i(l),p=t.performance.now();const a={};return c.headers.forEach(((e,t)=>{a[t]=e})),o&&(u.responseHeaders=a),xn({type:"response",headers:a,url:s,recordBody:n.recordBody})&&(u.responseBody=await Dn({r:c,options:n,url:s})),c}finally{An(t,"fetch",l.url,d,p).then((t=>{var n;const r=Ln({entry:t,method:l.method,status:null===(n=c)||void 0===n?void 0:n.status,networkRequest:u,start:d,end:p,url:l.url,initiatorType:"fetch"});e({requests:r})})).catch((()=>{}))}}));return()=>{i()}}let Hn=null;function Zn(e,t,n){if(!("performance"in t))return()=>{};if(Hn)return yn.warn("Network observer already initialised, doing nothing"),()=>{};const r=n?Object.assign({},_n,n):_n,o=t=>{const n=[];t.requests.forEach((e=>{const t=r.maskRequestFn(e);t&&n.push(t)})),n.length>0&&e({...t,requests:n})},i=Tn(o,t,r);let s=()=>{},a=()=>{};return(r.recordHeaders||r.recordBody)&&(s=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const r=Mn("request",n.recordHeaders),o=Mn("response",n.recordHeaders),i=In(t.XMLHttpRequest.prototype,"open",(i=>function(s,a){let l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=arguments.length>3?arguments[3]:void 0,u=arguments.length>4?arguments[4]:void 0;const d=this,p=new Request(a),h={};let f,m;const g={},y=d.setRequestHeader.bind(d);d.setRequestHeader=(e,t)=>(g[e]=t,y(e,t)),r&&(h.requestHeaders=g);const v=d.send.bind(d);d.send=e=>(xn({type:"request",headers:g,url:a,recordBody:n.recordBody})&&(h.requestBody=En({body:e,options:n,url:a})),f=t.performance.now(),v(e)),d.addEventListener("readystatechange",(()=>{if(d.readyState!==d.DONE)return;m=t.performance.now();const r={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{const t=e.split(": "),n=t.shift(),o=t.join(": ");n&&(r[n]=o)})),o&&(h.responseHeaders=r),xn({type:"response",headers:r,url:a,recordBody:n.recordBody})&&(h.responseBody=En({body:d.response,options:n,url:a})),An(t,"xmlhttprequest",p.url,f,m).then((t=>{const n=Ln({entry:t,method:p.method,status:null==d?void 0:d.status,networkRequest:h,start:f,end:m,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:n})})).catch((()=>{}))})),i.call(d,s,a,l,c,u)}));return()=>{i()}}(o,t,r),a=Fn(o,t,r)),Hn=()=>{i(),s(),a()},Hn}const Pn=e=>({name:"rrweb/network@1",observer:Zn,options:e});let Bn,Wn,Gn;mn.__PosthogExtensions__=mn.__PosthogExtensions__||{},mn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:jt,getRecordNetworkPlugin:Pn},mn.__PosthogExtensions__.rrweb={record:ut,version:"v2",rrwebVersion:ht},mn.rrweb={record:ut,version:"v2",rrwebVersion:ht},mn.rrwebConsoleRecord={getRecordConsolePlugin:jt},mn.getRecordNetworkPlugin=Pn,function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(Bn||(Bn={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(Wn||(Wn={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(Gn||(Gn={}));var qn,Vn,Yn,jn,Un,zn,Xn,$n,Jn={},Kn=[],Qn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,er=Array.isArray;function tr(e,t){for(var n in t)e[n]=t[n];return e}function nr(e){var t=e.parentNode;t&&t.removeChild(e)}function rr(e,t,n){var r,o,i,s={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?qn.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===s[i]&&(s[i]=e.defaultProps[i]);return or(e,s,r,o,null)}function or(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==o?++Yn:o,__i:-1,__u:0};return null==o&&null!=Vn.vnode&&Vn.vnode(i),i}function ir(e){return e.children}function sr(e,t){this.props=e,this.context=t}function ar(e,t){if(null==t)return e.__?ar(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?ar(e):null}function lr(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return lr(e)}}function cr(e){(!e.__d&&(e.__d=!0)&&jn.push(e)&&!ur.__r++||Un!==Vn.debounceRendering)&&((Un=Vn.debounceRendering)||zn)(ur)}function ur(){var e,t,n,r,o,i,s,a,l;for(jn.sort(Xn);e=jn.shift();)e.__d&&(t=jn.length,r=void 0,i=(o=(n=e).__v).__e,a=[],l=[],(s=n.__P)&&((r=tr({},o)).__v=o.__v+1,Vn.vnode&&Vn.vnode(r),vr(s,r,o,n.__n,void 0!==s.ownerSVGElement,32&o.__u?[i]:null,a,null==i?ar(o):i,!!(32&o.__u),l),r.__.__k[r.__i]=r,br(a,r,l),r.__e!=i&&lr(r)),jn.length>t&&jn.sort(Xn));ur.__r=0}function dr(e,t,n,r,o,i,s,a,l,c,u){var d,p,h,f,m,g=r&&r.__k||Kn,y=t.length;for(n.__d=l,function(e,t,n){var r,o,i,s,a,l=t.length,c=n.length,u=c,d=0;for(e.__k=[],r=0;r<l;r++)null!=(o=e.__k[r]=null==(o=t[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?or(null,o,null,null,o):er(o)?or(ir,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?or(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,a=hr(o,n,s=r+d,u),o.__i=a,i=null,-1!==a&&(u--,(i=n[a])&&(i.__u|=131072)),null==i||null===i.__v?(-1==a&&d--,"function"!=typeof o.type&&(o.__u|=65536)):a!==s&&(a===s+1?d++:a>s?u>l-s?d+=a-s:d--:d=a<s&&a==s-1?a-s:0,a!==r+d&&(o.__u|=65536))):(i=n[r])&&null==i.key&&i.__e&&(i.__e==e.__d&&(e.__d=ar(i)),_r(i,i,!1),n[r]=null,u--);if(u)for(r=0;r<c;r++)null!=(i=n[r])&&0==(131072&i.__u)&&(i.__e==e.__d&&(e.__d=ar(i)),_r(i,i))}(n,t,g),l=n.__d,d=0;d<y;d++)null!=(h=n.__k[d])&&"boolean"!=typeof h&&"function"!=typeof h&&(p=-1===h.__i?Jn:g[h.__i]||Jn,h.__i=d,vr(e,h,p,o,i,s,a,l,c,u),f=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&Cr(p.ref,null,h),u.push(h.ref,h.__c||f,h)),null==m&&null!=f&&(m=f),65536&h.__u||p.__k===h.__k?l=pr(h,l,e):"function"==typeof h.type&&void 0!==h.__d?l=h.__d:f&&(l=f.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=l,n.__e=m}function pr(e,t,n){var r,o;if("function"==typeof e.type){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=pr(r[o],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function hr(e,t,n,r){var o=e.key,i=e.type,s=n-1,a=n+1,l=t[n];if(null===l||l&&o==l.key&&i===l.type)return n;if(r>(null!=l&&0==(131072&l.__u)?1:0))for(;s>=0||a<t.length;){if(s>=0){if((l=t[s])&&0==(131072&l.__u)&&o==l.key&&i===l.type)return s;s--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&o==l.key&&i===l.type)return a;a++}}return-1}function fr(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Qn.test(t)?n:n+"px"}function mr(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||fr(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||fr(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,i?yr:gr,i)):e.removeEventListener(t,i?yr:gr,i);else{if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function gr(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Vn.event?Vn.event(e):e)}function yr(e){return this.l[e.type+!0](Vn.event?Vn.event(e):e)}function vr(e,t,n,r,o,i,s,a,l,c){var u,d,p,h,f,m,g,y,v,b,C,_,I,S,w,k=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),i=[a=t.__e=n.__e]),(u=Vn.__b)&&u(t);e:if("function"==typeof k)try{if(y=t.props,v=(u=k.contextType)&&r[u.__c],b=u?v?v.props.value:u.__:r,n.__c?g=(d=t.__c=n.__c).__=d.__E:("prototype"in k&&k.prototype.render?t.__c=d=new k(y,b):(t.__c=d=new sr(y,b),d.constructor=k,d.render=Ir),v&&v.sub(d),d.props=y,d.state||(d.state={}),d.context=b,d.__n=r,p=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=tr({},d.__s)),tr(d.__s,k.getDerivedStateFromProps(y,d.__s))),h=d.props,f=d.state,d.__v=t,p)null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==k.getDerivedStateFromProps&&y!==h&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,b),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,b)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[],d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,b),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(h,f,m)}))}if(d.context=b,d.props=y,d.__P=e,d.__e=!1,_=Vn.__r,I=0,"prototype"in k&&k.prototype.render){for(d.state=d.__s,d.__d=!1,_&&_(t),u=d.render(d.props,d.state,d.context),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[]}else do{d.__d=!1,_&&_(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++I<25);d.state=d.__s,null!=d.getChildContext&&(r=tr(tr({},r),d.getChildContext())),p||null==d.getSnapshotBeforeUpdate||(m=d.getSnapshotBeforeUpdate(h,f)),dr(e,er(w=null!=u&&u.type===ir&&null==u.key?u.props.children:u)?w:[w],t,n,r,o,i,s,a,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),g&&(d.__E=d.__=null)}catch(e){t.__v=null,l||null!=i?(t.__e=a,t.__u|=l?160:32,i[i.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),Vn.__e(e,t,n)}else null==i&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,o,i,s,a,l){var c,u,d,p,h,f,m,g=n.props,y=t.props,v=t.type;if("svg"===v&&(o=!0),null!=i)for(c=0;c<i.length;c++)if((h=i[c])&&"setAttribute"in h==!!v&&(v?h.localName===v:3===h.nodeType)){e=h,i[c]=null;break}if(null==e){if(null===v)return document.createTextNode(y);e=o?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,y.is&&y),i=null,a=!1}if(null===v)g===y||a&&e.data===y||(e.data=y);else{if(i=i&&qn.call(e.childNodes),g=n.props||Jn,!a&&null!=i)for(g={},c=0;c<e.attributes.length;c++)g[(h=e.attributes[c]).name]=h.value;for(c in g)h=g[c],"children"==c||("dangerouslySetInnerHTML"==c?d=h:"key"===c||c in y||mr(e,c,null,h,o));for(c in y)h=y[c],"children"==c?p=h:"dangerouslySetInnerHTML"==c?u=h:"value"==c?f=h:"checked"==c?m=h:"key"===c||a&&"function"!=typeof h||g[c]===h||mr(e,c,h,g[c],o);if(u)a||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),dr(e,er(p)?p:[p],t,n,r,o&&"foreignObject"!==v,i,s,i?i[0]:n.__k&&ar(n,0),a,l),null!=i)for(c=i.length;c--;)null!=i[c]&&nr(i[c]);a||(c="value",void 0!==f&&(f!==e[c]||"progress"===v&&!f||"option"===v&&f!==g[c])&&mr(e,c,f,g[c],!1),c="checked",void 0!==m&&m!==e[c]&&mr(e,c,m,g[c],!1))}return e}(n.__e,t,n,r,o,i,s,l,c);(u=Vn.diffed)&&u(t)}function br(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)Cr(n[r],n[++r],n[++r]);Vn.__c&&Vn.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Vn.__e(e,t.__v)}}))}function Cr(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Vn.__e(e,n)}}function _r(e,t,n){var r,o;if(Vn.unmount&&Vn.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Cr(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Vn.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&_r(r[o],t,n||"function"!=typeof e.type);n||null==e.__e||nr(e.__e),e.__=e.__e=e.__d=void 0}function Ir(e,t,n){return this.constructor(e,n)}function Sr(e,t,n){var r,o,i,s;Vn.__&&Vn.__(e,t),o=(r="function"==typeof n)?null:t.__k,i=[],s=[],vr(t,e=(!r&&n||t).__k=rr(ir,null,[e]),o||Jn,Jn,void 0!==t.ownerSVGElement,!r&&n?[n]:o?null:t.firstChild?qn.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,s),br(i,e,s)}function wr(e,t,n){var r,o,i,s,a=tr({},e.props);for(i in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==i?r=t[i]:"ref"==i?o=t[i]:a[i]=void 0===t[i]&&void 0!==s?s[i]:t[i];return arguments.length>2&&(a.children=arguments.length>3?qn.call(arguments,2):n),or(e.type,a,r||e.key,o||e.ref,null)}qn=Kn.slice,Vn={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},Yn=0,sr.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=tr({},this.state),"function"==typeof e&&(e=e(tr({},n),this.props)),e&&tr(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),cr(this))},sr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),cr(this))},sr.prototype.render=ir,jn=[],zn="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Xn=function(e,t){return e.__v.__b-t.__v.__b},ur.__r=0,$n=0;const kr=un,Tr=fn,Mr=e=>{const t={left:"left: 30px;",right:"right: 30px;",center:"\n left: 50%;\n transform: translateX(-50%);\n "};return`\n .survey-form, .thank-you-message {\n position: fixed;\n margin: 0px;\n bottom: 0px;\n color: black;\n font-weight: normal;\n font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n text-align: left;\n max-width: ${parseInt((null==e?void 0:e.maxWidth)||"300")}px;\n width: 100%;\n z-index: ${parseInt((null==e?void 0:e.zIndex)||"99999")};\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n border-bottom: 0px;\n ${t[(null==e?void 0:e.position)||"right"]||"right: 30px;"}\n flex-direction: column;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n box-shadow: -6px 0 16px -8px rgb(0 0 0 / 8%), -9px 0 28px 0 rgb(0 0 0 / 5%), -12px 0 48px 16px rgb(0 0 0 / 3%);\n }\n \n .survey-box, .thank-you-message-container {\n padding: 20px 25px 10px;\n display: flex;\n flex-direction: column;\n border-radius: 10px;\n }\n\n .thank-you-message {\n text-align: center;\n }\n\n .form-submit[disabled] {\n opacity: 0.6;\n filter: grayscale(50%);\n cursor: not-allowed;\n }\n .survey-form textarea {\n color: #2d2d2d;\n font-size: 14px;\n font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n background: white;\n color: black;\n outline: none;\n padding-left: 10px;\n padding-right: 10px;\n padding-top: 10px;\n border-radius: 6px;\n border-color: ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n margin-top: 14px;\n width: 100%;\n box-sizing: border-box;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea {\n margin-top: 0;\n }\n .form-submit {\n box-sizing: border-box;\n margin: 0;\n font-family: inherit;\n overflow: visible;\n text-transform: none;\n position: relative;\n display: inline-block;\n font-weight: 700;\n white-space: nowrap;\n text-align: center;\n border: 1.5px solid transparent;\n cursor: pointer;\n user-select: none;\n touch-action: manipulation;\n padding: 12px;\n font-size: 14px;\n border-radius: 6px;\n outline: 0;\n background: ${(null==e?void 0:e.submitButtonColor)||"black"} !important;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);\n box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);\n width: 100%;\n }\n .form-cancel {\n display: flex;\n float: right;\n border: none;\n background: none;\n cursor: pointer;\n }\n .cancel-btn-wrapper {\n position: absolute;\n width: 35px;\n height: 35px;\n border-radius: 100%;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n background: white;\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .bolded { font-weight: 600; }\n .buttons {\n display: flex;\n justify-content: center;\n }\n .footer-branding {\n font-size: 11px;\n margin-top: 10px;\n text-align: center;\n display: flex;\n justify-content: center;\n gap: 4px;\n align-items: center;\n font-weight: 500;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n text-decoration: none;\n backgroundColor: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n color: ${Ar((null==e?void 0:e.backgroundColor)||"#eeeded")};\n }\n .survey-question {\n font-weight: 500;\n font-size: 14px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .question-textarea-wrapper {\n display: flex;\n flex-direction: column;\n }\n .survey-question-description {\n font-size: 13px;\n padding-top: 5px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .ratings-number {\n font-size: 16px;\n font-weight: 600;\n padding: 8px 0px;\n border: none;\n }\n .ratings-number:hover {\n cursor: pointer;\n }\n .rating-options {\n margin-top: 14px;\n }\n .rating-options-number {\n display: grid;\n border-radius: 6px;\n overflow: hidden;\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n }\n .rating-options-number > .ratings-number {\n border-right: 1px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n }\n .rating-options-number > .ratings-number:last-of-type {\n border-right: 0px;\n }\n .rating-options-number .rating-active {\n background: ${(null==e?void 0:e.ratingButtonActiveColor)||"black"};\n }\n .rating-options-emoji {\n display: flex;\n justify-content: space-between;\n }\n .ratings-emoji {\n font-size: 16px;\n background-color: transparent;\n border: none;\n padding: 0px;\n }\n .ratings-emoji:hover {\n cursor: pointer;\n }\n .ratings-emoji.rating-active svg {\n fill: ${(null==e?void 0:e.ratingButtonActiveColor)||"black"};\n }\n .emoji-svg {\n fill: '#939393';\n }\n .rating-text {\n display: flex;\n flex-direction: row;\n font-size: 11px;\n justify-content: space-between;\n margin-top: 6px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n opacity: .60;\n }\n .multiple-choice-options {\n margin-top: 13px;\n font-size: 14px;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options {\n margin-top: 0;\n }\n .multiple-choice-options .choice-option {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 13px;\n cursor: pointer;\n margin-bottom: 5px;\n position: relative;\n }\n .multiple-choice-options > .choice-option:last-of-type {\n margin-bottom: 0px;\n }\n .multiple-choice-options input {\n cursor: pointer;\n position: absolute;\n opacity: 0;\n }\n .choice-check {\n position: absolute;\n right: 10px;\n background: white;\n }\n .choice-check svg {\n display: none;\n }\n .multiple-choice-options .choice-option:hover .choice-check svg {\n display: inline-block;\n opacity: .25;\n }\n .multiple-choice-options input:checked + label + .choice-check svg {\n display: inline-block;\n opacity: 100% !important;\n }\n .multiple-choice-options input:checked + label {\n font-weight: bold;\n border: 1.5px solid rgba(0,0,0);\n }\n .multiple-choice-options input:checked + label input {\n font-weight: bold;\n }\n .multiple-choice-options label {\n width: 100%;\n cursor: pointer;\n padding: 10px;\n border: 1.5px solid rgba(0,0,0,.25);\n border-radius: 4px;\n background: white;\n }\n .multiple-choice-options .choice-option-open label {\n padding-right: 30px;\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n max-width: 100%;\n }\n .multiple-choice-options .choice-option-open label span {\n width: 100%;\n }\n .multiple-choice-options .choice-option-open input:disabled + label {\n opacity: 0.6;\n }\n .multiple-choice-options .choice-option-open label input {\n position: relative;\n opacity: 1;\n flex-grow: 1;\n border: 0;\n outline: 0;\n }\n .thank-you-message-body {\n margin-top: 6px;\n font-size: 14px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .thank-you-message-header {\n margin: 10px 0px 0px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .thank-you-message-container .form-submit {\n margin-top: 20px;\n margin-bottom: 10px;\n }\n .thank-you-message-countdown {\n margin-left: 6px;\n }\n .bottom-section {\n margin-top: 14px;\n }\n `};function xr(e){if("#"===e[0]){const t=e.replace(/^#/,"");return"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")"}return"rgb(255, 255, 255)"}function Ar(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Nr;"#"===t[0]&&(e=xr(t)),t.startsWith("rgb")&&(e=t);const n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(n&&(e=xr(n)),!e)return"black";const r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){const e=parseInt(r[1]),t=parseInt(r[2]),n=parseInt(r[3]);return Math.sqrt(e*e*.299+t*t*.587+n*n*.114)>127.5?"black":"white"}return"black"}const Er={backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:"right"},Nr="#eeeded",Lr=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;r&&(localStorage.setItem(Zr(n),"true"),r.capture("survey sent",{$survey_name:n.name,$survey_id:n.id,$survey_iteration:n.current_iteration,$survey_iteration_start_date:n.current_iteration_start_date,$survey_questions:n.questions.map((e=>e.question)),sessionRecordingUrl:null===(e=r.get_session_replay_url)||void 0===e?void 0:e.call(r),...t,$set:{[Pr(n,"responded")]:!0}}),kr.dispatchEvent(new Event("PHSurveySent")))},Or=(e,t,n)=>{var r;!n&&t&&(t.capture("survey dismissed",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(r=t.get_session_replay_url)||void 0===r?void 0:r.call(t),$set:{[Pr(e,"dismissed")]:!0}}),localStorage.setItem(Zr(e),"true"),kr.dispatchEvent(new Event("PHSurveyClosed")))},Rr=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),Dr=(e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n]))?t.reverse():t,Fr=e=>(e.questions.forEach(((e,t)=>{e.originalQuestionIndex=t})),e.appearance&&e.appearance.shuffleQuestions?Dr(e.questions,Rr(e.questions)):e.questions),Hr=e=>{var t,n;return!(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||!n.repeatedActivation||!(e=>{var t,n,r,o,i,s;return null!=(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(r=n.values)||void 0===r?void 0:r.length)&&(null===(o=e.conditions)||void 0===o||null===(i=o.events)||void 0===i||null===(s=i.values)||void 0===s?void 0:s.length)>0})(e))},Zr=e=>{let t=`seenSurvey_${e.id}`;return e.current_iteration&&e.current_iteration>0&&(t=`seenSurvey_${e.id}_${e.current_iteration}`),t},Pr=(e,t)=>{let n=`$survey_${t}/${e.id}`;return e.current_iteration&&e.current_iteration>0&&(n=`$survey_${t}/${e.id}/${e.current_iteration}`),n},Br=function(e,t){var n={__c:t="__cC"+$n++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,cr(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0}),Wr=e=>{let{component:t,children:n,renderAsHtml:r,style:o}=e;return wr(t,r?{dangerouslySetInnerHTML:{__html:n},style:o}:{children:n,style:o})},Gr=fn;var qr,Vr,Yr,jr,Ur=0,zr=[],Xr=[],$r=Vn.__b,Jr=Vn.__r,Kr=Vn.diffed,Qr=Vn.__c,eo=Vn.unmount;function to(e,t){Vn.__h&&Vn.__h(Vr,e,Ur||t),Ur=0;var n=Vr.__H||(Vr.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Xr}),n.__[e]}function no(e){return Ur=1,function(e,t,n){var r=to(qr++,2);if(r.t=e,!r.__c&&(r.__=[fo(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Vr,!Vr.u)){var o=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(e){return e.__c}));if(o.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var s=!1;return o.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&r.__c.props===e)&&(!i||i.call(this,e,t,n))};Vr.u=!0;var i=Vr.shouldComponentUpdate,s=Vr.componentWillUpdate;Vr.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,o(e,t,n),i=r}s&&s.call(this,e,t,n)},Vr.shouldComponentUpdate=o}return r.__N||r.__}(fo,e)}function ro(e,t){var n=to(qr++,3);!Vn.__s&&ho(n.__H,t)&&(n.__=e,n.i=t,Vr.__H.__h.push(n))}function oo(e){return Ur=5,io((function(){return{current:e}}),[])}function io(e,t){var n=to(qr++,7);return ho(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function so(e){var t=Vr.context[e.__c],n=to(qr++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Vr)),t.props.value):e.__}function ao(){for(var e;e=zr.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(uo),e.__H.__h.forEach(po),e.__H.__h=[]}catch(t){e.__H.__h=[],Vn.__e(t,e.__v)}}Vn.__b=function(e){Vr=null,$r&&$r(e)},Vn.__r=function(e){Jr&&Jr(e),qr=0;var t=(Vr=e.__c).__H;t&&(Yr===Vr?(t.__h=[],Vr.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=Xr,e.__N=e.i=void 0}))):(t.__h.forEach(uo),t.__h.forEach(po),t.__h=[],qr=0)),Yr=Vr},Vn.diffed=function(e){Kr&&Kr(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==zr.push(t)&&jr===Vn.requestAnimationFrame||((jr=Vn.requestAnimationFrame)||co)(ao)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==Xr&&(e.__=e.__V),e.i=void 0,e.__V=Xr}))),Yr=Vr=null},Vn.__c=function(e,t){t.some((function(e){try{e.__h.forEach(uo),e.__h=e.__h.filter((function(e){return!e.__||po(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Vn.__e(n,e.__v)}})),Qr&&Qr(e,t)},Vn.unmount=function(e){eo&&eo(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{uo(e)}catch(e){t=e}})),n.__H=void 0,t&&Vn.__e(t,n.__v))};var lo="function"==typeof requestAnimationFrame;function co(e){var t,n=function(){clearTimeout(r),lo&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);lo&&(t=requestAnimationFrame(n))}function uo(e){var t=Vr,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Vr=t}function po(e){var t=Vr;e.__c=e.__(),Vr=t}function ho(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function fo(e,t){return"function"==typeof t?t(e):t}var mo=0;function go(e,t,n,r,o,i){var s,a,l={};for(a in t)"ref"==a?s=t[a]:l[a]=t[a];var c={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--mo,__i:-1,__u:0,__source:o,__self:i};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return Vn.vnode&&Vn.vnode(c),c}const yo=go("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:go("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),vo=go("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:go("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),bo=go("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:go("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Co=go("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:go("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),_o=go("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:go("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Io=go("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:go("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:"black"})}),So=go("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[go("g",{"clip-path":"url(#clip0_2415_6911)",children:[go("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:go("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),go("g",{mask:"url(#mask0_2415_6911)",children:[go("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),go("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),go("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),go("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),go("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),go("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),go("defs",{children:go("clipPath",{id:"clip0_2415_6911",children:go("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),wo=go("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:go("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});function ko(){return go("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",So]})}function To(e){let{text:t,submitDisabled:n,appearance:r,onSubmit:o,link:i}=e;const{isPreviewMode:s,isPopup:a}=so(Br),l=r.submitButtonTextColor||Ar(r.submitButtonColor||Er.submitButtonColor);return go("div",{className:"bottom-section",children:[go("div",{className:"buttons",children:go("button",{className:"form-submit",disabled:n&&!s,type:"button",style:a?{color:l}:{},onClick:()=>{s||(i&&(null==un||un.open(i)),o())},children:t})}),!r.whiteLabel&&go(ko,{})]})}function Mo(e){let{question:t,description:n,descriptionContentType:r,backgroundColor:o,forceDisableHtml:i}=e;const{isPopup:s}=so(Br);return go("div",{style:s?{backgroundColor:o||Er.backgroundColor}:{},children:[go("div",{className:"survey-question",children:t}),n&&Wr({component:rr("div",{className:"survey-question-description"}),children:n,renderAsHtml:!i&&"text"!==r})]})}function xo(e){let{onClick:t}=e;const{isPreviewMode:n}=so(Br);return go("div",{className:"cancel-btn-wrapper",onClick:t,disabled:n,children:go("button",{className:"form-cancel",onClick:t,disabled:n,children:Io})})}function Ao(e){let{header:t,description:n,contentType:r,forceDisableHtml:o,appearance:i,onClose:s,styleOverrides:a}=e;const l=Ar(i.backgroundColor||Er.backgroundColor),{isPopup:c}=so(Br);return go(ir,{children:go("div",{className:"thank-you-message",style:{...a},children:go("div",{className:"thank-you-message-container",children:[c&&go(xo,{onClick:()=>s()}),go("h3",{className:"thank-you-message-header",style:{color:l},children:t}),n&&Wr({component:rr("div",{className:"thank-you-message-body"}),children:n,renderAsHtml:!o&&"text"!==r,style:{color:l}}),c&&go(To,{text:i.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:i,onSubmit:()=>s()})]})})})}function Eo(e){var t;const n=oo(null),[r,o]=no(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black");return ro((()=>{if(n.current){const e=function(e){const t=kr.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"===t)return"black";const n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(!n)return"black";const r=parseInt(n[1]),o=parseInt(n[2]),i=parseInt(n[3]);return Math.sqrt(r*r*.299+o*o*.587+i*i*.114)>127.5?"black":"white"}(n.current);o(e)}}),[e.appearance,e.forceUpdate]),{ref:n,textColor:r}}function No(e){let{question:t,forceDisableHtml:n,appearance:r,onSubmit:o}=e;const i=oo(null),[s,a]=no("");return go("div",{ref:i,children:[go(Mo,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:r.backgroundColor,forceDisableHtml:n}),go("textarea",{rows:4,placeholder:null==r?void 0:r.placeholder,onInput:e=>a(e.currentTarget.value)}),go(To,{text:t.buttonText||"Submit",submitDisabled:!s&&!t.optional,appearance:r,onSubmit:()=>o(s)})]})}function Lo(e){let{question:t,forceDisableHtml:n,appearance:r,onSubmit:o}=e;return go(ir,{children:[go(Mo,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),go(To,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:r,onSubmit:()=>o("link clicked")})]})}function Oo(e){let{question:t,forceDisableHtml:n,displayQuestionIndex:r,appearance:o,onSubmit:i}=e;const s=t.scale,a=10===t.scale?0:1,[l,c]=no(null);return go(ir,{children:[go(Mo,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:o.backgroundColor}),go("div",{className:"rating-section",children:[go("div",{className:"rating-options",children:["emoji"===t.display&&go("div",{className:"rating-options-emoji",children:(3===t.scale?Fo:Ho).map(((e,t)=>{const n=t+1===l;return go("button",{className:`ratings-emoji question-${r}-rating-${t} ${n?"rating-active":null}`,value:t+1,type:"button",onClick:()=>{c(t+1)},style:{fill:n?o.ratingButtonActiveColor:o.ratingButtonColor,borderColor:o.borderColor},children:e},t)}))}),"number"===t.display&&go("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${s-a+1}, minmax(0, 1fr))`},children:Wo(t.scale).map(((e,t)=>go(Ro,{displayQuestionIndex:r,active:l===e,appearance:o,num:e,setActiveNumber:e=>{c(e)}},t)))})]}),go("div",{className:"rating-text",children:[go("div",{children:t.lowerBoundLabel}),go("div",{children:t.upperBoundLabel})]})]}),go(To,{text:t.buttonText||(null==o?void 0:o.submitButtonText)||"Submit",submitDisabled:rn(l)&&!t.optional,appearance:o,onSubmit:()=>i(l)})]})}function Ro(e){let{num:t,active:n,displayQuestionIndex:r,appearance:o,setActiveNumber:i}=e;const{textColor:s,ref:a}=Eo({appearance:o,defaultTextColor:"black",forceUpdate:n});return go("button",{ref:a,className:`ratings-number question-${r}-rating-${t} ${n?"rating-active":null}`,type:"button",onClick:()=>{i(t)},style:{color:s,backgroundColor:n?o.ratingButtonActiveColor:o.ratingButtonColor,borderColor:o.borderColor},children:t})}function Do(e){let{question:t,forceDisableHtml:n,displayQuestionIndex:r,appearance:o,onSubmit:i}=e;const s=oo(null),a=io((()=>(e=>{if(!e.shuffleOptions)return e.choices;const t=e.choices;let n="";e.hasOpenChoice&&(n=t.pop());const r=Dr(t,Rr(t));return e.hasOpenChoice&&(e.choices.push(n),r.push(n)),r})(t)),[t]),[l,c]=no(t.type===Wn.MultipleChoice?[]:null),[u,d]=no(!1),[p,h]=no(""),f=t.type===Wn.SingleChoice?"radio":"checkbox";return go("div",{ref:s,children:[go(Mo,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:o.backgroundColor}),go("div",{className:"multiple-choice-options",children:a.map(((e,n)=>{let o="choice-option";const i=e,s=e;return t.hasOpenChoice&&n===t.choices.length-1&&(o+=" choice-option-open"),go("div",{className:o,children:[go("input",{type:f,id:`surveyQuestion${r}Choice${n}`,name:`question${r}`,value:i,disabled:!i,onInput:()=>t.hasOpenChoice&&n===t.choices.length-1?d(!u):t.type===Wn.SingleChoice?c(i):t.type===Wn.MultipleChoice&&Jt(l)?l.includes(i)?c(l.filter((e=>e!==i))):c([...l,i]):void 0}),go("label",{htmlFor:`surveyQuestion${r}Choice${n}`,style:{color:"black"},children:t.hasOpenChoice&&n===t.choices.length-1?go(ir,{children:[go("span",{children:[s,":"]}),go("input",{type:"text",id:`surveyQuestion${r}Choice${n}Open`,name:`question${r}`,onInput:e=>{const n=e.currentTarget.value;return t.type===Wn.SingleChoice?c(n):t.type===Wn.MultipleChoice&&Jt(l)?h(n):void 0}})]}):s}),go("span",{className:"choice-check",style:{color:"black"},children:wo})]})}))}),go(To,{text:t.buttonText||"Submit",submitDisabled:(rn(l)||Jt(l)&&!u&&0===l.length||Jt(l)&&u&&!p&&0===l.length&&!t.optional)&&!t.optional,appearance:o,onSubmit:()=>{u&&t.type===Wn.MultipleChoice?Jt(l)&&i([...l,p]):i(l)}})]})}const Fo=[bo,vo,yo],Ho=[Co,bo,vo,yo,_o],Zo=[1,2,3,4,5],Po=[1,2,3,4,5,6,7],Bo=[0,1,2,3,4,5,6,7,8,9,10];function Wo(e){switch(e){case 5:default:return Zo;case 7:return Po;case 10:return Bo}}const Go=un,qo=fn;class Vo{constructor(e){this.posthog=e,this.surveyInFocus=null}canShowNextEventBasedSurvey=()=>{const e=qo.querySelectorAll("div[class^=PostHogSurvey]");var t;return!(e.length>0)||1===(null===(t=e[e.length-1].shadowRoot)||void 0===t?void 0:t.childElementCount)};handlePopoverSurvey=e=>{var t;const n=null===(t=e.conditions)||void 0===t?void 0:t.seenSurveyWaitPeriodInDays,r=localStorage.getItem("lastSeenSurveyDate");if(n&&r){const e=new Date,t=Math.abs(e.getTime()-new Date(r).getTime());if(Math.ceil(t/864e5)<n)return}const o=(e=>!!localStorage.getItem(Zr(e))&&!Hr(e))(e);if(!o){this.addSurveyToFocus(e.id);const t=((e,t,n)=>{const r=Tr.createElement("div");r.className=`PostHogSurvey${t}`;const o=r.attachShadow({mode:"open"});if(e){const t=Object.assign(Tr.createElement("style"),{innerText:e});o.appendChild(t)}return Tr.body.appendChild(r),o})(Mr(null==e?void 0:e.appearance),e.id);Sr(go(Uo,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!0},"popover-survey"),t)}};handleWidget=e=>{const t=function(e){var t;const n=Gr.createElement("div");n.className=`PostHogWidget${e.id}`;const r=n.attachShadow({mode:"open"}),o=`\n .ph-survey-widget-tab {\n position: fixed;\n top: 50%;\n right: 0;\n background: ${(null===(t=e.appearance)||void 0===t?void 0:t.widgetColor)||"#e0a045"};\n color: white;\n transform: rotate(-90deg) translate(0, -100%);\n transform-origin: right top;\n min-width: 40px;\n padding: 8px 12px;\n font-weight: 500;\n border-radius: 3px 3px 0 0;\n text-align: center;\n cursor: pointer;\n z-index: 9999999;\n }\n .ph-survey-widget-tab:hover {\n padding-bottom: 13px;\n }\n .ph-survey-widget-button {\n position: fixed;\n }\n `;return r.append(Object.assign(Gr.createElement("style"),{innerText:o})),Gr.body.appendChild(n),r}(e),n=Mr(e.appearance);t.appendChild(Object.assign(qo.createElement("style"),{innerText:n})),Sr(go(Xo,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus},"feedback-survey"),t)};handleWidgetSelector=e=>{var t;const n=(null===(t=e.appearance)||void 0===t?void 0:t.widgetSelector)&&qo.querySelector(e.appearance.widgetSelector);if(n)if(0===qo.querySelectorAll(`.PostHogWidget${e.id}`).length)this.handleWidget(e);else if(1===qo.querySelectorAll(`.PostHogWidget${e.id}`).length&&!n.getAttribute("PHWidgetSurveyClickListener")){var r,o;const t=null===(r=qo.querySelector(`.PostHogWidget${e.id}`))||void 0===r||null===(o=r.shadowRoot)||void 0===o?void 0:o.querySelector(".survey-form");n.addEventListener("click",(()=>{t&&(t.style.display="none"===t.style.display?"block":"none",t.addEventListener("PHSurveyClosed",(()=>{this.removeSurveyFromFocus(e.id),t.style.display="none"})))})),n.setAttribute("PHWidgetSurveyClickListener","true")}};sortSurveysByAppearanceDelay(e){return e.sort(((e,t)=>{var n,r;return((null===(n=e.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)-((null===(r=t.appearance)||void 0===r?void 0:r.surveyPopupDelaySeconds)||0)}))}canRenderSurvey=e=>{const t={visible:!1};if(e.end_date)return t.disabledReason=`survey was completed on ${e.end_date}`,t;if(e.type!=Bn.Popover)return t.disabledReason="Only Popover survey types can be rendered",t;if(!(!e.linked_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.linked_flag_key)))return t.disabledReason=`linked feature flag ${e.linked_flag_key} is false`,t;if(!(!e.targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.targeting_flag_key)))return t.disabledReason=`targeting feature flag ${e.targeting_flag_key} is false`,t;return!e.internal_targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key)?(t.visible=!0,t):(t.disabledReason=`internal targeting feature flag ${e.internal_targeting_flag_key} is false`,t)};renderSurvey=(e,t)=>{Sr(go(Uo,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!1},"popover-survey"),t)};callSurveysAndEvaluateDisplayLogic=(()=>{var e=this;return function(){var t;let n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(t=e.posthog)||void 0===t||t.getActiveMatchingSurveys((t=>{const n=t.filter((e=>"api"!==e.type));e.sortSurveysByAppearanceDelay(n).forEach((t=>{if(rn(e.surveyInFocus)){var n,r,o;if(t.type===Bn.Widget)"tab"===(null===(n=t.appearance)||void 0===n?void 0:n.widgetType)&&0===qo.querySelectorAll(`.PostHogWidget${t.id}`).length&&e.handleWidget(t),"selector"===(null===(r=t.appearance)||void 0===r?void 0:r.widgetType)&&null!==(o=t.appearance)&&void 0!==o&&o.widgetSelector&&e.handleWidgetSelector(t);t.type===Bn.Popover&&e.canShowNextEventBasedSurvey()&&e.handlePopoverSurvey(t)}}))}),n)}})();addSurveyToFocus=e=>{rn(this.surveyInFocus)||yn.error(`Survey ${[...this.surveyInFocus]} already in focus. Cannot add survey ${e}.`),this.surveyInFocus=e};removeSurveyFromFocus=e=>{this.surveyInFocus!==e&&yn.error(`Survey ${e} is not in focus. Cannot remove survey ${e}.`),this.surveyInFocus=null};getTestAPI(){return{addSurveyToFocus:this.addSurveyToFocus,removeSurveyFromFocus:this.removeSurveyFromFocus,surveyInFocus:this.surveyInFocus,canShowNextEventBasedSurvey:this.canShowNextEventBasedSurvey,handleWidget:this.handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,handleWidgetSelector:this.handleWidgetSelector,sortSurveysByAppearanceDelay:this.sortSurveysByAppearanceDelay}}}function Yo(e){if(!qo||!Go)return;const t=new Vo(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((()=>{t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}function jo(e,t,n,r,o){const[i,s]=no(r||0===n),[a,l]=no(!1);return ro((()=>{if(r||!t)return;const i=()=>{o(e.id),s(!1)},a=()=>{var t,n;null!==(t=e.appearance)&&void 0!==t&&t.displayThankYouMessage?(l(!0),o(e.id),null!==(n=e.appearance)&&void 0!==n&&n.autoDisappear&&setTimeout((()=>{s(!1)}),5e3)):(o(e.id),s(!1))},c=()=>{var n;s(!0),Go.dispatchEvent(new Event("PHSurveyShown")),t.capture("survey shown",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(n=t.get_session_replay_url)||void 0===n?void 0:n.call(t)}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())};return Go.addEventListener("PHSurveyClosed",i),Go.addEventListener("PHSurveySent",a),n>0?(()=>{const e=setTimeout((()=>{c()}),n);return()=>{clearTimeout(e),Go.removeEventListener("PHSurveyClosed",i),Go.removeEventListener("PHSurveySent",a)}})():(c(),()=>{Go.removeEventListener("PHSurveyClosed",i),Go.removeEventListener("PHSurveySent",a)})}),[]),{isPopupVisible:i,isSurveySent:a,setIsPopupVisible:s}}function Uo(e){var t,n,r,o,i,s;let{survey:a,forceDisableHtml:l,posthog:c,style:u,previewPageIndex:d,removeSurveyFromFocus:p,isPopup:h}=e;const f=Number.isInteger(d),m=null!==(t=a.appearance)&&void 0!==t&&t.surveyPopupDelaySeconds?1e3*a.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:g,isSurveySent:y,setIsPopupVisible:v}=jo(a,c,m,f,p),b=y||d===a.questions.length,C=null!==(n=u)&&void 0!==n&&n.left&&sn(null===(r=u)||void 0===r?void 0:r.left)?{left:u.left-40}:{};return f&&(u=u||{},u.left="unset",u.right="unset",u.transform="unset"),g?go(Br.Provider,{value:{isPreviewMode:f,previewPageIndex:d,handleCloseSurveyPopup:()=>Or(a,c,f),isPopup:h||!1},children:b?go(Ao,{header:(null===(o=a.appearance)||void 0===o?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null===(i=a.appearance)||void 0===i?void 0:i.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null===(s=a.appearance)||void 0===s?void 0:s.thankYouMessageDescriptionContentType,appearance:a.appearance||Er,styleOverrides:{...u,...C},onClose:()=>v(!1)}):go(zo,{survey:a,forceDisableHtml:!!l,posthog:c,styleOverrides:u})}):go(ir,{})}function zo(e){var t,n;let{survey:r,forceDisableHtml:o,posthog:i,styleOverrides:s}=e;const a=Ar((null===(t=r.appearance)||void 0===t?void 0:t.backgroundColor)||Er.backgroundColor),[l,c]=no({}),{isPreviewMode:u,previewPageIndex:d,handleCloseSurveyPopup:p,isPopup:h}=so(Br),[f,m]=no(d||0),g=io((()=>Fr(r)),[r]);ro((()=>{m(null!=d?d:0)}),[d]);return go("form",{className:"survey-form",style:h?{color:a,borderColor:null===(n=r.appearance)||void 0===n?void 0:n.borderColor,...s}:{},children:g.map(((e,t)=>{var n;const{originalQuestionIndex:s}=e;return(u?f===s:f===t)&&go("div",{className:"survey-box",style:h?{backgroundColor:(null===(n=r.appearance)||void 0===n?void 0:n.backgroundColor)||Er.backgroundColor}:{},children:[h&&go(xo,{onClick:()=>p()}),$o({question:e,forceDisableHtml:o,displayQuestionIndex:t,appearance:r.appearance||Er,onSubmit:e=>(e=>{let{res:t,originalQuestionIndex:n,displayQuestionIndex:o}=e;if(!i)return;const s=0===n?"$survey_response":`$survey_response_${n}`;if(c({...l,[s]:t}),!i.getNextSurveyStep)return void(o===r.questions.length-1?Lr({...l,[s]:t},r,i):m(o+1));const a=i.getNextSurveyStep(r,o,t);a===Gn.End?Lr({...l,[s]:t},r,i):m(a)})({res:e,originalQuestionIndex:s,displayQuestionIndex:t})})]})}))})}function Xo(e){var t,n;let{survey:r,forceDisableHtml:o,posthog:i,readOnly:s,removeSurveyFromFocus:a}=e;const[l,c]=no(!1),[u,d]=no({}),p=oo(null);return ro((()=>{var e,t;if(!s&&i){if("tab"===(null===(e=r.appearance)||void 0===e?void 0:e.widgetType)&&p.current){var n;const e=p.current.getBoundingClientRect(),t={top:"50%",left:parseInt(""+(e.right-360)),bottom:"auto",borderRadius:10,borderBottom:`1.5px solid ${(null===(n=r.appearance)||void 0===n?void 0:n.borderColor)||"#c9c6c6"}`};d(t)}if("selector"===(null===(t=r.appearance)||void 0===t?void 0:t.widgetType)){const e=qo.querySelector(r.appearance.widgetSelector||"");null==e||e.addEventListener("click",(()=>{c(!l)})),null==e||e.setAttribute("PHWidgetSurveyClickListener","true")}}}),[]),go(ir,{children:["tab"===(null===(t=r.appearance)||void 0===t?void 0:t.widgetType)&&go("div",{className:"ph-survey-widget-tab",ref:p,onClick:()=>!s&&c(!l),style:{color:Ar(r.appearance.widgetColor)},children:[go("div",{className:"ph-survey-widget-tab-icon"}),(null===(n=r.appearance)||void 0===n?void 0:n.widgetLabel)||""]}),l&&go(Uo,{posthog:i,survey:r,forceDisableHtml:o,style:u,removeSurveyFromFocus:a,isPopup:!0},"feedback-widget-survey")]})}const $o=e=>{let{question:t,forceDisableHtml:n,displayQuestionIndex:r,appearance:o,onSubmit:i}=e;const s={[Wn.Open]:No,[Wn.Link]:Lo,[Wn.Rating]:Oo,[Wn.SingleChoice]:Do,[Wn.MultipleChoice]:Do},a={question:t,forceDisableHtml:n,appearance:o,onSubmit:i},l={[Wn.Open]:{},[Wn.Link]:{},[Wn.Rating]:{displayQuestionIndex:r},[Wn.SingleChoice]:{displayQuestionIndex:r},[Wn.MultipleChoice]:{displayQuestionIndex:r}};return go(s[t.type],{...{...a,...l[t.type]}})};function Jo(e){return!en(Event)&&Ko(e,Event)}function Ko(e,t){try{return e instanceof t}catch{return!1}}function Qo(e){return rn(e)||!Qt(e)&&!Kt(e)}function ei(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function ti(e){return ei(e,"DOMError")}mn.__PosthogExtensions__=mn.__PosthogExtensions__||{},mn.__PosthogExtensions__.canActivateRepeatedly=Hr,mn.__PosthogExtensions__.generateSurveys=Yo,mn.extendPostHogWithSurveys=Yo;const ni=/\(error: (.*)\)/,ri=50,oi="?";function ii(e,t,n,r){const o={filename:e,function:"<anonymous>"===t?oi:t,in_app:!0};return en(n)||(o.lineno=n),en(r)||(o.colno=r),o}const si=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ai=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,li=/\((\S*)(?::(\d+))(?::(\d+))\)/,ci=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ui=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,di=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=[],o=e.split("\n");for(let e=t;e<o.length;e++){const t=o[e];if(t.length>1024)continue;const i=ni.test(t)?t.replace(ni,"$1"):t;if(!i.match(/\S*Error: /)){for(const e of r){const t=e(i);if(t){n.push(t);break}}if(n.length>=ri)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return t.reverse(),t.slice(0,ri).map((e=>({...e,filename:e.filename||pi(t).filename,function:e.function||oi})))}(n)}}(...[[30,e=>{const t=si.exec(e);if(t){const[,e,n,r]=t;return ii(e,oi,+n,+r)}const n=ai.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){const e=li.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}const[e,t]=hi(n[1]||oi,n[2]);return ii(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,e=>{const t=ci.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=ui.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||oi;return[n,e]=hi(n,e),ii(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function pi(e){return e[e.length-1]||{}}const hi=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:oi,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};let fi;!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(fi||(fi={}));const mi=["fatal","error","warning","log","info","debug"],gi=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function yi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=e.stacktrace||e.stack||"",r=function(e){if(e&&vi.test(e.message))return 1;return 0}(e);try{const e=di(n,r);return e.slice(0,e.length-t)}catch{}return[]}const vi=/Minified React error #\d+;/i;function bi(e,t){var n,r;const o=yi(e),i=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null!==(r=null==t?void 0:t.synthetic)&&void 0!==r&&r;return{$exception_list:[{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:function(e){const t=e.message;if(t.error&&"string"==typeof t.error.message)return t.error.message;return t}(e),stacktrace:{frames:o},mechanism:{handled:i,synthetic:s}}],$exception_level:"error"}}function Ci(e,t){var n,r,o;const i=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(o=null==t?void 0:t.defaultExceptionType)&&void 0!==o?o:"Error",value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:i,synthetic:s}};if(null!=t&&t.syntheticException){const e=yi(t.syntheticException,1);e.length&&(a.stacktrace={frames:e})}return{$exception_list:[a],$exception_level:"error"}}function _i(e){return tn(e)&&!nn(e)&&mi.indexOf(e)>=0}function Ii(e,t){var n,r;const o=null===(n=null==t?void 0:t.handled)||void 0===n||n,i=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,s=null!=t&&t.overrideExceptionType?t.overrideExceptionType:Jo(e)?e.constructor.name:"Error",a=null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:`Non-Error exception captured with keys: ${function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40;const n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(let e=n.length;e>0;e--){const r=n.slice(0,e).join(", ");if(!(r.length>t))return e===n.length||r.length<=t?r:`${r.slice(0,t)}...`}return""}(e)}`,l={type:s,value:a,mechanism:{handled:o,synthetic:i}};if(null!=t&&t.syntheticException){const e=yi(null==t?void 0:t.syntheticException,1);e.length&&(l.stacktrace={frames:e})}return{$exception_list:[l],$exception_level:_i(e.level)?e.level:"error"}}function Si(e,t){let[n,r,o,i,s]=e,a={$exception_list:[]};const l=s||n;if(ti(l)||function(e){return ei(e,"DOMException")}(l)){const e=l;if(function(e){return"stack"in e}(l))a=bi(l,t);else{const n=e.name||(ti(e)?"DOMError":"DOMException"),r=e.message?`${n}: ${e.message}`:n,o=ti(e)?"DOMError":"DOMException";a=Ci(r,{...t,overrideExceptionType:o,defaultExceptionMessage:r})}return"code"in e&&(a.$exception_DOMException_code=`${e.code}`),a}if(function(e){return ei(e,"ErrorEvent")}(l)&&l.error)return bi(l.error,t);if(function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return Ko(e,Error)}}(l))return bi(l,t);if(function(e){return ei(e,"Object")}(l)||Jo(l)){return Ii(l,t)}if(en(s)&&tn(n)){let e="Error",r=n;const o=n.match(gi);return o&&(e=o[1],r=o[2]),Ci(r,{...t,overrideExceptionType:e,defaultExceptionMessage:r})}return Ci(l,t)}function wi(e){let[t]=e;const n=function(e){if(Qo(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}(t);return Qo(n)?Ci(`Non-Error promise rejection captured with value: ${String(n)}`,{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):Si([n],{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(n)})}const ki={wrapOnError:e=>{const t=un;t||yn.info("window not available, cannot wrap onerror");const n=t.onerror;return t.onerror=function(){for(var t,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];const s=Si(o);return e(s),null!==(t=null==n?void 0:n(...o))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onerror)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=n}},wrapUnhandledRejection:e=>{const t=un;t||yn.info("window not available, cannot wrap onUnhandledRejection");const n=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];const a=wi(i);return e(a),null!==(r=null==n?void 0:n.apply(t,i))&&void 0!==r&&r},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onunhandledrejection)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=n}}};mn.__PosthogExtensions__=mn.__PosthogExtensions__||{},mn.__PosthogExtensions__.errorWrappingFunctions=ki,mn.__PosthogExtensions__.parseErrorAsProperties=Si,mn.posthogErrorWrappingFunctions=ki,mn.parseErrorAsProperties=Si;const Ti=(e,t)=>{const{sessionId:n,windowId:r}=e.checkAndGetSessionAndWindowId(!0);t.headers.set("X-POSTHOG-SESSION-ID",n),t.headers.set("X-POSTHOG-WINDOW-ID",r)};mn.__PosthogExtensions__=mn.__PosthogExtensions__||{};const Mi={_patchFetch:e=>In(un,"fetch",(t=>async function(n,r){const o=new Request(n,r);return Ti(e,o),t(o)})),_patchXHR:e=>In(un.XMLHttpRequest.prototype,"open",(t=>function(n,r){let o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;const a=new Request(r);return Ti(e,a),t.call(this,n,a.url,o,i,s)}))};mn.__PosthogExtensions__.tracingHeadersPatchFns=Mi,mn.postHogTracingHeadersPatchFns=Mi;var xi,Ai,Ei,Ni=-1,Li=function(e){addEventListener("pageshow",(function(t){t.persisted&&(Ni=t.timeStamp,e(t))}),!0)},Oi=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Ri=function(){var e=Oi();return e&&e.activationStart||0},Di=function(e,t){var n=Oi(),r="navigate";return Ni>=0?r="back-forward-cache":n&&(document.prerendering||Ri()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},Fi=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},Hi=function(e,t,n,r){var o,i;return function(s){t.value>=0&&(s||r)&&((i=t.value-(o||0))||void 0===o)&&(o=t.value,t.delta=i,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Zi=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Pi=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Bi=function(e){var t=!1;return function(){t||(e(),t=!0)}},Wi=-1,Gi=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},qi=function(e){"hidden"===document.visibilityState&&Wi>-1&&(Wi="visibilitychange"===e.type?e.timeStamp:0,Yi())},Vi=function(){addEventListener("visibilitychange",qi,!0),addEventListener("prerenderingchange",qi,!0)},Yi=function(){removeEventListener("visibilitychange",qi,!0),removeEventListener("prerenderingchange",qi,!0)},ji=function(){return Wi<0&&(Wi=Gi(),Vi(),Li((function(){setTimeout((function(){Wi=Gi(),Vi()}),0)}))),{get firstHiddenTime(){return Wi}}},Ui=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},zi=[1800,3e3],Xi=function(e,t){t=t||{},Ui((function(){var n,r=ji(),o=Di("FCP"),i=Fi("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(i.disconnect(),e.startTime<r.firstHiddenTime&&(o.value=Math.max(e.startTime-Ri(),0),o.entries.push(e),n(!0)))}))}));i&&(n=Hi(e,o,zi,t.reportAllChanges),Li((function(r){o=Di("FCP"),n=Hi(e,o,zi,t.reportAllChanges),Zi((function(){o.value=performance.now()-r.timeStamp,n(!0)}))})))}))},$i=[.1,.25],Ji=[2500,4e3],Ki={},Qi=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},es=function(e){if("loading"===document.readyState)return"loading";var t=Qi();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},ts=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},ns=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,o=r.id?"#"+r.id:ts(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+o.length>(t||100)-1)return n||o;if(n=n?o+">"+n:o,r.id)break;e=r.parentNode}}catch(e){}return n},rs=-1,os=function(e,t){var n=Qi(),r="navigate";return rs>=0?r="back-forward-cache":n&&(document.prerendering||function(){var e=Qi();return e&&e.activationStart||0}()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:-1,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},is=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},ss=function(e,t,n,r){var o,i;return function(s){t.value>=0&&(s||r)&&((i=t.value-(o||0))||void 0===o)&&(o=t.value,t.delta=i,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},as=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},ls=0,cs=1/0,us=0,ds=function(e){e.forEach((function(e){e.interactionId&&(cs=Math.min(cs,e.interactionId),us=Math.max(us,e.interactionId),ls=us?(us-cs)/7+1:0)}))},ps=function(){"interactionCount"in performance||xi||(xi=is("event",ds,{type:"event",buffered:!0,durationThreshold:0}))},hs=[],fs=new Map,ms=0,gs=function(){return(xi?ls:performance.interactionCount||0)-ms},ys=[],vs=function(e){if(ys.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=hs[hs.length-1],n=fs.get(e.interactionId);if(n||hs.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};fs.set(r.id,r),hs.push(r)}hs.sort((function(e,t){return t.latency-e.latency})),hs.length>10&&hs.splice(10).forEach((function(e){return fs.delete(e.id)}))}}},bs=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=function(e){var t=!1;return function(){t||(e(),t=!0)}}(e),"hidden"===document.visibilityState?e():(n=t(e),as(e)),n},Cs=[200,500],_s=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()}((function(){var n;ps();var r,o=os("INP"),i=function(e){bs((function(){e.forEach(vs);var t,n=(t=Math.min(hs.length-1,Math.floor(gs()/50)),hs[t]);n&&n.latency!==o.value&&(o.value=n.latency,o.entries=n.entries,r())}))},s=is("event",i,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=ss(e,o,Cs,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),as((function(){i(s.takeRecords()),r(!0)})),function(e){addEventListener("pageshow",(function(t){t.persisted&&(rs=t.timeStamp,e(t))}),!0)}((function(){ms=0,hs.length=0,fs.clear(),o=os("INP"),r=ss(e,o,Cs,t.reportAllChanges)})))})))},Is=[],Ss=[],ws=new WeakMap,ks=new Map,Ts=-1,Ms=function(e){Is=Is.concat(e),xs()},xs=function(){Ts<0&&(Ts=bs(As))},As=function(){ks.size>10&&ks.forEach((function(e,t){fs.has(t)||ks.delete(t)}));var e=hs.map((function(e){return ws.get(e.entries[0])})),t=Ss.length-50;Ss=Ss.filter((function(n,r){return r>=t||e.includes(n)}));for(var n=new Set,r=0;r<Ss.length;r++){var o=Ss[r];Es(o.startTime,o.processingEnd).forEach((function(e){n.add(e)}))}for(var i=0;i<50;i++){var s=Is[Is.length-1-i];if(!s||s.startTime<Ei)break;n.add(s)}Is=Array.from(n),Ts=-1};ys.push((function(e){e.interactionId&&e.target&&!ks.has(e.interactionId)&&ks.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;Ei=Math.max(Ei,e.processingEnd);for(var r=Ss.length-1;r>=0;r--){var o=Ss[r];if(Math.abs(n-o.renderTime)<=8){(t=o).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:[e]},Ss.push(t)),(e.interactionId||"first-input"===e.entryType)&&ws.set(e,t),xs()}));var Es=function(e,t){for(var n,r=[],o=0;n=Is[o];o++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;r.push(n)}return r};const Ns={onLCP:function(e,t){t=t||{},Ui((function(){var n,r=ji(),o=Di("LCP"),i=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(o.value=Math.max(e.startTime-Ri(),0),o.entries=[e],n())}))},s=Fi("largest-contentful-paint",i);if(s){n=Hi(e,o,Ji,t.reportAllChanges);var a=Bi((function(){Ki[o.id]||(i(s.takeRecords()),s.disconnect(),Ki[o.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Bi(e),"hidden"===document.visibilityState?e():(n=t(e),Pi(e)),n}(a)}),!0)})),Pi(a),Li((function(r){o=Di("LCP"),n=Hi(e,o,Ji,t.reportAllChanges),Zi((function(){o.value=performance.now()-r.timeStamp,Ki[o.id]=!0,n(!0)}))}))}}))},onCLS:function(e,t){t=t||{},Xi(Bi((function(){var n,r=Di("CLS",0),o=0,i=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=i[0],n=i[i.length-1];o&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(o+=e.value,i.push(e)):(o=e.value,i=[e])}})),o>r.value&&(r.value=o,r.entries=i,n())},a=Fi("layout-shift",s);a&&(n=Hi(e,r,$i,t.reportAllChanges),Pi((function(){s(a.takeRecords()),n(!0)})),Li((function(){o=0,r=Di("CLS",0),n=Hi(e,r,$i,t.reportAllChanges),Zi((function(){return n()}))})),setTimeout(n,0))})))},onFCP:Xi,onINP:function(e,t){Ai||(Ai=is("long-animation-frame",Ms)),_s((function(t){var n=function(e){var t=e.entries[0],n=ws.get(t),r=t.processingStart,o=n.processingEnd,i=n.entries.sort((function(e,t){return e.processingStart-t.processingStart})),s=Es(t.startTime,o),a=e.entries.find((function(e){return e.target})),l=a&&a.target||ks.get(t.interactionId),c=[t.startTime+t.duration,o].concat(s.map((function(e){return e.startTime+e.duration}))),u=Math.max.apply(Math,c),d={interactionTarget:ns(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:u,processedEventEntries:i,longAnimationFrameEntries:s,inputDelay:r-t.startTime,processingDuration:o-r,presentationDelay:Math.max(u-o,0),loadState:es(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(n)}),t)}};mn.__PosthogExtensions__=mn.__PosthogExtensions__||{},mn.__PosthogExtensions__.postHogWebVitalsCallbacks=Ns,mn.postHogWebVitalsCallbacks=Ns}();
16
2
  //# sourceMappingURL=all-external-dependencies.js.map